source: mainline/kernel/arch/ia32/src/boot/vesa_prot.inc@ b112055

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since b112055 was 873c681, checked in by Martin Decky <martin@…>, 15 years ago

initial support for early kernel debugging prints
use C comments in C-preprocessed assembler files (to avoid confusion between assembler comments and preprocessor directives)

  • Property mode set to 100644
File size: 1.8 KB
Line 
1#ifdef CONFIG_FB
2
3#define MULTIBOOT_LOADER_MAGIC 0x2BADB002
4#define MBINFO_BIT_CMDLINE 2
5#define MBINFO_OFFSET_CMDLINE 16
6
7 /* Copy real mode VESA initialization code */
8
9 pm_status $status_vesa_copy
10
11 mov $vesa_init, %esi
12 mov $VESA_INIT_SEGMENT << 4, %edi
13 mov $e_vesa_init - vesa_init, %ecx
14 rep movsb
15
16 /* Check for GRUB command line */
17
18 pm_status $status_grub_cmdline
19
20 mov grub_eax, %eax
21 cmp $MULTIBOOT_LOADER_MAGIC, %eax
22 jne no_cmdline
23
24 mov grub_ebx, %ebx
25 mov (%ebx), %eax
26 bt $MBINFO_BIT_CMDLINE, %eax
27 jnc no_cmdline
28
29 /* Skip the kernel path in command line */
30
31 mov MBINFO_OFFSET_CMDLINE(%ebx), %esi
32
33 skip_loop:
34 lodsb
35
36 cmp $0, %al
37 je no_cmdline
38
39 cmp $' ', %al
40 je skip_loop_done
41
42 jmp skip_loop
43 skip_loop_done:
44
45 space_loop:
46 mov (%esi), %al
47
48 cmp $0, %al
49 je no_cmdline
50
51 cmp $' ', %al
52 jne space_loop_done
53
54 inc %esi
55 jmp space_loop
56 space_loop_done:
57
58 /* Copy at most 23 characters from command line */
59
60 mov $VESA_INIT_SEGMENT << 4, %edi
61 add $default_mode - vesa_init, %edi
62 mov $23, %ecx
63
64 cmd_loop:
65 lodsb
66 stosb
67
68 cmp $0, %al
69 je cmd_loop_done
70
71 loop cmd_loop
72 cmd_loop_done:
73
74 /* Zero termination */
75
76 xor %eax, %eax
77 stosb
78
79 no_cmdline:
80
81 /* Jump to the real mode */
82
83 pm_status $status_vesa_real
84
85 mov $VESA_INIT_SEGMENT << 4, %edi
86 jmpl *%edi
87
88 vesa_meeting_point:
89 /* Returned back to protected mode */
90
91 mov %ax, KA2PA(vesa_scanline)
92 shr $16, %eax
93 mov %ax, KA2PA(vesa_bpp)
94
95 mov %bx, KA2PA(vesa_height)
96 shr $16, %ebx
97 mov %bx, KA2PA(vesa_width)
98
99 mov %dl, KA2PA(vesa_green_pos)
100 shr $8, %edx
101 mov %dl, KA2PA(vesa_green_mask)
102 shr $8, %edx
103 mov %dl, KA2PA(vesa_red_pos)
104 shr $8, %edx
105 mov %dl, KA2PA(vesa_red_mask)
106
107 mov %esi, %edx
108 mov %dl, KA2PA(vesa_blue_pos)
109 shr $8, %edx
110 mov %dl, KA2PA(vesa_blue_mask)
111
112 mov %edi, KA2PA(vesa_ph_addr)
113#endif
Note: See TracBrowser for help on using the repository browser.