How to change BIOS boot sequence programmatically

  • Follow


Can anybody suggest me how to programmatically change BIOS boot
sequence using Assembly language or C programming language. I got some
information like we can access CMOS data by send address to port 70h
and receiving data through port 71h. But i dont know boot sequence
address 
in CMOS memory map

0
Reply spamtrap2 (1628) 7/27/2006 7:17:02 PM

Haha....cant you just enter the password and change it?
In short...Im guessing you dont have the password and this is why you
wish to change it. You could overwrite all locations with zero....this
will probably have the desired effect under Windows 95 or DOS.
Under NT4/XP any sensible permissions will prevent access to these
ports. So no - not unless you have admin rights.
BTW the boot sequence address can be different for each BIOS type.

san wrote:
> Can anybody suggest me how to programmatically change BIOS boot
> sequence using Assembly language or C programming language. I got some
> information like we can access CMOS data by send address to port 70h
> and receiving data through port 71h. But i dont know boot sequence
> address 
> in CMOS memory map

0
Reply PillMonsta 7/27/2006 10:41:40 PM


PillMonsta wrote:
> Haha....cant you just enter the password and change it?
> In short...Im guessing you dont have the password and this is why you
> wish to change it. You could overwrite all locations with zero....this
> will probably have the desired effect under Windows 95 or DOS.
> Under NT4/XP any sensible permissions will prevent access to these
> ports. So no - not unless you have admin rights.
> BTW the boot sequence address can be different for each BIOS type.
>
> san wrote:
> > Can anybody suggest me how to programmatically change BIOS boot
> > sequence using Assembly language or C programming language. I got some
> > information like we can access CMOS data by send address to port 70h
> > and receiving data through port 71h. But i dont know boot sequence
> > address
> > in CMOS memory map

Thank you for the response. I do not want to set boot sequence through
setup. This is required as i want to switch between network boot and
hard disk boot at the time of each boot depending on some conditions.

0
Reply san 7/28/2006 7:21:03 AM

On 28 Jul 2006 00:21:03 -0700, "san"  <spamtrap@crayne.org> wrote:

>
>PillMonsta wrote:
>> Haha....cant you just enter the password and change it?
>> In short...Im guessing you dont have the password and this is why you
>> wish to change it. You could overwrite all locations with zero....this
>> will probably have the desired effect under Windows 95 or DOS.
>> Under NT4/XP any sensible permissions will prevent access to these
>> ports. So no - not unless you have admin rights.
>> BTW the boot sequence address can be different for each BIOS type.
>>
>> san wrote:
>> > Can anybody suggest me how to programmatically change BIOS boot
>> > sequence using Assembly language or C programming language. I got some
>> > information like we can access CMOS data by send address to port 70h
>> > and receiving data through port 71h. But i dont know boot sequence
>> > address
>> > in CMOS memory map
>
>Thank you for the response. I do not want to set boot sequence through
>setup. This is required as i want to switch between network boot and
>hard disk boot at the time of each boot depending on some conditions.

