public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Booting a modular kernel through a multiple streams file
@ 2001-12-16 20:37 Otto Wyss
  2001-12-16 20:50 ` Alexander Viro
                   ` (2 more replies)
  0 siblings, 3 replies; 66+ messages in thread
From: Otto Wyss @ 2001-12-16 20:37 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'

Well I don't think a kernel without anything compiled in is currently functional
but I'd rather like to have as less as possible. And I _don't_ like the solution
with initrd. So I've thought about other solutions to solve the hen-egg dilemma
when booting a modular kernel.

Well a simple solution would be if Linux supports the multiple streams file
format. Assume the kernel and all necessary modules for booting (if not all
modules) are combined into a single file. The boot loader (i.e. lilo) simply
loads this file and starts the first stream (the kernel). It doesn't need to
know the full multiple stream format (maybe nothing at all). The kernel of
course needs this functionality to load the rest of the modules for a minimal
working system. 

I assume it's no problem to integrate the building of this boot file into either
the Linux compilation or better into a separate setup phase (possibly together
with good hardware/module detection).

Advantages:
- A simple boot loader can handle it without much tweaking
- The multiple streams file format is a standard concept usable anywhere
- No ramdisk is necessary
- This concept needs possibly less kernel functionality than initrd
- No change in the current compilation process except for the additional setup phase

Disadvantages:
- Someone else has to do it, I'm not a kernel/driver developer

Why did nobody else have this simple idea? I don't know, maybe the multiple
streams file format isn't widely known in the Linux community. Who else does use
it? The MacOS runs nicely with it, supporting data and resource streams. Maybe
it is already ported from the MacOS X to Darwin. WindowsNT supports it but
doesn't use it.

O. Wyss

^ permalink raw reply	[flat|nested] 66+ messages in thread
* RE: Booting a modular kernel through a multiple streams file
@ 2001-12-17 19:53 Grover, Andrew
  2001-12-17 20:26 ` Alexander Viro
  0 siblings, 1 reply; 66+ messages in thread
From: Grover, Andrew @ 2001-12-17 19:53 UTC (permalink / raw)
  To: 'otto.wyss@bluewin.ch', Alexander Viro
  Cc: 'linux-kernel@vger.kernel.org'

> From: Otto Wyss [mailto:otto.wyss@bluewin.ch]
> You have to admit that a multiple streams file format 
> (regardless which kind)
> would be a good solution to the booting of a modular kernel. 
> Anyway this format
> has to be supported by the kernel itself and in some extend 
> by any boot loader.
> So anybody has to write a kernel module for the cpio/tar 
> format and help with
> implementing it into  boot loaders. Maybe you could give some help. 

I don't think multiple streams is a good idea, but did you all see the patch
by Christian Koenig to let the bootloader load modules? That seems to solve
the problem nicely.

Regards -- Andy

^ permalink raw reply	[flat|nested] 66+ messages in thread
* RE: Booting a modular kernel through a multiple streams file
@ 2001-12-17 22:10 Grover, Andrew
  2001-12-18  2:31 ` Alexander Viro
  0 siblings, 1 reply; 66+ messages in thread
From: Grover, Andrew @ 2001-12-17 22:10 UTC (permalink / raw)
  To: 'Alexander Viro'
  Cc: 'otto.wyss@bluewin.ch',
	'linux-kernel@vger.kernel.org'

> From: Alexander Viro [mailto:viro@math.psu.edu]
> On Mon, 17 Dec 2001, Grover, Andrew wrote:
> > I don't think multiple streams is a good idea, but did you 
> all see the patch
> > by Christian Koenig to let the bootloader load modules? 
> That seems to solve
> > the problem nicely.
> 
> That puts an awful lot of smarts into bootloader and creates 
> code duplication
> for no good reason.
> 
> We _already_ have code for loading modules.  And it's going 
> to stay, no
> matter what happens on boot.  So why the hell duplicate that 
> in $BIGNUM
> unrelated pieces of software (LILO, SYSLINUX, MILO, SILO, etc.)?  Just
> to create extra fun with debugging?

