Subject: Kernel source tree specifications
To: None <tech-kern@netbsd.org>
From: Ian Zagorskih <ianzag@megasignal.com>
List: tech-kern
Date: 06/18/2003 23:54:23
Hi all,
I would likt to ask is there available any clean and complete documentati=
on or=20
better specification related to the structure of kernel source tree ?
Let me explain. I read article about "How to write your own pseudo device=
=20
driver" from http://www.netbsd.org/Documentation/kernel/pseudo/#newdevice
Nice and usefull article at least for the beginner as I am. It says that=20
machine independant device driver code should be place at /sys/dev and=20
machine dependant should be at /sys/arch/<arch>/<arch>.
Ok, good statement. But this article says nothing about content of /src/d=
ev.=20
There are more then 40 sub-dirrectories in NetBSD 1.6.1 related to ISA, P=
CI,=20
USB and so so on. What about this structure ? Is it explicitly defined by=
any=20
document or "it happened so historically" ? What about other kernel sourc=
e=20
code tree structure ? How can i add my own "bus" into the kernel ? Where=20
should i place my code ?
Even while it's quite specific custom hardware and i doubt this code will=
be=20
ever released outside of our company, i would like to play with rules of=20
operating system rather inventing my own wheel.
At this moment i have several different PC104 addapters which implement a=
t=20
higher level some custom bus dependant message passing mechanism. CANBUS,=
=20
BITBUS and DSP boards if to be exact. This message passing schemes do not=
fit=20
in block nor character device scheme. For field busses like CANBUS or BIT=
BUS=20
IMO datagram socket scheme would be good.
While i have done all underlying hardware dependant board raw interface, =
i do=20
not know at this moment how to implement kernel <-> userland interface. C=
an=20
you suggest me a good example of alike "non-standard" interface ? ATM i'm=
=20
trying to implement client synchronous message send->reply call through i=
octl=20
but it dosn't look so well for me. Even ugly :)
Thank you.
--=20
RF, JSC Novosibirsk Geophysical Equipment Development Center.
WEB=09http://www.megasignal.com