VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

When the VGA BIOS is ran (at address C000:3). what does the VGA BIOS do exactly? Does it initialise a video mode? If so, what video mode is set by default? Does it do other things (other than set the Video Interrupt to it's own handler)?

My own initiaisation handler currently:
- Initialises VGA ROM memory (basic information and Dosbox tables(VGA fonts etc.)).
- Set interrupt 10h handler to the VGA BIOS handler location.
- Switch to default video mode (mode 03h).

Is this correct? Does the VGA BIOS do anything else that's needed from this point on?

Last edited by superfury on 2015-12-30, 16:18. Edited 1 time in total.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 5, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

I assume also default palette setup (for VGA and CGA-on-VGA emulation) and maybe set up default font bank? I also use the Plex86 VGA emulation on my emulator and that one comes with (commented sources). See: http://www.nongnu.org/vgabios

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 3 of 5, by Scali

User metadata
Rank l33t
Rank
l33t
superfury wrote:

- Switch to default video mode (mode 03h).

I think this part may actually be done by the main BIOS rather than the VGA BIOS.
On PC/XT machines, you usually have a jumper or dipswitch on the motherboard to select which mode to start up in (mono/colour, sometimes even 40/80 column too).
On 286 and newer, you generally have a setting for 'Video: EGA/VGA' or something.

So I think that setting controls the video mode the BIOS will set (probably through int 10h).
Mind you, for EGA/VGA it is probably required to at least initialize the registers to a valid videomode, because otherwise the monitor won't be able to sync if you have a system with both MDA/Hercules and EGA/VGA attached, and you choose to boot up in MDA mode.
CGA/MDA is in the main BIOS itself, so that probably initializes properly anyway (you can find the BIOS source code for the PC, XT and AT in the IBM Technical Reference manuals).

Last edited by Scali on 2015-12-28, 13:55. Edited 1 time in total.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 4 of 5, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie
superfury wrote:

Isn't Plex86 built for 286/386+ processors? So it won't run on my 80(1)86 emulation.

Ugh, I am sorry, you are right. I am not 100% sure if it uses any 286/386 stuff though, I will need to look.

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 5 of 5, by superfury

User metadata
Rank l33t++
Rank
l33t++

Originally the 'BIOS' was set to change to mode 0. When the Generic Turbo XT BIOS boots, it detects the VGA but doesn't switch to mode 2/3(messing up the output intended for 80x25 text modes) or simply starts mode 0/1. The top row(and everything after it) is split in two 40x25 lines when I set the default video mode to 0 instead of 3. Looking at the BIOS source code reveals that it doesn't set AL anywhere before calling the mode set. Maybe it tries to use the mode set on initialization of the used BIOS(Either an external VGA at C000+:0003, or it's own (I believe it's for CGA cards). It does execute some AH=0xF calls at the start.

Edit: Tried Windows 3.0 with different graphics card setup:
- VGA works.
- VGA with monochrome display fails when used with Dosbox's int10_modes.cpp-based handlers. It works without problems using an actual IBM VGA BIOS (BIOS image taken from PCE emulator's "IBM VGA BIOS (1986-10-27)"). It seems to run fine in Dosbox 0.74?
- EGA works.
- CGA works.

Anyone knows why VGA with monochrome display fails? Everything is reduced to big white blocklike blobs. Even the mouse.

Edit: Just verified using an actual IBM VGA BIOS: The "VGA with monochrome display" display setting with an actual IBM VGA BIOS works. It also works in Dosbox 0.74. When using the Dosbox video mode in my emulator with the Dosbox-based BIOS video mode, it gives junk for some reason?

Video mode code used, based on Dosbox code:
https://bitbucket.org/superfury/x86emu/src/94 … ode.c?at=master

Dosbox 'BIOS' mode 11h:

The attachment vga_monochrome_mode11h_bmp.zip is no longer available

IBM VGA BIOS mode 11h:

The attachment vga_monochrome_mode11h_bmp_VGABIOS.zip is no longer available

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io