File tree 1 file changed +29
-1
lines changed
1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 7
7
# the bootloader from disk , and jumps to stage_2.
8
8
9
9
_start:
10
+ # Try VESA
11
+ mov ax , 0x9000
12
+ mov es , ax
13
+ mov di , 0
14
+ mov ax , 0x4f00
15
+ int 0x10
16
+ cmp ax , 0x004f
17
+ jne zero
18
+ # Check VESA version 2 or 3
19
+ mov ax , es : [ di + 4 ]
20
+ cmp ax , 0x0300
21
+ je init_vesa
22
+ cmp ax , 0x0200
23
+ jne zero
24
+ # Hard coded 800x600x16bit mode ; this gets us the PHY-addr of the FB
25
+ init_vesa:
26
+ mov ax , 0x4f01
27
+ mov cx , 0x114
28
+ mov di , VESAInfo
29
+ int 0x10
30
+
31
+ mov ax , 0x4f02
32
+ mov bx , 0x4114
33
+ int 0x10
34
+
35
+ zero:
10
36
# zero segment registers
11
37
xor ax , ax
12
38
mov ds , ax
@@ -35,7 +61,6 @@ enable_a20:
35
61
out 0x92 , al
36
62
enable_a20_after:
37
63
38
-
39
64
enter_protected_mode:
40
65
# clear interrupts
41
66
cli
@@ -231,3 +256,6 @@ dap_start_lba:
231
256
232
257
.org 510
233
258
. word 0xaa55 # magic number for bootable disk
259
+
260
+ VESAInfo:
261
+ .space 256 , 0
You can’t perform that action at this time.
0 commit comments