The length of my bootsector
The length of my bootsector
Hi. I'v seen the code of some open source bootsector which is written for ISO 9660. I noticed that the bootsector is 2048 bytes instead of 512. I also noticed that it doesn't have aa55 at the end. I remember reading somewhere that ISO 9660 Bootsectors are different.
Anyway, I'm now trying to write my own ISO 9660 bootsector and it won't run. QEMU says it's not bootable and a real computer just does nothing. Why not?
Anyway, I'm now trying to write my own ISO 9660 bootsector and it won't run. QEMU says it's not bootable and a real computer just does nothing. Why not?
- xenos
- Member
- Posts: 1121
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: The length of my bootsector
If I had to guess I would say because it is not bootable.
Re: The length of my bootsector
Why isn't it bootable? I assembled it with NASM (if that detail is necessary).
Re: The length of my bootsector
You might find this document helpful.Isaac wrote:I'm now trying to write my own ISO 9660 bootsector and it won't run. QEMU says it's not bootable and a real computer just does nothing. Why not?
Those who understand Unix are doomed to copy it, poorly.
Re: The length of my bootsector
Ouch!
Make sure you have your CD blocks layed out correctly. You have to have an entire CD filesystem in place in order to boot from a CD. It doesn't just load the first block and execute it, like a floppy drive.
The following wiki page goes into detail on the bootable CD format.
El-Torito
If you still have problems, let us know.
Make sure you have your CD blocks layed out correctly. You have to have an entire CD filesystem in place in order to boot from a CD. It doesn't just load the first block and execute it, like a floppy drive.
The following wiki page goes into detail on the bootable CD format.
El-Torito
If you still have problems, let us know.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Re: The length of my bootsector
Just to speed things up, here are some data structures that you are going to need:
Primary Volume Descriptor
Boot Record Descriptor
Supplementary Volume Descriptor
Descriptor Terminator
Boot Descriptor
- Validation Entry
- Default Entry
- Terminator
This is the layout that I'm using, and it seems to work on both real and virtual hardware. Let us know if you have any questions.
Primary Volume Descriptor
Boot Record Descriptor
Supplementary Volume Descriptor
Descriptor Terminator
Boot Descriptor
- Validation Entry
- Default Entry
- Terminator
This is the layout that I'm using, and it seems to work on both real and virtual hardware. Let us know if you have any questions.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Re: The length of my bootsector
I created an image using genisoimage and burned it to a CD_RW. I then tried to boot this CD_RW on real hardware and it didn't work. Is there something I have to add to my bootsector file? Or is it just good enough to create an image in genisoimage? If so, why doesn't my bootsector work?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: The length of my bootsector
For starters, a CD doesn't have a bootsector, which probably means that what you're trying is not going to work either.
Post your genisoimage command as well as the sizes of all the input files if you want to have a sanity check. You can also leech the correct instructions from the wiki.
Post your genisoimage command as well as the sizes of all the input files if you want to have a sanity check. You can also leech the correct instructions from the wiki.
Re: The length of my bootsector
My genisoimage command:
I only included one file in my ISO image; my bootsector.
Code: Select all
genisoimage -R -b bootsector -no-emul-boot -boot-load-size 2 -boot-info-table -o bootable.iso folder_containing_the_bootsector
- JohnBurger
- Posts: 7
- Joined: Tue Mar 18, 2014 12:20 am
- Location: Canberra, Australia
Re: The length of my bootsector
Isaac,
As others have said, an ISO doesn't have a bootsector as such. It has a much more complicated environment - but I've already written some NASM code ( [wiki]JohnBurger:Demo/Overview#ISO[/wiki] ) to generate an ISO image at assemble time as part of a bigger Demo.
For your information, when a computer loads a CD at boot time, it actually loads sector #17, not sector #1 (and yes, that's 2,048 byte sectors). But it doesn't just blindly JMP to its first location, so there's no need for the AA55 signature. Instead, that sector is a data table to reference other sectors on the CD.
My code takes advantage of the 32kiB gap at the beginning of the CD to put my code there. It's smaller than 32kiB, so it fits neatly. If yours is larger, you'll need to make some changes...
The trick is that my code sets up the ISO into Floppy emulation mode, so it behaves as if the sectors are 512 bytes in size. The BIOS will read 2,048-byte sectors, but dole them out in 512 byte pieces. And yes, my emulated boot sector has AA55 at location 1FE
As others have said, an ISO doesn't have a bootsector as such. It has a much more complicated environment - but I've already written some NASM code ( [wiki]JohnBurger:Demo/Overview#ISO[/wiki] ) to generate an ISO image at assemble time as part of a bigger Demo.
For your information, when a computer loads a CD at boot time, it actually loads sector #17, not sector #1 (and yes, that's 2,048 byte sectors). But it doesn't just blindly JMP to its first location, so there's no need for the AA55 signature. Instead, that sector is a data table to reference other sectors on the CD.
My code takes advantage of the 32kiB gap at the beginning of the CD to put my code there. It's smaller than 32kiB, so it fits neatly. If yours is larger, you'll need to make some changes...
The trick is that my code sets up the ISO into Floppy emulation mode, so it behaves as if the sectors are 512 bytes in size. The BIOS will read 2,048-byte sectors, but dole them out in 512 byte pieces. And yes, my emulated boot sector has AA55 at location 1FE