Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I programmatically create a bootable CD?

I'm using a barebones tutorial as the basis for an OS I'm working on, and it seems to be an older tutorial: it has be compiling the kernel down to a floppy image, and then loading it with GRUB.

Basically, I still want to use GRUB, but I'd like to have my OS run from a CD instead. The main reason is that I don't actually have a real floppy drive available (I'm testing in VirtualBox currently) and I thus have no way to test my OS on real hardware.

I've been poking around on the net, and I can find lots of utilities that create a bootable CD from a floppy image, but these all seem to require an actual floppy drive, plus it's not really what I'm looking for. I'd like to be able to end up with a bootable CD during my make step ideally, without needing to first place the image on a floppy, which seems rather pointless.

I guess the easy way to answer this: How do I set up GRUB to read my kernel image from a CD? Will I need a special utility to do this from Windows? (The kernel can't compile itself yet, that's not for a looong while)

Thanks!

like image 213
Nicholas Flynt Avatar asked Jan 08 '09 19:01

Nicholas Flynt


People also ask

How can make bootable CD?

Choose the menu "File > Properties" to set the iso file properties. Click on the "Save" button on toolbar, or click on the "File > Save As..." menu. Choose the menu "Action > Boot > Add Boot Information" to load a bootable image file. Save the iso file to "Standard ISO Images (*.

How do I make a bootable DVD from Media Player?

To create a bootable DVD, open Burnaware and click on Burn ISO. Click Browse and locate your Windows ISO file. Insert a DVD and click Burn. Alternatively, you can use Window's native ISO burner.


1 Answers

I found the solution for my project on my own, with some advice from the folks over at OSdev. There is a utility called mkisofs (which can run under Windows using a cygwin dll) that takes a directory, and makes that directory into an ISO image that can be burned to a CD. Using the -b flag, you can specify which file should reside in the boot sector of the disk.

The solution is just to have GRUB in the bootsector, and use GRUB to load the kernel image, which I can compile out in non-floppy form easily.

like image 70
Nicholas Flynt Avatar answered Sep 20 '22 04:09

Nicholas Flynt