Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jun 1997 03:20:38 -0400 (EDT)
From:      Brian Mitchell <brian@firehouse.net>
To:        Steve Howe <un_x@anchorage.net>
Cc:        freebsd-hackers <hackers@FreeBSD.ORG>
Subject:   Re: BSD io
Message-ID:  <Pine.BSI.3.95.970624031307.9821A-100000@shell.firehouse.net>
In-Reply-To: <Pine.BSF.3.95q.970623215859.7612A-100000@aak.anchorage.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 23 Jun 1997, Steve Howe wrote:

> i run across bits and pieces, but i am not sure
> i have covered all my options.  an when i run
> across new ones, they are heavily clouded
> with personal opinions.
> 
> from lkm's, to dev/io, to kernel io, 
> to various scripting languages.
> 
> i remember i asked once how to read in a character mode
> from the keyboard, and while i was, as always, humbled
> by people reaching out to help, i ended up with 3 responses
> with pages of source code each, and no real clear cut answer.

It is not terribly difficult, you should have been referred to advanced
programming in the unix environment which covers this in chapter 11.

> 
> then, on my own i found out i could do:
> 
> #include <ncurses.h> and then use cbreak();
> OR
> #include <stdlib.h> and then use system("stty cbreak");
> 

Neither of which really the optimal choice. In case 1, you are using
(n)curses when you really dont need to (well, you may need to - or you may
not need to. Simply reading 1 char at a time does not mean you need to use
ncurses in my opinion). In case 2, you are executing a program you really
dont need to - and that particular sequence would be suicide in a
privledged program.

> so i don't know what to think.
> 
> and for those of you that conquer some aspect of BSD,
> like driver coding or kernel source debugging,  for example, 
> why don't you try to document your efforts and share them 
> with the BSD community?

Some people do. I don't think freebsd would even exist if they did not.

> 
> > I for one would be more than happy to talk to you about how to do what
> > you're talking about, but so far all I've heard you talk about is some
> > wonderful "visual everything editor", and a lot of what the demo crowd
> 
> i never said it was wonderful, it's just useful to me.
> first, i'd like to know exactly how to write a device
> driver.  ie, disconnect any existing driver, plug in
> a new one, do port i/o, use the driver, disconnect
> it, and restore the original.
> 
> i read info relating to other unices, but it's not valid with
> BSD, many functions are appear to be different.

Run and buy the design and implementation of bsd44

> > Firstly; why on earth do you want to read back from the screen anyway?
> 
> because i find it more efficient to scan a screen for data entries
> / error checking than to write code that deals, in a global sense, 
> with each field entered by a cursor.

This sounds to me to be extremely unportable, although I may be
misinterpreting your statement.

> you guys think you know it all, and got it all figured out,
> yet i hardly see any documentation of all your knowledge,
> where's your "write a BSD driver tutorial"?

at http://www.freebsd.org



Brian Mitchell                                  brian@firehouse.net
"BSD code sucks. Of course, everything else sucks far more."
- Theo de Raadt






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSI.3.95.970624031307.9821A-100000>