BIN to ISO ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Teln0
Posts: 11
Joined: Thu Feb 28, 2019 6:50 am
Libera.chat IRC: Teln0

BIN to ISO ?

Post 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.
AwfulMint
Member
Member
Posts: 35
Joined: Wed Nov 01, 2017 7:41 pm

Re: BIN to ISO ?

Post 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/
OS Development is awesome!

|AetherOS Project|
Teln0
Posts: 11
Joined: Thu Feb 28, 2019 6:50 am
Libera.chat IRC: Teln0

Re: BIN to ISO ?

Post by Teln0 »

I am not using GRUB, I did my own bootloader. Will it work anyway ?
Octocontrabass
Member
Member
Posts: 5586
Joined: Mon Mar 25, 2013 7:01 pm

Re: BIN to ISO ?

Post 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.
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: BIN to ISO ?

Post 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
Post Reply