27 lines
614 B
NASM
27 lines
614 B
NASM
|
[org 0x7c00] ; bootloader offset
|
||
|
mov bp, 0x9000 ; set stack
|
||
|
mov sp, bp
|
||
|
|
||
|
mov bx, MSG_REAL_MODE
|
||
|
call print ; will be written after bios messages
|
||
|
|
||
|
call enter_protected
|
||
|
jmp $ ; will never really be executed
|
||
|
|
||
|
%include "print.asm"
|
||
|
%include "32bit_gdt.asm"
|
||
|
%include "32bit_print.asm"
|
||
|
%include "32bit_jump.asm"
|
||
|
|
||
|
[bits 32]
|
||
|
BEGIN_PROTECTED: ; 32bit entry
|
||
|
mov ebx, MSG_PROT_MODE
|
||
|
call print_string_pm ; Will be written in top left
|
||
|
jmp $
|
||
|
|
||
|
MSG_REAL_MODE db "Welcome! Started in 16-bit protected mode"
|
||
|
MSG_PROT_MODE db "Hello, world! 32-bit mode initialized successfully"
|
||
|
|
||
|
; bootsector
|
||
|
times 510-($-$$) db 0
|
||
|
dw 0xaa55
|