Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BITS 16
- ORG 7C00h
- start:
- cli
- mov ah, 02h
- mov al, 1
- mov ch, 0
- mov dh, 0
- mov cl, 2
- mov bx, loadLocation
- int 13h
- xor ax, ax
- push ax
- popf
- mov ds, ax
- lgdt [gdt_desc]
- mov eax, cr0
- or eax, 1
- mov cr0, eax
- jmp 08h:protectedModeBegin
- BITS 32
- protectedModeBegin:
- mov ax, 10h
- mov ds, ax
- mov ss, ax
- mov esp, 90000h
- mov [0B8000h], BYTE 'P'
- mov [0B8001h], BYTE 1Bh
- jmp loadLocation
- gdt:
- gdt_null:
- dq 0
- gdt_code:
- dw 0FFFFh
- dw 0
- db 0
- db 10011010b
- db 11001111b
- db 0
- gdt_data:
- dw 0FFFFh
- dw 0
- db 0
- db 10010010b
- db 11001111b
- db 0
- gdt_end:
- gdt_desc:
- dw gdt_end - gdt
- dd gdt
- times 510-($-$$) db 0
- dw 0AA55h
- loadLocation:
- mov [0B8002h], BYTE 'L'
- mov [0B8003h], BYTE 1Bh
- .loop:
- jmp .loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement