From owner-freebsd-hackers Wed Dec 19 19:52: 2 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp013.mail.yahoo.com (smtp013.mail.yahoo.com [216.136.173.57]) by hub.freebsd.org (Postfix) with SMTP id 5461B37B419 for ; Wed, 19 Dec 2001 19:51:58 -0800 (PST) Received: from unknown (HELO lql) (61.133.13.239) by smtp.mail.vip.sc5.yahoo.com with SMTP; 20 Dec 2001 03:51:55 -0000 Date: Thu, 20 Dec 2001 11:58:12 +0800 From: Leslie Jackson Reply-To: cewandys@yahoo.com To: freebsd-hackers@freebsd.org Subject: Re: Re: boot0/boot0.s X-mailer: FoxMail 4.0 beta 2 [cn] Message-Id: <20011220035158.5461B37B419@hub.freebsd.org> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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