How to make a boot Sector over 512 bytes boot on a CDRom

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
tsdnz
Member
Member
Posts: 333
Joined: Sun Jun 16, 2013 4:09 am

How to make a boot Sector over 512 bytes boot on a CDRom

Post by tsdnz »

Hi guys, my OS bootloader, stage 1, stage 2 and 64 bit is all implemented in one .img file, which is much larger than 512 bytes.
This works fine when using qemu with disk, but with CDRom I am unsure how to get the .img file into the CDRom to boot.
I am using windows.
I have tried mkisofs, but I am not sure if I have set the options correctly.

Any ideas??

Regards, Alistair
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: How to make a boot Sector over 512 bytes boot on a CDRom

Post by egos »

What is different between "OS bootloader" and "stage 1"?
If you have seen bad English in my words, tell me what's wrong, please.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: How to make a boot Sector over 512 bytes boot on a CDRom

Post by Mikemk »

When I was on windows, I used the trial version of UltraISO
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
Casm
Member
Member
Posts: 221
Joined: Sun Oct 17, 2010 2:21 pm
Location: United Kingdom

Re: How to make a boot Sector over 512 bytes boot on a CDRom

Post by Casm »

Creating a bootable CD is a decidedly messy process. For one thing there is no boot sector on a CD, and what would be called the second stage loader on a hard disk is loaded directly by the BIOS, with the help of an on disk structure called the boot catalog. Your life will be easier if you use a third party utility such as Power ISO on Windows, or a command line utility, which I think is bundled with binutils, with Linux (I can't remember the program's name).
User avatar
Yoda
Member
Member
Posts: 255
Joined: Tue Mar 09, 2010 8:57 am
Location: Moscow, Russia

Re: How to make a boot Sector over 512 bytes boot on a CDRom

Post by Yoda »

tsdnz wrote:with CDRom I am unsure how to get the .img file into the CDRom to boot.
I'm not sure what do you mean when you talk about "getting .img file to the CD-ROM". There are three modes of booting from CD-ROM: floppy emulation mode, HDD emulation mode and no emulation mode.The first two modes are rather simple. You just make floppy or HDD image then prepare CD-ROM image. But many BIOSes are buggy in these modes. The third mode (no emulation) requires writing special boot sector, parsing ISO-9660 file system and taking into account that the sector size is 2048 bytes. I don't know which tools prepare emulation modes ISO images. For creating no emulation image under Windows you may read description in my OS boot tools (see link in my signature).
Yet Other Developer of Architecture.
OS Boot Tools.
Russian national OSDev forum.
Post Reply