here is another question connected with the boot sector. if i want to transfer my self made boot sector to the hard disk and overwrite my original mbr how should i save the partition table in the new mbr so the disk would be readable? my intention is to overwrite the mbr so the partitions and all the information stay untouched. best regards,
:manchev
Partition table entries
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Partition table entries
according to http://www.nondot.org/sabre/os/files/Pa ... Tables.txt, only the first 466 bytes of the MBR are bytes of code. The last 2 bytes of the MBR are the 55AA signature and it is preceded by 4 * 16 entries which actually describe the partitionning.
So just read the current MBR, and place the code you wish within the 466 low bytes, then write back. This cannot be done with tools like "rawcopy" or "cat >/dev/xxx", afaik: you'll have to make a small system program (maybe that will run as a floppy bootsector) that do the read - change - writeback commands ...
btw, i strongly suggest that you first pick a snapshot of your partition table with a tool like norton diskedit so that you can restore it in case of failure ...
When i tried to play the firtst time, i messed up a "READ" and a WRITE" and boom ... no partitions anymore. No backup. Just raw hardware ... So be wiser than me
So just read the current MBR, and place the code you wish within the 466 low bytes, then write back. This cannot be done with tools like "rawcopy" or "cat >/dev/xxx", afaik: you'll have to make a small system program (maybe that will run as a floppy bootsector) that do the read - change - writeback commands ...
btw, i strongly suggest that you first pick a snapshot of your partition table with a tool like norton diskedit so that you can restore it in case of failure ...
When i tried to play the firtst time, i messed up a "READ" and a WRITE" and boom ... no partitions anymore. No backup. Just raw hardware ... So be wiser than me
Re:Partition table entries
thanks again, Pype.Clicker. i will follow your advice
:manchev
:manchev