Page 1 of 1
Bochs cdrom
Posted: Sun Oct 12, 2008 9:36 am
by mobruan
Hi, how do i boot in bochs from a cd-rom?
Thanks
Re: Bochs cdrom
Posted: Sun Oct 12, 2008 9:59 am
by Troy Martin
Well, if you're using a physical CD, put in into your CD drive and edit your bochsrc config file to have something like this in it:
Code: Select all
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=cdrom, path="x", status=inserted
Where "x" is the name of the drive that has the CD in it. Change your
boot: something line to
boot: cdrom and save it. It should boot now. I haven't used Bochs since 2.3.0 (mid-2006!)
Re: Bochs cdrom
Posted: Sun Oct 12, 2008 10:33 am
by mobruan
Hi, and if i want to boot from image?
Thanks!
Re: Bochs cdrom
Posted: Sun Oct 12, 2008 11:19 am
by Troy Martin
Replace the "x" with "imagename.iso" where imagename.iso is the filename of the image
Re: Bochs cdrom
Posted: Sun Oct 12, 2008 3:45 pm
by mobruan
Hi, didnt work. I think i need a program to generate a cd-rom image. Now i´m only chance the extension of the archive to .img.
what do you think?
thanks
Re: Bochs cdrom
Posted: Sun Oct 12, 2008 3:58 pm
by Masterkiller
Booting from CD is more complicated than booting a diskette. You should have a boot volume descriptor at sector 17 (or just somewhere between main volume descriptor in sector 16 and terminate descriptor). Boot volume descriptor points to special sector that describes LBA block from where to load, number of sectors to load and load address. Last two things are not always supported and load address is still 0x07C0:0x0000 (0x7C00) and only one sector is loaded (even only first 512 of the sector).
For more information click here:
http://en.wikipedia.org/wiki/El_Torito_ ... _standard) and look somewhere in the external links.
.ISO file can be created manually (even using assembler). First 2048 bytes from the file are the first sector, secont 2048 are the second and so on.
Re: Bochs cdrom
Posted: Mon Oct 13, 2008 3:23 am
by egos
The standard provides boot block with size of 65535 512-byted sectors (usually just 4 sectors).
Re: Bochs cdrom
Posted: Tue Oct 14, 2008 5:31 am
by mobruan
Hi, if diskete is more easie i´ll try it. What i have to write in the config file to boot from a diskete image?
Thanks
Re: Bochs cdrom
Posted: Wed Oct 15, 2008 2:14 am
by samueldotj
Creating a grub bootable ISO is easy - see
http://wiki.osdev.org/Mkisofs
Re: Bochs cdrom
Posted: Wed Oct 15, 2008 4:50 am
by Walling
I use a .iso image myself in my "reseach" OS. All virtual machines support booting it. I do that because I won't develop a file system driver soon (ISO9660 format is complicated I hear); instead I ask GRUB to load the modules I need. In that sense .iso images are really easy.
You need to get GRUB Legacy compiled for El Torito boot. It is a file called stage2_eltorito. If you're using Linux and have GRUB installed, just find it in /usr/lib/grub/i386-pc/stage2_eltorito. If you're using Windows, google the file. Create a directory for your .iso image content. I'll call it "iso". Then create the directory structure needed for GRUB:
Code: Select all
iso/
boot/
you-can-put-your-kernel-here
grub/
stage2_eltorito
menu.lst
In menu.lst you write something like this:
Code: Select all
default 0
timeout 10
title My kernel
kernel /boot/you-can-put-your-kernel-here
module /foo/bar/module ...
You don't have to use the "root" command. When GRUB boots in El Torito mode, the root is already set to "(cd)". Now create the .iso image using mkisofs / genisoimage, like this:
Code: Select all
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o my_kernel.iso iso
That's it (beside adding the tasks to your Makefile). Boot it and enjoy.