Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

In reply to : Bret 'll have to hate FreeDOS mKEYB, too (Developers)

posted by tom Homepage, Germany (West), 16.05.2011, 17:13

> I quick viewed mKEYB in memory (using the disassembler included in McAffe's
> proview), it didn't appear to /chain/ 154F (as in passing scancodes by
> calling or jmping to the previously installed int 15 hook). Either I
> mis-looked or there is a misunderstanding over the notion of chain. Please
> clarify.

_int15_handler:
jnc chain_int15_non_carry

cmp ah,04fh
jne chain_int15

push bx
push cx
push dx
push ds
push es

push cs
pop ds
push ax

call near _cint15_handler_full
pop cx ; pop argument from stack

pop es
pop ds
pop dx
pop cx
pop bx

; scancode if pass down key to BIOS
; 0 if scancode was handled
mov ah,04fh
cmp al,0
jne chain_int15

push bp
mov bp,sp
and byte [bp+6],0feh ; clear carry
pop bp
iret

chain_int15:
stc
chain_int15_non_carry:
db 0eah ; Jump Far
_OldInt15 dd 0


in short words: _cint15_handler_full decides if it has
handled the scancode; if so it returns 0, and the code IRET's
(I even think that this is not correct; it would be better
to clear carry, and chain to the old handler. left as an exercise)

otherwise scancode processing is left to the BIOS. this is true for most
alpha, all shift, cursor, insert, function keys. (however accented alpha
keys are handled by mKEYB)

> Incidentally I also noticed you use int 16h for stuffing the buffer - I
> have reservations over such use (we do direct buffer handling); not because
> of reentrancy nor efficiency problems, but because calling int 16h at that
> point you don't know /who/ is going to mess with the buffer for good or
> bad. Either do it ourselves, or we could call the BIOS int 16 at its
> default entry point (per ISA quasi standard).

I don't know or care who is messing with the buffer.
but it's most likely the same that is also handling the other int16 keyboard
functions, and this is a good thing

besides that, as there exists a documented function
(int 16/5) KEYBOARD - STORE KEYSTROKE IN KEYBOARD BUFFER
for the purpose, most of the time ist's a good idea to use this standard.

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 249 users online (0 registered, 249 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum