boot from cd [fixed]
boot from cd [fixed]
hi all, i have a boot loader that boots from a floppy disk but i want to boot from a cdrom, does the bios have a function for this and how do i use it.
my old code is attached...
thx
my old code is attached...
thx
- Attachments
-
- loaderblack.ASM
- (2.19 KiB) Downloaded 33 times
Last edited by GLneo on Wed Jan 03, 2007 5:17 pm, edited 1 time in total.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Well.. You could try reading up on the El Torito standard.
http://www.phoenix.com/NR/rdonlyres/98D ... scdrom.pdf
I should also note that since BSD and Linux offer bootable cdroms, Their bootloaders are usually open source.
http://www.openbsd.org/cgi-bin/cvsweb/s ... nd/cdboot/
http://www.kernel.org/git/?p=boot/sysli ... olinux.asm (See line 297 onward..)
Nothing wrong with also reading up on:
BIOS INT 13 Specifications, including any extensions.
ATAPI Specifications and the ISO 9660 Specification.
http://www.phoenix.com/NR/rdonlyres/98D ... scdrom.pdf
I should also note that since BSD and Linux offer bootable cdroms, Their bootloaders are usually open source.
http://www.openbsd.org/cgi-bin/cvsweb/s ... nd/cdboot/
http://www.kernel.org/git/?p=boot/sysli ... olinux.asm (See line 297 onward..)
Nothing wrong with also reading up on:
BIOS INT 13 Specifications, including any extensions.
ATAPI Specifications and the ISO 9660 Specification.
To boot from cd using El Torito is very easy. You need a bootloader image like when you're booting from floppy, with a few differences:
1) the boot image can be larger than 512 Byte
2) you dont need the 55AA in the end
In general, the image is loaded at address 0x7C00, but El Torito allows to select another base address. The simplest is to use a ISO9660 creator like mkisofs oder UltraISO or whatever.
1) the boot image can be larger than 512 Byte
2) you dont need the 55AA in the end
In general, the image is loaded at address 0x7C00, but El Torito allows to select another base address. The simplest is to use a ISO9660 creator like mkisofs oder UltraISO or whatever.
- 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:
The easiest thing to do is to create a floppy image (you might already have it), then instruct mkisofs to make an el-torito emulation CD
From my makefile:
i.e. create a empty dir (cd), stuff in there whatever you want on the cd (incl image)
call mkisofs:
-o mos.iso = the output is mos.iso
-A MOSCD = the CD label
-b floppy.img = your bootloader
cd = the directory to get everything
after that i remove the temporary directory.
The result is a CD (image) that boots as if it were a floppy.
(Note: El-Torito emulation isnt the same as no-emulation El-Torito. some bioses seem to support one but not the other)
From my makefile:
Code: Select all
mos.iso: floppy.img
-mkdir cd
cp floppy.img cd
mkisofs -o mos.iso -A MOSCD -b floppy.img cd
rm -r -f cd/*
rmdir cd
call mkisofs:
-o mos.iso = the output is mos.iso
-A MOSCD = the CD label
-b floppy.img = your bootloader
cd = the directory to get everything
after that i remove the temporary directory.
The result is a CD (image) that boots as if it were a floppy.
(Note: El-Torito emulation isnt the same as no-emulation El-Torito. some bioses seem to support one but not the other)
The KISS way to do it , is to open up your cd burn software and click on the make bootable (some time in the new projects), it will pop up a window asking for a bootable floppy image point it to your floppy image then burn it and that's it you have a bootable cd.
PS: Make sure your BIOS is set to boot from CD before hdd.
PS: Make sure your BIOS is set to boot from CD before hdd.
- 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:
Nope. Like i said, it boots from the cd as if it were an actual floppy. (unless you do low level hardware access or tell the bios to end the emulation)GLneo wrote:i like Combuster idea, but does floppy.img have to know its on a cd? becouse my boot loader trys to load the kernel from floppy?, well i'll just try it
Code: Select all
root@COMPUTER:~# mkdir cd
root@COMPUTER:~# cp a.img cd
root@COMPUTER:~# mkisofs -o LOS.iso -A LemonOS -b a.img cd
Size of boot image is 56 sectors -> mkisofs: Error - boot image 'cd/a.img' has not an allowable size.
root@COMPUTER:~#
solved it!, i made an addition to makeboot: "attached"
- Attachments
-
- makeboot.c
- (1.68 KiB) Downloaded 49 times
Re: boot from cd [fixed]
you can try to use magiciso to make bootable iso image from bootable floppy disk. Just read guide below.GLneo wrote:hi all, i have a boot loader that boots from a floppy disk but i want to boot from a cdrom, does the bios have a function for this and how do i use it.
my old code is attached...
thx
http://www.magiciso.com/FAQ/FAQ0006.htm
- kataklinger
- Member
- Posts: 381
- Joined: Fri Nov 04, 2005 12:00 am
- Location: Serbia
Word of the warnning:
If you use 'No emulation' mode you should know that you specify size of boot image, which is going to be loaded into memory, in _sectors_ ! Specification says that _sector_ size is 2048 bytes not 512 (_virtual_sector_ size is 512), but some BIOSes use _virtual_sector size and others use _sector_ size to calculate total size of boot image.
I hate those guys!
If you use 'No emulation' mode you should know that you specify size of boot image, which is going to be loaded into memory, in _sectors_ ! Specification says that _sector_ size is 2048 bytes not 512 (_virtual_sector_ size is 512), but some BIOSes use _virtual_sector size and others use _sector_ size to calculate total size of boot image.
I hate those guys!