flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > enabling the a20 gate |
Author |
|
Gmakermaniac!!! 22 Mar 2005, 02:56
I'm lost...... how do you do it? can someone give me a link to an example? thanks in advance
|
|||
22 Mar 2005, 02:56 |
|
Torrey 22 Mar 2005, 04:56
Gmakermaniac!!! wrote: I'm lost...... how do you do it? can someone give me a link to an example? thanks in advance Check out this well documented example. |
|||
22 Mar 2005, 04:56 |
|
Gmakermaniac!!! 22 Mar 2005, 22:19
thanks All I know was my first line was right, otherwise, I was going compleatly the wrong way. It dosn't represent yours at all. Thanks. I'll look through the code
|
|||
22 Mar 2005, 22:19 |
|
crc 23 Mar 2005, 02:33
I use the following in RetroForth/Native:
Code: ; Enable A20 gate a20enable: mov al,0xd1 out 0x64,al call a20wait mov al,0xdf out 0x60,al call a20wait mov al,0xff out 0x64,al a20wait: in al,0x64 jmp .l0 .l0: and al,2 jnz a20wait ret |
|||
23 Mar 2005, 02:33 |
|
Gmakermaniac!!! 24 Mar 2005, 00:32
0.o.... mine came out so long ..... it works though
Code: enable_a20: ; enable_a20 function: enable the A20 gate pusha ; push all general purpose registers mov SI, .msg call strout ; display the message cli ; disable hardware interrupts mov CX, 5 ; 5 attempts to enable it .1: .1.1: ; wait for port to open, and send the command to read the output port xor AX, AX ; nullify AX in AL, 0x64 ; read port status bt AX, 1 ; see if the port is busy jc .1.1 ; if it is, check again mov AL, 0xD0 ; D0h is the command to read port output out 0x64, AL ; send the command to the port .1.2: ; wait for data to be ready xor AX, AX ; nullify AX in AL, 0x64 ; read data status bt AX, 0 ; jnc .1.2 ; if it's not ready, keep waiting xor AX, AX ; nullify AX in AL, 0x60 ; read data from keyboard push AX ; store AX for later .1.3: ; wait for port to open to write the status byte in AL, 0x64 ; read port status bt AX, 1 ; check to see if the port is ready jc .1.3 ; keep checking untill it's ready mov AL, 0xD1 ; out 0x64, AL ; tell the kbd controller I want to change the status byte .1.4: ; wait for the controller to be ready xor AX, AX ; nullify AX in AL, 0x64 ; read status byte bt AX, 1 ; see if it's busy jc .1.4 ; and if it is, repeat pop AX ; get the value we stored earlier or AL, 00000010b ; turn on the A20 enable bit out 60h, AL ; send the byte to the controller .1.5: ; send command to read output port xor AX, AX ; nullify AX in AL, 0x64 ; check the kbd status bt AX, 1 ; ..... jc .1.5 ; if it's not, check again mov AL, 0xD0 ; command to read port output out 0x64, AL ; send the command .1.6: ; get the info xor AX, AX ; nullify AX in AL, 0x64 ; get port status bt AX, 0 ; jnc .1.6 ; keep going till it's ready xor AX, AX ; nullify AX in AL, 0x60 ; get the data from the port bt AX, 1 ; is the A20 bit set?? jc .success ; success!!! w00t!!! loop .1 ; try 5 times ; failure code here sti ; enable interrupts mov SI, .failmsg call strout ; display the failure message popa ; return the registers back to the way they were hlt ; halt cpu operation ret .success: sti ; enable interrupts mov SI, .successmsg call strout ; display the success message popa ; return the registers back to the way they were ret .msg db "Enableing A20 gate: ",0 .failmsg db "Failed enabeling the A20 gate, halting cpu operations. you may turn off your pc.",13,10,0 .successmsg db "A20 gate enabled successfully.",13,10,0 ;------- _________________ ____________________ my computer lags so much, that when I move the volume dial on my speakers, it takes several seconds for me to hear the difference |
|||
24 Mar 2005, 00:32 |
|
Dex4u 24 Mar 2005, 04:26
The most important thing, is that you got it to work .
|
|||
24 Mar 2005, 04:26 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.