Add debug infos on panic

This commit is contained in:
2026-03-22 14:27:56 +01:00
parent 897775f63a
commit 15ecefb5fb
14 changed files with 282 additions and 50 deletions

View File

@@ -1,10 +1,12 @@
#![allow(unused)]
#![feature(panic_internals, core_intrinsics)]
use core::sync::atomic::AtomicUsize;
use io::{Read as Readio, Write};
use shared::syscall;
use shared::{fs::File, syscall};
use std::io::{Read, Stdin, stdin};
static FOO: AtomicUsize = AtomicUsize::new(0);
fn main() {
let mut input = String::new();
input.push('a');
@@ -13,13 +15,15 @@ fn main() {
// 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");
let mut tty = unsafe { File::from_raw_fd(syscall::open("/dev/tty0")) };
syscall::close(1);
let _ = syscall::open("/dev/tty0");
println!("test from test_pic");
tty.write(input.as_bytes()).unwrap();
syscall::spawn("/usr/bin/shell");
core::panicking::panic("explicit panic");
// panic!("explicit panic");
// std::process::abort();
unsafe {core::arch::asm!("unimp")};
loop {
let mut test = [0; 2];
// let len = stdin().read(&mut test);