diff options
| author | Tianhao Wang <shrik3@mailbox.org> | 2024-05-29 01:18:02 +0200 |
|---|---|---|
| committer | Tianhao Wang <shrik3@mailbox.org> | 2024-06-11 15:17:10 +0200 |
| commit | 959a93e653684b1ed8db4bd21eaca9831e372fb0 (patch) | |
| tree | 152426d2f9eb39ff26941204aaa149840e59578a /src/lib.rs | |
| parent | 590d29c3e44fc06bc79c2624fc94273434505b9d (diff) | |
multiboot: basic support for multiboot info
well, it's not trivial to use bios function because thanks to grub +
multiboot, we are already in protected mode when the startup code takes
control. Also the MB info is easier to play with than BIOS (or ACPI)
Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -8,13 +8,13 @@ mod ds; mod io; mod machine; mod mm; +use crate::machine::key::Modifiers; use arch::x86_64::interrupt; use arch::x86_64::interrupt::pic_8259; use arch::x86_64::interrupt::pic_8259::PicDeviceInt; use core::panic::PanicInfo; use machine::cgascr::CGAScreen; - -use crate::machine::key::Modifiers; +use machine::multiboot; #[cfg(not(test))] #[panic_handler] @@ -28,14 +28,18 @@ pub extern "C" fn _entry() -> ! { // init code io::set_attr(0x1f); io::clear_screen(); + assert!(multiboot::check_magic(), "bad multiboot magic!"); + let mbi = multiboot::get_mb_info().expect("bad multiboot info flags"); + println!("MB INFO: {:#X?}", mbi); interrupt::init(); pic_8259::allow(PicDeviceInt::KEYBOARD); interrupt::interrupt_enable(); - io::print_welcome(); let mut framemap = mm::pma::FMap::new(); framemap.init(); println!("Bitmap starting from : {:p}", framemap.bm.as_ptr()); println!("Skip first {} bytes", framemap.skip_byte); + println!("system init .. done!"); + // io::print_welcome(); // busy loop query keyboard loop { |