OK so (correct me if I'm wrong) there are two parts to loading modules -
getting them in memory, and then resolving references. My understanding of
Christian's work is that the bootloader (e.g. GRUB) gets them in memory, but
then it is up to the kernel linker to resolve refs. So yes, there would be
an additional piece of code (marked __init), but it would not have to be
duplicated for each bootloader -- all they have to do is get the modules in
memory and indicate via the multiboot struct where they are.

I don't think this will obsolete any existing boot methods, but it seems
like an additional genuinely useful capability for the Linux kernel to have.

Regards -- Andy

^ permalink raw reply	[flat|nested] 66+ messages in thread
[parent not found: <Pine.GSO.4.21.0112180350550.6100-100000@weyl.math.psu.edu>]
* RE: Booting a modular kernel through a multiple streams file
@ 2001-12-18 17:43 Grover, Andrew
  2001-12-18 18:45 ` Alexander Viro
  2001-12-18 18:49 ` Greg KH
  0 siblings, 2 replies; 66+ messages in thread
From: Grover, Andrew @ 2001-12-18 17:43 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'; +Cc: 'otto.wyss@bluewin.ch'

> From: Alexander Viro [mailto:viro@math.psu.edu]
> On Mon, 17 Dec 2001, Grover, Andrew wrote:
> all they have to do is 
> get the modules in
> > memory and indicate via the multiboot struct where they are.
> 
> *shrug*  Your "all they have to do" is quite heavy.

GRUB 0.90 does this today. All other bootloaders could also do it quite
easily, since this is just an extension of what they have to do for the
kernel and initrd images.

> I've had a very dubious pleasure of dealing with our boot 
> sequence lately.
> Adding more cruft to it (including in-kernel linker, for fsck sake) is
> _not_ a good idea.

I see this as cruft elimination. By adding a kernel linker (which can be
discarded after init) it allows one to increase the modularity of the kernel
- without using an initrd. Heck, you could make the initrd code
modularizable ;-)

> Folks, whatever had happened with "if it can be done in 
> userland - don't
> put it into the kernel"?

Yes, but this isn't an absolute rule. IIRC that rule also has an "unless it
makes things a lot simpler" clause, too.

> That goes for a _lot_ of code.  Mounting root.  Detecting the type of
> initrd contents.  Loading ramdisk from floppies.  Asking to press
> key (you really ought to look what is done for _that_).  Speaking
> DHCP - we have a kernel DHCP client, of all things.  All that stuff
> can (and should) be done from userland process.  And there's much
> more of the same kind.

> There is a word for that and that word is "crap".

These examples are either a direct result of initrd complexities, or not
related.

Initrd exists to allow a two-phase startup. My point is that why have a 2
phase startup when you can have a 1 phase startup? Also, I'm not advocating
ditching the initrd capability, but wouldn't bootloading modules be
preferable for the majority of the systems currently using initrd out of
necessity?

Regards -- Andy

^ permalink raw reply	[flat|nested] 66+ messages in thread
* RE: Booting a modular kernel through a multiple streams file
@ 2001-12-18 17:47 Grover, Andrew
  2001-12-18 18:53 ` Alexander Viro
  2001-12-18 19:43 ` David Weinehall
  0 siblings, 2 replies; 66+ messages in thread
From: Grover, Andrew @ 2001-12-18 17:47 UTC (permalink / raw)
  To: 'James A Sutherland', Alexander Viro
  Cc: 'otto.wyss@bluewin.ch',
	'linux-kernel@vger.kernel.org'

> From: James A Sutherland [mailto:james@sutherland.net]
> > Had you actually looked at initrd-related code?  I had and 
> "bloody mess"
> > is the kindest description I've been able to come up with.  
> Even after
> > cleanups and boy, were they painful...
> 
> With a choice between that, or teaching lilo, grub etc how to 
> link modules - 
> and how to read NTFS and XFS, and losing the ability to boot 
> from fat, minix 
> etc floppies, tftp or nfs servers - almost any level of 
> existing nastiness 
> would be preferable to that sort of insane codebloat!

1) GRUB can already do this
2) Each bootloader doesn't need to link, the kernel includes the linker.
(which after it does its job can be discarded and insmod used later on)
3) Seeing how ugly everyone seems to think initrd is, this seems like a
worthwhile option to consider.

Regards -- Andy

^ permalink raw reply	[flat|nested] 66+ messages in thread
* RE: Booting a modular kernel through a multiple streams file
@ 2001-12-18 19:50 Grover, Andrew
  2001-12-18 20:26 ` Alexander Viro
                   ` (4 more replies)
  0 siblings, 5 replies; 66+ messages in thread
