From owner-freebsd-hardware Wed Sep 25 06:34:04 1996 Return-Path: owner-hardware Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id GAA10690 for hardware-outgoing; Wed, 25 Sep 1996 06:34:04 -0700 (PDT) Received: from bacall.lodgenet.com (bacall.lodgenet.com [205.138.147.242]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id GAA10655 for ; Wed, 25 Sep 1996 06:34:01 -0700 (PDT) Received: (from mail@localhost) by bacall.lodgenet.com (8.6.12/8.6.12) id IAA21309; Wed, 25 Sep 1996 08:27:48 -0500 Received: from garbo.lodgenet.com(204.124.123.250) by bacall via smap (V1.3) id sma021291; Wed Sep 25 08:27:23 1996 Received: from jake.lodgenet.com (jake.lodgenet.com [204.124.120.30]) by garbo.lodgenet.com (8.6.12/8.6.9) with ESMTP id IAA16589; Wed, 25 Sep 1996 08:28:21 -0500 Received: from localhost (localhost [127.0.0.1]) by jake.lodgenet.com (8.7.5/8.6.12) with SMTP id IAA23132; Wed, 25 Sep 1996 08:23:38 -0500 (CDT) Message-Id: <199609251323.IAA23132@jake.lodgenet.com> X-Authentication-Warning: jake.lodgenet.com: Host localhost [127.0.0.1] didn't use HELO protocol X-Mailer: exmh version 1.6.2 7/18/95 To: Narvi cc: hardware@FreeBSD.org Subject: Re: Porting serial driver In-reply-to: Your message of "Wed, 25 Sep 1996 13:34:38 +0300." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 25 Sep 1996 08:23:38 -0500 From: "Eric L. Hernes" Sender: owner-hardware@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Howdy, there's a couple of ways to go here. 1) You could take an existing FBSD driver such as sio, or cy for example. Stay away from the digiboard driver, it's GPL. And only use the SCO source as a reference for the machine dependancy stuff, probe(), attach(), setting modem control, etc. 2) Use most of the SCO driver and patch up the incompatibilities. Off the top of my head, some of the incompatibilities are: Sco uses xx_init() for device probing/attaching, wheras FBSD has separate probe()/attach(). Sco's IOCTLs are numbered sequentially from 0, FBSD's have a lot of information coded in the ioctl request, maybe not an issue if the macros are used. It could be an issue for hardware dependant ioctl's though. the read/write/ioctl, and possibly the open/close take different arguments. At one time I had fixed a driver to be compilable on Sco/FBSD by using the cpp to fix this, but it was kind of ugly. select may need some attention, probably just setting the d_select member of the devsw to ttsel. It will also partly depend on what version of FBSD you want to work with. 2.1.5 and earlier need devswitch entries in i386/i386/conf.c, 2.2-current has the devswitch entries in the driver proper. SCO provides a xxpoll() entry point that gets called once per clock tick. On FreeBSD, you've gotta re-schedule your own callout. Maybe not an issue if you use interrupts. there's probably more... I'd probably go with option 1. eric. Narvi writes: > > HI! > > >I have a question regarding porting a driver for a multiport serial card. >I have access to the source code for SCO. How easy/difficult/possible is >porting it to FReeBSD? I also happen to have access to the full docs of >the card. And no, the card is not already supported for sure, it is >manufactured locally. > > Sander > -- erich@lodgenet.com http://rrnet.com/~erich erich@rrnet.com