[BITS 32] global _start extern start_kernel CODE_SEG equ 0x08 DATA_SEG equ 0x10 ; No access to BIOS from now on.... _start: ; Set all segments to the same as the DATA_SEG mov ax, DATA_SEG mov ds, ax mov es, ax mov fs, ax mov gs, ax mov ss, ax ; Set the stack pointer and base pointer further in mem mov ebp, 0x00200000 mov esp, ebp ; Enable A20 line in al, 0x92 or al, 2 out 0x92, al ; Remap master PIC mov al, 00010001b out 0x20, al ; MasterPIC mov al, 0x20 ; Start master ISR at 0x20 out 0x21, al mov al, 00000001b ; Put the PIC in x86 mode out 0x21, al sti ; Jump to C code call start_kernel jmp $ ; Hack to align the source code at 16bytes (because 512 is a multiple of 16) times 512 - ($ - $$) db 0