flat assembler
Message board for the users of flat assembler.

Index > OS Construction > A20 Gate enabling

Author
Thread Post new topic Reply to topic
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 28 Oct 2005, 15:24
what if someone uses USB keyboard and mouse? How to enable A20 then?
Post 28 Oct 2005, 15:24
View user's profile Send private message Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 28 Oct 2005, 21:41
The I8042 keyboard controller is still in somewhere inside the chipset even if the PC/Laptop has no external plug for an PS/2 mice or keyboard.

It has multiple other purposes like: A20, Speaker, Reset, etc

So you can still use it to enable the A20 gate.


As a side note: because of this, actually using an USB keyboard or mouse is kind of stupid.

The mouse an the keyboard are pretty straight forward devices that deserve a clear, fast and simple interface and resource assignments in hardware/software. USB is more generic and normally used for faster or more demanding device...

To mix the two and to share hardware registers and most important IRQs for this... is.... doh hummans Wink


For example:
1) consider that the USB has a very bad internal design even it it looks nice seen from above. Pooling instead of IRQ for data transfer and constantly feeding the PCI bus with read and write requests is at least funny ... to be nice...

2)The mouse an keyboard are also slower USB devices and no matter what they will take up cycles slots from the faster USB devices like camera or memory sticks.
Post 28 Oct 2005, 21:41
View user's profile Send private message Visit poster's website Reply with quote
Remy Vincent



Joined: 16 Sep 2005
Posts: 155
Location: France
Remy Vincent 29 Oct 2005, 01:20
Sure, very very complex drivers Twisted Evil Sad Cool Wink

_________________
Groups lower your IQ
Post 29 Oct 2005, 01:20
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 29 Oct 2005, 15:03
The drivers are not very complex... (they will be included in the next release of Solar OS) .

It is just a bad internal design of the USB chips and standards... The resulting stuff is sub-optimal to say at least... but looks very nice for the user o the outside Smile
Post 29 Oct 2005, 15:03
View user's profile Send private message Visit poster's website Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 30 Oct 2005, 17:57
Ralf Brown's PORTS.A Table P0401:
Quote:

Values for keyboard controller commands (data goes to PORT 0060h):
. . .
D0h read read output port and place on PORT 0060h (see #P0405)

D0h Compaq places byte in output port in output buffer. Use this command

only when the output buffer is empty

D1h double write output port. The next byte written to PORT 0060h will

be written to the 804x output port; the original IBM AT and

many compatibles such as the OPTi 82C392 use bit 1 of the

output port to control the A20 gate.
. . .
DFh sngl enable address line A20 (HP Vectra only???)
. . .

So, as I understand to enable A20 I need to
Code:
    mov al, 0DFh
    out 64h, al
    

But in every source I was looking at I saw
Code:
    mov al, 0D1h
    out 64h, al
    mov al, 0DFh
    out 60h, al
    

What is that?

And what is the difference between the two methods of enabling A20 that
are described in 'enableA20.s' file:
method #1
Code:
    mov al, 0D0h
    out 64h, al
    in al, 60h
    push ax
    mov al, 0D1h
    out 64h, al
    pop ax
    or al, 2
    out 60h, al
    

method #2:
Code:
    mov al, 0D1h
    out 64h, al
    mov al, 0DFh
    out 60h, al
    
Post 30 Oct 2005, 17:57
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 30 Oct 2005, 18:26
Oups, sorry. method #2 above is correct:
Code:
mov AL, 0DFh

out 64h, AL
    


but in MenuetOS kernel I see the confusing sequence of instructions:
Code:
l.5: in      al, 0x64                ; Enable A20
        test    al, 2
        jnz     l.5
        mov     al, 0xD1
        out     0x64, al
   l.6: in      al, 0x64
        test    al, 2
        jnz     l.6
        mov     al, 0xDF
        out     0x60, al
    

Why is it so?
Post 30 Oct 2005, 18:26
View user's profile Send private message 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.