: Checksum, this mean that the image file will be compared with number?
yes. A simple checksum will add up all the bytes in a range of memory so that the end result is 0. By adding in the last byte, the checksum byte, the value overflows back to 0.
Your current bios might do this in 8, 16 or 32bits, so you need to know where the checksum is stored and how it's calculated.
It's easily fooled. If you add 1 to one byte, subtract 1 from another and the checksum will still be 0.
: I have a old motherboard that im working on, and last week i had contact with a person who had the same BIOS chip for me. So now i can play with it, without to lose a good BIOS that doesn`t work. So when the BIOS code doesn`t work, i replace the bad one with the good one, and can reprogram the bad one! ;)
excellent. This is a pretty good way to work; at least you won't end up throwing your motherboard away.
I suggest investing in one of these:
These cards allow you to display the value written to I/O port 80h, which is the debug/diagnostic port. You write a new value to port 80 at the entry point of every module of your code, so then you can trace where it last hung up. Otherwise, you're working blind.
: So now i have placed a jump at the start adress in the image to some code that displays a "A" on the screen, without a result i see! Because i dont have memmory ;) And i dont have a good checksum.
and you haven't initialized the video card.
The motherboard BIOS calls the BIOS (called an option ROM) that is on your video card so it can be set up and readied to display characters on the screen.
Does your computer beep when you try executing your custom BIOS?
On most modern computers, there is another tiny BIOS called the boot-block which allows you to recover a mis-flashed BIOS if the bootblock sees that the main BIOS checksum doesn't match. So, essentially, there are 2 BIOSes on your flash chip. The 1st one doesn't get flashed in when you upgrade your BIOS. This may or may not be affecting you, depending on your BIOS/vendor/motherboard age.
: But if i place a jump at the end of the P.O.S.T. to my own code in the BIOS. Have this code to be compressed.
You'll have to experiment with where the best location to patch your code in. If you have a utility to disassemble the BIOS image file, you might find sections of code that are not compressed that you can hook into. You might even get lucky enough to make changes in areas that aren't checksummed. Trial and error is about the only way you're going to figure it out, but even that's easier than re-writing all the code to initialize your hardware.