From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 920 invoked by alias); 14 Jun 2007 23:11:25 -0000 Received: (qmail 908 invoked by uid 22791); 14 Jun 2007 23:11:24 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 14 Jun 2007 23:11:21 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HyyT3-0000Ai-LV for ecos-discuss@sources.redhat.com; Fri, 15 Jun 2007 01:11:05 +0200 Received: from c-76-17-159-202.hsd1.mn.comcast.net ([76.17.159.202]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Jun 2007 01:11:05 +0200 Received: from grante by c-76-17-159-202.hsd1.mn.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Jun 2007 01:11:05 +0200 To: ecos-discuss@sources.redhat.com From: Grant Edwards Date: Fri, 15 Jun 2007 08:43:00 -0000 Message-ID: References: <70d4f620706141241x6eefc498w18d9590e5dc2ef93@mail.gmail.com> User-Agent: slrn/0.9.8.1 (Linux) X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Re: Device driver implementation questions X-SW-Source: 2007-06/txt/msg00162.txt.bz2 On 2007-06-14, Mike Sweeney wrote: > I am finding the way device drivers are implemented in eCos to be > slightly confusing so was looking for some help. The main source of my > confusion is the need for some sort of interface under the io package > and then another part of the driver in the devs package. I have looked > at examples like the serial driver and understand how it works in that > context, but am having trouble seeing the bigger picture. Should > drivers for all types of devices follow this split implementation > design? Furthermore, can someone provide me an analogy between the > eCos driver model and Linux, for example? I don't see this two layer > method in Linux so am hoping someone can clarify this. Linux has almost the exact same two layer method for many drivers: Serial drivers: There is a line-discipline layer which provides the application with open/close/read/write calls. That corresponds to the "io" stuff in eCos. The line-discipline layer then calls lower-level hardware-specific drivers for different sorts of serial ports. That corresponds to the "dev" stuff in eCos. SCSI drivers: Pretty much the same -- there's a generic layer that provides an API to the user and then a lower layer that talks to individual SCSI controllers (or other hardware). There are probably other examples (VFS on top of the individual filesystem modules, 80211 on top of various card drivers). -- Grant Edwards grante Yow! FUN is never having to at say you're SUSHI!! visi.com -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss