Page 2 of 2

Re: CGA graphics mode (INT 0x10, AX=0x0004)

Posted: Thu May 22, 2014 3:44 am
by freecrac
Hello.
Brendan wrote: Mostly what I'm saying here is that if you can't get EDID from the monitor it should still be safe to use the "safe mode timings", which includes any video modes where the horizontal resolution is 320, 360, 640 or 720 and the vertical resolution is anything from 200 to 240 or from 400 to 480, regardless of number of colours.


Cheers,

Brendan
I wish to have a choice which resolution and wich refreshrate to be used and for to put it into a profile for starting, example if there is a VBE version 3 Bios aviable. And then start a test with that choosen resolution and with a click box shown on the screen for to confirm this resolution and with a countdown timer for to go back to a more stable resolution if the choosen resolution fails. But if we confirm then we can put it in a profile for storing and for to start next times with a profile.

Example in the past i used my MSI Geforce 4 TI 4200(AGPx4; 64MB) together with a 20"CRT monitor that i had found in the street in a bulk of trash. At the backside of the monitor there was only 5 BNC connectors for a BNC-cable (but with no DDC for to get the EDID).

Starting the PC with that monitor in textmode 3 or with trying do use a resolution of 800x600 or 640x480, the monitor shows only flimmer effects. But with a higher resolution like 1024x768@100hz,1600x1200@85hz, 2048x1536@60hz, the monitor shows the content of the deskop screen and also with switching into a VBE 3 mode with own CRT-parameter for those higher resolutions.

Dirk

Re: CGA graphics mode (INT 0x10, AX=0x0004)

Posted: Thu May 22, 2014 4:00 am
by Combuster
Brendan wrote:The downside here is that you need four "1 bit per pixel" buffers;
Or you can extract the relevant bits from a regularly packed buffer on the fly - you have a "slow" write to hide the latency behind - and make all the in-memory drawing operations much simpler.

Re: CGA graphics mode (INT 0x10, AX=0x0004)

Posted: Thu May 22, 2014 5:49 am
by Octocontrabass
freecrac wrote:Example in the past i used my MSI Geforce 4 TI 4200(AGPx4; 64MB) together with a 20"CRT monitor that i had found in the street in a bulk of trash. At the backside of the monitor there was only 5 BNC connectors for a BNC-cable (but with no DDC for to get the EDID).
Perhaps the monitor was in the trash because it was no longer able to sync properly. Or, perhaps it didn't sync to VGA frequencies because it wasn't a VGA monitor.

VGA timings are still the safest assumption - all VGA (and DVI, and probably also HDMI and DisplayPort) displays will work, and there's no way to tell the difference between an incompatible display and one that simply does not support EDID.

Re: CGA graphics mode (INT 0x10, AX=0x0004)

Posted: Thu May 22, 2014 8:59 am
by Antti
@Brendan: in this post, a long time ago, you gave a link to your experiment boot code. The file was "flop1440.img" and I downloaded it back then. I remembered that the interactive boot loader showed a nice list of supported video modes and reliability percentages. Because this video topic is topical for me, I tried the floppy image again. It run well on VirtualBox and gave me a nice list of video modes. Well done.

However, using an emulator is boring. I used a real floppy (!) and tried the boot loader on one of my test computer. It is the only one having a floppy drive. Do not worry, I know there is no warranty. Unfortunately, I was not able to check the video list. The boot loader hangs here:

Code: Select all

...
...
...
Checking PCI interface:
  Config Mechanism #1 is supported
  Done
Detecting motherboards identification:
It would have been interesting to see the video mode list (with reliability percentages) on that computer. The computer is IBM NetVista something with Pentium 4 CPU (designed for Windows XP). Perhaps this is a known bug/feature but I thought you want to know if the boot loader should have been extremely robust.

Re: CGA graphics mode (INT 0x10, AX=0x0004)

Posted: Thu May 22, 2014 7:18 pm
by Brendan
Hi,
Antti wrote:It would have been interesting to see the video mode list (with reliability percentages) on that computer. The computer is IBM NetVista something with Pentium 4 CPU (designed for Windows XP). Perhaps this is a known bug/feature but I thought you want to know if the boot loader should have been extremely robust.
Thanks; but I mostly abandoned that code in 2009.

I started it up today and played around with it a little, mostly comparing how different video modes look (in the "test pattern" and for the boot log's scaled fonts after you leave the interactive boot menu thing). That test pattern generator was extreme overkill - it generates 96-bit per pixel data then converts it down to the target colour depth using dithering (so even the 24-bpp/32-bpp modes are dithered). 8)


Cheers,

Brendan

Re: CGA graphics mode (INT 0x10, AX=0x0004)

Posted: Fri May 23, 2014 5:42 am
by Antti
After thinking this issue more, I am starting to believe that the monitor is not a problem. Using a CGA mode should be safe. I am still a little bit afraid of getting a "function not supported" when calling "INT 0x10, AX=0x0004" on modern hardware. If mainstream OSs did not use it in the past, having a support for it was not vital. This has nothing to do whether the monitor itself supports the mode or not.

My boot plan is something like this:

Code: Select all

First stage boot loader
 - "512 bytes", "boot sector", or "VBR"
 - Default video mode
 - English only error messages (using BIOS "teletype")
 - Version for real floppies (few versions), diskette parameter table etc.
 - Version for "hard disks", including USB variations
 - Version for El-Torito, no-emulation
 - Loads Second boot loader
 - Simple checksum algorithm
 - Well defined state when starting Second stage boot loader

Second stage boot loader (for all BIOS-based booting methods)
 - File system support (FAT??, ISO9660)
 - CGA graphics mode 0x04
 - Language-independent non-interactive status screen
 - Visual error messages (no English "sentences")
 - Parsing boot config file (if available)
 - Loading boot modules
 - CRC32 checking
 - "ABI" for boot file system (for modules)
 - Starts main boot module

Modules
 - A20
 - CPU
 - GUI
 - LOC (localization)
 - MEM
 - VBE
 - ...
 - ...
 - SYS (main boot module)
I try to get the first and second stage boot loaders ready and start testing them. I do not want to have "experimental" versions but, hopefully, stable and suitable for "production use". Not having too much features at that boot stage is important.

Second stage boot loader is using the CGA video mode because the VBE support is going to be in a module. It is also the safe video mode used when testing different VBE modes. Also, my first (floppy) and second stage loaders are compatible with really old hardware. That is something added for fun if I want to try some bootable applications, i.e. modules in this case, on vintage computers.

Next challenge is to create boot modules that are stable etc. One step at a time.

Re: CGA graphics mode (INT 0x10, AX=0x0004)

Posted: Fri May 23, 2014 6:04 am
by Combuster
After thinking this issue more, I am starting to believe that the monitor is not a problem.
Actually, in the old days I had a 19" BNC monitor that didn't work until windows 98 put it to 1024x768x8...