Fantasy94 wrote: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.
Nope, what I've sent you is the source of a GPL licensed VGA ROM (used by many emulators, bochs and qemu as well, but it is a VGA ROM not an emulator). On a real machine you'll have a manufacturer specific ROM, and chances are good you can't change that at all. The best you can do is change the VGA ROM used by the emulator.
Why do you want to change the default palette by the way, when you could simply modify the effective palette any time? Or even better, by using a modern video hardware use true color pixels without palette in the first place?
Fantasy94 wrote:I only referenced OpenBSD because the wscons driver only supports ANSI colors.
This doesn't mean it's using text mode at all. It could be that it uses a framebuffer, and emulates ANSI colors. Same with the Linux consoles (Ctrl+Alt+F1 .. Ctrl+Alt+F6; do not confuse with GUI terminal emulators like xterm, gnome-terminal, konsole etc.) Under the hood those consoles are pixel based framebuffers, yet they only supports ANSI colors via CSI sequences. I haven't checked, but wscons could do the same. Actually if OpenBSD boots on an UEFI machine, there's no other way.
Fantasy94 wrote: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.
You won't find the palette in that. That's stored in the VGA ROM, which is physically a chip on the video card not on the mother board. Let's assume you have a motherboard with AWARD BIOS. You plug in a Cirrus video card, then the default palette will be provided by the Cirrus VGA ROM. Then you replace the card with a Trident card, then the AWARD BIOS remains the same, but now you'll have an entirely different VGA ROM with different VGA functions, and in theory with a different default palette (the palette is standardized so it's unlikely to have a different one, but could be).
Fantasy94 wrote:In the BIOS system it must have some VGA writing function, am I wrong? This is where I want to go.
No, that's in the VGA ROM. It's just the interface is standardized, so that the BIOS could use the same IO ports for VGA. But not for SVGA and above, there the compatibility is limited to the INT 10h interface, and not to the IO ports. Furthermore, most modern video cards does not emulate legacy IO ports either.
Fantasy94 wrote: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.
No wonder, there's no such function in the system BIOS. Disassemble the VGA ROM, or take a look at the source I've linked. You'll find it there (
vgabios.c, line 837 function load_dac_palette).
Cheers,
bzt