From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@9fans.net From: erik quanstrom Date: Tue, 15 Apr 2008 09:43:10 -0400 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Writing drivers in Plan 9 Topicbox-Message-UUID: 8e3008da-ead3-11e9-9d60-3106f5b1d025 > 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. i don't buy the thesis that talking to hardware is always hard. talking to some hardware can be hard. for exampe, the aoe driver doesn't talk to hardware, it talks to the ethernet drivers. yet it's the largest driver i've written, largely because it implements its own dev interface. i think it's a mistake to think hardware == hard, software interfaces == easy. - erik