mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] early command-line parsing
Date: Wed, 20 Nov 2002 13:56:47 -0800	[thread overview]
Message-ID: <3DDC051F.2060904@us.ibm.com> (raw)
In-Reply-To: <24571.1037826022@passion.cambridge.redhat.com>

David Woodhouse wrote:
> Not all architectures have asm/setup.h. And not all have the command line 
> somewhere convenient before setup_arch runs, although that could perhaps be 
> changed.
> 
> I wonder if calling checksetup(0, ...) should be called from setup_arch as 
> soon as the command line is available, rather than in start_kernel().

11 of the 18 architectures that I looked at do some form of their own 
command-line parsing.  There is a lot of arch code that could be saved 
if they could use the __setup mechanisms for this.
	
As far as the architectures that don't have the command-line 
available, we could do something like this:
void start_kernel(void)
{
         char * command_line;
         extern char saved_command_line[];

	get_command_line_arch(&saved_command_line);
	strcpy(command_line, saved_command_line);
	checksetup(0, ...)
	...
}

The weird ones like sparc could do their prom_getcmdline() in 
get_command_line_arch();

Use of command line in setup_arch:
---------------------------------
alpha	does parsing in setup_arch
  	modifies read command line, in case of INSTALL

arm	has its own command-line parsing function

cris	doesn't use a command line

i386	has its own parse_cmdline_early
	can use command line before setup_arch

ia64	the only thing that happens before the strcopy is unw_init

m68k	does its own parsing
	can modify the cmd line in m68k_parse_bootinfo(), which is
  	  early in setup_arch()

mips	many per-arch setups first
	next after those is cmdline copy

ppc+64	does a bit of its own parsing for the debuggers

s390+x	does its own parsing for mem=, and others

sh	has own early printk
	does its own parsing

sparc	get cmdline from prom call
and 64	does own parsing in boot_flags_init()
	
um	cmdline copy happens after paging_init() in setup_arch

v850	does cmdline copy, first thing

x86_64	does its own parsing for early_printk, and in
	  parse_cmdline_early
-- 
Dave Hansen
haveblue@us.ibm.com


      reply	other threads:[~2002-11-20 21:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20 18:40 Dave Hansen
2002-11-20 21:00 ` David Woodhouse
2002-11-20 21:56   ` Dave Hansen [this message]

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=3DDC051F.2060904@us.ibm.com \
    --to=haveblue@us.ibm.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®