summaryrefslogtreecommitdiffstats
path: root/rsnix/src/uefi.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-08-02 15:21:34 +0200
committersalmonik <salmonik@tuta.io>2026-08-02 15:21:34 +0200
commitc7d92071e1dd11c45999457b16554b4abaa73b28 (patch)
treeaff7c7f19adcffe1dd91e1c2514af02c77fd524e /rsnix/src/uefi.rs
parentv0.5.5: fix real-hardware boot crash — shadow back in heap as first allocation (diff)
downloadrs-dos-c7d92071e1dd11c45999457b16554b4abaa73b28.tar.gz
rs-dos-c7d92071e1dd11c45999457b16554b4abaa73b28.zip
v0.5.5: crash reports go to a dedicated CRASHLOG USB stick
The fault handler now writes crash.log to the volume labeled CRASHLOG (label-selected via fat::crash_vol), falling back to slot 0. On real hardware the boot USB may be unwritable, so a second stick labeled CRASHLOG survives the write; the shell auto-prints the previous crash report from it at next boot (read_crash_log resolves /disk/<uid>/crash.log through the FAT path, since Disk nodes hold no cached children). - fat.rs: volume_label() + crash_vol() (no allocation) - fs.rs: write_crash_log targets crash_vol(); read_crash_log prefers the CRASHLOG disk node; drop now-unused first_disk() - mkdisk.sh: --label option - test-fault.sh: boots with a dedicated CRASHLOG stick (mkfs -F 32 -n CRASHLOG), verifies crash.log lands there and NOT on the ESP
Diffstat (limited to 'rsnix/src/uefi.rs')
-rw-r--r--rsnix/src/uefi.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/rsnix/src/uefi.rs b/rsnix/src/uefi.rs
index c311ad9..234ad65 100644
--- a/rsnix/src/uefi.rs
+++ b/rsnix/src/uefi.rs
@@ -40,6 +40,32 @@ pub const EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID: Guid = Guid {
40 d: [0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a], 40 d: [0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a],
41}; 41};
42 42
43pub const EFI_LOADED_IMAGE_PROTOCOL_GUID: Guid = Guid {
44 a: 0x5b1b31a1,
45 b: 0x9562,
46 c: 0x11d2,
47 d: [0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
48};
49
50/// Minimal EFI_LOADED_IMAGE_PROTOCOL — we only need the image base/size
51/// to reserve the kernel's own code/data/bss pages so the heap and page
52/// allocators can never overwrite the running kernel.
53#[repr(C)]
54pub struct LoadedImageProtocol {
55 pub revision: u32,
56 _pad0: u32,
57 pub parent_handle: Handle,
58 pub system_table: *mut core::ffi::c_void,
59 pub device_handle: Handle,
60 pub file_path: *mut core::ffi::c_void,
61 _reserved: *mut core::ffi::c_void,
62 pub load_options_size: u32,
63 _pad1: u32,
64 pub load_options: *mut core::ffi::c_void,
65 pub image_base: *mut core::ffi::c_void,
66 pub image_size: u64,
67}
68
43// --------------------------------------------------------------------------- 69// ---------------------------------------------------------------------------
44// Table header 70// Table header
45// --------------------------------------------------------------------------- 71// ---------------------------------------------------------------------------