updated on Sun Jan 15 04:04:02 UTC 2012
[aur-mirror.git] / lilo-gfxmenu / lilo-22.7-vga_inst.diff
blobd5ca3e8be4acba673f0d42300547606a6039a851
1 --- lilo-22.7/bsect.c
2 +++ lilo-22.7/bsect.c
3 @@ -1083,6 +1083,7 @@
4 else if (!strcasecmp(vga,"ext") || !strcasecmp(vga,"extended"))
5 descr->vga_mode = EXTENDED_VGA;
6 else if (!strcasecmp(vga,"ask")) descr->vga_mode = ASK_VGA;
7 + else if (!strcasecmp(vga,"inst")) descr->vga_mode = INST_VGA;
8 else descr->vga_mode = to_number(vga);
9 #endif
11 --- lilo-22.7/lilo.c
12 +++ lilo-22.7/lilo.c
13 @@ -278,6 +278,9 @@
14 case ASK_VGA:
15 printf("ASK\n");
16 break;
17 + case INST_VGA:
18 + printf("INST\n");
19 + break;
20 default:
21 printf("%d (0x%04x)\n",
22 descrs.d.descr[image].vga_mode,
23 --- lilo-22.7/lilo.h
24 +++ lilo-22.7/lilo.h
25 @@ -324,6 +324,7 @@
26 #define FLAG_RETAIN 0x2000 /* retain BMP screen on boot */
28 #define VGA_NOCOVR 0x8000 /* VGA setting not overridden on command line */
29 +#define INST_VGA 0xfff0 /* test for framebuffer at vga=771 */
31 #define SER_DFL_PRM 0xa3 /* default serial parameters: 2400n8 */
33 --- lilo-22.7/second.S
34 +++ lilo-22.7/second.S
35 @@ -1243,7 +1243,8 @@
36 pop bp
37 pop bx
38 or cx,cx ; test CX==0 means all okay
39 - jz doboot
40 + jnz pwfail
41 + br doboot
42 ; fall into pwfail
44 #else
45 @@ -1300,13 +1301,153 @@
46 or cl,cl ! no errors ?
47 jnz pwfail ! no -> fail
48 cmp byte ptr (si),#0 ! at end ?
49 - je doboot ! yes -> continue booting
50 + jne pwfail ! yes -> continue booting
51 + br doboot
52 #endif /* CRC_PASSWORDS */
54 pwfail: mov bx,#msg_pf ! display an error message
55 call say
56 br iloop ! get next input
58 +! Test if the monitor can display a vga mode
59 +! mode in ax, returns ax if success, otherwise 0
60 +montest:
61 + push es
62 + push di
63 + push bx
64 + push cx
65 + push dx
66 + push ax
67 + push #0
68 + pop es
69 + mov di,#0xfc00
70 + xor cx,cx
71 + seg es
72 + mov 0xfc23,cx
73 + xor dx,dx
74 + mov bx,#1
75 + mov ax,#0x4f15
76 + int 0x10
77 + cmp ax,#0x4f
78 + pop ax
79 + jnz monno
80 + mov bx,ax
81 + sub bx,#0x100
82 + cmp bx,#0x1c
83 + jnb monno
84 + seg cs
85 + mov bl,monbits(bx)
86 + xor bh,bh
87 + seg es
88 + mov cx,0xfc23
89 + or cx,cx
90 + jnz nofsc
91 + call fscscan
92 +nofsc: and cl,#0xfe
93 + bt cx,bx
94 + jc monok
95 +monno: xor ax,ax
96 +monok: pop dx
97 + pop cx
98 + pop bx
99 + pop di
100 + pop es
101 + ret
103 +monbits:
104 + .byte 5,5,9,9,14,14,15,15,0,0,0,0,0,0,0,0
105 + .byte 5,5,5,9,9,9,14,14,14,15,15,15
107 +! return in cx the bits for FSC notebooks.
108 +fscscan:
109 + push ds
110 + push si
111 + push di
112 + push ax
113 + push bx
114 + push #0xf000
115 + pop ds
116 + xor di,di
117 +fscnn: cmp dword ptr (di),#0x696a7546
118 + jnz fscn
119 + cmp dword ptr 4(di),#0x20757374
120 + jnz fscn
121 + mov cx,#0x20
122 + xor bx,bx
123 + mov si,di
124 +fscsig: lodsb
125 + add bl,al
126 + dec cx
127 + jnz fscsig
128 + or bl,bl
129 + jnz fscn
130 + mov al,23(di)
131 + and al,#0xf0
132 + jnz fscbad
133 + mov bl,21(di)
134 + and bx,#0xf0
135 + shr bx,#3
136 + seg cs
137 + mov cx,fscbits(bx)
138 + jmp fscok
139 +fscn: add di,#0x10
140 + jnz fscnn
141 +fscbad: xor cx,cx
142 +fscok: pop bx
143 + pop ax
144 + pop di
145 + pop si
146 + pop ds
147 + ret
149 +fscbits:
150 + .word 0,0x0020,0x0200,0x4000,0x8000,0x8000,0,0
151 + .word 0x8000,0,0,0,0,0,0,0
153 +! Test if the driver can display a vga mode
154 +! mode in ax, returns ax if success, otherwise 0
155 +vgatest:
156 + push es
157 + push di
158 + push bx
159 + push cx
160 + push dx
161 + push ax
162 + push #0
163 + pop es
164 + mov cx,ax
165 + xor ax,ax
166 + seg es
167 + mov 0xfc00+0x28,ax
168 + seg es
169 + mov 0xfc00+0x2a,ax
170 + mov di,#0xfc00
171 + mov ax,#0x4f01
172 + int 0x10
173 + cmp ax,#0x4f
174 + jnz vgano
175 + seg es
176 + mov ax,0xfc00
177 + and ax,#0x99
178 + cmp ax,#0x99
179 + jnz vgano
180 + seg es
181 + mov ax,0xfc00+0x28
182 + seg es
183 + or ax,0xfc00+0x2a
184 + jz vgano
185 + pop ax
186 + jmp vgayes
187 +vgano: pop ax
188 + xor ax,ax
189 +vgayes: pop dx
190 + pop cx
191 + pop bx
192 + pop di
193 + pop es
194 + ret
197 ! Boot the image BX points to
199 doboot: mov byte ptr prechr,#61 ! switch to equal sign
200 @@ -1484,8 +1625,33 @@
201 jmp vgaset
202 vganorm:test bx,#FLAG_VGA
203 jz novga
204 -vgaset: seg es
205 - mov [VGA_SET],ax ! magic offset in the boot sector
206 +vgaset:
207 +#ifdef NORMAL_VGA
208 + cmp ax,#INST_VGA
209 + jnz vganoi
210 + mov ax,#0x117
211 + call vgatest
212 + or ax,ax
213 + jz vga2
214 + call montest
215 + or ax,ax
216 + jnz vga3
217 +vga2: mov ax,#0x114
218 + call vgatest
219 + or ax,ax
220 + jz vga4
221 + call montest
222 + or ax,ax
223 + jnz vga3
224 +vga4: mov ax,#0x101
225 + call vgatest
226 + or ax,ax
227 + jnz vga3
228 + mov ax,#NORMAL_VGA-0x0200
229 +vga3: add ax,#0x200
230 +#endif
231 +vganoi: seg es
232 + mov [VGA_SET],ax ! magic offset in the boot sector
233 novga: push bx ! use flags (BX) later
234 test bx,#FLAG_LOCK ! ... lock target ?
235 jnz lockit ! yup -> do it
236 @@ -3295,6 +3461,9 @@
237 .byte 0
238 .word NORMAL_VGA
239 .ascii "NORMAL"
240 + .byte 0
241 + .word INST_VGA
242 + .ascii "INST"
243 .byte 0
244 #endif
245 .word 0