From: Grover, Andrew @ 2001-12-18 19:50 UTC (permalink / raw)
  To: 'Alexander Viro'
  Cc: 'linux-kernel@vger.kernel.org',
	'otto.wyss@bluewin.ch'

> From: Alexander Viro [mailto:viro@math.psu.edu]
> On Tue, 18 Dec 2001, Grover, Andrew wrote:
> > GRUB 0.90 does this today.
> ... and I'm quite sure that EMACS could do it easily.  Let's not talk
> about GNU bloatware, OK?

I don't think this is bloatware, especially considering there really isn't
any cost for having a full-featured bootloader - all its footprint gets
reclaimed, after all. I respect lilo and its cousins, but they make things
harder than they have to be. Why maintain a reduced level of functionality
(software emaciation?) when better alternatives are available?

> Except that in this case it doesn't make anything simpler.

Implicit in the use of initrd is that you have to *make a ramdisk image*,
and then tell your bootloader to load it. If you have a bootloader that can
load multiple images (i.e. the modules themselves) you can skip the first
step.

> BTW, we don't need a special device to handle initrd after that.  Just
> have your initrd image (gzipped, whatever) in the archive 
> under /initrd.
> After that /init will have the contents in that file (regular file, at
> that) and can do whatever it bloody wants.

Again, even the new scheme will still involve the creation of an initrd. I'm
saying, as a user, it would be easier for me to not do this, and just modify
a .conf file to have the driver loaded early-on.

I'm not arguing that the new initrd won't be better than the old initrd
(because obviously you are right) I'm arguing that no matter how whizzy
initrd is, it's still an unnecessary step, and it's one that other OSs (e.g.
FreeBSD) omit in favor of the approach I'm advocating.

> IOW, we are backwards compatible with old
> loaders.

No progress will ever be made if we cater to the lowest common denominator.

Regards -- Andy

^ permalink raw reply	[flat|nested] 66+ messages in thread
* RE: Booting a modular kernel through a multiple streams file
@ 2001-12-18 20:35 Torrey Hoffman
  0 siblings, 0 replies; 66+ messages in thread
From: Torrey Hoffman @ 2001-12-18 20:35 UTC (permalink / raw)
  To: 'Grover, Andrew', 'Alexander Viro'
  Cc: 'linux-kernel@vger.kernel.org',
	'otto.wyss@bluewin.ch'

Grover, Andrew wrote:

[...]

> I'm arguing that no matter 
> how whizzy
> initrd is, it's still an unnecessary step, and it's one that 
> other OSs (e.g.
> FreeBSD) omit in favor of the approach I'm advocating.

Well, I'm a linux user more than a developer but I disagree.

It isn't hard to make an initrd, and initrd will always be 
neccessary for some things.  Since we can't get rid of it 
and don't want to (*), I like the approach of making it better.

* I network boot (via pxelinux boot loader) a linux kernel and 
initrd.gz, total size <2 MB, which then proceeds to:

1 - load network drivers, do dhcp
2 - partition and format the hard disk
3 - mount the new filesystems
4 - download (with retry/resume), unpack, cryptographically 
    verify, and install a complete (~100 mb) embedded linux
    system.  
5 - while it does all the above, it shows pretty graphics and
    "please wait while we setup your system" messages on the
    attached television set via framebuffer support.

You may be able to get grub to do the first step but the next
four would be... challenging.  I agree that grub is cool, though.

Torrey Hoffman

