File tree 4 files changed +47
-2
lines changed
4 files changed +47
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ llvm-tools = "0.1"
28
28
[features ]
29
29
default = []
30
30
vga_320x200 = []
31
+ vesa_800x600 = []
31
32
recursive_page_table = []
32
33
map_physical_memory = []
33
34
Original file line number Diff line number Diff line change @@ -31,9 +31,11 @@ global_asm!(include_str!("stage_2.s"));
31
31
global_asm ! ( include_str!( "e820.s" ) ) ;
32
32
global_asm ! ( include_str!( "stage_3.s" ) ) ;
33
33
34
+ #[ cfg( feature = "vesa_800x600" ) ]
35
+ global_asm ! ( include_str!( "video_mode/vesa_800x600.s" ) ) ;
34
36
#[ cfg( feature = "vga_320x200" ) ]
35
37
global_asm ! ( include_str!( "video_mode/vga_320x200.s" ) ) ;
36
- #[ cfg( not( feature = "vga_320x200" ) ) ]
38
+ #[ cfg( not( any ( feature = "vesa_800x600" , feature = " vga_320x200") ) ) ]
37
39
global_asm ! ( include_str!( "video_mode/vga_text_80x25.s" ) ) ;
38
40
39
41
unsafe fn context_switch ( boot_info : VirtAddr , entry_point : VirtAddr , stack_pointer : VirtAddr ) -> ! {
Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ enable_a20:
35
35
out 0x92 , al
36
36
enable_a20_after:
37
37
38
-
39
38
enter_protected_mode:
40
39
# clear interrupts
41
40
cli
Original file line number Diff line number Diff line change
1
+ . section .boot , "awx"
2
+ .intel_syntax noprefix
3
+ .code16
4
+
5
+ # This code is responsible for enabling VESA graphics while in
6
+ # real mode.
7
+ config_video_mode:
8
+ # Try VESA
9
+ mov ax , 0x9000
10
+ mov es , ax
11
+ mov di , 0
12
+ mov ax , 0x4f00
13
+ int 0x10
14
+ cmp ax , 0x004f
15
+ jne vesa_out
16
+ # Check VESA version 2 or 3
17
+ mov ax , es : [ di + 4 ]
18
+ cmp ax , 0x0300
19
+ je init_vesa
20
+ cmp ax , 0x0200
21
+ jne vesa_out
22
+ # Hard coded 800x600x16bit mode ; this gets us the PHY-addr of the FB
23
+ init_vesa:
24
+ mov ax , 0x4f01
25
+ mov cx , 0x114
26
+ mov di , VESAInfo
27
+ int 0x10
28
+
29
+ mov ax , 0x4f02
30
+ mov bx , 0x4114
31
+ int 0x10
32
+
33
+ vesa_out:
34
+ ret
35
+
36
+ vga_println:
37
+ ret
38
+
39
+ vga_map_frame_buffer:
40
+ ret
41
+
42
+ VESAInfo:
43
+ .space 256 , 0
You can’t perform that action at this time.
0 commit comments