Subversion Repositories HelenOS

Rev

Rev 4128 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4127 decky 1
#ifdef CONFIG_FB
4128 decky 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
 
4127 decky 9
	mov $vesa_init, %esi
10
	mov $VESA_INIT_SEGMENT << 4, %edi
11
	mov $e_vesa_init - vesa_init, %ecx
12
	rep movsb
13
 
4128 decky 14
	# check for GRUB command line
15
 
16
	mov grub_eax, %eax
17
	cmp $MULTIBOOT_LOADER_MAGIC, %eax
18
	jne no_cmdline
19
 
20
	mov grub_ebx, %ebx
21
	mov (%ebx), %eax
22
	bt $MBINFO_BIT_CMDLINE, %eax
23
	jnc no_cmdline
24
 
25
	# skip the kernel path in command line
26
 
27
	mov MBINFO_OFFSET_CMDLINE(%ebx), %esi
28
 
29
	skip_loop:
30
		lodsb
31
 
32
		cmp $0, %al
33
		je no_cmdline
34
 
35
		cmp $' ', %al
36
		je skip_loop_done
37
 
38
		jmp skip_loop
39
	skip_loop_done:
40
 
41
	mov (%esi), %al
42
	cmp $0, %al
43
	je no_cmdline
44
 
45
	# copy at most 23 characters from command line
46
 
4127 decky 47
	mov $VESA_INIT_SEGMENT << 4, %edi
4128 decky 48
	add $default_mode - vesa_init, %edi
49
	mov $23, %ecx
50
 
51
	cmd_loop:
52
		lodsb
53
		stosb
54
 
55
		cmp $0, %al
56
		je cmd_loop_done
57
 
58
		loop cmd_loop
59
	cmd_loop_done:
60
 
61
	# zero termination
62
 
63
	xor %eax, %eax
64
	stosb
65
 
66
	no_cmdline:
67
 
68
	# jump to the real mode
69
 
70
	mov $VESA_INIT_SEGMENT << 4, %edi
4127 decky 71
	jmpl *%edi
72
 
73
	vesa_meeting_point:
4128 decky 74
		# returned back to protected mode
75
 
4127 decky 76
		mov %esi, KA2PA(vesa_ph_addr)
77
		mov %di, KA2PA(vesa_height)
78
		shr $16, %edi
79
		mov %di, KA2PA(vesa_width)
80
		mov %bx, KA2PA(vesa_scanline)
81
		shr $16, %ebx
82
		mov %bx, KA2PA(vesa_bpp)
83
#endif