From: Jeremy S. <js...@mv...> - 2001-10-27 00:44:00
|
A couple months ago, I proposed adding a configurable command line to the SH kernel, w/o the whole parameter block and with no assumptions about the bootloader; Niibe responded that a different way based on an earlier proposal by David Woodhouse was preferable. At the time I set it aside to do other things, but now I'd like to respond and try to justify my proposal a bit better (or at least how I think about it...) [Note: I've reordered some of Niibe's comments to combine my answers.] > > Rather than the entire parameter block we copy only the kernel command > > line, made configurable (with a copy in misc.c itself so zImage is still > > built w/o the empty_zero_page). This allows kernel config to force the > > command line regardless of the bootloader, or to not have one and depend > > on the bootloader as now. (Or to use sh-ipl+g to load w/o having to set > > up the command line using gdb commands.) > > I think it's good idea to have hard-coded default parameters, and make > them configurable. I don't think it's good to "force" the parameters. > It should be overridden at run-time. > How about following? > > (a) Introduce parameter block something like David Woodhouse suggested. > (b) Provide the config option to build "zImage + parameter block", > say, zImage+parms, and provide options for default paremeters > to build parameters block. > > Users can use zImage+parms with no boot loader, use zImage with boot > loader, or use zImage+parms with boot loader which may override params > at run-time. I'm not sure that the bootloader should be able to trump the kernel in all cases; isn't it sort of a coin toss? I can always build the kernel w/o a cmdline and it'll use whatever the bootloader says. Having said that, I'll admit that I'm not very familiar with available bootloaders and their capabilities; I've only been using ethboot, or S-record serial download. (I also rebuild the kernel regularly, so redoing the config and recompiling some files isn't a big deal here; admittedly that may be a bad way to look at it.) [And if the boot loader can override params at runtime, why use the zImage with no params option?] One concern is that expressed by David in his original proposal and patch for the parameter block: compatibility with boot loaders. If I understood David's patch, the zImage expects the loader to overwrite its beginning part and jump to its start, which will copy that beginning to the correct place. If the loader doesn't know to do that, it may try executing the parameter block which will just jump to the image; but if the loader (now incorrectly) put parameters at _text, the zImage can't tell and will ignore them, right? The point was made that it's easy to change the boot loaders, but I'm always uncomfortable with the need to couple separate pieces of SW more closely... I know this isn't much better, but at least with the kernel forcing you'd have a kernel that behaves consistently across different bootloaders and bootloader versions. If you build a kernel w/o the forcing, you get bootloader parameters, consistent with your current behavior. Also, I've been working only with the command line string. Seems to me that's the easiest way to configure, and it's real flexible; one param and you can set all kinds of things without needing lots of config options. (Of course, this may just be laziness on my part.) A final point is that I think ppc has command line configuration which kind of works like this (and maybe arm)? > Besides, for the implementation of default parameters for zImage, > I think it could be implemented the file(s) under arch/sh/boot/. > > > --- kernel/arch/sh/kernel/head.S Fri Jul 27 04:48:29 2001 > > +++ test/arch/sh/kernel/head.S Tue Sep 4 14:13:49 2001 > > I think touching beyond arch/sh/boot/ is irrelevant for this purpose. I assume you meant that touching arch/sh/kernel is irrelevant... one thing I liked about this though is that it produces a vmlinux which has the command line in it, not just a zImage -- so, for example, using gdb with sh-ipl+g and doing a "load" I didn't have to use a .gdbinit to put in the command line string (but could if desired, of course.) But of course this isn't really necessary. Is any of this convincing? Thanks, --Jeremy Siegel |