Autor Thema: A20-Gate  (Gelesen 3398 mal)

zacK

  • Beiträge: 216
    • Profil anzeigen
    • http://www.domae.ch
Gespeichert
« am: 21. April 2005, 17:27 »
Huhu

ich habe schon ein paar mal in threads gefragt was mit meinem a20-gate code ist, leider aber keine antworten bekommen. desshalb versuche ich es nun wieder.

da mein code mir auf dem bildschirm angibt das a20 aktiviert ist dem aber nicht so ist, scheint mein a20-prüfcode nicht richtig zu funktionieren...

könnte jemand von euch mir sagen ob dieser code funktioniert?

der code sollte in ax 1 ausgeben wenn a20 aktiviert ist. sonst 0!
;===============================================================
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;-----------Test if a20 is set----------------------------------
TestA20:
.0:
push bx
push cx
push es

.1:
mov bx, 0xFFFF
mov es, bx
push bx
mov ax, [es:0x100]
not ax
xor bx, bx
mov es, bx
mov [es:0x100], ax
pop bx
mov es, bx
cmp ax, [es:0x100]
je .2

mov ax, 1
jmp .3

.2:
mov ax, 0

.3:
pop es
pop cx
pop bx
ret


thx

zacK

  • Beiträge: 216
    • Profil anzeigen
    • http://www.domae.ch
Gespeichert
« Antwort #1 am: 25. April 2005, 10:11 »
warum antwortet mir niemand....? :shock:
das hat doch sicher schon jeder gecoded?!

pls, ich brauche das wirklich nun.... :(

zacK

  • Beiträge: 216
    • Profil anzeigen
    • http://www.domae.ch
Gespeichert
« Antwort #2 am: 26. April 2005, 09:27 »
doch das ist eine variante.... das ist auch nur ein test code ob a20 aktiviert ist.... der ganze code zum aktivieren ist hier. ich nutze 4 varianten..
;===============================================================
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;---------------------A20 Gate----------------------------------
SetupA20:
.0:
pusha

.1:
call EnableA20Int

call TestA20
cmp ax, 1
je ._Done

.2:
call EnableA20Port

call TestA20
cmp ax, 1
je ._Done

.3:
call EnableA20KbdCom

call TestA20
cmp ax, 1
je ._Done

.4:
call EnableA20KbdStat

call TestA20
cmp ax, 1
je ._Done

._Fail:
mov si, msg_A20Fail
call PrintString
cli
hlt

._Done:
popa
ret


;===============================================================
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;-----------Enable A20 Gate with Interrupt----------------------
EnableA20Int:
.0:
push ax

.1:
mov ax, 0x2401
int 0x15

.2:
pop ax
ret


;===============================================================
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;-----------Enable A20 Gate with Keyboard Statusbyte------------
EnableA20KbdStat:
.0:
push eax
cli

.1:
call WaitKbd

.2:
mov al, 0xD0
out 0x64, al

.3:
in al, 0x64
test al, 0x1
jz .3

.4:
in al, 0x60
or al, 00000010b
push eax

.5:
call WaitKbd

.6:
mov al, 0xD1
out 0x64, al

.7:
call WaitKbd

.8:
pop eax
out 0x60, al
call WaitKbd

.9:
sti
pop eax
ret


;===============================================================
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;-----------Enable A20 with Keyboard Commando-------------------
EnableA20KbdCom:
.0:
push ax

.1:
call WaitKbd

.2:
mov al, 0xDF
out 0x64, al

.3:
call WaitKbd

.4:
pop ax
ret


;===============================================================
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;-----------Wait for the Keyboard-------------------------------
WaitKbd:
.0:
pusha
.1:
jmp .3

.2:
in al, 0x60

.3:
in al, 0x64
test al, 0x1
jnz .2
test al, 0x2
jnz .3

.4:
popa
ret


;===============================================================
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;-----------Enable A20 with port 0x92---------------------------
EnableA20Port:
.0:
push ax

.1:
in al, 0x92
xor ah, ah
test al, 0x2
je .3

.2:
and   al, 0x0FD
out 0x92, al

.3:
pop ax
ret



;===============================================================
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;-----------Test if a20 is set----------------------------------
TestA20:
.0:
push bx
push cx
push es

.1:
mov bx, 0xFFFF
mov es, bx
push bx
mov ax, [es:0x100]
not ax
xor bx, bx
mov es, bx
mov [es:0x100], ax
pop bx
mov es, bx
cmp ax, [es:0x100]
je .2

mov ax, 1
jmp .3

.2:
mov ax, 0

.3:
pop es
pop cx
pop bx
ret

zacK

  • Beiträge: 216
    • Profil anzeigen
    • http://www.domae.ch
Gespeichert
« Antwort #3 am: 29. April 2005, 10:53 »
need reply.... :'-(

Jidder

  • Administrator
  • Beiträge: 1 625
    • Profil anzeigen
Gespeichert
« Antwort #4 am: 29. April 2005, 12:42 »
einmal liest du von 0xFFFF:0x0100 = 0x001000F0 und einmal schreibst du nach 0x0100 statt 0x00F0 ...
Dieser Text wird unter jedem Beitrag angezeigt.

zacK

  • Beiträge: 216
    • Profil anzeigen
    • http://www.domae.ch
Gespeichert
« Antwort #5 am: 29. April 2005, 13:16 »
yuhu!! das war es scho. vielen dank!

nun funktioniert auch mein grafik-treiber... :D *freu*

 

Einloggen