I managed to add BIOS options to a AMI BIOS. My ASRock NF2 BIOS mod now has more DRAM settings.
I would like to share a few words about AMI BIOS modding and my main problems I had.
1.0 AMI BIOS
AMI BIOS modules are divided into module IDs:
The modules we want to mod is 1B (System module) and 21 (language module).
2.0 Language module
The first bytes of the language module should be the same as in most AMI BIOSes. Offset 08h and 09h indicate the start of the first address to the lables. This is also the start where the counter begins. Addresses are written down in little endian (offset 06F6 --> F606).
Special note to the (red) offset 14h and 15h. This bytes are crucial. Wrong values will cause a crash in AMIBCP. I have no clue what they mean.
The last address follows with the first lable F606. No further addresses can be added here. To solve this problem I added 200h free space between the last address and the fist lable. Then I had to correct ALL (!) addresses by +0002 (little endian, +200h offsets). Then I was able to add a lot of new lables! I filled the whole 200h with addresses.
Important! I also had to change offset 14h and 15h by +0002!
Now, lets have a look at our new lables in AMIBCP:
Looks fine now. Lable tokens are important fo find the BIOS strings and menu in the System module.
3.0 Edit System module.
The 1b module consists of several parts. The part that I need is called here: SETSVR_CSEG (sometimes other names). You can easily find it with this sequence:
There is a tool (ami_1b_utilz) to split the 1B module to its parts. Many thanks here to Antinomy!
Now you have to search for the lable tokens. This can help to decrypt the BIOS menu and the BIOS items.
Here is some help to find it easier. BIOS items (begins with 01 ….) should look like:
(pics from Polygon)
BIOS menu code should look something like this:
My second problem was to find empy space for my code. There is usable space before the code starts and some space in between. AMI BCP finds this new added code, but the BIOS (after a flash) showed an empty screen with no items. My conclusion is that AMBCP and probably some boards will find this new added code, but my board is not able to use the code from the empty spaces (maybe not addressable area?). To solve this problem, I deleted unimportant and unused BIOS options and moved some code to create empty space for my new option. Well, this worked. My BIOS mod works finally! One sidenote: Moving menus in AMIBCP can cause problems. It seems like AMIBCP moves also the menu in the BIOS code.
The BIOS mod now sets correct CMOS values.
The next part should be to create a PCI option rom, that changes all BIOS settings in the System part. As far as I know, AMI BIOS is not able to add a ISA option rom. So, exchanging existing LAN boot rom to our modded option rom is the way to go.
LAN and LAN Boot has to be enable in BIOS!
There are still some points to improve in this BIOS (hidden RAID menu, more settings...). If I find the motivation to do so, I will improve the BIOS mod.
ami_1b_utilz.zip K7NF2_DB2_R2.zip K7NF2_DB3_R2.zip K7NF2_DBA_R2.zip