Page 1 of 1

Create bootable CD, USB disk etc.

Posted: Tue Nov 01, 2011 5:08 pm
by kendfrey
I have a working bootable floppy image that runs on Bochs. I want to start testing on real hardware, but I can't get a bootable anything working. I tried making a bootable CD image, but I couldn't get Bochs to boot from it, so I didn't waste a CD. I tried making a bootable USB stick, but it froze our old computer before I could open setup, and my newer PC said 'Operating system not found' when I booted from the USB stick. Can someone explain how to make something bootable that I can boot from? (I don't have any floppy disks)

Re: Create bootable CD, USB disk etc.

Posted: Tue Nov 01, 2011 6:14 pm
by theseankelly
Some issues I've run into that may or may not be helpful

1) Bochs will only boot from CD if its the only device listed as a boot device, it seems. So, if you have something like first device: floppy, second device: cd, don't expect it to default to CD when no floppy image is mounted. I have no idea why. Maybe that'll be your problem.

If not, check out this post for taking your bootable floppy and putting it onto a CD
http://wiki.osdev.org/Genisoimage

2) USB Stick should be pretty easy -- just need to make sure your first sector is the standard 512 bytes with the bootloader signature at the end just like floppy. Use dd to copy it over. If that doesn't work, maybe your BIOS isn't configured to boot from USB.

Re: Create bootable CD, USB disk etc.

Posted: Tue Nov 01, 2011 6:18 pm
by Casm
kendfrey wrote:I have a working bootable floppy image that runs on Bochs. I want to start testing on real hardware, but I can't get a bootable anything working. I tried making a bootable CD image, but I couldn't get Bochs to boot from it, so I didn't waste a CD. I tried making a bootable USB stick, but it froze our old computer before I could open setup, and my newer PC said 'Operating system not found' when I booted from the USB stick. Can someone explain how to make something bootable that I can boot from? (I don't have any floppy disks)
A CD doesn't have a boot sector in the normal sense. The operating system loader is loaded directly by the BIOS without an intervening boot sector. On hard disks the first sector of the disk has a master boot record, which contains a partition table and some code to load a boot sector from whichever partition is marked as having an operating system on it.

So I would read up on the El Torito specification for CDs, and the master boot record for hard disks. However, the master boot record might become antique in the next few years as EFI systems start to become the norm.

Re: Create bootable CD, USB disk etc.

Posted: Tue Nov 01, 2011 9:29 pm
by kendfrey
theseankelly wrote:USB Stick should be pretty easy -- just need to make sure your first sector is the standard 512 bytes with the bootloader signature at the end just like floppy. Use dd to copy it over. If that doesn't work, maybe your BIOS isn't configured to boot from USB.
My BIOS has an option to boot from USB storage, so I assume it is supported. I used PowerISO to create a bootable USB drive from a floppy image. It did something, since my USB drive went from 8GB to 1.44MB. Could PowerISO be the problem?

Re: Create bootable CD, USB disk etc.

Posted: Tue Nov 01, 2011 10:58 pm
by Brynet-Inc
Why would you write an ISO image to a USB thumb drive?

Re: Create bootable CD, USB disk etc.

Posted: Wed Nov 02, 2011 12:00 am
by Combuster
It did something, since my USB drive went from 8GB to 1.44MB. Could PowerISO be the problem?
Unlikely that software ships with showstopper bugs.

What you see is that your stick contains a single FAT12 partition of 1.4M in size, something that would probably have been there on a real floppy too. The question is if the bios thinks your USB stick is a floppy, or rather treat it as a harddrive.

Re: Create bootable CD, USB disk etc.

Posted: Wed Nov 02, 2011 12:14 am
by bonch
I can make bootable .iso files by opening bootloader.bin (or whatever) in MagicISO and exporting it as "bootable image file". Makes (for me) .iso files that boot on VirtualBox, Bochs and real hardware.

Re: Create bootable CD, USB disk etc.

Posted: Wed Nov 02, 2011 7:13 am
by egos
CD/DVD
Run e.g. Nero Burning ROM and choose New Compilation -> CD-ROM (Boot). Then set following settings:

Code: Select all

Boot:
  Source of boot image data
    Image file: your_iso_bootloader.bin
  Enable expert settings (for advanced users only!)
    Kind of emulation: No Emulation
    Boot message:
    Load segment of sectors (hex): 7C0
    Number of loaded sectors: 4
Or:

Code: Select all

Boot:
  Source of boot image data
    Image file: your_floppy_image.bin
  Enable expert settings (for advanced users only!)
    Kind of emulation: Floppy Emulation 1,44 MB
    Boot message:
    Load segment of sectors (hex): 7C0
    Number of loaded sectors: 1
USB-HDD
Run e.g. HxD and choose Extras -> Open disk -> Physical disks ->Removable Disk1. Then write (check it is present) your MBR boot loader and mark boot partiton as active in partition table. Then find (or open it as logical disk) the partition and write your stage 1 boot loader.

USB-FDD
Run e.g. HxD and choose Extras -> Open disk -> Physical disks ->Removable Disk1. Then write your floppy disk image.

Re: Create bootable CD, USB disk etc.

Posted: Wed Nov 02, 2011 10:45 am
by kendfrey
I did get a bootable CD working on Bochs, but I had to EXPLICITLY choose to boot from CD. Still not sure how to boot from USB.