Answer the question
In order to leave comments, you need to log in
How does assembler addressing work in protected mode?
I can not understand some points in the code, the code goes into protected mode and displays the letter "A", I really need help.
The code:
use16
org 0x7c00
start:
mov bx,pm_entry
mov ax, 0x0003
int 0x10
in al, 0x92
or al, 2
out 0x92, al
lgdt [gdtr]
cli
in al, 0x70
or al, 0x80
out 0x70, al
mov eax, cr0
or al, 1
mov cr0, eax
jmp 00001000b:pm_entry
use32
pm_entry:
mov ax, cs
mov ds, ax
mov es, ax
mov edi, 0xB8000
mov esi, msg
cld
mov al,'A'
mov [edi],al
jmp $
gdt:
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
db 0xFF, 0xFF, 0x00, 0x00, 0x00, 10011010b, 11001111b, 0x00
gdt_size equ $ - gdt
gdtr:
dw gdt_size - 1
dd gdt
finish:
times 0x1FE-finish+start db 0
db 0x55, 0xAA
jmp 00001000b:pm_entry
use32
pm_entry:
db 0xFF, 0xFF, 0x00, 0x00, 0x00, 10011010b, 11001111b, 0x00
Answer the question
In order to leave comments, you need to log in
The whole problem is that I do not understand the structure of the descriptor ..
I can't figure out exactly how this jump happens.jmp 00001000b:pm_entry use32 pm_entry:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question