[Top] [All Lists]

Re: question concerning serial console setup

To: Ralf Baechle <>
Subject: Re: question concerning serial console setup
From: "Andrew R. Baker" <>
Date: Mon, 17 Jan 2000 20:47:38 -0600 (CST)
Cc: Jeff Harrell <>, Conrad Parker <>,
In-reply-to: <>

On Tue, 18 Jan 2000, Ralf Baechle wrote:
> On Mon, Jan 17, 2000 at 07:56:42PM -0600, Andrew R. Baker wrote:
> > > A simple solution is to hardwire the commmand line in
> > > arch/mips/kernel/setup.c.
> > 
> > I have some hackish code that queries the prom enviroment and edits the
> > commandline to reflect the appropriate console.  If that is worthwhile to
> > have available I will dig up a diff.
> Have you considered hacking kerne/printk.c:console_setup() instead?
> There is already some SPARC code there.

The code in kernel/printk.c seems to be only involved in normalizing the
names of the serial ports.  What I needed was to get the console
enviroment setting from the prom.  I don't like the idea of putting prom
code into kernel/printk.c.  Here is the code I used (from

        /* get the console enviroment variable into the command line.
         * But only if the console parameter wasn't entered by the user.
         * Is this a bad thing to do here?
         * -Andrew
        if(console_option == 0) 
                console = prom_getenv("console");
                strcpy(cp, "console=");
                cp += strlen("console=");
                strcpy(cp, console);
                cp += strlen(console);
                *cp++ = ' ';

I don't like the way it messes with the passed commandline.  However, we
could read the value into some other variable and let kernel/printk.c pick
it up from there.  


<Prev in Thread] Current Thread [Next in Thread>