summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-03-18 04:33:22 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2013-03-18 04:33:22 (GMT)
commit5169e4e2b35b5364bae129bd14cc1ac8e9cb95b5 (patch)
treee8930f913ff566c4743462ba2113caf76d30b9f0
parent507fab0b8b1ce1ed19a1e5c1138d71c2c58f4f1e (diff)
downloadvirtio9p-5169e4e2b35b5364bae129bd14cc1ac8e9cb95b5.zip
virtio9p-5169e4e2b35b5364bae129bd14cc1ac8e9cb95b5.tar.gz
virtio9p-5169e4e2b35b5364bae129bd14cc1ac8e9cb95b5.tar.bz2
virtio9p-5169e4e2b35b5364bae129bd14cc1ac8e9cb95b5.tar.xz
Check if we are in PM before poking around for VDS
Virtual DMA Services (VDS) only make sense if we are in protected mode (typically V86 mode, of course); the lmsw instruction is an unprivileged way to query the bottom half of CR0, which includes the PE bit.
-rw-r--r--start.asm4
1 files changed, 4 insertions, 0 deletions
diff --git a/start.asm b/start.asm
index 64c1bf6..45e80b3 100644
--- a/start.asm
+++ b/start.asm
@@ -537,6 +537,10 @@ configure_vring:
printmsg ":"
pushw vring_desc
call printhex4
+
+ lmsw %ax /* If we are not in protected mode = no VDS */
+ shrw $1,%ax
+ jnc vring_mapped
pushw %es
movw $0x354b,%ax /* Read int $0x4b vector */