Tuesday, March 27, 2018

An example of MBR

//sectors_per_track = 56


[511-512](1fe~1ff): 55 AA
[447-510] 1BE - 1FD : partition table
partition 1(0x0):
 .bt0 = 0x80 =  Active
/* .bt1 = disk_hdr_idx = 01
 .bt2&0x3f = sector_id = 01
 ((.bt2&0xc0) >> 6) + (.bt3 << 2) = cylinder_idx = 0
 .bt4: file system id( NTFS = 0x07 )
 .dw8: sector_addr = 0x38// byte_addr = 0x7000

partition 2(0x1):
 .bt0 = 0 = not Active/*
 disk_hdr_idx = 0
 sector_id = 1
 cylinder_idx = 1023*/
 file system id = 0f = extend partition
 .dw8: 42911400 // byte_addr = 42911400 * 512 = 0x51D8D5000 ,
 //extend partition can have its own partition table, it's 0x51D8D51be here
 //here we only have one logic partition inside, it's D:
 D.Active = false
 D.byte_addr = 0x7000
 //byte_addr is relative, the abs byte_addr is 0x51D8Dc000, at this addr we can find the (logic) partition's boot record

No comments:

Post a Comment