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.
As the thread says I want to move some mem from 1018h to 100000h, but this wont work?! I think that maybe the a20gate is not on, but I do it with this code :
F_Enable_A20:
;==================================================================
;== init Enable HMA access (real mode)
;== assumes interrupts disabled
;==================================================================
push ax
push cx
call A20@wt ;wait 8042 to be ready
mov al,0D1h ;message: writing on port 0x60
out 64h,al ;sent to COMMAND PORT
call A20@wt
mov al,0DFh ;enable 32 bits addresses
out 60h,al
call A20@wt
pop cx
pop ax
ret
A20@wt: xor cx,cx ;WAIT 8042 STATE
A20@00: in al,64h
test al,2
loopne A20@00
jne A20@01
ret
A20@01: add sp,6 ;cleans up the stack
mov ax,code_16
mov ds,ax
mov dx,dat(xmsg4) ;error message !
jmp error
I use now the new code, but it still wont work. The problem is also still the mem move from 1018h to 100000h. I attach my code. Maybe there are some more failures!
Empty_KeyboardBuffer:
xor al, al
in al, 0x64
test al, 0x02
jnz Empty_KeyboardBuffer
ret
Empty_KeyboardBuffer:
xor al, al
in al, 0x64
test al, 0x02
jnz Empty_KeyboardBuffer
ret
I haven't read your code closely... but you can try to enable A20 first with the keyboard controller and then with the system control port A (port 0x92):
; A20 enabled with keyboard controller
call empty_keyb_buf
mov al, 0xd1
out 0x64, al
call empty_keyb_buf
mov al, 0xdf
out 0x60, al
call empty_keyb_buf
; A20 enabled via system control port A
in al, 0x92
or al, 0x02
out 0x92, al