[syslinux] COM32 Advice

Michael_E_Brown at Dell.com Michael_E_Brown at Dell.com
Mon Apr 21 06:01:20 PDT 2003


Windows uses several sectors in the _partition_ for booting. Windows only
uses sector 0 of the Disk (the MBR), and does not use any other sectors.
Other boot managers and copy protection software (the stuff that comes with
TurboTax this year uses track 0, evil...)

For FAT16 filesystems, only the first sector is used. 

For FAT32, there are 32 sectors that are reserved by the FS, and I've come
up with the following handy chart for which sectors are used where:

Sector layout for FAT32 **partition** boot record.
------------------------
sector  purpose
0 - boot sector / EBPB          offset 510 = 0xFF, 511 = 0xAA
1 - FSINFO Sector              offset 510 = 0xFF, 511 = 0xAA
2 - boot 3                     offset 510 = 0xFF, 511 = 0xAA
3 - unused
4 - unused
5 - unused
6 - backup boot sector / EBPB   offset 510 = 0xFF, 511 = 0xAA
7 - backup FSINFO Sector       offset 510 = 0xFF, 511 = 0xAA
8 - backup boot 3              offset 510 = 0xFF, 511 = 0xAA
9 - unused
10- unused
11- unused
12- W2K Boot record (Unconfirmed...)
..
31 - sectors 13-31 are reserved area.


conversion chart
Sector# --> decimal offset --> hex offset
----------------------------------------
sector   decimal     hex
0 -          0   -    0x0
1 -        512   -  0x200
2 -       1024   -  0x400
3 -       1536   -  0x600
4 -       2048   -  0x800
5 -       2560   -  0xa00
6 -       3072   -  0xc00
7 -       3584   -  0xe00
8 -       4096   - 0x1000
... 
12-       6144   - 0x1800

FSINFO sectors basically store one or two numbers (they left room to grow, I
guess). It stores the cached number of clusters in use, and the last free
cluster (IIRC). You can set them both to 0xFFFF, and they will be
regenerated on bootup.

Extended Bios Parameter Block (EBPB) starts on byte 12 (decimal) and has
last byte at 70 (decimal). This info is used by the bootloader and
filesystem driver.
--
Michael

-----Original Message-----
From: Murali krishnan Ganapathy [mailto:gmurali at cs.uchicago.edu]
Sent: Friday, April 18, 2003 10:58 PM
To: syslinux at zytor.com
Subject: RE: [syslinux] COM32 Advice



hmm.... I always thought officially you are only allowed to use 
the 0th sector on track 0 (MBR). I have heard of (windows I think) 
using upto 4 sectors, but that may be in the partition in which 
it is installed. So I thought, sectors 6-9 should be safe. If 
I can be reasonably assured that Linux (i.e. LILO), and Windows
dont use more than the first 4 sectors on track 0, I will be happy.

Since I am doing the partitioning, I can ensure that track 0 is 
"unpartitioned space", so officially only the MBR lives there.

>> The process of installing OSes (especially multiple OSes), require
one 
>> to boot in some particular order, e.g. Boot into DOS off the CD, and 
>> then off the hard disk,.... I am currently trying to automate that 
>> process. To that end I am writing a COM32 code, which ineffect reads
a 
>> particular sector from the hard disk (sector 6-9 in the 0th cylinder 
>> which AFAIK is not used by any OS to do anything),
>>

>Well... it's used (in a completely uncoordinated fashion) by various 
>boot managers, etc.)  Track 0 is pretty much the wild west of 
>harddrives; it doesn't *have* to be unpartitioned space, even, it just 
>usually is.

And regarding booting off the hard disk, I think I will wait till
COMBOOT API
includes that.

- Murali


_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX at zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.




More information about the Syslinux mailing list