flat assembler
Message board for the users of flat assembler.

Index > OS Construction > keyboard driver

Author
Thread Post new topic Reply to topic
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 01 Oct 2005, 10:14
Hello i need some explanations about this code from menuetos keyboard
driver.
Code:
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.
Post 01 Oct 2005, 10:14
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
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 Wink


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.
Post 01 Oct 2005, 12:39
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 01 Oct 2005, 15:36
bogdanontanu wrote:
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 .
http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/keyboard/atkeyboard.html
and what happened to the solar OS forum?
Post 01 Oct 2005, 15:36
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
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:
http://board.win32asmcommunity.net/index.php?board=70.0

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.
Post 02 Oct 2005, 07:54
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.