public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Padraig Brady <Padraig@AnteFacto.com>
To: Bart Trojanowski <bart@jukie.net>
Cc: antonpoon@hongkong.com, linux-kernel@vger.kernel.org
Subject: Re: How can I add a function to the kernel initialization
Date: Wed, 11 Apr 2001 14:16:57 +0100	[thread overview]
Message-ID: <3AD45949.5D925566@AnteFacto.com> (raw)
In-Reply-To: <Pine.LNX.4.30.0104110718010.31213-100000@localhost>

These things usually sit off a serial port.
I.E. /dev/lcd is a link to /dev/ttyS0 or whatever.
Anyway the main point is you don't have access to libc.
So how can you access the serial port from the booting
kernel. Well to spit kernel messages out the serial
port you pass the console=ttyS1,19200 or equivalent
parameter to the kernel. So see what that is done 
in the kernel code and copy.

Note www.kernelnewbies.org is probably more appropriate 
for this sort of question.

Padraig.

Bart Trojanowski wrote:
> 
> First it does not work because you do not have access to libc in the
> kernel.  Secondly your LCD driver is not available at the time of
> start_kernel so there is no one to listen to the /dev/lcd.
> 
> The quickest hack would be to find your lcd driver and modify it to spit
> out the Loading Kernel, after it initializes.
> 
> B.
> 
> On Wed, 11 Apr 2001, antonpoon@hongkong.com wrote:
> 
> > I have written a driver for a character set LCD module using parallel port. I want to display a message when the kernel is initialized.
> >
> > I added the following to start_kernel() in init/main.c
> >
> > #include <stdio.h>
> >
> > {
> >   int i;
> >   char line = "Loading Kernel";
> >   FILE *ptr;
> >   ptr = fopen("/dev/lcd","w");
> >
> >   for (i=0;i<10;i++)
> >   {
> >       fprintf(ptr, "%s\n", line);
> >   }
> >   fclose(ptr);
> > }
> >
> > Error was found, it looks like that it can not include stdio.h in the initialization.
> > How can I do that?
> >
> > I wish to be personally CC'ed the answers/comments posted to the list in response to my posting. Thank you.
> >
> > Best Regards,
> > Anton

  reply	other threads:[~2001-04-11 12:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-11  8:07 How can I add a function to the kernel initialization antonpoon
2001-04-11 11:22 ` Bart Trojanowski
2001-04-11 13:16   ` Padraig Brady [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-04-15 14:20 James Simmons

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=3AD45949.5D925566@AnteFacto.com \
    --to=padraig@antefacto.com \
    --cc=antonpoon@hongkong.com \
    --cc=bart@jukie.net \
    --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