diff options
| author | Tianhao Wang <shrik3@riseup.net> | 2023-03-10 19:26:31 +0100 |
|---|---|---|
| committer | Tianhao Wang <shrik3@riseup.net> | 2023-03-10 19:26:31 +0100 |
| commit | 29e28bc9c67378d0d9a7174dec6a0b541fb7f4d5 (patch) | |
| tree | ff9cd708e41ffb7f3b84347d404ffde758c18ab5 /src/arch/x86_64/asm/startup.s | |
| parent | 285508a3c9c2fa35b608e3a561f0c7a63cfacf62 (diff) | |
a minimal working demo on bare metal
Diffstat (limited to 'src/arch/x86_64/asm/startup.s')
| -rw-r--r-- | src/arch/x86_64/asm/startup.s | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/arch/x86_64/asm/startup.s b/src/arch/x86_64/asm/startup.s index 4c696e1..7b5bbff 100644 --- a/src/arch/x86_64/asm/startup.s +++ b/src/arch/x86_64/asm/startup.s @@ -17,7 +17,7 @@ ; Constants ; -; stack for the main function +; stack for the main function (renamed to _entry()) STACKSIZE: equ 65536 ; video memory base address @@ -59,8 +59,8 @@ pagetable_end: equ 0x200000 [GLOBAL _ZdlPvm] ; functions from the C parts of the system -[EXTERN main] -[EXTERN guardian] +[EXTERN _entry] +;[EXTERN guardian] ; addresses provided by the compiler [EXTERN ___BSS_START__] @@ -204,7 +204,7 @@ fill_tables3_done: ; system start, part 2 (in 64-bit Long Mode) ; ; This code clears the BSS segment and initializes IDT and PICs. Then the -; constructors of global C++ objects are called, and finally main() is run. +; constructors of global C++ objects are called, and finally _entry() is run. ; longmode_start: @@ -234,7 +234,7 @@ clear_bss: ;mov cr4, rax call _init ; call constructors of global objects - call main ; call the OS kernel's C / C++ part + call _entry ; call the OS kernel's C / C++ part call _fini ; call destructors cli ; Usually we should not get here. hlt @@ -279,7 +279,7 @@ wrapper_body: ; pass interrupt number as the first parameter mov rdi, rax - call guardian +; call guardian ; restore volatile registers pop r11 |
