cstarter wrote:

> 
> %define bsOemName       bp+0x03      ; OEM label
> %define bsBytesPerSec   bp+0x0b      ; bytes/sector
> %define bsSecPerClust   bp+0x0d      ; sectors/allocation unit
> %define bsResSectors    bp+0x0e      ; # reserved sectors
> %define bsFATs          bp+0x10      ; # of fats
> %define bsRootDirEnts   bp+0x11      ; # of root dir entries
> %define bsSectors       bp+0x13      ; # sectors total in image
> %define bsMedia         bp+0x15      ; media descrip: fd=2side9sec, etc...
> %define sectPerFat      bp+0x16      ; # sectors in a fat
> %define sectPerTrack    bp+0x18      ; # sectors/track
> %define nHeads          bp+0x1a      ; # heads
> %define nHidden         bp+0x1c      ; # hidden sectors
> %define nSectorHuge     bp+0x20      ; # sectors if > 65536
> %define xsectPerFat     bp+0x24      ; Sectors/Fat
> %define xrootClst       bp+0x2c      ; Starting cluster of root directory
> %define drive           bp+0x40      ; Drive number
> I read the boot code many times , the "bp+xxx" puzzled me .
> not value specified , how to calculate .
> I wonder the bsSectors's(nFATs ,...) value , and how to  calculate .
> Thanks .
>  

I'm not really sure what you are asking.
The number of FATs is stored in the BPB at offset 0x10 (bsFATs).
The BP+0x10 is a trick to generate smaller code, it works because BIOS
loads the 1st sector (which has the BPB and boot code) from the disk to
0:07C0h and the boot code sets SS to 0 and BP to 07C0h, so any positive
reference from BP will access the BPB (or boot code).  The value
actually stored in the BPB for number of FATs is placed there when the
disk is formated (almost always 2 unless a RAM disk or special tool
used), sys takes care not to alter these when placing the boot code on
the disk.

Jeremy





-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Freedos-kernel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to