CMOS on AMI BIOS

Only for programmers and BIOS gurus with technical questions.
Post Reply
gabirata
New visitors - please read the rules.
Posts: 4
Joined: Mon Nov 12, 2007 8:17 pm

I'm developing a application to save and restore the content of the CMOS. Then I'm copying the 128 bytes to a file and later restoring it again. In other BIOSes it works fine, but with AMI I get the error "CMOS Configuration Wrong".

Anyone knows if the AMI has some check that depend on dynamic data?
superpyton
New visitors - please read the rules.
Posts: 5
Joined: Mon Nov 28, 2005 12:30 pm

This is because new BIOSes (not only AMI but also latest version of AWARD 6.00 too) uses 256-bytes length CMOS. Use ports 0x72 and 0x73 (instead 0x70 and 0x71) to access all data in CMOS-memory.
gabirata
New visitors - please read the rules.
Posts: 4
Joined: Mon Nov 12, 2007 8:17 pm

I should read the first 128 bytes using the ports 0x70 and 0x71 then using the ports 0x72 and 0x73 to read the next 128 bytes?
Or may I use the ports 0x72 and 0x73 to read the entire 256 bytes?

thanks by your attention!
gabirata
New visitors - please read the rules.
Posts: 4
Joined: Mon Nov 12, 2007 8:17 pm

Maybe the length would be a problem too. But, I think there is another error. Please take a look at the step I used to test the program:

1 - First, I run my program to save the CMOS to a file.
2 - Next, I reboot the machine and then I make some modifications to the CMOS using the Setup, including the boot sequence.
3 - Next, I run my program again to restore the CMOS from the file previously saved.
4 - Finally, when I reboot the machine I get the error "CMOS Configurations Wrong".

But when I look the Setup again, all configurations was restored, except the boot sequence. Then, I just change the boot sequence, save the Setup and everything works fine. Because this, I'm wondering that AMI has some check related to the boot sequence.

Other stuff: If I save the CMOS to a file and then restore it without make change in the Setup everything works fine. None worth was made, but this shows that the code would be OK. Only when I make changes I get the error.

Have someone any idea?

Thanks in advance!
superpyton
New visitors - please read the rules.
Posts: 5
Joined: Mon Nov 28, 2005 12:30 pm

You should read all data by ports 72h/73h.
Try this CMOS editor - i've use it on ASRock K8Upgrade-NF3 (AMI BIOS 8 ) and it works fine:
http://www.rebelshavenforum.com/sisubb/ ... 2;t=000086
gabirata
New visitors - please read the rules.
Posts: 4
Joined: Mon Nov 12, 2007 8:17 pm

I had saved to the CMOS using the ports 72h/73h. I really can modify its configurations, but the error still remain. I see that all configuration was saved but the boot sequence, that always appear with the floppy disk in the first place. I think this is causing the message "CMOS Settings Wrong". The same code works fine in Award BIOSes but fail with the AMI BIOS.
superpyton
New visitors - please read the rules.
Posts: 5
Joined: Mon Nov 28, 2005 12:30 pm

Maybe CMOS is larger than 256 bytes on your motherboard? Try to read/write 384 or 512 bytes... Maybe this is the key...
Post Reply