A20 Line is already enabled
Posted: Mon Jan 28, 2013 8:46 pm
Hello everyone.
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)
This code (I hope) tests if the value from memory 0x0000:0x7DFE = 0x7DFE is 0xAA55 (boot flag), if so, it prints "equal", else it prints "not equal".
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:
This code (I hope) compares the value of memory 0xFFFF:0x7E0E = 0x107DFE with 0xAA55, if so print "equal" else print "not equal".
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:
And for my surprise the result was "equal" and "equal" (so now it seems to wrap around the memory!).
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.
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.