enable a20

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mobruan
Member
Member
Posts: 71
Joined: Thu Oct 09, 2008 8:25 am
Location: Rio de Janeiro - Brazil

enable a20

Post by mobruan »

to enable a20 is just send a comand to the keyboard controller?
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: enable a20

Post 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
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: enable a20

Post 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
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: enable a20

Post by Love4Boobies »

Or the other threads on this issue. I remember saying something about the BIOS functions myself :)
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Post Reply