non-working squashfs driver updates, partial stack traces, and more

This commit is contained in:
Zoe
2023-11-24 03:58:30 -06:00
parent 1c865a6695
commit 525ae40054
24 changed files with 477 additions and 357 deletions

View File

@@ -0,0 +1,26 @@
#[repr(C)]
#[derive(Clone, Copy, Debug)]
struct StackFrame {
back: *const StackFrame,
rip: u64,
}
pub fn print_stack_trace(max_frames: usize) {
let mut stackframe: *const StackFrame;
unsafe {
core::arch::asm!("mov {0:r}, rbp", out(reg) stackframe);
};
crate::println!("Stack Trace:");
for _frame in 0..max_frames {
if stackframe.is_null() || unsafe { (*stackframe).back.is_null() } {
break;
}
unsafe {
crate::println!(" {:#X}", (*stackframe).rip);
stackframe = (*stackframe).back;
};
}
}