[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fast serial (was: misc kernel patches... (mostly tty stuff))



Nicholas S Castellano writes:

> > ok!  but that still requires changes in MiNT.  for example currently it
> >seems a 1K tty read gets _always_ translated into 1000 device reads of
> >each one char, that just cant be fast no matter how good the driver is...
> >and to get it real fast such a driver would also need a way to tell
> >MiNT that it reads and writes bytes, not longs.  then it could get a
> >RAW 1K read or write as that and just bcopy the data. (and also sleep
> >gracefully when it waits for more than a few bytes to go over the port
> >so it doesn't have to waste so much CPU time...)
> 
> The idea would be to have the drive bypass MiNT completely and twiddle
> the iorec itself, to do the reads and writes.

 well thats exactly what i hacked into uucp...  i thought you were
talking about a driver to install as replacement for /dev/{modem,serial}*,
the problem is when you do that and tell MiNT that its a tty (O_TTY,
is_terminal), MiNT will do these things for you... (please correct me
if i'm wrong.)

 or do you mean a something like /dev/modem1raw, i.e. a device not marked
as tty that can then only be used for RAW?  i don't think that would
help because programs usually don't expect to have to open a different
device for RAW...
> 
> The only thing at all difficult about doing this that i've noticed is
> that the iorec elements seem to be misnamed and misdocumented; in
> practice the head element seems to really be the tail and vice-versa.

 true :-)  (actually its not too easy because you have to think a little
to avoid race conditions and such... but its certainly possible.)
> 
> > or things like TIOCCAR/CLOCAL, HUPCL.. they probably need some help
> >from the kernel too.
> 
> I don't know what those are, but they look like maybe part of the
> system V tty driver controls?

 yup... CLOCAL is termio(s) (local mode, turn on to chat with the modem,
then turn off and you get SIGHUP when carrier goes away...)  TIOC(N)CAR
is the same for BSD (i think :-)  HUPCL is `hang up on close' (drop DTR
when the device gets close()d), also known as TIOCHPCL.

 another useful thing would be VMIN (min. number of characters to read,
only known in termio), then you don't have to calculate times to sleep
when you need to read at least n characters in RAW mode...

>  Of course if you want to support new
> driver controls at least some of them will need to be in the kernel.

 ok :)
> 
> >>  I've been thinking recently
> >> that most of my TOS 1.0 hacks in MiNT's rsconf() code should really be
> >> in a standalone device driver as well (especially since that code
> >> still doesn't work terribly well.)
> >
> > well either this, or just forget about those 1001 TOS bugs and tell
> >people to use one of the serial port fix TSRs available, some of them
> >now even work. :)
> 
> I agree, but I never found one that corrected the TOS 1.0 bug of not
> being able to query the port speed.  (I think I found one that claimed
> to do this but actually just caused spectacular crashes.) 

 hmm..  well since TOS 1.04 it just remembers the last speed set with
Rsconf, if someone changes the timer settings themselves you still get
wrong results.  (have you tried hsmodem1?)
> 
> > and for a standalone modem driver rsconf (and iorec) would better just
> >translate their parameters into device ioctls, right?
> 
> For the most part yes, but they could also do nice things like giving
> real FIONREAD/FIONWRITE results for the serial port, allow Fselect()
> on the port, etc.

 well this both then can be fixed in the driver i would say...

> No, I was talking about a MiNT installed device for fast/better serial
> port access, not a TSR.  I could go dig through my old mail and find
> the refernce but it would probably be faster to just write the code
> :-).

 oh :-)
> 
> > other than that i only know of someone who seems to hate MiNT so much
> >that he wrote a fast driver that tries to act like MiNT, but for TOS!
> >(looks for Fopen ("u:\dev\modem1"..) and then handles Fread/Fwrite
> >itself or so...  i guess if you could read all those maus news you'd
> >sometimes just shake your head... :-)
> 
> I love it when people say they hate MiNT so they want to implement all
> its functionality in TOS (e.g. they are effectively saying they want
> to write their own MiNT :-)

 no need to tell me, tell that Harun_Scheutzow@b.maus.de :-)

 cheers
	Juergen
-- 
J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
								...ohne Gewehr
PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA