mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Pass Multiboot structure pointer as argument
This commit is contained in:
@@ -19,6 +19,7 @@ section .text
|
||||
bits 32
|
||||
start:
|
||||
mov esp, stack_top
|
||||
mov edi, ebx
|
||||
|
||||
call check_multiboot
|
||||
call check_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!`
|
||||
|
||||
@@ -24,7 +24,7 @@ use core::fmt::Write;
|
||||
mod vga_buffer;
|
||||
|
||||
#[no_mangle]
|
||||
pub extern fn rust_main() {
|
||||
pub extern fn rust_main(multiboot_address: usize) {
|
||||
// ATTENTION: we have a very small stack and no guard page
|
||||
use vga_buffer::{Writer, Color};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user