Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] boot loader
@ 1999-10-21 23:55 Paul Bame
  1999-10-22  1:39 ` Stan Sieler
  1999-10-22  2:10 ` Jason Eckhardt
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Bame @ 1999-10-21 23:55 UTC (permalink / raw)
  To: parisc-linux


Here's a sketch of a new (really, mostly stolen from other places
like the existing boot_code code) boot loader for parisc.  It's
aimed at solving some of our current problems (like linking ramdisks
into the kernel) and being good enough to live on for a while,
and be easily replaced if it starts to smell bad.

In order to use HP boot firmware, our disk layout has to look
at least somewhat like a LIF volume (as it does today), so it
makes sense to use LIF for a few other things too.  LIF is a
very simple file system layout -- almost as simple as the one
we were going to use for ramdisks.

My proposal is to have a LIF volume on the beginning of any disk
from which one might boot.  Make that LIF volume at least 2Mb, and
maybe 10Mb if you want to store several kernels and ramdisk images.
Here are the files it would hold:

	IPL		Pretty much the boot loader we're using today
			with some LIF intelligence added
	vmlinuz		The kernel image, put there with the 'lifcp'
			command.  Could have several kernels
			on the LIF volume and boot any of them.
	cmdline		The default, or the last?, command line used
			to boot Linux.  Could possibly have several
			different command lines in one or several files
			but the UI for this needs thought.
	ramdisk		One or more files containing ramdisk images
	ptable		Partition table -- see below

During boot, the IPL is same as today.  It presents a
command line just like today, from the 'cmdline' file if one is
available.  On the command line you can select which kernel to
boot if you have more than one and enter the normal Linux
command-line parameters.  There'll be some little extension to handle
specifying which ramdisk image you want, which is stripped off
by the IPL and not passed to the kernel in that form.  The HP
firmware would continue to be used, as it is today, to select whether
you want to interact with the boot loader command line or not.

When the command line is committed, the ramdisk and kernel are loaded
just like they are today (using the same code probably) the kernel
is told how to find the ramdisk image (need to learn how this is done).

Non-bootable disks can skip the LIF volume header altogether, though
they might want it just in case they want to be bootable in the future.

			Partition Table

I suggest we place the partition table at a fixed low address on
the disk such that it can appear as a file in the LIF file system
on disks which have them, and be in the same location on non-LIF
disks just there wouldn't be any LIF sugar around it.  This way
the table's always in the same place which is easy for the tools
which use it, and it's a LIF file too which might be convenient.
Alex suggests we re-use maybe the sparc partition table format?

			Development Cycle

After building a new kernel, you'd have to
'lifcp <the-kernel-image> /dev/sda:vmlinuz' instead of
doing 'mkImage' like we do today.  It's also cool that the ramdisk
isn't linked into the kernel.

		    If you already have HP-UX

The existing HP-UX LIF volume header has less than 300k of free
space, so it wouldn't be large enough to hold vmlinuz, therefore
you can't boot from an existing HP-UX volume.  Which means if
you want to keep your HP-UX disk intact, you'll have to add another
disk for Linux, and I think the firmware can handle booting from
one of several disks just fine.

			    Tools

lifinit and lifcp should already be able to handle the LIF stuff, so
no new C code required to build the LIF volumes.  We can probably
talk HP into open sourcing the LIF commands, and if not can grab
the ones from OpenBSD.  For now we can use the ones on HP-UX.
[I suspect the HP ones are not byte-order safe (yet).]

			    Future

It's relatively easy to replace IPL (and vmlinuz for that matter)
in the scheme above with wonderful new stuff when we figure out
what that is.  The firmware and existing disk headers wouldn't
have to change to accomodate a new boot loader.

			    The Name

BTW the current contender for the name, instead of hilo, is palo
for PArisc LOader.  It is also a reminder of of Palo Alto
which is where HP began.

Comments?

			    -Paul Bame

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [parisc-linux] boot loader
  1999-10-21 23:55 [parisc-linux] boot loader Paul Bame
