Add more from the std
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user