Clean way to patch the std

This commit is contained in:
2026-03-18 17:19:08 +01:00
parent 51780b3a78
commit a087bdd523
35 changed files with 6302 additions and 1430 deletions

View File

@@ -1,8 +1,11 @@
#![feature(custom_std)]
fn main() -> isize {
fn main() {
let a = std::env::args();
for a in a {
println!("Argument: {}", a);
}
println!(
"Hello from PIC program loaded dynamically with custom std and a better justfile, and syscalls ! "
);
0
}

View File

@@ -2,7 +2,7 @@
#![allow(unused)]
use io::{Read, Write};
use std::{io::stdin, syscall};
use std::{io::{Stdin, stdin}, syscall};
fn main() {
// let mut input = String::new();
@@ -15,8 +15,8 @@ fn main() {
syscall::spawn("/usr/bin/shell");
loop {
let mut test = [0; 2];
let len = stdin().read(&mut test).unwrap();
let len = tty.read(&mut test).unwrap();
tty.write(str::from_utf8(&test[..len as usize]).unwrap().as_bytes())
.unwrap();
.unwrap();
}
}