Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Dec 2002 12:33:32 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        David Leimbach <leimy2k@mac.com>
Cc:        freebsd-doc@freebsd.org
Subject:   RE: Error in example for Kernel module....
Message-ID:  <XFMail.20021217123332.jhb@FreeBSD.org>
In-Reply-To: <670D0148-1172-11D7-A572-0003937E39E0@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 17-Dec-2002 David Leimbach wrote:
> I think so anyway...
> 
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/ 
> x10109.html
> 
> In :
> 
>   static int
>      echo_loader(struct module *m, int what, void *arg)
>      {
>        int err = 0;
> 
>        switch (what) {
>        case MOD_LOAD:                /* kldload */
>          sdev = make_dev(&echo_cdevsw,
>                  0,
>                  UID_ROOT,
>                  GID_WHEEL,
>                  0600,
>                  "echo");
>          /* kmalloc memory for use by this driver */
>          /*    malloc(256,M_ECHOBUF,M_WAITOK); */
>          MALLOC(echomsg, t_echo *, sizeof(t_echo), M_ECHOBUF, M_WAITOK);
>          printf("Echo device loaded.\n");
>          break;
> 
> Should probably be:
>       uprintf("Echo device loaded\n");
> 
> This is probably minor...

You can use printf in the kernel directly.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20021217123332.jhb>