Page 1 of 1
the GRUB, the OS, and the bare metal
Posted: Sat Apr 30, 2011 6:33 pm
by xfelix
Is there a simple way to use the GRUB terminal, to be able to boot my OS on the bare metal?
As of now, I'm using the QEMU that is loading the OS from a floppy disk image with GRUBS stage1 and stage2.
Re: the GRUB, the OS, and the bare metal
Posted: Sat Apr 30, 2011 7:12 pm
by xfelix
berkus wrote:What is the question about?
running on the bare metal means booting the OS on the actual machine. Can this be accomplished via GRUB?
and if so maybe some tips
Re: the GRUB, the OS, and the bare metal
Posted: Sat Apr 30, 2011 8:17 pm
by Brendan
Hi,
xfelix wrote:berkus wrote:What is the question about?
running on the bare metal means booting the OS on the actual machine. Can this be accomplished via GRUB?
and if so maybe some tips
Yes.
First you need to install GRUB somewhere (if it's not already installed). Unfortunately GRUB is too lame to have it's own OS independent installer, so the easiest way to install GRUB is to install another OS (e.g. a distribution of Linux) so that the other OS's installer does all the work.
Note: this same problem effects all systems that try to use GRUB; and eventually this will include your OS when you have to find some way of installing GRUB from your OS's "installation CD" or something.
Then you have to put your OS's boot files in a file system that GRUB can access. If your OS has it's own native file system then GRUB can't/won't support it, and you'll need to either patch GRUB or use a "non-native" file system (where you can't prevent people using different OSs on the same machine from tampering with your boot files).
Then you have to configure GRUB. Unfortunately GRUB is too lame to have it's own inbuilt user-friendly configuration utility; so configuring GRUB depends on which version of GRUB (GRUB-legacy or GRUB2) you're using, and the easiest way to do it is by searching through the GRUB manual (and for GRUB2, hoping the documentation is at least a little bit up-to-date) and using a text editor. Of course because GRUB doesn't have it's own user-friendly configuration; a good user-friendly OS (e.g. Ubuntu) will have it's own scripting magic to auto-generate GRUB's configuration. This means changes you make manually to GRUB's configuration get trashed by these OSs. To fix that you'd have to track down the documentation for the other OS's scripting magic or find some other way to work around the problem (like using GRUB to chainload a different copy of GRUB).
Note: this same problem effects all systems that try to use GRUB to boot multiple/different OSs if one (or more) of those OSs make some attempt at being user-friendly; and eventually this will include your OS when you try to hide the ugly configuration mess from your unsuspecting end-users. Of course I don't think it's possible for your OSs to detect other OSs and automatically work-around the other OS's "GRUB configuration trashing" magic, so you'll have to let all the end-users figure out how to work around the problem on their own if they want to dual boot (kiss "user-friendly" goodbye).
Cheers,
Brendan