Answer the question
In order to leave comments, you need to log in
Assembler how to work with video memory in protected mode?
I want to fill the screen completely with one color, for this it is necessary to fill the entire video frame with the address of the beginning of which is 0A000h.
When I do this, for some reason, only a smaller part of the screen is painted over.
The code:
use16
org 0x7c00
start:
mov ax,4F02h
mov bx,100h
int 10h
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:
cld
xor edi,edi
mov eax,0xA000
mov edi,eax
p0:
mov al,1Fh
stosb
jmp p0
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
Answer the question
In order to leave comments, you need to log in
for some reason, only a smaller part of the screen is painted over.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question