iso hard disk
iso hard disk
I am thinking of standardizing on an iso cd image, El torito hard disk, as my actual hard disk format.
Iso has 32k of reserved space at the beginning.
I would use the first 512 bytes of that to put a fake mbr.
The fake mbr would use a fake disk number like ff in dl so that the real mbr knows that this is an iso image and it should get the real disk number from dh and get an extra number of hidden sectors from say cx.
The vbr would have something similar.
Any suggestions?
I'm particularly interested in what Id I should use in the partition table of the fake mbr to indicate that this is an iso image, not a normal hard disk.
Iso has 32k of reserved space at the beginning.
I would use the first 512 bytes of that to put a fake mbr.
The fake mbr would use a fake disk number like ff in dl so that the real mbr knows that this is an iso image and it should get the real disk number from dh and get an extra number of hidden sectors from say cx.
The vbr would have something similar.
Any suggestions?
I'm particularly interested in what Id I should use in the partition table of the fake mbr to indicate that this is an iso image, not a normal hard disk.
Re: iso hard disk
The MBR partition you are looking for is ISO-9660, I've never used it but I guess that it should point to the start of an ISO image. Which I do not suggest you to set it as sector 0 (or LBA0). The ID for that partition is 0x96. Here is a list of MBR partition ID's : https://en.m.wikipedia.org/wiki/Partition_type
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: iso hard disk
Why?kerravon wrote:I am thinking of standardizing on an iso cd image, El torito hard disk, as my actual hard disk format.
Syslinux uses 0x17.kerravon wrote:I'm particularly interested in what Id I should use in the partition table of the fake mbr to indicate that this is an iso image, not a normal hard disk.
Re: iso hard disk
Thanks for that. I did some searching and it looks to me like the start sector for the 0x96 partition should be lba 0.devc1 wrote:The MBR partition you are looking for is ISO-9660, I've never used it but I guess that it should point to the start of an ISO image. Which I do not suggest you to set it as sector 0 (or LBA0). The ID for that partition is 0x96. Here is a list of MBR partition ID's : https://en.m.wikipedia.org/wiki/Partition_type
Is there a reason you are suggesting not to do that?
Re: iso hard disk
It seems neat to me. You can standardize on iso format and burn it to either cdrom or hard disk/USB stick.Octocontrabass wrote:Why?kerravon wrote:I am thinking of standardizing on an iso cd image, El torito hard disk, as my actual hard disk format.
With minimal software.
Re: iso hard disk
No, its fine. You can make it at LBA0, I just said that I don't recommend it because ISOs does not have an MBR and this will make another driver consider the partition as corrupt (because the ISO starts with an MBR), Or not ! now I get it, ISOs start with a 32KB system area, you can leave your MBR there, there is absolutely no problem. Is what I said right ? This is my little research.
Re: iso hard disk
Even that Linux uses this partition type. Universally : (The famous Wikipedia) says that this partition type is reserved for hidden file systems, and can be an EFS, NTFS...Octocontrabass wrote:Syslinux uses 0x17.
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: iso hard disk
Some BIOSes will examine the partition table and misbehave or refuse to boot if a partition starts at LBA 0.kerravon wrote:I did some searching and it looks to me like the start sector for the 0x96 partition should be lba 0.
Is there a reason you are suggesting not to do that?
It makes sense for removable media, but it sounds like you're suggesting the internal disk should be formatted this way too...kerravon wrote:It seems neat to me. You can standardize on iso format and burn it to either cdrom or hard disk/USB stick.
Re: iso hard disk
That's pretty rude. For what reason does the bios need to have knowledge of the internal details of the MBR?Octocontrabass wrote:Some BIOSes will examine the partition table and misbehave or refuse to boot if a partition starts at LBA 0.kerravon wrote:I did some searching and it looks to me like the start sector for the 0x96 partition should be lba 0.
Is there a reason you are suggesting not to do that?
Isn't that the sole prerogative of the MBR code?
Yes, I am planning on standardizing on El torito everywhere.It makes sense for removable media, but it sounds like you're suggesting the internal disk should be formatted this way too...kerravon wrote:It seems neat to me. You can standardize on iso format and burn it to either cdrom or hard disk/USB stick.
Pdos would still recognize a traditional MBR, or indeed a traditional vbr-only, but if you want either of those on your hard disk you'll need to extract them yourself.
Also note that my hard disk image will be a vhd so that it can be extracted from the iso and mounted on windows.
Linux will directly manipulate the fat partition in an iso if you tell it the correct offset.
Re: iso hard disk
That's certainly my understanding, which is why I tentatively decided to go this route.devc1 wrote:No, its fine. You can make it at LBA0, I just said that I don't recommend it because ISOs does not have an MBR and this will make another driver consider the partition as corrupt (because the ISO starts with an MBR), Or not ! now I get it, ISOs start with a 32KB system area, you can leave your MBR there, there is absolutely no problem. Is what I said right ? This is my little research.
To date I've only ever produced isos with 32kb NULs so I have no other feedback on real hardware.
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: iso hard disk
The BIOS examines the MBR on a USB flash drive to decide whether the drive is bootable, whether INT 0x13 should treat it like a floppy disk or a hard disk, and what the INT 0x13 CHS geometry should be. This is done both to prevent booting from a drive that isn't bootable and to ensure compatibility with software that was written before USB existed.kerravon wrote:That's pretty rude. For what reason does the bios need to have knowledge of the internal details of the MBR?
Isn't that the sole prerogative of the MBR code?
UEFI needs to examine the partition tables to load a file from a partition. In theory, UEFI should prefer El Torito over MBR regardless of media, but who knows how well vendors follow that part of the specification...
That seems like a bad idea. The UEFI specification says this should be fine, but I expect you will have problems with real hardware since firmware authors only bother to test Windows.kerravon wrote:Yes, I am planning on standardizing on El torito everywhere.
What happens when you write a small ISO to a big flash drive? Is the rest of the space unusable?kerravon wrote:Also note that my hard disk image will be a vhd so that it can be extracted from the iso and mounted on windows.
Re: iso hard disk
Oh, I wasn't aware I could put a floppy image on a USB stick. That's great. I'll give it a try.Octocontrabass wrote:The BIOS examines the MBR on a USB flash drive to decide whether the drive is bootable, whether INT 0x13 should treat it like a floppy disk or a hard disk, and what the INT 0x13 CHS geometry should be. This is done both to prevent booting from a drive that isn't bootable and to ensure compatibility with software that was written before USB existed.kerravon wrote:That's pretty rude. For what reason does the bios need to have knowledge of the internal details of the MBR?
Isn't that the sole prerogative of the MBR code?
Oh, I wasn't expecting El torito, I was expecting my mbr code to be executed. Basically I am designing for a 1995 bios with advance knowledge of El torito.
UEFI needs to examine the partition tables to load a file from a partition. In theory, UEFI should prefer El Torito over MBR regardless of media, but who knows how well vendors follow that part of the specification...
If the bios detects El torito and bypasses my fake mbr, will it actually give me a writable hard disk or will it make it read only like a normal cd?
I don't really care if pdos doesn't work on buggy bioses. So long as it is clearly the bios that is violating protocol, someone can report the bug to the vendor.That seems like a bad idea. The UEFI specification says this should be fine, but I expect you will have problems with real hardware since firmware authors only bother to test Windows.kerravon wrote:Yes, I am planning on standardizing on El torito everywhere.
If the vendor doesn't care, then select a different vendor when buying a pc.
My fdisk program only handles a single partition currently, and the pdos mods haven't even started yet, but there is no reason why additional partitions can't be added after the event by fdisk.What happens when you write a small ISO to a big flash drive? Is the rest of the space unusable?kerravon wrote:Also note that my hard disk image will be a vhd so that it can be extracted from the iso and mounted on windows.
fdisk will need to have knowledge of the additional vhd sectors plus the 2048-512 padding after the vhd.
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: iso hard disk
Unfortunately, some BIOSes (maybe only UEFI CSMs?) will not boot a USB drive that hasn't been partitioned.kerravon wrote:Oh, I wasn't aware I could put a floppy image on a USB stick. That's great. I'll give it a try.
UEFI doesn't execute any legacy code. BIOS and UEFI CSM execute legacy code.kerravon wrote:Oh, I wasn't expecting El torito, I was expecting my mbr code to be executed.
I couldn't tell you - I only use BIOS for booting, and booting doesn't involve writing any disks.kerravon wrote:If the bios detects El torito and bypasses my fake mbr, will it actually give me a writable hard disk or will it make it read only like a normal cd?
So, if I can't choose a different PC, I can't use your OS?kerravon wrote:I don't really care if pdos doesn't work on buggy bioses. So long as it is clearly the bios that is violating protocol, someone can report the bug to the vendor.
If the vendor doesn't care, then select a different vendor when buying a pc.
Re: iso hard disk
Are you sure that you will never want to write data to the hard disk after creating the image?kerravon wrote:It seems neat to me. You can standardize on iso format and burn it to either cdrom or hard disk/USB stick.
Re: iso hard disk
You could still run pdos if you extract the vhd, or even just the img, from the iso, and burn that to hard disk.Octocontrabass wrote:So, if I can't choose a different PC, I can't use your OS?kerravon wrote:I don't really care if pdos doesn't work on buggy bioses. So long as it is clearly the bios that is violating protocol, someone can report the bug to the vendor.
If the vendor doesn't care, then select a different vendor when buying a pc.
I would be happy to document that, but I just want to ship a single iso.