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,6 +1,4 @@
62a \ target_os = "survos" => { \
mod unsupported; \
pub use self::unsupported::*; \
mod survos; \
pub use self::survos::*; \
}

View File

@@ -1,3 +1,10 @@
#[path = "unsupported/mod.rs"]
mod unsupported;
pub use self::unsupported::*;
#[path = "../../../../../crates/shared/src/syscall.rs"]
mod syscall;
/// # Safety
/// `argc` and `argv` are passed by the kernel
#[unsafe(no_mangle)]
@@ -9,3 +16,8 @@ pub unsafe extern "C" fn _start(argc: isize, argv: *const *const u8) -> isize {
unsafe { main(argc, argv) }
}
pub fn abort_internal() -> ! {
// todo real abort
syscall::exit()
}

View File

@@ -2,7 +2,7 @@ use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
#[path = "unsupported.rs"]
mod unsupported;
pub use self::unsupported::{STDIN_BUF_SIZE, Stderr, Stdin, is_ebadf, panic_output};
pub use self::unsupported::{STDIN_BUF_SIZE, Stderr, Stdin, is_ebadf};
pub struct Stdout;
// pub struct Stdin;
@@ -36,6 +36,11 @@ impl io::Write for Stdout {
// }
// }
pub fn panic_output() -> Option<impl io::Write> {
// Todo, use Stderr
Some(Stdout::new())
}
#[repr(u64)]
pub enum SysCall {
Read = 0,