réplica de
https://github.com/Arnau478/quark.git
synced 2024-06-06 15:46:46 +02:00
35 líneas
679 B
NASM
35 líneas
679 B
NASM
|
[bits 32]
|
||
|
extern kmain
|
||
|
extern i686_outw
|
||
|
global _start
|
||
|
|
||
|
_start:
|
||
|
mov esp, _sys_stack
|
||
|
jmp call_kmain
|
||
|
|
||
|
; Multiboot header
|
||
|
align 4
|
||
|
mboot:
|
||
|
; Some macros
|
||
|
MULTIBOOT_PAGE_ALIGN equ 1<<0
|
||
|
MULTIBOOT_MEMORY_INFO equ 1<<1
|
||
|
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
|
||
|
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO
|
||
|
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
|
||
|
|
||
|
; The actual header
|
||
|
dd MULTIBOOT_HEADER_MAGIC
|
||
|
dd MULTIBOOT_HEADER_FLAGS
|
||
|
dd MULTIBOOT_CHECKSUM
|
||
|
|
||
|
call_kmain:
|
||
|
call kmain
|
||
|
push 0x2000
|
||
|
push 0x604
|
||
|
call i686_outw
|
||
|
jmp $
|
||
|
|
||
|
section .bss
|
||
|
resb 8192 ; For the stack
|
||
|
_sys_stack:
|