^ permalink raw reply	[flat|nested] 66+ messages in thread
[parent not found: <Pine.GSO.4.21.0112190313080.9963-100000@weyl.math.psu.edu>]
* RE: Booting a modular kernel through a multiple streams file
@ 2001-12-23  7:20 Grover, Andrew
  2001-12-23  9:15 ` Eric W. Biederman
  0 siblings, 1 reply; 66+ messages in thread
From: Grover, Andrew @ 2001-12-23  7:20 UTC (permalink / raw)
  To: 'ebiederm@xmission.com', dcinege
  Cc: otto.wyss, 'linux-kernel@vger.kernel.org', Rusty Russell

> From: ebiederm@xmission.com [mailto:ebiederm@xmission.com]
> > Basically what Grub does is loads the kernel modules from disk
> > into memory, and 'tells' the kernel the memory location to load
> > them from, very similar to how an initrd file is loaded. The problem
> > is Linux, is not MBS compilant and doesn't know to look for and load
> > the modules. 
> 
> So tell me how you make an MBS compliant alpha kernel again?

1) Someone writes a MBS spec chapter for Alpha
2) Someone implements it.

Any volunteers? (Eric? ;-))

It's all about scratching an itch, right? Things don't become cross-platform
by themselves. Linux started out 386-only, after all.

Regards -- Andy

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

end of thread, other threads:[~2001-12-27 10:59 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-16 20:37 Booting a modular kernel through a multiple streams file Otto Wyss
2001-12-16 20:50 ` Alexander Viro
2001-12-17 18:49   ` Otto Wyss
2001-12-17 19:07     ` Andreas Dilger
2001-12-20 18:47       ` Otto Wyss
2001-12-16 21:06 ` H. Peter Anvin
2001-12-16 22:02   ` antirez
2001-12-16 22:18     ` H. Peter Anvin
2001-12-23  0:08 ` Dave Cinege
2001-12-23  6:26   ` Eric W. Biederman
2001-12-23 13:48   ` Alan Cox
2001-12-23 17:57     ` Dave Cinege
2001-12-23 23:05     ` Marcus Meissner
2001-12-24  2:38       ` Alan Cox
2001-12-27 10:58       ` Wilfried Weissmann
  -- strict thread matches above, loose matches on Subject: below --
2001-12-17 19:53 Grover, Andrew
2001-12-17 20:26 ` Alexander Viro
2001-12-17 22:10 Grover, Andrew
2001-12-18  2:31 ` Alexander Viro
2001-12-18  5:46   ` Craig Christophel
2001-12-23  0:28   ` Dave Cinege
2001-12-23  0:44   ` Dave Cinege
2001-12-23  1:39   ` H. Peter Anvin
2001-12-23  2:10     ` Alexander Viro
2001-12-23  3:00       ` Dave Cinege
2001-12-23  3:52         ` Alexander Viro
2001-12-23  4:41         ` Ryan Cumming
2001-12-23  5:52           ` Dave Cinege
2001-12-23  7:16             ` Bernd Eckenfels
2001-12-23  8:06               ` H. Peter Anvin
2001-12-23 12:22                 ` Kai Henningsen
2001-12-23 20:58                   ` Erik Mouw
     [not found] <Pine.GSO.4.21.0112180350550.6100-100000@weyl.math.psu.edu>
2001-12-18 11:16 ` James A Sutherland
2001-12-18 19:10   ` H. Peter Anvin
2001-12-19  9:27     ` James A Sutherland
2001-12-19 10:11       ` Erik Andersen
2001-12-23  0:39     ` Dave Cinege
2001-12-23  0:42       ` H. Peter Anvin
2001-12-23  1:15         ` Dave Cinege
2001-12-23  1:35           ` H. Peter Anvin
2001-12-23  2:08             ` Alexander Viro
2001-12-18 17:43 Grover, Andrew
2001-12-18 18:45 ` Alexander Viro
2001-12-18 18:49 ` Greg KH
2001-12-18 17:47 Grover, Andrew
2001-12-18 18:53 ` Alexander Viro
2001-12-18 19:43 ` David Weinehall
2001-12-18 19:50 Grover, Andrew
2001-12-18 20:26 ` Alexander Viro
2001-12-18 20:30 ` M. R. Brown
2001-12-18 20:35 ` H. Peter Anvin
2001-12-19  9:34 ` James A Sutherland
2001-12-23  1:02   ` Dave Cinege
2001-12-23  9:10     ` James A Sutherland
2001-12-19 14:13 ` Erik Mouw
2001-12-18 20:35 Torrey Hoffman
     [not found] <Pine.GSO.4.21.0112190313080.9963-100000@weyl.math.psu.edu>
2001-12-19  8:47 ` Eric W. Biederman
2001-12-19 14:55   ` Alexander Viro
2001-12-19 15:49     ` Eric W. Biederman
2001-12-19 17:03       ` Alexander Viro
2001-12-19 19:01         ` Eric W. Biederman
2001-12-20  3:30         ` H. Peter Anvin
2001-12-23  7:20 Grover, Andrew
2001-12-23  9:15 ` Eric W. Biederman
2001-12-23  9:47   ` H. Peter Anvin
2001-12-23 21:24     ` Eric W. Biederman

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