MCPcopy Create free account
hub / github.com/Infinity-OS/infinity / rust_main

Function rust_main

src/start.rs:27–60  ·  view source on GitHub ↗

Entry point for the Rust code

(multiboot_information_address: usize)

Source from the content-addressed store, hash-verified

25#[no_mangle]
26/// Entry point for the Rust code
27pub extern "C" fn rust_main(multiboot_information_address: usize) {
28
29 // clear the console screen
30 vga_buffer::clear_screen();
31
32 // print out a welcome message
33 println!("kernel: botting");
34
35 let boot_info = unsafe { multiboot2::load(multiboot_information_address) };
36
37 // enable NXE bit, to allow define none executable pages.
38 enable_nxe_bit();
39
40 // set write protect bit in order to enable write protection on kernel mode.
41 enable_write_protect_bit();
42
43 // set up guard page and map the heap pages
44 let mut memory_controller = memory::init(boot_info);
45
46 // Initialize IDT
47 interrupts::init(&mut memory_controller);
48
49 // Initialize devices
50 device::init(&mut memory_controller);
51
52 // TODO Read ACPI tables, starts APs
53
54 // Initialize all the non-core devices
55 device::init_non_core();
56
57 println!("It did not crash!");
58
59 loop {}
60}

Callers

nothing calls this directly

Calls 5

clear_screenFunction · 0.85
enable_nxe_bitFunction · 0.85
enable_write_protect_bitFunction · 0.85
init_non_coreFunction · 0.85
initFunction · 0.50

Tested by

no test coverage detected