Subversion Repositories HelenOS

Rev

Rev 4127 | Rev 4346 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4127 Rev 4128
Line 1... Line 1...
1
#ifdef CONFIG_FB
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
	
2
	mov $vesa_init, %esi
9
	mov $vesa_init, %esi
3
	mov $VESA_INIT_SEGMENT << 4, %edi
10
	mov $VESA_INIT_SEGMENT << 4, %edi
4
	mov $e_vesa_init - vesa_init, %ecx
11
	mov $e_vesa_init - vesa_init, %ecx
5
	rep movsb
12
	rep movsb
6
	
13
	
-
 
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
	
-
 
47
	mov $VESA_INIT_SEGMENT << 4, %edi
-
 
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
	
7
	mov $VESA_INIT_SEGMENT << 4, %edi
70
	mov $VESA_INIT_SEGMENT << 4, %edi
8
	jmpl *%edi
71
	jmpl *%edi
9
	
72
	
10
	vesa_meeting_point:
73
	vesa_meeting_point:
-
 
74
		# returned back to protected mode
-
 
75
		
11
		mov %esi, KA2PA(vesa_ph_addr)
76
		mov %esi, KA2PA(vesa_ph_addr)
12
		mov %di, KA2PA(vesa_height)
77
		mov %di, KA2PA(vesa_height)
13
		shr $16, %edi
78
		shr $16, %edi
14
		mov %di, KA2PA(vesa_width)
79
		mov %di, KA2PA(vesa_width)
15
		mov %bx, KA2PA(vesa_scanline)
80
		mov %bx, KA2PA(vesa_scanline)