booting grub, loading kernels and unloading kernels question
A question. It may be stupid but I have to ask it.
Can we boot grub
and boot linux
so that
linux don't write on grub reserved memory (let's say first 640k) And then make an special halt command
that halts linux and boots again grub? (without rebooting)
I think this has a lof of possibilities for using OSes as a grub module in live cds but I do not know if it is feasible.
Currently I want an easy way of showing an image with a lot of colours in grub without having to code vesa and all of that. (Talking about grub legacy, as always ;) )
If this works... I will need to know how to patch the kernel and how to strip gnu/linux distro to have only the display command or equivalent to show images in framebuffer or equivalent.
adrian15
Quoted 6 lines · "adrian15" <[email protected]> writes:
Can we boot grub
and boot linux
so that
linux don't write on grub reserved memory (let's say first 640k) And then make an special halt command
that halts linux and boots again grub? (without rebooting)
GRUB depends on the BIOS to function. I think linux changes the hardware state too much. So even if you can return to GRUB, I don't think the hardware state is reliable enough for GRUB or the BIOS to function reliably and properly, if it is possible at all.
Quoted 3 lines
Currently I want an easy way of showing an image with a lot of colours in grub without having to code vesa and all of that. (Talking about grub legacy, as always ;) )
No.
Quoted 3 lines
If this works... I will need to know how to patch the kernel and how to strip gnu/linux distro to have only the display command or equivalent to show images in framebuffer or equivalent.
Sorry, but I don't think it works like you hoped it would.
--
Marco
Quoted 8 lines
Quoted 6 lines · "adrian15" <[email protected]> writes:
Can we boot grub
and boot linux
so that
linux don't write on grub reserved memory (let's say first 640k) And then make an special halt command
that halts linux and boots again grub? (without rebooting)
When we discussed thhis on IRC i expressed an idea of having grub in linux kernel format. Then we could use kexec facility to return to grub. But it would also need patching linux so that it doesnt't clobber BIOS memory. NetBSD takes care not to do so afaik, so if kloader worked on i386 thhis could be another option.
Quoted 5 lines
GRUB depends on the BIOS to function. I think linux changes the hardware state too much. So even if you can return to GRUB, I don't think the hardware state is reliable enough for GRUB or the BIOS to function reliably and properly, if it is possible at all.
Hardware state? What hardware is in question, except disks?
Quoted 18 lines
Quoted 4 lines
Currently I want an easy way of showing an image with a lot of colours in
grub without having to code vesa and all of that. (Talking about grub legacy, as always ;) )No.
Quoted 3 lines
If this works... I will need to know how to patch the kernel and how to strip gnu/linux distro to have only the display command or equivalent to show images in framebuffer or equivalent.
Sorry, but I don't think it works like you hoped it would.
--
Marco
Quoted 5 lines
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
---------------------------------------------------------------------------
o Lubomir Kundrak
°O° <[email protected]>, http://skosi.org/~lkundrak/
(_) SKOSI -- Slovak OpenSource Initiative
---------------------------------------------------------------------------
Quoted 9 lines · Lubomir Kundrak
Quoted 8 lines
Quoted 6 lines · "adrian15" <[email protected]> writes:
Can we boot grub
and boot linux
so that
linux don't write on grub reserved memory (let's say first 640k) And then make an special halt command
that halts linux and boots again grub? (without rebooting)
Quoted 5 lines
When we discussed thhis on IRC i expressed an idea of having grub in linux kernel format. Then we could use kexec facility to return to grub. But it would also need patching linux so that it doesnt't clobber BIOS memory. NetBSD takes care not to do so afaik, so if kloader worked on i386 thhis could be another option.
I personally don't think it is feasible and worth the effort.
Quoted 7 lines
Quoted 5 lines
GRUB depends on the BIOS to function. I think linux changes the hardware state too much. So even if you can return to GRUB, I don't think the hardware state is reliable enough for GRUB or the BIOS to function reliably and properly, if it is possible at all.
Hardware state? What hardware is in question, except disks?
It can be all hardware. Like how IRQs are routed, which set of keyboard scancodes are used, video state, etc.
--
Marco
Quoted 1 line
Did you use GRUB 2 CVS?
Yes.
Quoted 9 lines
Quoted 5 lines
When I tried to boot against it, I saw the initial Grub welcome message, but it immediately gave an error message. I don't have the error message to show as I've rebuilt the machine with extra partitions this time. I can now try dedicating one for /boot and possibly one for grub itself (running the grub-install seemed to insist on one).
Right, the reason for that is that the firmware can't load from ext2 (or whatever you use). So you need a HFS+ partition as /boot (assuming you use an apple).
I'm still a little confused by this. In Gentoo at least, yaboot does not require a /boot partition, but it does require the apple bootstrap partition. This is created by using the 'b' command in mac-fdisk, which creates an 800k HFS partition. Once created, mkofboot is run to format the bootstrap partition and copy the yaboot files to it. This is the location where I put the grubof.modules and grub.cfg files.
For grub to work, does this partition need to be larger and then mounted as /boot in Linux?
Or do I need a separate /boot partition, but it must be an HFS partition?
Can I see your /etc/fstab and partition map? It might be easier for me to just duplicate what you have. Once I get it working, I can figure out exactly what the requirements are. For what its worth, I'm setting this up on a MacMini with 256MB. Not sure if that should make a difference.
I did try setting up separate /boot and /boot/grub partitions, but didn't think these needed to be HFS. I assumed that once grub was running from the bootstrap partition it was no longer neccessary to stay within HFS.
Quoted 10 lines
Quoted 5 lines
Alternatively, is there a description of the layout of the grub2 code so I can follow the process myself to figure it out? I'm a developer, but I'm having some difficulty figuring out the organization as I poke around. Would the documentation for grub legacy help? Is there some general information floating around that I haven't found yet?
I will write something for the wiki this evening or tomorrow, if nothing is there about the organisation of the code. Otherwise I'll point you to the
right documents.
Have you looked into this yet? I was hoping to dig through the code before sending this email :) I feel like I'm doing something fundamentally wrong and it might be easier just following the logic..
Thanks,
Jon