Date: Wed, 06 Nov 2002 08:50:41 +0100 From: Poul-Henning Kamp <phk@critter.freebsd.dk> Cc: Robert Watson <rwatson@FreeBSD.ORG>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/conf majors Message-ID: <93096.1036569041@critter.freebsd.dk> In-Reply-To: Your message of "06 Nov 2002 18:11:22 %2B1030." <1036568487.55376.99.camel@chowder.localdomain>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <1036568487.55376.99.camel@chowder.localdomain>, "Daniel O'Connor" w rites: >On Wed, 2002-11-06 at 18:04, Poul-Henning Kamp wrote: >> That is still not a reason for cloning the driver. If you did it right >> with a linedisc, it would also work on sparc64 which uses a siemens >> chips, on multiport cards which use their own chips and on any future >> serial port worth its salt. >> >> If you continue to clone the sio driver, you will get a driver which >> conflicts with the sio driver, making life difficult for people who >> want to mix and match normal serial and RS485. >> >> Trust me on this, I've cleaned up more "I'll just make a copy and >> modify" code in the kernel than anybody else in this project. >> >> Please do it right, don't hack it. > >Could you perhaps suggest something helpful, like HOW I would write a >line discipline? >Where would I get information on it? Is there something similar I could >copy? Line disciplines sit between the filedescriptor and the tty drivers, and interpret read/write/ioctl system calls according to their own policies. Currently I belive we have three working line disciplines in the kernel, the default "tty" linediscipline, which we use on command lines and such, the slip and the ppp line disciplines. The "infrastructure" for linedisciplines are in sys/kern/tty_conf.c, this is mainly the functions to register/deregister them with the kernel. The default tty discipline is in sys/kern/tty.c The ppp discipline in sys/net/tty_ppp.c, the slip discipline in sys/net/if_sl.c The entire chapter 10 in the 4.4 "daemon" book is about terminals and line disciplines. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?93096.1036569041>