nullplan wrote:
Character colors are defined by the graphics card. The BIOS merely writes them into the memory area reserved for VGA, but it is the graphics card that interprets the bytes there and sends the signals to the monitor. If you wanted those bytes to be interpreted differently, you would have to change the way the graphics card works. Either by creating a new video BIOS or by just changing its settings. But that will require you to study your graphics card's documentation. Good luck!
These days, most people would just switch the graphics card to graphics mode and draw glyphs into the frame buffer. And then you can have any color you want. I also don't know what OpenBSD and BIOS have to do with any of this. BIOS is only needed to write characters in real mode, and OpenBSD is not using it for that if the developers have any sense.
I only referenced OpenBSD because the wscons driver only supports ANSI colors. These are the colors that it supports, and it is shocking to me that it can write in ring0 directly to the VGA memory with more colors.
https://man.openbsd.org/wscons.4https://github.com/openbsd/src/blob/master/sys/dev/wscons/wsdisplayvar.hCode:
/* fg / bg values. Made identical to ANSI terminal color codes. */
#define WSCOL_BLACK 0
#define WSCOL_RED 1
#define WSCOL_GREEN 2
#define WSCOL_BROWN 3
#define WSCOL_BLUE 4
#define WSCOL_MAGENTA 5
#define WSCOL_CYAN 6
#define WSCOL_WHITE 7
The only thing that I would like to try now, is simply that my BIOS write the characters on the screen of a different color, I thought that the BIOS itself would have a function of this type, and if there is to be able to modify the color parameter.
bzt wrote:
You could simply modify the
VGA DAC registers to use a different palette, simple as that. Palette works with text mode just as well as with 16 / 256 color graphics modes.
Otherwise yes, you can modify the
VGA BIOS ROM and replace the default colors (
vgatables.h line 532). The bochs source has the bios source too, you can modify that and recompile the vgabios.rom image...
nullplan wrote:
These days, most people would just switch the graphics card to graphics mode and draw glyphs into the frame buffer.
...but yes, this would be my suggestion too. With UEFI there's no text mode, only graphics mode, meaning on modern machines this is the only option.
Cheers,
bzt
I think what you sent me is for an emulator called Bosch, I would like to apply it in a real BIOS, sorry if it is not like that and I misunderstood.
foliagecanine wrote:
You most likely could figure out a way to decompile (or at least jump out to some custom code and then jump back into) the AwardBIOS and modify it in order to change the VGA color palette. It would probably take a while, but it's most likely possible.
However, it has a much higher chance at bricking your computer (unless you've got something like dual-BIOS).
Also, when you're writing code for a BIOS, you've got to be SUPER careful about vendor-specific stuff, which things have been initialized yet, and so on.
In any case, it is probably easier to either
A) Modify the OpenBSD kernel that you are using to change the color palette on boot-up or
B) Create an intermediate loader that runs prior to either BIOSBOOT (the OpenBSD bootloader) or OpenBSD, changes the color palette, then loads BIOSBOOT/OpenBSD
I would like to disassemble the BIOS and modify the color palette.
I found this site, it is very interesting there you can find the structure of an AWARD BIOS.
https://sites.google.com/site/pinczakko/award-bios-file-structureI have the binaries, even the VGA ROM one, but I don't think I need it as my current BIOS doesn't have VGA built in. In this case the BIOS system writes the characters to the VGA and that is what I want to find.
Referencing the link, the file:
Code:
0. System BIOS 20000h(128.00K) 13C31h(79.05K) 865IDC19.BIN
In the BIOS system it must have some VGA writing function, am I wrong? This is where I want to go.
Forgive me if I'm saying something crazy, I'm getting started. I have the binaries and IDA to try to see the code in ASM, but there is where I am lost and I will not find that function if it exists.
Thanks guys.