Any reasonable network boot should ask "boot from network?" and if you
answer no, should go back to the bios to continue on from there.
-- 
ArarghMail607 at [drop the 'http://www.' from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html

To reply by email, remove the garbage from the reply address.

0
Reply spamtrap 7/28/2006 8:03:20 AM

On 28 Jul 2006 00:21:03 -0700, "san"  <spamtrap@crayne.org>
wrote:

>PillMonsta wrote:
>> Haha....cant you just enter the password and change it?
>> In short...Im guessing you dont have the password and this is why you
>> wish to change it. You could overwrite all locations with zero....this
>> will probably have the desired effect under Windows 95 or DOS.
>> Under NT4/XP any sensible permissions will prevent access to these
>> ports. So no - not unless you have admin rights.
>> BTW the boot sequence address can be different for each BIOS type.
>>
>> san wrote:
>> > Can anybody suggest me how to programmatically change BIOS boot
>> > sequence using Assembly language or C programming language. I got some
>> > information like we can access CMOS data by send address to port 70h
>> > and receiving data through port 71h. But i dont know boot sequence
>> > address
>> > in CMOS memory map
>
>Thank you for the response. I do not want to set boot sequence through
>setup. This is required as i want to switch between network boot and
>hard disk boot at the time of each boot depending on some conditions.
>

So, you write a bootloader (that loads from your harddisk).
The bootloader probes the condition you set and depending on that
condition, either continues to boot from the harddisk or boots
from your network.

We may need to adjust our adagium "anything can be done from
assembly". Changing the bootorder may well be out of reach :-)

-- 
Kind regards,
Gerard Bok

0
Reply spamtrap 7/28/2006 8:31:12 AM

san wrote:
> Can anybody suggest me how to programmatically change BIOS boot
> sequence using Assembly language or C programming language. I got some
> information like we can access CMOS data by send address to port 70h
> and receiving data through port 71h. But i dont know boot sequence
> address 
> in CMOS memory map

All you could do is compare the CMOS contents before and after
manually changing the setting in BIOS setup - on *every* board your
code is supposed to run, because the addresses are indeed often
different. 
On some systems, some config data might be stored elsewhere, outside
the 128 CMOS bytes.

-- 
Gr��e,
Andreas

0
Reply Andreas 7/28/2006 2:03:44 PM

"san"  <spamtrap@crayne.org> wrote:
>
>Thank you for the response. I do not want to set boot sequence through
>setup. This is required as i want to switch between network boot and
>hard disk boot at the time of each boot depending on some conditions.

The key problem, in case you couldn't figure it out from the other replies,
is that there is NO standard for this type of information in CMOS.  It's
probably in their somewhere, but it's almost certainly different between
different models, even with the same BIOS manufacturer.
-- 
- Tim Roberts, timr@probo.com
  Providenza & Boekelheide, Inc.

0
Reply Tim 7/29/2006 3:52:04 AM

Andreas Gr�gel wrote:
> san wrote:
> > Can anybody suggest me how to programmatically change BIOS boot
> > sequence using Assembly language or C programming language. I got some
> > information like we can access CMOS data by send address to port 70h
> > and receiving data through port 71h. But i dont know boot sequence
> > address
> > in CMOS memory map
>
> All you could do is compare the CMOS contents before and after
> manually changing the setting in BIOS setup - on *every* board your
> code is supposed to run, because the addresses are indeed often
> different.
> On some systems, some config data might be stored elsewhere, outside
> the 128 CMOS bytes.
>
> --
> Gr��e,
> Andreas

I tried this but it does have any affect. i downloaded CMOS14.zip which
have tools to save/restore CMOS. I took first snapshot of CMOS and
named it as BEFORE.DATA and did modifications to BOOT Order and
rebooted. Now i restored BEFORE.DAT and rebooted to check the BOOT
order. no effect.

0
Reply san 7/29/2006 7:44:50 AM

"san" <spamtrap@crayne.org> wrote in message
news:1154159090.439496.283530@i42g2000cwa.googlegroups.com...
> Andreas Gr�gel wrote:
> > san wrote:
> > > Can anybody suggest me how to programmatically change BIOS boot
> > > sequence using Assembly language or C programming language. I got some
> > > information like we can access CMOS data by send address to port 70h
> > > and receiving data through port 71h. But i dont know boot sequence
> > > address
> > > in CMOS memory map
> >
> > All you could do is compare the CMOS contents before and after
> > manually changing the setting in BIOS setup - on *every* board your
> > code is supposed to run, because the addresses are indeed often
> > different.
> > On some systems, some config data might be stored elsewhere, outside
> > the 128 CMOS bytes.
>
> I tried this but it does have any affect. i downloaded CMOS14.zip which
> have tools to save/restore CMOS. I took first snapshot of CMOS and
> named it as BEFORE.DATA and did modifications to BOOT Order and
> rebooted. Now i restored BEFORE.DAT and rebooted to check the BOOT
> order. no effect.

When  you did the "compare" step Andreas suggested, were there any differences?
Other than the clock, of course.

I suspect there weren't, because the boot order is not stored in CMOS on that
machine.  On most machines, what you want is either stored in the BIOS Flash,
often along with the ESCD, or specifically for network boot, on the network
card itself.

    - Bill

0
Reply William 7/29/2006 9:05:36 AM

The CMOS has a checksum - so unless you know the checksum algorithm -
simply modifying the bytes that have changed (some of which will alwas
be the checksum too) will always give you a "checksum failed" or other
BIOS startup message.
I am certain that there are plenty of bootloaders out there on the
internet which would suit your requirements - and I would be surprised
if some did not have sourcecode.
The solution here is to use a bootloader - not play around with the
BIOS.

William J. Leary Jr. wrote:
> "san" <spamtrap@crayne.org> wrote in message
> news:1154159090.439496.283530@i42g2000cwa.googlegroups.com...
> > Andreas Gr�gel wrote:
> > > san wrote:
> > > > Can anybody suggest me how to programmatically change BIOS boot
> > > > sequence using Assembly language or C programming language. I got some
> > > > information like we can access CMOS data by send address to port 70h
> > > > and receiving data through port 71h. But i dont know boot sequence
> > > > address
> > > > in CMOS memory map
> > >
> > > All you could do is compare the CMOS contents before and after
> > > manually changing the setting in BIOS setup - on *every* board your
> > > code is supposed to run, because the addresses are indeed often
> > > different.
> > > On some systems, some config data might be stored elsewhere, outside
> > > the 128 CMOS bytes.
> >
> > I tried this but it does have any affect. i downloaded CMOS14.zip which
> > have tools to save/restore CMOS. I took first snapshot of CMOS and
> > named it as BEFORE.DATA and did modifications to BOOT Order and
> > rebooted. Now i restored BEFORE.DAT and rebooted to check the BOOT
> > order. no effect.
>
> When  you did the "compare" step Andreas suggested, were there any differences?
> Other than the clock, of course.
>
> I suspect there weren't, because the boot order is not stored in CMOS on that
> machine.  On most machines, what you want is either stored in the BIOS Flash,
> often along with the ESCD, or specifically for network boot, on the network
> card itself.
> 
>     - Bill

0
Reply PillMonsta 7/31/2006 7:40:42 AM

"PillMonsta" <spamtrap@crayne.org> wrote in message
news:1154331642.888373.253180@s13g2000cwa.googlegroups.com...
> The CMOS has a checksum - so unless you know the checksum algorithm -
> simply modifying the bytes that have changed (some of which will alwas
> be the checksum too) will always give you a "checksum failed" or other
> BIOS startup message.

Yes, I know.  I've written code to modify CMOS entries.  Getting the checksums
and CRCs right is a minor nightmare.

However, that's not what was being suggested.

The suggestion was to save the CMOS to disk, then use setup to change it, then
save it again.  Andreas then suggested that he should compare the two, I assume
to see if anything changed.  This would reveal if the required setting was in
CMOS or not.

> I am certain that there are plenty of bootloaders out there on the
> internet which would suit your requirements

His requirements, not mine.

> - and I would be surprised if some did not have sourcecode.

Please locate one if you can.  I've been unable to find one which fulfills his
requirements.

> The solution here is to use a bootloader - not play around with the
> BIOS.

If by "BIOS" you mean the BIOS setup as stored in CMOS, I agree.  This
discussion has also been going on over in comp.msdos.programmer where several
have pointed out that what he want's to do, the way he want's to do it, is
going to be machine dependant, if it can be made to work at all.

    - Bill

0
Reply William 7/31/2006 11:00:35 PM

san wrote:
> Can anybody suggest me how to programmatically change BIOS boot
> sequence using Assembly language or C programming language. I got some
> information like we can access CMOS data by send address to port 70h
> and receiving data through port 71h. But i dont know boot sequence
> address 
> in CMOS memory map

Just in case this hasn't been mentioned already: There actually _is_ a 
standard and it's called "BIOS Boot Specification" (something to google 
for), and yes, this also defines run time services. Unfortunately, the
implementation off run time services is only _optional_. But you just 
might get lucky on your system.

0
Reply Michael 8/12/2006 3:12:25 PM

11 Replies
167 Views

(page loaded in 0.105 seconds)

Similiar Articles:


















7/27/2012 12:00:23 PM


Reply: