From owner-freebsd-hackers Thu Dec 20 6:18:11 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp014.mail.yahoo.com (smtp014.mail.yahoo.com [216.136.173.58]) by hub.freebsd.org (Postfix) with SMTP id 4B66637B405 for ; Thu, 20 Dec 2001 06:18:08 -0800 (PST) Received: from unknown (HELO lql) (61.156.98.119) by smtp.mail.vip.sc5.yahoo.com with SMTP; 20 Dec 2001 14:18:07 -0000 Date: Thu, 20 Dec 2001 22:24:24 +0800 From: Leslie Jackson Reply-To: cewandys@yahoo.com To: corecode Cc: freebsd-hackers@freebsd.org Subject: Re: Thanx and another question X-mailer: FoxMail 4.0 beta 2 [cn] Message-Id: <20011220141808.4B66637B405@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 corecode has written: >On Thu, 20 Dec 2001 14:2:16 +0800 Leslie Jackson >wrote: > >> Now i think i've got a basic knowledge about the BIOS data area. >> But reading the code of boot0.s, i got another question as in the >> following code: >> >> main.5: incw dx # Next item >> addb $0x10,bl # Next entry >> jnc main.3 # Till done >> >> The partition table in MBR only has 4 items, why check for 16 times?? > >it doesn't check for 16. it adds 0x10 to bl and if bl overflows (prolly >the end of the partition table. as sizeof(ever entry) == 0x10 and the 4th >ends at 0x1fc another (a 5th) increment will overflow bl and result in a >set carry flag. > Thanks for your insight! And i've got the point. Before the loop around on the partition table, the register %dx has been assigned the value $0x7c2(That is: 0x600 + 0x1be + 4) as in the code: movw $(partbl+0x4), %bx So 4 items of the partition table has been checked, %bl has the value $0xf2. And the following increment(addb $0x10, %bl) will result in a carry flag. Am i right?? Thanks a lot. BTW: the more i read it(boot0.s), the more i find it's worth reading. _________________________________________________________ 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