Page 1 of 1

enable a20

Posted: Wed Oct 29, 2008 9:21 am
by mobruan
to enable a20 is just send a comand to the keyboard controller?

Re: enable a20

Posted: Wed Oct 29, 2008 9:47 am
by djmauretto
Ciao,
There are 2 way to enable A20.
1) Standard with Keyboard controller
2) Fast gate A20 with port 92H
You can ask it at BIOS with function 2403H if fast gate A20 is supported
example:

Code: Select all

	MOV	AX,2403H			; QUERY A20 GATE SUPPORT
	INT	15H
	JC	@Not_Supported
if carry flag set this BIOS function is not supported then you can enable A20 in standard
way with keyboard controller.
If this function is supported ,it return in register BX fast gate A20 support with bit 1 set.
In this case you can enable A20 in this way:

Code: Select all

	IN	AL,92H				
	OR	AL,2
	OUT	92H,AL
To enable A20 in standard way with keyboard controller use this:

Code: Select all

	CLI

;===========	
;Wait_INPB
;===========

@@:
	IN	AL,64H				
	TEST	AL,00000010B			
	JNZ	@B				

        MOV	AL,0D0H				
        OUT 	64H,AL				
	
;==========	
;Wait_OUTB
;==========

@@:
	IN	AL,64H				
	TEST	AL,00000001B			
	JZ	@B				
					
	IN	AL,60H				
	OR	AL,00000010B			
	MOV	BL,AL				

;===========	
;Wait_INPB
;===========

@@:
	IN	AL,64H				
	TEST	AL,00000010B			
	JNZ	@B				

        MOV	AL,0D1H				
        OUT 	64H,AL				

;===========	
;Wait_INPB
;===========

@@:
	IN	AL,64H				
	TEST	AL,00000010B			
	JNZ	@B				

	MOV	AL,BL				
	OUT	60H,AL				

	STI

Re: enable a20

Posted: Fri Oct 31, 2008 6:12 am
by jal
mobruan wrote:to enable a20 is just send a comand to the keyboard controller?
Of course, you could have consulted the Wiki before asking questions here.


JAL

Re: enable a20

Posted: Fri Oct 31, 2008 5:55 pm
by Love4Boobies
Or the other threads on this issue. I remember saying something about the BIOS functions myself :)