jankos/loader.asm
shockrahwow 8d1879fe97 - Retesting framebuffer drivers
- clear_fb() fully working
- trying to add positional buffer writes for fancy output
- POSITION macro only seems to work for (0,0) coords for now
haven't tested other edge cases yet
2019-02-25 15:36:31 -08:00

37 lines
799 B
NASM

; since we have no stack we have to create one for the OS
global loader
; this section is partly handled by nasm tolerating some minor bs
MAGIC_NUMBER equ 0x1BADB002
FLAGS equ 0x0
CHECKSUM equ -MAGIC_NUMBER
; size in bytes of stack
KERNEL_STACK_SIZE equ 4096
extern test_fb
; external labels(cdecl) calling convention
section .text
; align all instructions to 4 byte boundary by the x86 instruction set law
align 4
; dropping our magic and other things into memory
dd MAGIC_NUMBER
dd FLAGS
dd CHECKSUM
loader:
call test_fb
.loop:
jmp .loop
section .bss
align 4 ; aligned to 4 bytes for performance
kernel_stack:
; (res)erve (b)ytes x
resb KERNEL_STACK_SIZE ; 4k of stack size in mem
; now we setup the stack pointer for our kernel
mov esp, kernel_stack + KERNEL_STACK_SIZE