mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-17 14:57:49 +00:00
Pass multiboot pointer as argument to rust_main
This commit is contained in:
@@ -19,6 +19,9 @@ section .text
|
||||
bits 32
|
||||
start:
|
||||
mov esp, stack_top
|
||||
; Move Multiboot info pointer to edi to pass it to the kernel. We must not
|
||||
; modify the `edi` register until the kernel it called.
|
||||
mov edi, ebx
|
||||
|
||||
call test_multiboot
|
||||
call test_cpuid
|
||||
|
||||
@@ -20,7 +20,7 @@ bits 64
|
||||
long_mode_start:
|
||||
call setup_SSE
|
||||
|
||||
; call rust main
|
||||
; call rust main (with multiboot pointer in rdi)
|
||||
call rust_main
|
||||
.os_returned:
|
||||
; rust main returned, print `OS returned!`
|
||||
|
||||
@@ -23,7 +23,7 @@ extern crate spin;
|
||||
mod vga_buffer;
|
||||
|
||||
#[no_mangle]
|
||||
pub extern fn rust_main() {
|
||||
pub extern fn rust_main(multiboot_information_address: usize) {
|
||||
// ATTENTION: we have a very small stack and no guard page
|
||||
vga_buffer::clear_screen();
|
||||
println!("Hello World{}", "!");
|
||||
|
||||
Reference in New Issue
Block a user