Skip to content

Commit abf3817

Browse files
committed
debug: revert to UEFI allocator, add screen_print for visibility
- Reverted to 6dd084b base (UEFI allocator that worked further) - Replaced log::info with screen_print for on-screen visibility - Reduced stalls from 30s to 1-3s for faster iteration
1 parent 6dd084b commit abf3817

1 file changed

Lines changed: 15 additions & 20 deletions

File tree

src/main.rs

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -148,50 +148,45 @@ fn main(_image_handle: Handle, mut system_table: SystemTable<Boot>) -> Status {
148148
}
149149

150150
// 3. Initialize Memory Management
151-
152-
// 3. Initialize Memory Management
153-
early_serial_print(b"[BOOT] Initializing MM...\r\n");
154-
log::info!("[Kernel] Initializing Memory Management...");
155-
// STALL 2s
156-
system_table.boot_services().stall(2_000_000);
151+
screen_print!(system_table, "[Kernel] Initializing Memory Management...");
152+
system_table.boot_services().stall(1_000_000); // STALL 1s
157153

158154
let (phys_offset, memory_map_iter) = mm::init(&system_table);
159-
log::info!("[Kernel] Memory Management initialized");
155+
screen_print!(system_table, "[Kernel] Memory Management initialized");
160156

161157
// 4. Initialize Filesystem (RamFS)
162-
early_serial_print(b"[BOOT] Initializing FS...\r\n");
163-
log::info!("[Kernel] Initializing Filesystem...");
158+
screen_print!(system_table, "[Kernel] Initializing Filesystem...");
164159
fs::init(phys_offset);
165-
// STALL 2s
166-
system_table.boot_services().stall(2_000_000);
160+
system_table.boot_services().stall(1_000_000); // STALL 1s
167161

168162
// 5. Initialize Scheduler
169-
log::info!("[Kernel] Initializing Scheduler...");
163+
screen_print!(system_table, "[Kernel] Initializing Scheduler...");
170164
sched::init();
171165

172166
// 6. Initialize Drivers
173-
log::info!("[Kernel] Initializing Drivers...");
167+
screen_print!(system_table, "[Kernel] Initializing Drivers...");
174168
drivers::init();
175-
system_table.boot_services().stall(30_000_000); // STALL 30s
169+
system_table.boot_services().stall(1_000_000); // STALL 1s
176170

177171
// 7. Enable Interrupts (NOW it's safe)
178172
#[cfg(target_arch = "x86_64")]
179173
{
174+
screen_print!(system_table, "[Kernel] About to enable interrupts...");
180175
interrupts::enable();
181-
log::info!("[Kernel] Interrupts ENABLED");
176+
screen_print!(system_table, "[Kernel] Interrupts ENABLED");
182177
}
183-
system_table.boot_services().stall(30_000_000); // STALL 30s
178+
system_table.boot_services().stall(3_000_000); // STALL 3s
184179

185180
// For testing: set to true to use simple init.bin instead of BusyBox
186181
const USE_SIMPLE_INIT: bool = false;
187182

188183
// 7. Load Init Process
189184
let init_path = if USE_SIMPLE_INIT { "/init" } else { "/bin/busybox" };
190-
log::info!("[Kernel] Loading {}...", init_path);
191-
system_table.boot_services().stall(30_000_000); // STALL 30s
185+
screen_print!(system_table, "[Kernel] Loading init process...");
186+
system_table.boot_services().stall(1_000_000); // STALL 1s
192187

193-
log::info!("[Kernel] DEBUG: About to call fs::open");
194-
system_table.boot_services().stall(30_000_000); // STALL 30s
188+
screen_print!(system_table, "[Kernel] DEBUG: About to call fs::open");
189+
system_table.boot_services().stall(1_000_000); // STALL 1s
195190

196191
if let Ok(inode) = fs::open(init_path, 0) {
197192
log::info!("[Kernel] DEBUG: fs::open succeeded");

0 commit comments

Comments
 (0)