Interrupts aren't working anymore

This commit is contained in:
2026-03-15 10:48:41 +01:00
parent de6ef959ce
commit b1aac20b57
17 changed files with 455 additions and 89 deletions

View File

@@ -12,13 +12,19 @@ fn main() {
// syscall::seek(&mut file, SeekFrom::End(-3));
// syscall::write(&mut file, &[255; 6400 * 50]);
syscall::sleep(Duration::from_secs_f64(2.0));
let mut stdin = syscall::open("/dev/input/keyboard");
let mut test = [0; 2];
syscall::read(&mut stdin, &mut test);
let mut stdin = syscall::open("/dev/tty0");
let mut file = syscall::open("/dev/tty0");
syscall::write(&mut file, b"Hi !\nnice tty\x08");
println!(
"Hello from PIC program loaded dynamically with custom std and a better justfile, and syscalls ! {:?}",
test
);
loop {
let mut test = [0; 2];
syscall::read(&mut stdin, &mut test);
let len = *test.iter().find(|x| **x == 0).unwrap_or(&1) + 1;
syscall::write(
&mut file,
str::from_utf8(&test[..len as usize]).unwrap().as_bytes(),
);
}
// println!(
// "Hello from PIC program loaded dynamically with custom std and a better justfile, and syscalls ! {:?}",
// str::from_utf8(&test)
// );
}