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

Re: MiNT device drivers



In-Reply-To: <9408221245.AA08379@topo.matups.fr>


Hi

>> The big problem if you write your own driver is that it won't be
>>called in some emergency situations. If you type ^C or ^\ to kill a
>>runaway process, this will be ignored if this process does not deign to
>>read the keyboard :-)

I though this might be the case :-(

>> In fact, the MiNT kernel handles these keyboard "interrupts" in
>>a very ad hoc way, by directly peeking into the keyboard Iorec buffer at
>>regular intervals! It will not do it with your driver, obviously, that's
>>why you would need to fork a daemon process to check for this (or
>>better, use addroottimeout). If you don't mind writing a few lines of
>>assembler, I think a simpler solution would consist in adding a hook to
>>the RS232 receiver interrupt routine, which will pop the incoming
>>scancodes from the rs232 iorec buffer, convert them, and push them into
>>the keyboard iorec buffer. This is not very clean, but the problem
>>really lies in the brain-dead MiNT interface to tty drivers.

Actually this is what I've been looking at tonight. With the instructions
to build the keyboard interface came some assembler drivers which do more
or less this. Unfortunatly they jump straight into TOS in order to put the
character into the iorec buffer!

Anyway I've been looking at insterting characters into the iorec. The only
source code I have which does this is the BIOS listing for TOS 1.0! I've
tried converting this into C with limited success, but haven't quite
cracked it. I'm also slightly confused about the iorec buffer:

1) I always though it contained scancode/asciicode byte pairs. However when
I 'dump' it, it seems to contain 0/asciicode pairs? (This is under MiNT).

2) In the book 'The Anatomy of the Atari ST' (also known as 'Atari ST
Internals' I believe), the iorec() entry talks about characters being written
to ibufhd and being read from ibuftl. However in the BIOS listing at the
back, the code definately implies writing at the *tail*. Is there an
example of how to manipulate the iorec buffer anywhere? The 'Atari
Compendium' is sadly lacking on these details.

Thanks very much,

Roland.

@CiX