Add more from the std

This commit is contained in:
2026-03-20 09:47:32 +01:00
parent 3121c0b68b
commit 48a75485b6
297 changed files with 598 additions and 60308 deletions

View File

@@ -1,22 +1,24 @@
#![feature(custom_std)]
#![allow(unused)]
use io::{Read, Write};
use std::{io::{Stdin, stdin}, syscall};
use std::io::{Stdin, stdin};
use shared::syscall;
fn main() {
// let mut input = String::new();
let mut input = String::new();
input.push('a');
// let mut file = syscall::open("/dev/fb0");
// syscall::seek(&mut file, SeekFrom::End(-3));
// syscall::write(&mut file, &[255; 6400 * 50]);
// syscall::sleep(Duration::from_secs_f64(2.0));
syscall::close(0);
let mut tty = syscall::open("/dev/tty0");
tty.write(input.as_bytes()).unwrap();
syscall::spawn("/usr/bin/shell");
loop {
let mut test = [0; 2];
let len = tty.read(&mut test).unwrap();
tty.write(str::from_utf8(&test[..len as usize]).unwrap().as_bytes())
.unwrap();
.unwrap();
}
}