Making some tests at home, I found that line a20 seems to be already enabled on some newer PCs and VMs.
I tested the following code on qemu, bochs, virtualbox, my (real) eee-pc 701 and my not old home pc. I assume the BIOS version are relevant here, but I don't know how I see their versions.
(WARNING: Code in AT&T syntax)
Code: Select all
mov $0x0000, %ax
mov %ax, %ds
movw $0xAA55, %ax
movw $0x7DFE, %bx
movw (%bx), %bx
cmpw %ax, %bx
jnz not_equal
movw $equal_str, %si
call print_msg
jmp done
not_equal:
movw $not_equal_str, %si
call print_msg
done:
Print procedure is not shown here, but is just the basic BIOS interrupt 0x10.
The result here is "equal" to all tested machines and VMs.
Then, if I run this code:
Code: Select all
movw $0xFFFF, %ax
movw %ax, %ds
movw $0x7E0E, %bx
movw (%bx), %bx
movw $0x0000, %ax
movw %ax, %ds
movw $0xAA55, %ax
cmpw %ax, %bx
jnz not_equal2
movw $equal_str, %si
call print_msg
jmp done2
not_equal2:
movw $not_equal_str, %si
call print_msg
done2:
The result here is "not equal" to all tested machines and VMs.
First, I thought my code was wrong, but in a quick test, I add this "disable a20 line" code:
Code: Select all
mov $0x2400, %ax
int $0x15
Could someone else test those codes in some other PCs? Or can someone point what I'm doing wrong?
My theory is that newer PCs come with a BIOS that already set um a20 for us, so this is not necessary anymore.