jankos/loader.asm

44 lines
903 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
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:
mov al, 14
mov dx, 0x3d4
out dx, al ; 14 tells the framebuffer to expect the highest 8 bits of the position
mov al, 0
mov dx, 0x3d5
out dx, al ; sending the highest 8 bits of 0x0050
mov al, 15
mov dx, 0x3d4
out dx, al ; 15 tells the framebuffer to expect the lowest 8 bits of the position
mov al, 0
mov dx, 0x3d5
out dx, al ; sending the lowest 8 bits of 0x0050
call test_fb
.loop:
jmp .loop