📄 master boot record & fat layout.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0038)http://volny.cz/rootshell/mbr+fat.html -->
<HTML><HEAD><TITLE>Master Boot Record & FAT layout</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1276" name=GENERATOR></HEAD>
<BODY><PRE><HR>
<H2>MBR LAYOUT</H2>
<HR>
{L} adamus
<HR>
Master Boot Record is the 1st sector on HDD (LBA=0). you can view your own by typing
`dd if=/dev/hdx of=mbr.hex bs=512 count=1; hexedit mbr.hex`
substitute /dev/hdx to your device
The first 446 bytes of the MBR is the boot code. im not going to describe it any further. this
code just gets executed each startup and passes control to the boot code of the active
partition.<P>
<IMG src="Master Boot Record & FAT layout.files/mbr.gif">
copied from
<A href="http://www.pjrc.com/tech/8051/ide/fat32.html">http://www.pjrc.com/tech/8051/ide/fat32.html</A><P>
im going to describe the last 66 bytes of MBR, which is the binar data structure
containing information about 4 partitions and is ended always with 55 AA.
<IMG src="Master Boot Record & FAT layout.files/MBR_diagram.png"><P>
i've aligned my actual MBR to be easier visible. all bytes are shifted right by 2.
the CHS values are ignored for partitions bigger then ~8GB and maybe nowadays are
ignored altogether. it depends on boot loader, OS, particulkar programs.
working with LBA addressing scheme is simplier and provides parition sizes up to
2048GB if working with sector size of 512B (256^4*512B). if there is a extended
partition, one of 4 records in MBR should point to it as if it were primary
partition, only the FS ID is 0x0F or 0x05. then the extended partition contains EMBR
as it 1st sector, which may divide the extended partition to logical partitions.
retrieve, study, backup and experiment with your MBR<P>
<HR>
<H2>FAT LAYOUT</H2>
<HR>
you can get your own FAT by searching for the FAT partition in your MBR. it can be
determined by the FS ID flag. on my disk i have FAT on the 2nd partition (FS
ID=0x0B). i can read from MBR that it begins on LBA=0x0000BC43 => its begins on
sector number 48195 in decimal. so i retrieve my FAT (which begins on the 1st sector of its
partition) by typing
`dd if=/dev/hda of=fat.hex bs=512 count=1 skip=48195`
substitute `/dev/hda` and `48195` accordingly
for basics about FAT see <A href="http://www.pjrc.com/tech/8051/ide/fat32.html">http://www.pjrc.com/tech/8051/ide/fat32.html</A>
and there mentioned MS specification
i suggest you explore the first 64 sectors of your HDDs, it's enlightening.
i personally don't understand why there is about 32KB of unused free space and some backup
copies of MBR or whatever aren't there?
maybe a compatibily issue, does anybody know?
</PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -