grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Colin Watson <cjwatson@ubuntu.com>
To: grub-devel@gnu.org
Subject: Re: How to implant in GRUB 1.96 and GRUB 2.00+ kernel command from GRUB 0.97?
Date: Tue, 3 Dec 2013 10:17:54 +0000	[thread overview]
Message-ID: <20131203101754.GA7810@riva.ucam.org> (raw)
In-Reply-To: <67BFA875989E5748A862DFF55409F2A21B13CB10@IRSMSX104.ger.corp.intel.com>

On Mon, Dec 02, 2013 at 03:38:16PM +0000, Stojsavljevic, Zoran wrote:
> I have old 32bit GRUB version 0.97 installed long time ago on HDD. I
> am adding to it 32bit kernels for testing with the command: linux
> (hd0, 1)/images/bzImage_x.y.z [options] ...<cr>
> 
> I was able to add and boot standalone Bare Metal environment (around
> 60KB in size) using the following two lines:
> kernel (hd0,1)/images/kernel<cr>
> boot<cr>
> 
> This does boot my CPUs to use cases I would like them to execute.
> 
> I tried the same for GRUB version 1.96, but this does not work
> anymore! Did not try it for GRUB 2.00+...
> 
> The question is: what are the substitutes for commands (in GRUB 0.97):  kernel (hd0,1)/images/kernel<cr> boot<cr>
> [1] For GRUB 1.96?

I'm pretty sure nobody cares about 1.96 any more; it was a five-year-old
version of a development branch.  I'm certainly not going to try to go
back and work out what would have worked with it.  Sorry.  You could
always try going with the instructions for 2.00 if you're desperate, but
please just upgrade instead.

> [2] For GRUB 2.00+?

GRUB Legacy's "kernel" command was a magic thing that tried to detect
the kernel type and implement appropriate loading.  In GRUB 2, there's
instead a loader command for each kernel type: "linux", "multiboot2",
"knetbsd", etc.

Given that your kernel worked with GRUB 0.97, my guesses would be that
either it's a Multiboot 1 kernel (since GRUB Legacy didn't support
Multiboot 2), in which case you want the "multiboot" command; or it was
relying on the 16-bit Linux boot protocol, in which case you want the
"linux16" command.

The other thing to bear in mind is that GRUB 2 numbers partitions
starting at 1, not 0, so (hd0,1) in GRUB Legacy typically becomes
(hd0,2) in GRUB 2.

So, putting that all together, my guess is that a menu entry declaration
for your kernel in GRUB 2 would be something like this:

  menuentry "My bare-metal environment" {
    multiboot (hd0,2)/images/kernel
  }

... or, if you just want to type directly at the GRUB shell:

  multiboot (hd0,2)/images/kernel
  boot

Cheers,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


  parent reply	other threads:[~2013-12-03 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02 15:38 How to implant in GRUB 1.96 and GRUB 2.00+ kernel command from GRUB 0.97? Stojsavljevic, Zoran
     [not found] ` <CAA91j0Xn356u2==d3MdazwGeanyBDMjU+Eqyx8fgn7jPhwyDmg@mail.gmail.com>
2013-12-03 10:02   ` Stojsavljevic, Zoran
2013-12-03 10:17 ` Colin Watson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-12-03 11:54 Stojsavljevic, Zoran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131203101754.GA7810@riva.ucam.org \
    --to=cjwatson@ubuntu.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).