@ 1999-10-22  1:39 ` Stan Sieler
  1999-10-22 18:03   ` Stan Sieler
  1999-10-22  2:10 ` Jason Eckhardt
  1 sibling, 1 reply; 4+ messages in thread
From: Stan Sieler @ 1999-10-22  1:39 UTC (permalink / raw)
  To: Paul Bame; +Cc: parisc-linux

Hi,

> My proposal is to have a LIF volume on the beginning of any disk
> from which one might boot.  Make that LIF volume at least 2Mb, and
> maybe 10Mb if you want to store several kernels and ramdisk images.
> Here are the files it would hold:
> 
> 	IPL		Pretty much the boot loader we're using today
> 			with some LIF intelligence added
> 	vmlinuz		The kernel image, put there with the 'lifcp'
> 			command.  Could have several kernels
> 			on the LIF volume and boot any of them.
> 	cmdline		The default, or the last?, command line used
> 			to boot Linux.  Could possibly have several
> 			different command lines in one or several files
> 			but the UI for this needs thought.
> 	ramdisk		One or more files containing ramdisk images
> 	ptable		Partition table -- see below

As long as you don't want to use LIF utilities to access those files,
lowercase should be okay.

The LIF tools won't accept lowercase filenames.
Why care?  Because you could possibly boot HP-UX and use the LIF tools 
to manipulate the vmlinuz file, for example.

Example:  

   Oz(su) /: lifcp test /dev/dsk/c0t0d0:vmlinuz
   lifcp: Cannot create vmlinuz   ; improperly formatted LIF name
   Oz(su) /:

(BTW, the lifcp "-t" option won't help)

I'd suggest using uppercase, and making the IPL smart enough
to allow user-entry of lowercase (which gets mapped to uppercase)

> After building a new kernel, you'd have to
> 'lifcp <the-kernel-image> /dev/sda:vmlinuz' instead of
> doing 'mkImage' like we do today.  It's also cool that the ramdisk
> isn't linked into the kernel.

Note: my lifcp test was on 10.20
 
> lifinit and lifcp should already be able to handle the LIF stuff, so
> no new C code required to build the LIF volumes.  We can probably
> talk HP into open sourcing the LIF commands, and if not can grab
> the ones from OpenBSD.  For now we can use the ones on HP-UX.
> [I suspect the HP ones are not byte-order safe (yet).]

If that happens, we could support lowercase.
 
> 			    The Name
> 
> BTW the current contender for the name, instead of hilo, is palo
> for PArisc LOader.  It is also a reminder of of Palo Alto
> which is where HP began.

Great name!
 
-- 
Stan Sieler                                          sieler@allegro.com
                                         http://www.allegro.com/sieler/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [parisc-linux] boot loader
  1999-10-21 23:55 [parisc-linux] boot loader Paul Bame
  1999-10-22  1:39 ` Stan Sieler
@ 1999-10-22  2:10 ` Jason Eckhardt
  1 sibling, 0 replies; 4+ messages in thread
From: Jason Eckhardt @ 1999-10-22  2:10 UTC (permalink / raw)
  To: Paul Bame; +Cc: parisc-linux




On Thu, 21 Oct 1999, Paul Bame wrote:

> 
> Here's a sketch of a new (really, mostly stolen from other places
> like the existing boot_code code) boot loader for parisc.  It's
> aimed at solving some of our current problems (like linking ramdisks
> into the kernel) and being good enough to live on for a while,
> and be easily replaced if it starts to smell bad.
> 
 ...
> 
> BTW the current contender for the name, instead of hilo, is palo
> for PArisc LOader.  It is also a reminder of of Palo Alto
> which is where HP began.
> 
> Comments?

  My only comments are "keep it small and simple" and don't spend a lot of time
  on it. This was my "philosophy" when I first wrote the bootloader -- after
  all, it is just a bootloader. The whole idea was to spend a day or two
  writing it, so we could get to the _interesting_ stuff -- the kernel. In
  fact, the only reason I wrote a bootloader (instead of lifting the one from,
  say, mklinux) was to have a compact and simple one. 

  However, I'm all for cleaning it up a bit. The original code was actually
  quite nice and well-commented, especially considering the haste in which it
  was written. It has since degraded a shade after some hacking by others
  (as well as gaining functionality -- ELF loading, for example -- by the way,
  does that actually work?). 
  As far as naming goes, PALO, HILO, doesn't really matter to me although PALO
  is as cute as any. I like my original, verbose and iconoclastic name
  "PARISC/Linux Bootstrap v0.1" :).

  If you're really fired up, help out on the kernel. I'm confident Alex and
  Chris can find something that needs to be written! (I'm looking for time
  myself -- between more than full-time work at Cygnus, grad school at Rice,
  and 3 kids, I'm having trouble helping out much these days).

  Have fun, jason.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [parisc-linux] boot loader
  1999-10-22  1:39 ` Stan Sieler
@ 1999-10-22 18:03   ` Stan Sieler
  0 siblings, 0 replies; 4+ messages in thread
From: Stan Sieler @ 1999-10-22 18:03 UTC (permalink / raw)
  To: parisc-linux

Re:

> The LIF tools won't accept lowercase filenames.
> Why care?  Because you could possibly boot HP-UX and use the LIF tools 
> to manipulate the vmlinuz file, for example.
...
> Note: my lifcp test was on 10.20
 
I also tested on HP-UX 11.00, with the same result.
  
-- 
Stan Sieler                                          sieler@allegro.com
                                         http://www.allegro.com/sieler/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-10-22 18:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-10-21 23:55 [parisc-linux] boot loader Paul Bame
1999-10-22  1:39 ` Stan Sieler
1999-10-22 18:03   ` Stan Sieler
1999-10-22  2:10 ` Jason Eckhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox