flat assembler
Message board for the users of flat assembler.

Index > Heap > Get border color in Bochs/QEMU

Author
Thread Post new topic Reply to topic
System86



Joined: 15 Aug 2007
Posts: 77
System86
How do I determine what the border/overscan color is in an emulator like Bochs or QEMU? The following code changer the border color, using ports and the BIOS:
Code:
;set background/overscan color on VGA displays
org 100h

start:
mov ah, 9
mov dx, use_ports
int 21h
xor ah, ah
int 16h
mov dx, 3DAh ;make sure in index mode
in al, dx
mov dx, 3C0h
mov al, 11h ;set border/overscan color
out dx, al
mov al, 0xC
out dx, al
mov al, 20h
out dx, al
mov ah, 9
mov dx, use_bios
int 21h
xor ah, ah
int 16h
mov ax, 1001h ;set border color
mov bh, 0xB
int 10h
int 20h

use_ports db 'Changing border color to red using ports', 10, 13, '$'
use_bios db 'Changing border color to blue using BIOS', 10, 13, '$'      
    


It runs perfectly and changes the border color to red then blue under pure DOS (I used FreeDOS, on the same machine as all the other tests). Under WinXP, the second change works, the first change is only visible if you put an int 10h before the ports are accessed (for some reason, the ports only seem to become active after an int 10h is issued under NTVDM). Under Bochs or QEMU both things have no effect. Is this a bug in the emulators or is there some setting that I can see the overscan color?
Post 04 Mar 2008, 01:13
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
NTVDM does indeed not do full emulation until an INT10 call is emulated - I wonder if anybody knows the reason, I don't. But I expect it's performance related.

I doubt Bochs and QEMU support overscan, seems to be of very limited use... does it even exist on TFT/LCD screens?
Post 04 Mar 2008, 01:39
View user's profile Send private message Visit poster's website Reply with quote
System86



Joined: 15 Aug 2007
Posts: 77
System86
At least some LCD screens support it, I tried it on one and it worked, though it didn't work on another LCD screen (my system is a CRT, I tired it on 2 other systems under NTVDM). Overscan is a simple way to transmit debug information (along with keyboard LEDs and speaker) that can be done using only ports, without BIOS or even memory access. See http://www.osdev.org/wiki/Troubleshooting#What_to_do_if_characters_cannot_be_displayed
Post 04 Mar 2008, 20:27
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
> The following code changer the border color, using ports and the BIOS:
Code:
...    

> It runs perfectly and changes the border color to red then blue under pure
> DOS (I used FreeDOS, on the same machine as all the other tests).

Works perfectly for me also Smile

> Get border color in Bochs/QEMU

NO. Shocked

> How do I determine what the border/overscan color is in an emulator
> like Bochs or QEMU?

NO.

> Under Bochs or QEMU both things have no effect. Is this a bug in the
> emulators or is there some setting that I can see the overscan color?

Doesn't work, reason is obvious: BOCHS and QEMU don't emulate this area, you can't change colour of something that doesn't exist Laughing I'm not aware of any setting Crying or Very sad

Where would you expect too see the colour ?

BOCHS and QEMU don't emulate the overscan, like they don't emulate the noise of a floppy drive ... feel free to consider it as bug Laughing

> NTVDM does indeed not do full emulation until an INT10 call is emulated
> - I wonder if anybody knows the reason, I don't. But I expect it's
> performance related.

NTVDM does never "full emulation" (unlike BOCHS), it just switches a few ports from "full dummy" to "somewhat functional" Neutral

> Overscan is a simple way to transmit debug information (along with
> keyboard LEDs and speaker) that can be done using only ports,
> without BIOS or even memory access. See > http://www.osdev.org/wiki/Troubleshooting#What_to_do_if_characters_cannot_be_displayed

Great, but overscan is bad Crying or Very sad

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 06 Mar 2008, 06:36
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.