Nearly everywhere I read that partition tables are always part of MBR.
What will happen, if I overwrite these tables by executable code?
Partition tables and MBR
Re: Partition tables and MBR
You will no longer have any partitions on your disk.
Re: Partition tables and MBR
Which calls will be affected by doing this? I think drive tables of int 0x13. Anything else?
Re: Partition tables and MBR
I do not recommend using executable code there. If there are no partitions, fill it with zeros.lopidas wrote:What will happen, if I overwrite these tables by executable code?
In fact, I always keep that area filled with zeros even in FAT12 floppy images (that do not contain partitions anyway). If I copy the image to a USB stick, it is definitely interpreted as a floppy. On the contrary, for my "HD images" with partitions I always leave the Bios Parameter Block filled with zeros (except the first short jump, of course).
Re: Partition tables and MBR
Why do you not recommend it?
Re: Partition tables and MBR
Hi,
If you're lucky (e.g. the "random" bytes in the partition table don't look valid) any other OS will assume the hard drive isn't partitioned properly yet and wipe the partition table in an attempt to install partitions/file systems (corrupting your code, but not trashing file system/s and user data).
Note: There is one and only one case where not having a partition table (and putting executable code there) is safe; and that's floppy disks (where no OS expects to see partitions). For all other cases you break the expectations of every other OSs that the user may have installed or may want to install later.
[EDIT: Actually, I forgot about CDs, which are also never partitioned but boot very differently anyway.[/EDIT]
Cheers,
Brendan
If you're unlucky (e.g. the "random" bytes in the partition table happen to look valid) any other OS can think there's valid partitions when there are none (possibly asking the user if the partitions it sees should be formatted, destroying data if the user says "yes").lopidas wrote:Why do you not recommend it?
If you're lucky (e.g. the "random" bytes in the partition table don't look valid) any other OS will assume the hard drive isn't partitioned properly yet and wipe the partition table in an attempt to install partitions/file systems (corrupting your code, but not trashing file system/s and user data).
Note: There is one and only one case where not having a partition table (and putting executable code there) is safe; and that's floppy disks (where no OS expects to see partitions). For all other cases you break the expectations of every other OSs that the user may have installed or may want to install later.
[EDIT: Actually, I forgot about CDs, which are also never partitioned but boot very differently anyway.[/EDIT]
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Partition tables and MBR
No BIOS functions will be affected; not even INT 13h, which is for controlling drives rather than file systems.lopidas wrote:Which calls will be affected by doing this? I think drive tables of int 0x13. Anything else?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]