Answer the question
In order to leave comments, you need to log in
Assembler what's wrong with the code?
I want to fill the entire screen with one color, the video memory is located at A0000.
Can someone throw a fixed my code so that I can figure out what's wrong?
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 esi,edi
mov ax,16
mov gs,ax
p0:
mov al,1Fh
mov [gs:edi],al
inc edi
cmp edi,307200
jz $
jmp p0
gdt:
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
db 0xFF, 0xFF, 0x00, 0x00, 0x00, 10011010b, 11001111b, 0x00
db 0FFh, 0FFh, 0x00, 0x00, 0x0A, 92h,40h,0
gdt_size equ $ - gdt
gdtr:
dw gdt_size - 1
dd gdt
Answer the question
In order to leave comments, you need to log in
what's wrong?
0x7c00: mov $0x4f01,%ax
0x7c03: mov $0x100,%cx
0x7c06: mov $0x7c77,%di
0x7c09: int $0x10
(gdb) x/6hx $di
0x7c77: 0x00bb 0x0007 0x0040 0x0040 0xa000 0x0000
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question