linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: Andrew Morton <akpm@digeo.com>
Cc: James Simmons <jsimmons@infradead.org>,
	Anton Blanchard <anton@samba.org>,
	" " "Martin J. Bligh" <mbligh@aracnet.com>,
	linux-kernel@vger.kernel.org, " "@averellmail.firstfloor.org,
	torvalds@transmeta.com,
	" " Linux console project 
	<linuxconsole-dev@lists.sourceforge.net>
Subject: Re: [BK PATCH] console changes 1
Date: 14 Oct 2002 03:18:12 +0200	[thread overview]
Message-ID: <m3adlhkecr.fsf@averell.firstfloor.org> (raw)
In-Reply-To: <3DA9E439.3613F889@digeo.com>

Andrew Morton <akpm@digeo.com> writes:

> I think what we need James is just the low-level hook in printk.c which
> the various platforms and boards can plug into.  The one in Martin's
> patch (module some cleanups, docco, conversion to C, etc) looks
> suitable to me.  The actual early console drivers don't appear to have
> much relationship at all to the console layer really.  They're just
> minimal-code busy-wait port banging.

The hook already exists and it is called register_console. Has been there
for years. early_printk on x86-64 uses that. Originally I used the hackish
printk hook way, but Linus put me on the right track. 

Your arch code just does a register_console very early which does the low level 
output.

Actually you need one new hook for cosmetic reason: when the real console
starts you want to disable the early console, otherwise you get duplicated
output when they go to the same output device. This can be done with a
straight forward function call in console_init.

BTW the x86-64 early console should just work fine on i386 too, with minor
changes. 

All you need to do is: 

- cp arch/x86_64/kernel/early_printk.c arch/i386/kernel/early_printk.c
- edit arch/i386/kernel/early_printk.c and replace VGABASE with 
__PAGE_OFFSET+0xb8000
- add it to arch/i386/kernel/Makefile
- (optional - if you don't do it will be only initialised after setup_arch when
  __setup arguments are parsed) 
  add something like
        if (c == ' ' && !memcmp(from,"earlyprintk=",12)) { 
                extern int setup_early_printk(char *opt)
                setup_early_printk(from+12); 
        }  
  to the comand line parsing in arch/i386/kernel/setup.c
- Enable CONFIG_EARLY_PRINTK so that console_init disables it.
- Boot with earlyprintk=vga (for vga output) 
  or earlyprintk=serial,ttySx,baud for serial output.
  Add ,keep when you want to keep it even after console_init


-Andi


  reply	other threads:[~2002-10-14  1:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-12  1:06 [BK PATCH] console changes 1 James Simmons
2002-10-12  1:29 ` Martin J. Bligh
2002-10-12  1:40   ` James Simmons
2002-10-12  1:43   ` Anton Blanchard
2002-10-12  2:24     ` Martin J. Bligh
2002-10-13 20:40     ` James Simmons
2002-10-13 20:49       ` Martin J. Bligh
2002-10-13 21:00       ` Russell King
2002-10-13 21:23         ` Andrew Morton
2002-10-14  1:18           ` Andi Kleen [this message]
2002-10-13 22:31       ` Anton Blanchard
2002-10-12 19:22   ` Dave Hansen
2002-10-12 19:23     ` William Lee Irwin III
2002-10-12 23:43     ` Anton Blanchard

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=m3adlhkecr.fsf@averell.firstfloor.org \
    --to=ak@muc.de \
    --cc=" "@averellmail.firstfloor.org \
    --cc=akpm@digeo.com \
    --cc=anton@samba.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxconsole-dev@lists.sourceforge.net \
    --cc=mbligh@aracnet.com \
    --cc=torvalds@transmeta.com \
    /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;
as well as URLs for NNTP newsgroup(s).