Message board for the users of flat assembler.
> OS Construction > keyboard driver
Octavio 01 Oct 2005, 10:14
Hello i need some explanations about this code from menuetos keyboard
kb_write: ;some instrucctins skipped out 0x60,al mov ecx,0xffff kw_loop3: in al,0x64 test al,2 jz kw_ok3 loop kw_loop3 mov ah,1 jmp kw_exit kw_ok3: mov ah,8 kw_loop4: mov ecx,0xffff kw_loop5: in al,0x64 test al,1 jnz kw_ok4 loop kw_loop5
on my computer bit 0 of status byte is not set to 1 but the code exits when
the loop counter reach 0.
is the code below `kw_loop5:` a bug or is for compatibility with some keyboards.
|01 Oct 2005, 10:14||
bogdanontanu 01 Oct 2005, 12:39
Code below kw_loop5 is a protection. You do have to wait until bit 1 becomes zero but if an error occurs you might wait forever and hang the OS.
So, a compromise is made: it will wait as the specifications require but not more than it takes for the ecx register to count down to zero... If ECX register does reach zero then the loop will exit anyway... signaling an error condition ... somehow
As a word of advice: it does not really matter how things happen to particullary work on YOUR PC... and OS has to work on MANY PC and if possible on ALL PCs. As a consequence you should follow the exact specifications for chipsets inside the PCs (both old and new) and not a special case that might work on your own PC.
However it might be quite OK if you want your OS to run on a single specific PC.
|01 Oct 2005, 12:39||
Octavio 01 Oct 2005, 15:36
it will wait as the specifications require .
where is this specification?
in this web page there is a example but they do nothing after writing to port 60h .
and what happened to the solar OS forum?
|01 Oct 2005, 15:36||
bogdanontanu 02 Oct 2005, 07:54
Solar OS forum was hacked by a script kid.
A backup version was kindly moved by Spook as a subforum under win32asm forums. This will be the Solar OS forums from now on.
I can be found here:
I do not recall where (many places) i did found the I8042 keyboard+PS/2 mouse controller specifications... but it is my intention to startup a section for such things on Solar OS web pages.
|02 Oct 2005, 07:54||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.