Page 1 of 1

Creating .iso of an OS not working

Posted: Sun Apr 26, 2015 7:28 am
by codeblaster
Hi ,
I followed the steps shown in http://wiki.osdev.org/Bare_Bones and able to run it successfully on QEMU.
Now I want to run it from a bootable USB.

Now problem is that on the above link it has mentioned how to create .iso image but it is actually creating .bin image.

Code: Select all

mkdir -p isodir
mkdir -p isodir/boot
cp myos.bin isodir/boot/myos.bin
mkdir -p isodir/boot/grub
cp grub.cfg isodir/boot/grub/grub.cfg
grub-mkrescue -o myos.iso isodir
myos.bin works perfectly with QEMU. But when I create bootable usb , using

Code: Select all

sudo dd if=myos.bin of=/dev/sdb && sync

it says bootable image not found.

How do I create myos.iso? and why doesn't it create an iso image even though it is mentioned to create the .iso in

Code: Select all

grub-mkrescue -o myos.iso isodir
What should be the exact steps I should follow to create bootable usb from myos.bin?

Re: Creating .iso of an OS not working

Posted: Sun Apr 26, 2015 7:50 am
by iansjack
Many people have used those instructions successfully, so we can assume that they work. This means, if you are following them exactly, that there is something wrong with your setup. Try running the instructions manually one-by-one and note any messages that you get.

BTW, you do realize that you cannot simply dd an ISO image to an USB stick to get a bootable drive, don't you?

Re: Creating .iso of an OS not working

Posted: Sun Apr 26, 2015 7:57 am
by codeblaster
I have followed the same steps shown in the link.
Just that the

Code: Select all

grub-mkrescue -o myos.iso isodir
code has no effect. But no error messages are thrown. :(

I am attaching the entire commands I ran.

Re: Creating .iso of an OS not working

Posted: Sun Apr 26, 2015 8:02 am
by Octocontrabass
iansjack wrote:BTW, you do realize that you cannot simply dd an ISO image to an USB stick to get a bootable drive, don't you?
That depends on the ISO image.

The lack of error messages is unusual. Is it creating myos.iso somewhere you haven't looked?

Re: Creating .iso of an OS not working

Posted: Sun Apr 26, 2015 8:06 am
by codeblaster
I am searching that on my system. But isn't supposed to be on the current working directory?

Re: Creating .iso of an OS not working

Posted: Sun Apr 26, 2015 8:18 am
by iansjack
Octocontrabass wrote:That depends on the ISO image.
I didn't realize that grub-mkrescue created hybrid ISO images.

I stand corrected.

Re: Creating .iso of an OS not working

Posted: Sun Apr 26, 2015 8:20 am
by codeblaster
Guys I have found the solution from http://wiki.osdev.org/GRUB_2
We need to install xorriso library.
Once I installed it and ran the

Code: Select all

grub-mkrescue -o myos.iso isodir
it created the myos.iso image :)

Re: Creating .iso of an OS not working

Posted: Sun Apr 26, 2015 8:24 am
by iansjack
codeblaster wrote:I have followed the same steps shown in the link.
Just that the

Code: Select all

grub-mkrescue -o myos.iso isodir
code has no effect. But no error messages are thrown. :(

I am attaching the entire commands I ran.
And your grub.cfg files is exactly as shown in the Wiki?

Re: Creating .iso of an OS not working

Posted: Sun Apr 26, 2015 8:31 am
by codeblaster
Yes.

Re: Creating .iso of an OS not working

Posted: Thu Mar 24, 2016 4:42 am
by abhyuday
You have to install PC-BIOS version of the grub. To do that, type the following in the kernel :

Code: Select all

sudo apt-get install grub-pc-bin