Page 1 of 1
BIN to ISO ?
Posted: Thu Feb 28, 2019 5:07 pm
by Teln0
So far, my makefile is giving me .bin files "os-image.bin". Now, I want to make a bootable ISO out of it, is there an easy way to do this ?
Thanks in advance.
Re: BIN to ISO ?
Posted: Thu Feb 28, 2019 6:37 pm
by AwfulMint
Hello, dude you can do it in makefile. Just add a target with these commands:
Code: Select all
mkdir -p isodir/boot/grub
cp grub.cfg isodir/boot/grub/
cp your-kernel-name.bin isodir/boot/
grub2-mkrescue -o your-kernel-name.iso isodir/
Just remember to setup grub.cfg properly o/
Re: BIN to ISO ?
Posted: Fri Mar 01, 2019 4:30 am
by Teln0
I am not using GRUB, I did my own bootloader. Will it work anyway ?
Re: BIN to ISO ?
Posted: Fri Mar 01, 2019 6:18 am
by Octocontrabass
Maybe. (Not with grub2-mkrescue, that only works with GRUB.)
You can boot a CD with INT 0x13 floppy disk emulation, INT 0x13 hard disk emulation, or no emulation. With emulation, you can use an existing floppy disk or hard disk bootloader, but you must build a floppy/hard disk image and then put that image into the ISO, and there are some limitations that might make your existing bootloader incompatible.
The wiki page for bootable CDs is
here.
Re: BIN to ISO ?
Posted: Sat Mar 02, 2019 10:46 am
by bzt
If you're not using GRUB, then you could try to use a cdrom image creator like mkisofs.
https://wiki.osdev.org/Mkisofs
Or if you want a dependency-less solution, you can create the image yourself with a little C code, it isn't that hard. But you have to read the aforementioned El Torito spec very carefully.
This is a good doc with byte offset tables. I've choosen this method because I'm creating a hybrid USB stick/GPT/MBR/CDROM/UEFI images in no-emulation mode.
A relatively easy to read example ISO creator in C from
FreeBSD's makefs.
Cheers,
bzt