I am writing a kernel with everything that goes with it (boot loader, etc) and I am testing it in vmware. My environment is a 64bit linux, fasm. I have a confusing situation where my documentation (FreeVGA stuff at standford.edu) says a bit flip should make the graphics card go into graphics mode but I don't see it happening (text mode remains functional). Other operations also present in the same byte work fine.
I'm sure this has been asked a million times, but please help me. I don't know what's wrong. Is this a problem with vmware or with my code? Should I be testing in something else?
Here is my code (it runs in 64bit mode, but is probably portable down anyway):
Code: Select all
;Disable graphics mode
mov dx,3CEh ;Address Register port
mov al,06h ;Select index 6: Miscellaneous Graphics Register
@@:
out dx,al
in al,dx ;Set it again if it didn't get trough
cmp al,06h
jne @b
inc dx ;Data Register port
in al,dx ;Read current data
;FIXME this doesnt work (only in vmware?)
or al,00000001b ;Set Alphanumeric Mode Disable to 1
;
and al,11110011b ;Set Memory Map Select to A0000h-BFFFFh
mov bl,al ;Backup value
@@:
out dx,al
in al,dx ;Set it again if it didn't get trough
cmp al,bl
jne @b
;Set 16 color mode
mov dx,3CEh ;Address Register port
mov al,05h ;Select index 5: Graphics Mode Register
@@:
out dx,al
in al,dx ;Set it again if it didn't get trough
cmp al,05h
jne @b
inc dx ;Data Register port
in al,dx ;Read current data
and al,10011111b ;Set Shift256 and Shift Reg. to 0
mov bl,al ;Backup value
@@:
out dx,al
in al,dx ;Set it again if it didn't get trough
cmp al,bl
jne @b
Thanks for any assistance you can offer. And no, I don't want to use INT 10h instead.