[9fans] Writing drivers in Plan 9
  Home FAQ Contact Sign in
comp.os.plan9 only
 
Advanced search
POPULAR GROUPS

more...

comp.os.plan9 Profile…
 Up
[9fans] Writing drivers in Plan 9         


Author: hugo rivera
Date: Apr 15, 2008 01:44

Hello:
I've been using Inferno and Plan 9 for almost a year. I certainly love
Plan 9's ideas and concepts, and I'd be glad to finally move forward
and leave Unix behind, but for now it is imposible for me, since my
work does not allow me this (I do data analysis for some physics
experiment using Cern's ROOT).
Anyway, I've always wanted to learn to write drivers and I did try it
a few years ago, using NetBSD, but I could not find time to complete
the task, so I leaved it unfinished. I want to start again, but this
time using Plan 9. So, I want to ask you for some pointers about how
doing this. Please, bear in mind, that I am a complete newbie when it
comes about writing drivers.
Saludos

Hugo
11 Comments
Re: [9fans] Writing drivers in Plan 9         


Author: a
Date: Apr 15, 2008 04:36

Given that you're already into Inferno as well as Plan 9, I
think a really nice way to get into driver development is
with emu drivers for Inferno. The basic structure is the
same as for native OS drivers in either system: implement
a small set of entry points (fooattach, fooread, &c),
making use of the dev* defaults where appropriate. It's
then a much smaller step to move into native hardware
drivers for Plan 9 or Inferno. And when you do get to that
point, take a look at Inferno's os/port/devXXX.c; it's a
template for what you need to implement. In any case,
the devtab (look for '^Dev') towards the end of any driver
will tell you what you really need. It's a much nicer,
constrained set for Inferno and Plan 9 than any unix.
Anthony
7 Comments
Re: [9fans] Writing drivers in Plan 9         


Author: erik quanstrom
Date: Apr 15, 2008 06:54

> Hello:
> I've been using Inferno and Plan 9 for almost a year. I certainly love
> Plan 9's ideas and concepts, and I'd be glad to finally move forward
> and leave Unix behind, but for now it is imposible for me, since my
> work does not allow me this (I do data analysis for some physics
> experiment using Cern's ROOT).
> Anyway, I've always wanted to learn to write drivers and I did try it
> a few years ago, using NetBSD, but I could not find time to complete
> the task, so I leaved it unfinished. I want to start again, but this
> time using Plan 9. So, I want to ask you for some pointers about how
> doing this. Please, bear in mind, that I am a complete newbie when it
> comes about writing drivers.
> Saludos

a few thoughts from inexperience
Show full article (1.34Kb)
no comments
Re: [9fans] Writing drivers in Plan 9         


Author: erik quanstrom
Date: Apr 15, 2008 07:18

> Given that you're already into Inferno as well as Plan 9, I
> think a really nice way to get into driver development is
> with emu drivers for Inferno. The basic structure is the
> same as for native OS drivers in either system: implement
> a small set of entry points (fooattach, fooread, &c),
> making use of the dev* defaults where appropriate. It's
> then a much smaller step to move into native hardware
> drivers for Plan 9 or Inferno. And when you do get to that
> point, take a look at Inferno's os/port/devXXX.c; it's a
> template for what you need to implement. In any case,
> the devtab (look for '^Dev') towards the end of any driver
> will tell you what you really need. It's a much nicer,
> constrained set for Inferno and Plan 9 than any unix.
> Anthony

i think this confuses implementing a Dev interface with writing
a device driver. for many devices, the Dev interface is already
taken care of. for example, serial, ethernet, disk devices using
sd implement an interface to devsd, ethernet.
Show full article (1.39Kb)
6 Comments
Re: [9fans] Writing drivers in Plan 9         


Author: a
Date: Apr 15, 2008 09:11

> i think this confuses implementing a Dev interface with writing
> a device driver. for many devices, the Dev interface is already
> taken care of. for example, serial, ethernet, disk devices using
> sd implement an interface to devsd, ethernet.

i think the Dev interface is still the right place to start, in terms of
understanding things.

for the benifit of the original question, the Dev interface (that
common set of entry points i was talking about) is the common
kernel interface that all device drivers have to go through at some
point. i think part of erik's point (which is correct) is that many of
the things people are commonly writing drivers for - disk
controllers, ethernet cards, and vga cards being probably the most
common examples - already have that interface covered, and
there's a separate interface that the hardware-specific part needs
to talk to.
Show full article (1.87Kb)
5 Comments
Re: [9fans] Writing drivers in Plan 9         


Author: hugo rivera
Date: Apr 15, 2008 11:31

Thanks for your feedback.
Now, I think I am going to start by trying to understand a little
about the Dev interface you talk about, and then continue to write a
real driver for a gamepad that I have.
Is there any documentation that describes this Dev interface?
This is a usb gamepad, so probably I have to deal with a Dev interface
related to the usb ports, am I right?

Hugo

2008/4/15, a@9srv.net 9srv.net>:
>> i think this confuses implementing a Dev interface with writing
>> a device driver. for many devices, the Dev interface is already
>> taken care of. for example...
Show full article (2.40Kb)
4 Comments
Re: [9fans] Writing drivers in Plan 9         


Author: erik quanstrom
Date: Apr 15, 2008 11:33

> Thanks for your feedback.
> Now, I think I am going to start by trying to understand a little
> about the Dev interface you talk about, and then continue to write a
> real driver for a gamepad that I have.
> Is there any documentation that describes this Dev interface?
> This is a usb gamepad, so probably I have to deal with a Dev interface
> related to the usb ports, am I right?
>
> Hugo

probablly not. the usb stuff is all accessable from userland. usbd
runs in user space as do all the clients of usb
-- usb/disk usb/mouse, etc.

- erik
3 Comments
Re: [9fans] Writing drivers in Plan 9         


Author: hugo rivera
Date: Apr 15, 2008 11:53

> probablly not. the usb stuff is all accessable from userland. usbd
> runs in user space as do all the clients of usb -- usb/disk usb/mouse, etc.

So, this means that I never have to deal with usb interfaces?
Can you point me some documentation about this?

Hugo
2 Comments
Re: [9fans] Writing drivers in Plan 9         


Author: erik quanstrom
Date: Apr 15, 2008 11:57

> So, this means that I never have to deal with usb interfaces?
> Can you point me some documentation about this?
>
> Hugo

it should be in the manul pages. try
; lookman usb

- erik
1 Comment
Re: [9fans] Writing drivers in Plan 9         


Author: hugo rivera
Date: Apr 15, 2008 12:10

> it should be in the manul pages. try
> ; lookman usb

Great! thanks

Hugo
no comments
1 2