VOGONS


BIOS checksums

Topic actions

First post, by stamasd

User metadata
Rank l33t
Rank
l33t

I am trying to modify a BIOS and I think I'm failing because I end up with an invalid checksum. It's not a change in the BIOS code itself, I am just adding a small piece of code (an option ROM) inside the main BIOS file in an otherwise empty area. I made sure to align it properly to 2k, not change the file size overall and so on.
But when I try the new BIOS, it doesn't work, the computer just emits a continuous tome from the speaker and doesn't POST. I think it's failing the BIOS checksum. I had thought I had it covered because the option ROM I inserted has its own checksum byte at the end and I thought it will cancel out - but obviously it didn't.

What tools are there for calculating/writing the correct checksum to a BIOS? I have done a search and haven't found anything obviously useful. If it matters, it's a 386 system from 1990-ish.
(and the piece of code I'm trying to add is, predictably, XTIDE)

(Edit) thought I'd add one more tidbit: it's a composite BIOS file, 128kB made up of 2 parts: the first 64k is a VGA ROM (because this motherboard has on-board graphics) and the second 64k is the system BIOS. The XTIDE I have placed in an empty area inside the system BIOS part because that's the only place I found where it would fit.
I don't know if each part of this composite BIOS has to have its own checksum (it probably does because at runtime they are mapped to different areas in memory) or if the checksum must be global for the whole file.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 1 of 9, by stamasd

User metadata
Rank l33t
Rank
l33t

Hmm, I found this project https://github.com/kpanic23/QB-checksummer
ran the tool on a few bios files which I know have a good checksum and it said they are valid
Then I cut the system BIOS part from that composite file above and ran the tool on it, it says good checksum
Then I did the same with my modded BIOS with the XTIDE embedded, and again it said the checksum is good.
So at this point, the BIOS file should be valid, but it doesn't boot.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 2 of 9, by stamasd

User metadata
Rank l33t
Rank
l33t

Actually... I think I have a (partial) answer. It looks like the W27C010 chips I was using for testing are not pin compatible with the S27C1001 that the original BIOS is in. 🙁 I ordered a few of the latter and willl have to test again, this time hopefully with the right pin-compatible chip.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 3 of 9, by stamasd

User metadata
Rank l33t
Rank
l33t

Well, anyway reporting back. It didn't work. Got the correct chips, wrote my custom image to one, it boots but my embedded XTIDE is not getting activated. Oh well it was a good try.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 4 of 9, by jakethompson1

User metadata
Rank Oldbie
Rank
Oldbie

Option ROMs have to be on a 2KB boundary to be detected during the POST scan.

Reply 5 of 9, by myne

User metadata
Rank Oldbie
Rank
Oldbie

Is it Ami? Phoenix? Award?
There are tools to add option roms.

I've thing to be aware of, there's a signature for oproms. They have to start with... 55aa Iirc.

I built:
Convert old ASUS ASC boardviews to KICAD PCB!
Re: A comprehensive guide to install and play MechWarrior 2 on new versions on Windows.
Dos+Windows 3.11+tcp+vbe_svga auto-install iso template
Script to backup Win9x\ME drivers from a working install
Re: The thing no one asked for: KICAD 440bx reference schematic

Reply 6 of 9, by stamasd

User metadata
Rank l33t
Rank
l33t
jakethompson1 wrote on 2025-01-23, 02:24:

Option ROMs have to be on a 2KB boundary to be detected during the POST scan.

Yes I made sure it was. I actually made 2 versions because I had 2 2k-aligned spots to place my code at, neither worked. One was 0xF780, the other 0xF800

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 7 of 9, by stamasd

User metadata
Rank l33t
Rank
l33t
myne wrote on 2025-01-23, 02:28:

Is it Ami? Phoenix? Award?
There are tools to add option roms.

I've thing to be aware of, there's a signature for oproms. They have to start with... 55aa Iirc.

It's neither. It is a very special custom ROM made by Philips for a Magnavox 386 computer. Yes, the configured XTIDE code I used has the 55aa signature and a correct checksum. It works if I stick it on a ROM chip somewhere in the upper memory area.
FWIW this is the motherboard; the BIOS is version 2.71 attached to that entry (which came from me, I'm the one who dumped it and uploaded it to TRW). https://theretroweb.com/motherboards/s/magnavox-286-386sx-16

The whole reason for this exercise was: this system has very few ISA slots (only 3 on the riser) and I'd like if possible to free one of them currently taken by a ROM card with XTIDE.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 8 of 9, by jakethompson1

User metadata
Rank Oldbie
Rank
Oldbie
stamasd wrote on 2025-01-23, 10:15:
jakethompson1 wrote on 2025-01-23, 02:24:

Option ROMs have to be on a 2KB boundary to be detected during the POST scan.

Yes I made sure it was. I actually made 2 versions because I had 2 2k-aligned spots to place my code at, neither worked. One was 0xF780, the other 0xF800

The option ROM scan doesn't go that high.

Reply 9 of 9, by stamasd

User metadata
Rank l33t
Rank
l33t

In many older BIOS versions, the option code scan goes to 0xF800
In others, it stops at 0xF400
I took a gamble, and it didn't pay out.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O