OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Sep 21, 2019 7:41 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Grub2 El-Torito CD
PostPosted: Fri Jun 18, 2010 7:01 pm 
Offline

Joined: Mon Sep 29, 2008 2:05 pm
Posts: 2
I'm trying to make a Grub2 El-Torito CD, the first thing I do is copy all the files I use from grub (cdboot.img, modules) into ./Image/iso9660/boot/grub (I don't know if this is required, but...)

Then I make an image of Grub with
Code:
grub-mkimage --prefix=/boot --config=./Image/iso9660/boot/grub/grub.cfg --output=./Image/iso9660/boot/grub/core.img biosdisk iso9660 multiboot sh


I then create the padding file so cdboot.img + core.img + padding = 1.44mb (Otherwise mkisofs complains)
Code:
dd if=/dev/zero of=./Image/iso9660/boot/grub/padding bs=1 count=$(shell expr 1474560 - $(shell stat --format=%s ./Image/iso9660/boot/grub/cdboot.img) - $(shell stat --format=%s ./Image/iso9660/boot/grub/core.img))


I combine cdboot.img, core.img, and padding
Code:
cat ./Image/iso9660/boot/grub/cdboot.img ./Image/iso9660/boot/grub/core.img ./Image/iso9660/boot/grub/padding > ./Image/iso9660/eltorito.img


Finally, I make the iso with
Code:
mkisofs -eltorito-boot eltorito.img -input-charset utf-8 -output ./Image/CdImage.iso ./Image/iso9660


When I pop it in an emulator, it says
Code:
Booting from CD-ROM...
3MB medium detected
no boot info


What am I doing wrong?

_________________
~BJRowlett


Top
 Profile  
 
 Post subject: Re: Grub2 El-Torito CD
PostPosted: Tue Jun 22, 2010 2:56 pm 
Offline

Joined: Mon Sep 29, 2008 2:05 pm
Posts: 2
Well, I finally got my iso to boot, but when I try to load my kernel, I get the error:
Code:
multiboot /boot/kernel.bin
error: Couldn't open file

I tried to list the drives in grub, and it found (fd0), when I try to ls -l, I get "unknown filesystem"

I had been reading online about these problems, and decided to try grub-mkrescue (which produces an iso directly) instead of grub-mkimage + mkisofs.
This time, when I boot it loads grub right away, but I still see "Couldn't open file" when I try to boot my kernel.

Any Ideas?

_________________
~BJRowlett


Top
 Profile  
 
 Post subject: Re: Grub2 El-Torito CD
PostPosted: Tue Jun 22, 2010 9:23 pm 
Offline
Member
Member
User avatar

Joined: Tue Mar 24, 2009 8:11 pm
Posts: 1249
Location: Sunnyvale, California
I'm not sure about the grub-mkimage command - what filesystem does it create in the image? And is cdboot.img designed for El Torito CDs or normal CDs? Everything past that is the same as what I do, so I assume those first couple commands are the problem. Does the produced floppy image (core.img) work when loaded as a floppy instead of as an El Torito CD?

What I usually do is create a 1.44 MB file, format it as FAT, loopback mount it, install GRUB as if to a real floppy, (I save the produced image once GRUB is installed for time reasons) then copy over the files, and use that image as the El Torito floppy image. It's more complicated, but I can at least assure you it's a working set of steps.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group