Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Dec 2001 11:58:12 +0800
From:      Leslie Jackson <cewandys@yahoo.com>
To:        freebsd-hackers@freebsd.org <freebsd-hackers@freebsd.org>
Subject:   Re: Re: boot0/boot0.s
Message-ID:  <20011220035158.5461B37B419@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Mike Smith has written

>
>If you're confused about what the code is doing there; it's comparing
>the number of hard drives in the system (stored in the BIOS data area
>at 0x475) with the drive number that's in al to verify whether the
>drive number is valid according to the BIOS.

Thanks for your help, Mike.
So stupid i am, i treated 0x475 as an immediate operand !
Now i know that's an address.

>
>The code is not very clear (being written for compactness), but if you
>are familiar with how PCs boot, it's pretty straightforward.

I'm now learing the PCs boot procedure by reading boot0.s.
So far as konw, after BIOS's POST, it would load the 512 byte of MBR to 0x7c00.
And the code there would then make a copy of itself at 0x600 and then make a jump.

But i've got no idea about the process _between_  the BIOS POST procedure and BIOS
load MBR procedure. As you said, BIOS would save the number of hard drives at 0x475 
in this 'between' procedure.  And from the following code:

.. ...

#
# Check what flags were loaded with us, specifically, Use a predefined Drive.
# If what the bios gives us is bad, use the '0' in the block instead, as well.
#
main:		testb $0x20,_FLAGS(%bp)		# Set number drive?
		jnz main.1			# Yes
		testb %dl,%dl			# Drive number valid?
		js main.2			# Possibly (0x80 set)

.. ...

That means that BIOS saves the current drive number in register %dl??

Could you give a hint about _where_ BIOS stores _what_??
I've searched the google.com, but got no valuable resource.

Thanks.






_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011220035158.5461B37B419>