aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/dev/v86asm.s
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2015-03-09 20:21:20 +0100
committerAlex Auvolat <alex@adnab.me>2015-03-09 20:21:20 +0100
commitf6acdfb863038a45709f0dc57884742c51fa6f07 (patch)
treed6a6e5a463ecf7a5f09dbc5a0cb73da32dc2b449 /src/kernel/dev/v86asm.s
parent45e1c020ae18c18ed0b31f7c12c53ccda2e4ac3a (diff)
downloadkogata-f6acdfb863038a45709f0dc57884742c51fa6f07.tar.gz
kogata-f6acdfb863038a45709f0dc57884742c51fa6f07.zip
Implement V86 monitor and VESA mode detection.
Diffstat (limited to 'src/kernel/dev/v86asm.s')
-rw-r--r--src/kernel/dev/v86asm.s39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/kernel/dev/v86asm.s b/src/kernel/dev/v86asm.s
new file mode 100644
index 0000000..da5bc38
--- /dev/null
+++ b/src/kernel/dev/v86asm.s
@@ -0,0 +1,39 @@
+
+[BITS 32]
+
+[GLOBAL v86_asm_enter_v86]
+v86_asm_enter_v86:
+ mov eax, [esp + 4]
+
+ xor ebx, ebx
+ mov bx, [eax + 20] ; get GS
+ push ebx
+ mov bx, [eax + 18] ; get FS
+ push ebx
+ mov bx, [eax + 14] ; get DS
+ push ebx
+ mov bx, [eax + 16] ; get ES
+ push ebx
+ mov bx, [eax + 22] ; get SS
+ push ebx
+ mov bx, [eax + 26] ; get SP
+ push ebx
+ pushf
+ pop ebx
+ or ebx, 20200h
+ push ebx
+ xor ebx, ebx
+ mov bx, [eax + 12] ; get CS
+ push ebx
+ mov bx, [eax + 24] ; get IP
+ push ebx
+
+ mov bx, [eax + 2]
+ mov cx, [eax + 4]
+ mov dx, [eax + 6]
+ mov di, [eax + 8]
+ mov si, [eax + 10]
+ mov ax, [eax]
+
+ iret
+