tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to define a major for a pseudo character device on NetBSD 1.6



On Mon, Jan 03, 2011 at 07:07:38AM -0500, Luciano Rodrigues Furtado wrote:
> Hi All,
> 
> I have a machine still stuck on NetBSD 1.6,  I decided to try to port
> the Tap driver to it. One question I have is where I define the major
> for this new driver on 1.6.
> 
> On current I see conf/majors. Do I do this simply by adding a new
> entry to the structure bellow:
> 
> #include "clockctl.h"
> cdev_decl(clockctl);
> 
> struct cdevsw   cdevsw[] =
> {
>         cdev_cn_init(1,cn),             /* 0: virtual console */
>         cdev_ctty_init(1,ctty),         /* 1: controlling terminal */
>         cdev_mm_init(1,mm),             /* 2: /dev/{null,mem,kmem,...} */
>         cdev_disk_init(NWD,wd),         /* 3: ST506/ESDI/IDE disk */
> 
> 
> 
> 
> more specifically on one of the positions listed as  cdev_notdef().

from what I remember this is the right way to do it, yes.
Don't forget to cdev_decl() it too.
You'll also have to hack MAKEDEV (or create the device nodes by calling
mknod directly).

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index