Date: Wed, 25 Sep 1996 08:23:38 -0500 From: "Eric L. Hernes" <erich@lodgenet.com> To: Narvi <narvi@haldjas.folklore.ee> Cc: hardware@FreeBSD.org Subject: Re: Porting serial driver Message-ID: <199609251323.IAA23132@jake.lodgenet.com> In-Reply-To: Your message of "Wed, 25 Sep 1996 13:34:38 %2B0300." <Pine.BSF.3.91.960925133024.1033A-100000@haldjas.folklore.ee>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609251323.IAA23132>