Creating .iso of an OS not working

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
codeblaster
Posts: 14
Joined: Fri Apr 24, 2015 1:25 pm
Libera.chat IRC: coder

Creating .iso of an OS not working

Post 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?
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Creating .iso of an OS not working

Post 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?
codeblaster
Posts: 14
Joined: Fri Apr 24, 2015 1:25 pm
Libera.chat IRC: coder

Re: Creating .iso of an OS not working

Post 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.
Attachments
run.sh.txt
my script for running all commands. added .txt for uploading.
(484 Bytes) Downloaded 80 times
Octocontrabass
Member
Member
Posts: 5587
Joined: Mon Mar 25, 2013 7:01 pm

Re: Creating .iso of an OS not working

Post 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?
codeblaster
Posts: 14
Joined: Fri Apr 24, 2015 1:25 pm
Libera.chat IRC: coder

Re: Creating .iso of an OS not working

Post by codeblaster »

I am searching that on my system. But isn't supposed to be on the current working directory?
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Creating .iso of an OS not working

Post by iansjack »

Octocontrabass wrote:That depends on the ISO image.
I didn't realize that grub-mkrescue created hybrid ISO images.

I stand corrected.
codeblaster
Posts: 14
Joined: Fri Apr 24, 2015 1:25 pm
Libera.chat IRC: coder

Re: Creating .iso of an OS not working

Post 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 :)
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Creating .iso of an OS not working

Post 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?
codeblaster
Posts: 14
Joined: Fri Apr 24, 2015 1:25 pm
Libera.chat IRC: coder

Re: Creating .iso of an OS not working

Post by codeblaster »

Yes.
abhyuday
Posts: 1
Joined: Thu Mar 24, 2016 4:33 am

Re: Creating .iso of an OS not working

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