Forum FAQForum FAQ SearchSearch MemberlistMemberlist   UsergroupsUsergroups RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Wim's BIOS RSS FeedRSS Log inLog in

Code to change BIOS boot sequence

 
Post new topic   Reply to topic    Wim's BIOS Forum Index -> In-depth High-tech BIOS section

Recommended by Wim's BIOS...

BIOS Agent scan: Upgrade your BIOS! Driver Agent scan: Instant Access to 116,215 Device Drivers Updates!

View previous topic :: View next topic  
Author Message
cjjoy1980
New visitors - please read the rules.


Joined: 06 May 2008
Posts: 1

PostPosted: Tue May 06, 2008 6:02 am     Post subject: Code to change BIOS boot sequence Reply with quote

Hi,
I have written a code to change boot sequence (sometimes want my system to boot from network) using C program, using port 70 h and 71H. I followed the following procedure:

1. Dumped the CMOS contents with the current boot sequence into a file.
2. Changed the boot sequence manually and again read the CMOS contents into a file.
3. From these two file contents I observed values are being changed at 3 locations ( 1 for boot sequence and other 2 boot sequence).
4. wrote C code to write into these 3 locations
5. I was able to write successfully
6. When I restarted, I got the error. System CMOS checksum error and BIOS was updated with default value.

Can anybody help me out with this.. Is this the correct method or is their any other way??
Back to top
View user's profile Send private message
cp
BIOS Guru


Joined: 21 Oct 2002
Posts: 1407
Location: Germany

PostPosted: Tue May 06, 2008 7:34 am     Post subject: Reply with quote

almost everything correct. except you obviously forgot to calculate the cmos checksum and write it back into the cmos.
i don't know if there's a standard way to calculate the checksum over the cmos contents.
_________________
If you email me include [WIMSBIOS] in the subject.
Back to top
View user's profile Send private message
prostar
New visitors - please read the rules.


Joined: 27 May 2008
Posts: 4

PostPosted: Tue May 27, 2008 2:09 pm     Post subject: Reply with quote

For many of leagacy bios, your design may work as expected if you re-compute the cmos checksum to the correct value.

But for newly UEFI based bios, your design won't work as expcted. Because these bios store the seetings in system flash directly.
Back to top
View user's profile Send private message
fzabkar
BIOS Newbie


Joined: 18 May 2008
Posts: 27

PostPosted: Wed May 28, 2008 7:15 am     Post subject: Code to change BIOS boot sequence Reply with quote

I once analysed an old AMI 386 BIOS with 128-bytes of CMOS RAM. In that particular case there were two 2-byte checksums.

The first was at CMOS RAM addresses 2E-2F. It summed the contents of addresses 10h to 2Dh.

The second was at 3E-3F and summed the contents of addresses 34h to 3Dh and 40h to 7Fh.

I don't know if this regime still applies.
Back to top
View user's profile Send private message
indianoutlaw187
New visitors - please read the rules.


Joined: 12 Jun 2007
Posts: 6

PostPosted: Sun Jun 29, 2008 6:45 am     Post subject: Reply with quote

The above statement is correct and the checksum is stored in 2e,2f, and 3e, 3f for non-EFI BIOS. EFI based BIOS store everything to flash.

So to help you, you need to understand the checksum method your BIOS uses and which locations are used to compute the checksum. This can vary from one BIOS to another. Simply change some of the BIOS options and see how it affects the contents of 2e,2f,3e,3f. Keep in mind that on Intel based systems, locations above the first 128 bytes are accessed using IO ports 72 and 73.
Back to top
View user's profile Send private message
zwzzhh
New visitors - please read the rules.


Joined: 15 Jul 2008
Posts: 1

PostPosted: Tue Jul 15, 2008 12:03 pm     Post subject: Code to change BIOS boot sequence Reply with quote

I agree with prostar. Because I use this method to test in UEFI based bios platform. But, it doesn't work.
However, I am not sure whether the bios store the setting in system flash directly or not. Because I haven't got any evidence about it.

I will be thankful, if who can give me evidence about it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Wim's BIOS Forum Index -> In-depth High-tech BIOS section All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group