* Using GRUB2 for booting from CD
@ 2007-08-12 16:14 Alex Roman
2007-08-13 17:40 ` Marco Gerards
0 siblings, 1 reply; 11+ messages in thread
From: Alex Roman @ 2007-08-12 16:14 UTC (permalink / raw)
To: The development of GRUB 2
Hello list,
I've managed to (finally :( ) use GRUB2 as a bootloader on a CD-ROM.
It loads the kernel and all modules I tell grub-mkimage to include.
The problem is that it doens't know how to mount the root to be able
to load other modules, read configuration files, etc. There is an
iso9660 already there, but how can I tell grub2 to actually mount the
CD-ROM drive as an iso9660 filesystem?
Thanks!
--
Alex Roman <alex.roman@gmail.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Using GRUB2 for booting from CD
2007-08-12 16:14 Using GRUB2 for booting from CD Alex Roman
@ 2007-08-13 17:40 ` Marco Gerards
2007-08-13 18:44 ` Alex Roman
0 siblings, 1 reply; 11+ messages in thread
From: Marco Gerards @ 2007-08-13 17:40 UTC (permalink / raw)
To: The development of GRUB 2
"Alex Roman" <alex.roman@gmail.com> writes:
Hi,
> I've managed to (finally :( ) use GRUB2 as a bootloader on a CD-ROM.
> It loads the kernel and all modules I tell grub-mkimage to include.
>
> The problem is that it doens't know how to mount the root to be able
> to load other modules, read configuration files, etc. There is an
> iso9660 already there, but how can I tell grub2 to actually mount the
> CD-ROM drive as an iso9660 filesystem?
Does this mean you implemented IDE support, etc? :-)
The filesystem should automatically be detected. What you can do is
dumping the first sector of the CDROM to see if it is read correctly.
Have a look at grub_iso9660_mount. It first tries to read the
superblock. Next it does is checking if it is actually an ISO9660
filesystem (by checking for "CD001"). This function should reach
"return data" if it is indeed a ISO9660 filesystem.
What you could do first is checking if grub-emu can read your
filesystem image. That way you can easily see if the problem is in my
code or in your code.
--
Marco
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Using GRUB2 for booting from CD
2007-08-13 17:40 ` Marco Gerards
@ 2007-08-13 18:44 ` Alex Roman
2007-08-14 0:40 ` Alex Roman
2007-08-20 14:45 ` Robert Millan
0 siblings, 2 replies; 11+ messages in thread
From: Alex Roman @ 2007-08-13 18:44 UTC (permalink / raw)
To: The development of GRUB 2
On 13/08/07, Marco Gerards <mgerards@xs4all.nl> wrote:
> "Alex Roman" <alex.roman@gmail.com> writes:
>
> Does this mean you implemented IDE support, etc? :-)
Not yet :( but that's coming :)
I'm doing it the Grub Legacy way of having a "stage 1" specifically
for CD-ROM booting. So, instead of using diskboot.S, for "disk"
booting, I use a cdboot.S which loads the kernel at the right address
and boots it.
>
> The filesystem should automatically be detected. What you can do is
> dumping the first sector of the CDROM to see if it is read correctly.
>
> Have a look at grub_iso9660_mount. It first tries to read the
> superblock. Next it does is checking if it is actually an ISO9660
> filesystem (by checking for "CD001"). This function should reach
> "return data" if it is indeed a ISO9660 filesystem.
I've been adding some debug prints in there...
I've modified biosdisk.c to recognize drives like (cd0) which
basically start at 0xe0 and have no partitions.
When I try to do something like ls (cd0)/, QEMU freezes (and I don't
see the prints I added), bochs quickly resets (and if the prints do
show up, I don't have time to see them before it resets)... :( I'll
probably step through with gdb or something...
>
> What you could do first is checking if grub-emu can read your
> filesystem image. That way you can easily see if the problem is in my
> code or in your code.
How can I use grub-emu with a CD-ROM image?
Thanks!
--
Alex Roman <alex.roman@gmail.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Using GRUB2 for booting from CD
2007-08-13 18:44 ` Alex Roman
@ 2007-08-14 0:40 ` Alex Roman
2007-08-15 9:24 ` Jeroen Dekkers
2007-08-20 14:45 ` Robert Millan
1 sibling, 1 reply; 11+ messages in thread
From: Alex Roman @ 2007-08-14 0:40 UTC (permalink / raw)
To: The development of GRUB 2
OK, I've done the following in grub-emu...
I have a map file that looks like this:
(fd0) floppy.img
(cd0) grub2-iso.iso
grub2-iso.iso is an iso I generate using genisoimage (mkisofs). I can
mount it just fine.
floppy.img is a floppy image I generate... It contains grub, basically
and a few modules.
I run grub-emu -d grub2 -m mapfile -r fd0
grub2 is my build directory.
I tried ls (cd0)/ but that did not work. The iso9660_mount function is
saying that it couldn't read the superblock.
Then I saw on your (Marco) blog about the loopback command. So I tried
it as follows:
loopback cd1 (host)/path/to/grub2-iso.iso
Now, ls (cd1)/ goes a bit further, it can read the superblock, but it
says it couldn't find the magic "CD001". I printed the data it reads
from the ISO and it's all 0's...
Am I doing anything wrong from what you can see here? I'd like to know
if it's something I'm doing wrong in my procedure or in my code...
Thanks!
--
Alex Roman <alex.roman@gmail.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Using GRUB2 for booting from CD
2007-08-14 0:40 ` Alex Roman
@ 2007-08-15 9:24 ` Jeroen Dekkers
2007-08-15 13:54 ` Alex Roman
0 siblings, 1 reply; 11+ messages in thread
From: Jeroen Dekkers @ 2007-08-15 9:24 UTC (permalink / raw)
To: The development of GRUB 2
At Mon, 13 Aug 2007 20:40:27 -0400,
Alex Roman wrote:
>
> OK, I've done the following in grub-emu...
>
> I have a map file that looks like this:
> (fd0) floppy.img
> (cd0) grub2-iso.iso
>
> grub2-iso.iso is an iso I generate using genisoimage (mkisofs). I can
> mount it just fine.
>
> floppy.img is a floppy image I generate... It contains grub, basically
> and a few modules.
>
> I run grub-emu -d grub2 -m mapfile -r fd0
>
> grub2 is my build directory.
>
> I tried ls (cd0)/ but that did not work. The iso9660_mount function is
> saying that it couldn't read the superblock.
>
> Then I saw on your (Marco) blog about the loopback command. So I tried
> it as follows:
>
> loopback cd1 (host)/path/to/grub2-iso.iso
>
> Now, ls (cd1)/ goes a bit further, it can read the superblock, but it
> says it couldn't find the magic "CD001". I printed the data it reads
> from the ISO and it's all 0's...
>
>
> Am I doing anything wrong from what you can see here? I'd like to know
> if it's something I'm doing wrong in my procedure or in my code...
Read what's in the file directly and compare it to what grub-emu
reads. If it reads something different than that's a bug in the
grub-emu or loopback code.
Also don't forget about the possiblity that qemu might be buggy,
especially if you're using bios functions that aren't really used that
much. Testing on real hardware is really necessary sometimes.
And whether your code is wrong or not is very difficult to tell if you
don't post your code...
Jeroen Dekkers
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Using GRUB2 for booting from CD
2007-08-15 9:24 ` Jeroen Dekkers
@ 2007-08-15 13:54 ` Alex Roman
2007-08-16 22:03 ` Jeroen Dekkers
0 siblings, 1 reply; 11+ messages in thread
From: Alex Roman @ 2007-08-15 13:54 UTC (permalink / raw)
To: The development of GRUB 2
On 15/08/07, Jeroen Dekkers <jeroen@vrijschrift.org> wrote:
> Read what's in the file directly and compare it to what grub-emu
> reads. If it reads something different than that's a bug in the
> grub-emu or loopback code.
It reads something different... I just wanted to make sure I was using
the right procedure...
> Also don't forget about the possiblity that qemu might be buggy,
> especially if you're using bios functions that aren't really used that
> much. Testing on real hardware is really necessary sometimes.
Yes, I've gotten it to work farther along... It starts querying the
CD-ROM device for information... The problem right now is that the
c/h/s values that bochs/qemu returns when doing a diskinfo int13
extension check are all 0xFFFFFFFF... Same code on VMWare doesn't work
because it seems that VMWare doesn't support that EDD extensions on
their CD-ROM drive :(... I'll try it on my main PC today and let you
know.
> And whether your code is wrong or not is very difficult to tell if you
> don't post your code...
I wanted to see if the procedure is right... :)
Thanks!
--
Alex Roman <alex.roman@gmail.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Using GRUB2 for booting from CD
2007-08-15 13:54 ` Alex Roman
@ 2007-08-16 22:03 ` Jeroen Dekkers
2007-08-16 22:43 ` Alex Roman
0 siblings, 1 reply; 11+ messages in thread
From: Jeroen Dekkers @ 2007-08-16 22:03 UTC (permalink / raw)
To: The development of GRUB 2
At Wed, 15 Aug 2007 09:54:58 -0400,
Alex Roman wrote:
>
> On 15/08/07, Jeroen Dekkers <jeroen@vrijschrift.org> wrote:
> > Also don't forget about the possiblity that qemu might be buggy,
> > especially if you're using bios functions that aren't really used that
> > much. Testing on real hardware is really necessary sometimes.
>
> Yes, I've gotten it to work farther along... It starts querying the
> CD-ROM device for information... The problem right now is that the
> c/h/s values that bochs/qemu returns when doing a diskinfo int13
> extension check are all 0xFFFFFFFF... Same code on VMWare doesn't work
> because it seems that VMWare doesn't support that EDD extensions on
> their CD-ROM drive :(... I'll try it on my main PC today and let you
> know.
Why are you using CHS and not LBA?
Jeroen Dekkers
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Using GRUB2 for booting from CD
2007-08-16 22:03 ` Jeroen Dekkers
@ 2007-08-16 22:43 ` Alex Roman
0 siblings, 0 replies; 11+ messages in thread
From: Alex Roman @ 2007-08-16 22:43 UTC (permalink / raw)
To: The development of GRUB 2
On 16/08/07, Jeroen Dekkers <jeroen@vrijschrift.org> wrote:
>
> Why are you using CHS and not LBA?
The get diskinfo int13 extension will return a grub_biosdisk_drp
structure which contains the c/h/s values along with the total number
of sectors...
On my PC it looks like the drive number is different, I'm going to try
to find the right drive number and query it to see what kind of
response I get.
Basically the problem that happens is that the size of the CD is not
read correctly, so at the kern/disk.c layer the reads are not even
attempted because they "look" out of range, thus causing the iso9660
detection to fail.
I'll also try to fake the size of the CD to see if that helps...
--
Alex Roman <alex.roman@gmail.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Using GRUB2 for booting from CD
2007-08-13 18:44 ` Alex Roman
2007-08-14 0:40 ` Alex Roman
@ 2007-08-20 14:45 ` Robert Millan
2007-08-20 23:05 ` Alex Roman
1 sibling, 1 reply; 11+ messages in thread
From: Robert Millan @ 2007-08-20 14:45 UTC (permalink / raw)
To: The development of GRUB 2; +Cc: patrick
On Mon, Aug 13, 2007 at 02:44:09PM -0400, Alex Roman wrote:
> On 13/08/07, Marco Gerards <mgerards@xs4all.nl> wrote:
> > "Alex Roman" <alex.roman@gmail.com> writes:
> >
> > Does this mean you implemented IDE support, etc? :-)
>
> Not yet :( but that's coming :)
I heard from Patrick Georgi on IRC (CCed) that he already has an ATAPI
implementation for GRUB as part of his LinuxBIOS work. Maybe you should
coordinate with him so that the code can be shared with pc/bios targets.
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Using GRUB2 for booting from CD
2007-08-20 14:45 ` Robert Millan
@ 2007-08-20 23:05 ` Alex Roman
2007-11-10 17:43 ` Marco Gerards
0 siblings, 1 reply; 11+ messages in thread
From: Alex Roman @ 2007-08-20 23:05 UTC (permalink / raw)
To: The development of GRUB 2; +Cc: patrick
On 20/08/07, Robert Millan <rmh@aybabtu.com> wrote:
> I heard from Patrick Georgi on IRC (CCed) that he already has an ATAPI
> implementation for GRUB as part of his LinuxBIOS work. Maybe you should
> coordinate with him so that the code can be shared with pc/bios targets.
Awesome, perhaps we'll be able to get it going after Summer of Code is
finished and all is integrated in the CVS, or if Patrick can post a
patch that'd work too.
Thanks!
--
Alex Roman <alex.roman@gmail.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Using GRUB2 for booting from CD
2007-08-20 23:05 ` Alex Roman
@ 2007-11-10 17:43 ` Marco Gerards
0 siblings, 0 replies; 11+ messages in thread
From: Marco Gerards @ 2007-11-10 17:43 UTC (permalink / raw)
To: The development of GRUB 2; +Cc: patrick
"Alex Roman" <alex.roman@gmail.com> writes:
Hi Alex,
> On 20/08/07, Robert Millan <rmh@aybabtu.com> wrote:
>> I heard from Patrick Georgi on IRC (CCed) that he already has an ATAPI
>> implementation for GRUB as part of his LinuxBIOS work. Maybe you should
>> coordinate with him so that the code can be shared with pc/bios targets.
>
> Awesome, perhaps we'll be able to get it going after Summer of Code is
> finished and all is integrated in the CVS, or if Patrick can post a
> patch that'd work too.
Did you send in a patch+Changelog entry with your work?
I would be happy to review it so we can integrate your work soon.
--
Marco
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-11-10 17:43 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-12 16:14 Using GRUB2 for booting from CD Alex Roman
2007-08-13 17:40 ` Marco Gerards
2007-08-13 18:44 ` Alex Roman
2007-08-14 0:40 ` Alex Roman
2007-08-15 9:24 ` Jeroen Dekkers
2007-08-15 13:54 ` Alex Roman
2007-08-16 22:03 ` Jeroen Dekkers
2007-08-16 22:43 ` Alex Roman
2007-08-20 14:45 ` Robert Millan
2007-08-20 23:05 ` Alex Roman
2007-11-10 17:43 ` Marco Gerards
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.