3
#define MULTIBOOT_LOADER_MAGIC 0x2BADB002
4
#define MBINFO_BIT_CMDLINE 2
5
#define MBINFO_OFFSET_CMDLINE 16
7
# copy real mode VESA initialization code
10
mov $VESA_INIT_SEGMENT << 4, %edi
11
mov $e_vesa_init - vesa_init, %ecx
14
# check for GRUB command line
17
cmp $MULTIBOOT_LOADER_MAGIC, %eax
22
bt $MBINFO_BIT_CMDLINE, %eax
25
# skip the kernel path in command line
27
mov MBINFO_OFFSET_CMDLINE(%ebx), %esi
54
# copy at most 23 characters from command line
56
mov $VESA_INIT_SEGMENT << 4, %edi
57
add $default_mode - vesa_init, %edi
77
# jump to the real mode
79
mov $VESA_INIT_SEGMENT << 4, %edi
83
# returned back to protected mode
85
mov %ax, KA2PA(vesa_scanline)
87
mov %ax, KA2PA(vesa_bpp)
89
mov %bx, KA2PA(vesa_height)
91
mov %bx, KA2PA(vesa_width)
93
mov %dl, KA2PA(vesa_green_pos)
95
mov %dl, KA2PA(vesa_green_mask)
97
mov %dl, KA2PA(vesa_red_pos)
99
mov %dl, KA2PA(vesa_red_mask)
102
mov %dl, KA2PA(vesa_blue_pos)
104
mov %dl, KA2PA(vesa_blue_mask)
106
mov %edi, KA2PA(vesa_ph_addr)