Subversion Repositories Kolibri OS

Rev

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

Rev 509 Rev 514
Line 1... Line 1...
1
$Revision: 509 $
1
$Revision: 514 $
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;;                                                              ;;
3
;;                                                              ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
5
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
5
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
6
;; Distributed under terms of the GNU General Public License    ;;
6
;; Distributed under terms of the GNU General Public License    ;;
Line 21... Line 21...
21
;==========================================================================
21
;==========================================================================
Line 22... Line 22...
22
 
22
 
23
 
23
 
24
putchar:
24
putchar:
25
; in: al=character
25
; in: al=character
26
    mov    ah, 0Eh
26
        mov     ah, 0Eh
27
    mov    bh, 0
27
        mov     bh, 0
Line 28... Line 28...
28
    int    10h
28
        int     10h
29
    ret
29
        ret
30
 
30
 
31
print:
31
print:
32
; in: si->string
32
; in: si->string
33
    mov    al, 186
33
        mov     al, 186
Line 34... Line 34...
34
    call    putchar
34
        call    putchar
35
    mov    al, ' '
35
        mov     al, ' '
36
    call    putchar
36
        call    putchar
37
 
37
 
38
printplain:
38
printplain:
39
; in: si->string
39
; in: si->string
40
    pusha
40
        pusha
41
    lodsb
41
        lodsb
42
@@:
42
@@:
43
    call    putchar
43
        call    putchar
44
    lodsb
44
        lodsb
Line 45... Line 45...
45
    cmp    al, 0
45
        cmp     al, 0
46
    jnz    @b
46
        jnz     @b
47
    popa
47
        popa
48
    ret
48
        ret
49
 
49
 
50
getkey:
50
getkey:
51
; get number in range [bl,bh] (bl,bh in ['0'..'9'])
51
; get number in range [bl,bh] (bl,bh in ['0'..'9'])
52
; in: bx=range
52
; in: bx=range
53
; out: ax=digit (1..9, 10 for 0)
53
; out: ax=digit (1..9, 10 for 0)
54
    mov    ah, 0
54
        mov     ah, 0
55
    int    16h
55
        int     16h
56
    cmp    al, bl
56
        cmp     al, bl
57
    jb    getkey
57
        jb      getkey
58
    cmp    al, bh
58
        cmp     al, bh
59
    ja    getkey
59
        ja      getkey
60
    push    ax
60
        push    ax
61
    call    putchar
61
        call    putchar
62
    pop    ax
62
        pop     ax
Line 63... Line 63...
63
    and    ax, 0Fh
63
        and     ax, 0Fh
64
    jnz    @f
64
        jnz     @f
65
    mov    al, 10
65
        mov     al, 10
66
@@:
66
@@:
67
    ret
67
        ret
68
 
68
 
Line 69... Line 69...
69
setcursor:
69
setcursor:
70
; in: dl=column, dh=row
70
; in: dl=column, dh=row
71
    mov    ah, 2
71
        mov     ah, 2
72
    mov    bh, 0
72
        mov     bh, 0
73
    int    10h
73
        int     10h
Line 74... Line 74...
74
    ret
74
        ret
75
 
75
 
76
macro _setcursor row,column
76
macro _setcursor row,column
Line 105... Line 105...
105
;
105
;
106
;=========================================================================
106
;=========================================================================
Line 107... Line 107...
107
 
107
 
108
 
108
 
109
start_of_code:
109
start_of_code:
-
 
110
        cld
110
    cld
111
; \begin{diamond}[02.12.2005]
111
; \begin{diamond}[02.12.2005]
112
; if bootloader sets ax = 'KL', then ds:si points to loader block
112
    cmp    ax, 'KL'
113
        cmp     ax, 'KL'
113
    jnz    @f
114
        jnz     @f
114
    mov    word [cs:cfgmanager.loader_block], si
115
        mov     word [cs:cfgmanager.loader_block], si
115
    mov    word [cs:cfgmanager.loader_block+2], ds
116
        mov     word [cs:cfgmanager.loader_block+2], ds
Line 116... Line 117...
116
@@:
117
@@:
-
 
118
; \end{diamond}[02.12.2005]
-
 
119
 
117
; \end{diamond}[02.12.2005]
120
; if bootloader sets cx = 'HA' and dx = 'RD', then bx contains identifier of source hard disk
118
 
121
; (see comment to bx_from_load)
119
    cmp    cx,'HA'						; ïî ðåãèñòðàì îïðåäåëÿåòñÿ çàãðóçêà ñ âèíòà
122
        cmp     cx, 'HA'
120
    jnz    no_hd_load
123
        jnz     no_hd_load
121
    cmp    dx,'RD'
124
        cmp     dx,'RD'
Line 122... Line 125...
122
    jnz    no_hd_load
125
        jnz     no_hd_load
123
    mov    word [cs:bx_from_load], bx		; {SPraid}[13.03.2007]
126
        mov     word [cs:bx_from_load], bx              ; {SPraid}[13.03.2007]
124
no_hd_load:
127
no_hd_load:
125
 
128
 
126
; set up stack
129
; set up stack
127
    mov    ax, 3000h
130
        mov     ax, 3000h
128
    mov    ss, ax
131
        mov     ss, ax
129
    mov    sp, 0EC00h
132
        mov     sp, 0EC00h
130
; set up segment registers
133
; set up segment registers
Line 131... Line 134...
131
    push    cs
134
        push    cs
132
    pop    ds
135
        pop     ds
133
    push    cs
136
        push    cs
Line 134... Line 137...
134
    pop    es
137
        pop     es
135
 
138
 
136
; set videomode
139
; set videomode
137
    mov    ax, 3
140
        mov     ax, 3
138
        int  0x10
141
        int     0x10
139
 
142
 
140
if lang eq ru
143
if lang eq ru
141
 ; Load & set russian VGA font (RU.INC)
144
 ; Load & set russian VGA font (RU.INC)
142
        mov  bp, RU_FNT1         ; RU_FNT1 - First part
145
        mov     bp, RU_FNT1             ; RU_FNT1 - First part
143
          mov  bx,1000h            ; 768 bytes
146
        mov     bx, 1000h               ; 768 bytes
144
          mov  cx,30h              ; 48 symbols
147
        mov     cx, 30h                 ; 48 symbols
145
          mov  dx,80h              ; 128 - position of first symbol
148
        mov     dx, 80h                 ; 128 - position of first symbol
146
        mov  ax,1100h
149
        mov     ax, 1100h
147
          int  10h
150
        int     10h
148
 
151
 
149
        mov  bp,RU_FNT2          ; RU_FNT2 -Second part
152
        mov     bp, RU_FNT2             ; RU_FNT2 -Second part
150
        mov  bx,1000h            ; 512 bytes
153
        mov     bx, 1000h               ; 512 bytes
151
        mov  cx,20h              ; 32 symbols
154
        mov     cx, 20h                 ; 32 symbols
152
        mov  dx,0E0h             ; 224 - position of first symbol
155
        mov     dx, 0E0h                ; 224 - position of first symbol
153
        mov  ax,1100h
156
        mov     ax, 1100h
154
          int  10h
157
        int     10h
155
 ; End set VGA russian font
158
 ; End set VGA russian font
156
else if lang eq et
159
else if lang eq et
157
        mov  bp,ET_FNT          ; ET_FNT1
160
        mov     bp, ET_FNT              ; ET_FNT1
Line 158... Line 161...
158
        mov  bx,1000h           ;
161
        mov     bx, 1000h               ;
159
        mov  cx,255             ; 256 symbols
162
        mov     cx, 255                 ; 256 symbols
160
        mov  dx,0h              ; 0 - position of first symbol
163
        xor     dx, dx                  ; 0 - position of first symbol
161
        mov  ax,1100h
164
        mov     ax, 1100h
162
        int  10h
165
        int     10h
Line 163... Line 166...
163
end if
166
end if
164
 
167
 
165
; draw frames
168
; draw frames
166
    push    0xb800
169
        push    0xb800
167
    pop    es
170
        pop     es
168
    xor    di, di
171
        xor     di, di
169
    mov    ah, 1*16+15
172
        mov     ah, 1*16+15
170
 
173
 
171
; draw top
174
; draw top
172
    mov    si, d80x25_top
175
        mov     si, d80x25_top
173
    mov    cx, d80x25_top_num * 80
176
        mov     cx, d80x25_top_num * 80
174
@@:
-
 
175
    lodsb
177
@@:
176
    stosw
178
        lodsb
177
    loop    @b
179
        stosw
178
; draw spaces
180
        loop    @b
179
    mov    si, space_msg
181
; draw spaces
180
    mov    cx, 25 - d80x25_top_num - d80x25_bottom_num
182
        mov     si, space_msg
181
dfl1:
183
        mov     dx, 25 - d80x25_top_num - d80x25_bottom_num
182
    push    cx
184
dfl1:
183
    push    si
185
        push    si
184
    mov    cx, 80
186
        mov     cx, 80
185
@@:
187
@@:
186
    lodsb
188
        lodsb
187
    stosw
189
        stosw
188
    loop    @b
190
        loop    @b
189
    pop    si
191
        pop     si
190
    pop    cx
192
        dec     dx
Line 191... Line 193...
191
    loop    dfl1
193
        jnz     dfl1
Line 192... Line 194...
192
; draw bottom
194
; draw bottom
Line 193... Line 195...
193
    mov    si, d80x25_bottom
195
        mov     si, d80x25_bottom
Line 194... Line 196...
194
    mov    cx, d80x25_bottom_num * 80
196
        mov     cx, d80x25_bottom_num * 80
195
@@:
197
@@:
196
    lodsb
198
        lodsb
197
    stosw
199
        stosw
198
    loop    @b
200
        loop    @b
199
 
201
 
200
    mov    byte [space_msg+80], 0    ; now space_msg is null terminated
202
        mov     byte [space_msg+80], 0    ; now space_msg is null terminated
201
 
203
 
202
    _setcursor d80x25_top_num,0
204
        _setcursor d80x25_top_num,0
203
 
205
 
204
 
206
 
205
; TEST FOR 386+
207
; TEST FOR 386+
206
 
208
 
207
    mov    bx, 0x4000
209
        mov     bx, 0x4000
208
        pushf
210
        pushf
209
        pop     ax
211
        pop     ax
210
        mov     dx,ax
212
        mov     dx, ax
211
        xor     ax,bx
213
        xor     ax, bx
Line 212... Line 214...
212
        push    ax
214
        push    ax
213
        popf
215
        popf
214
        pushf
216
        pushf
Line 215... Line 217...
215
        pop     ax
217
        pop     ax
216
        and     ax,bx
218
        and     ax, bx
Line 217... Line 219...
217
        and     dx,bx
219
        and     dx, bx
218
        cmp     ax,dx
220
        cmp     ax, dx
219
        jnz     cpugood
221
        jnz     cpugood
220
        mov     si,not386
222
        mov     si, not386
Line 245... Line 247...
245
; class 1 = mass storage
247
; class 1 = mass storage
246
; subclass 1 = IDE controller
248
; subclass 1 = IDE controller
247
; a) class 1, subclass 1, programming interface 0x80
249
; a) class 1, subclass 1, programming interface 0x80
248
        mov     ax, 0xB103
250
        mov     ax, 0xB103
249
        mov     ecx, 1*10000h + 1*100h + 0x80
251
        mov     ecx, 1*10000h + 1*100h + 0x80
250
        mov     si, 0   ; device index = 0
252
        xor     si, si  ; device index = 0
251
        int     0x1A
253
        int     0x1A
252
        jnc     .found
254
        jnc     .found
253
; b) class 1, subclass 1, programming interface 0x8A
255
; b) class 1, subclass 1, programming interface 0x8A
254
        mov     ax, 0xB103
256
        mov     ax, 0xB103
255
        mov     ecx, 1*10000h + 1*100h + 0x8A
257
        mov     ecx, 1*10000h + 1*100h + 0x8A
256
        mov     si, 0   ; device index = 0
258
        xor     si, si  ; device index = 0
257
        int     0x1A
259
        int     0x1A
258
        jnc     .found
260
        jnc     .found
259
; c) class 1, subclass 1, programming interface 0x85
261
; c) class 1, subclass 1, programming interface 0x85
260
        mov     ax, 0xB103
262
        mov     ax, 0xB103
261
        mov     ecx, 1*10000h + 1*100h + 0x85
263
        mov     ecx, 1*10000h + 1*100h + 0x85
262
        mov     si, 0
264
        xor     si, si
263
        int     0x1A
265
        int     0x1A
264
        jc      .nopci
266
        jc      .nopci
265
.found:
267
.found:
266
; get memory base
268
; get memory base
267
        mov     ax, 0xB10A
269
        mov     ax, 0xB10A
Line 271... Line 273...
271
        and     cx, 0xFFF0      ; clear address decode type
273
        and     cx, 0xFFF0      ; clear address decode type
272
        mov     [es:0x9031], cx
274
        mov     [es:0x9031], cx
273
.nopci:
275
.nopci:
274
; \end{Mario79}
276
; \end{Mario79}
Line 275... Line 277...
275
 
277
 
276
    mov   al,0xf6         ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå
278
        mov     al, 0xf6        ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå
277
    out   0x60,al
279
        out     0x60, al
278
    xor   cx,cx
280
        xor     cx, cx
279
wait_loop:       ; variant 2
281
wait_loop:       ; variant 2
280
; reading state of port of 8042 controller
282
; reading state of port of 8042 controller
281
        in      al,64h
283
        in      al, 64h
282
        and     al,00000010b  ; ready flag
284
        and     al, 00000010b  ; ready flag
283
; wait until 8042 controller is ready
285
; wait until 8042 controller is ready
Line 284... Line 286...
284
        loopnz  wait_loop
286
        loopnz  wait_loop
285
 
-
 
286
; --------------- APM ---------------------
-
 
287
    push    0
287
 
288
    pop    es
288
; --------------- APM ---------------------
289
    mov    word [es : 0x9044], 0        ; ver = 0.0 (APM not found)
289
        and     word [es:0x9044], 0     ; ver = 0.0 (APM not found)
290
    mov    ax, 0x5300
290
        mov     ax, 0x5300
291
    xor    bx, bx
291
        xor     bx, bx
292
    int    0x15
292
        int     0x15
293
    jc    apm_end                ; APM not found
293
        jc      apm_end                 ; APM not found
294
    test    cx, 2
294
        test    cx, 2
295
    jz    apm_end                ; APM 32-bit protected-mode interface not supported
295
        jz      apm_end                 ; APM 32-bit protected-mode interface not supported
296
    mov    [es : 0x9044], ax        ; Save APM Version
296
        mov     [es:0x9044], ax         ; Save APM Version
297
    mov    [es : 0x9046], cx        ; Save APM flags
297
        mov     [es:0x9046], cx         ; Save APM flags
298
 
298
 
299
    ; Write APM ver ----
299
        ; Write APM ver ----
300
    and    ax, 0xf0f
300
        and     ax, 0xf0f
301
    add    ax, '00'
301
        add     ax, '00'
302
    mov    si, msg_apm
302
        mov     si, msg_apm
303
    mov    [si + 5], ah
303
        mov     [si + 5], ah
304
    mov    [si + 7], al
304
        mov     [si + 7], al
305
    _setcursor 0, 3
305
        _setcursor 0, 3
306
    call    printplain
306
        call    printplain
307
    ; ------------------
307
        ; ------------------
308
 
308
 
309
    mov    ax, 0x5304            ; Disconnect interface
309
        mov     ax, 0x5304              ; Disconnect interface
310
    xor    bx, bx
310
        xor     bx, bx
311
    int    0x15
311
        int     0x15
312
    mov    ax, 0x5303            ; Connect 32 bit mode interface
312
        mov     ax, 0x5303              ; Connect 32 bit mode interface
313
    xor    bx, bx
-
 
314
    int    0x15
-
 
315
 
-
 
316
    push 0
313
        xor     bx, bx
317
    pop es
314
        int     0x15
318
 
315
 
319
    mov [es:0x9040], ebx
316
        mov     [es:0x9040], ebx
320
    mov [es:0x9050], ax
317
        mov     [es:0x9050], ax
Line 321... Line 318...
321
    mov [es:0x9052], cx
318
        mov     [es:0x9052], cx
322
    mov [es:0x9054], dx
319
        mov     [es:0x9054], dx
Line 323... Line 320...
323
 
320
 
Line 324... Line -...
324
apm_end:
-
 
325
        _setcursor d80x25_top_num, 0
-
 
326
 
321
apm_end:
327
; DISPLAY VESA INFORMATION
322
        _setcursor d80x25_top_num, 0
328
 
323
 
329
    push    0
324
; DISPLAY VESA INFORMATION
330
    pop    es
325
 
331
        mov     ax,0x4f00
326
        mov     ax, 0x4f00
332
        mov     di,0xa000
-
 
333
        int     0x10
-
 
334
        cmp     ax,0x004f
-
 
335
        mov    si, novesa
327
        mov     di, 0xa000
336
        jnz    @f
328
        int     0x10
337
        mov bx, word [es:di+0x12]
329
        cmp     ax, 0x004f
338
        shl ebx,16
330
        mov     si, novesa
339
        mov [es:0x9050], ebx
331
        jnz     @f
340
        mov     ax,[es:di+4]
332
        mov     ax, [es:di+4]
Line 341... Line 333...
341
        add     ax,'0'*256+'0'
333
        add     ax, '0'*256+'0'
342
        mov    si,vervesa
334
        mov     si, vervesa
343
        mov     [si+vervesa_off], ah
335
        mov     [si+vervesa_off], ah
344
        mov     [si+vervesa_off+2], al
336
        mov     [si+vervesa_off+2], al
345
@@:     call    print
337
@@:     call    print
346
 
338
 
347
; \begin{diamond}[30.11.2005]
339
; \begin{diamond}[30.11.2005]
348
cfgmanager:
340
cfgmanager:
349
; settings:
341
; settings:
350
; a) preboot_graph = graphical mode
342
; a) preboot_graph = graphical mode
351
;    preboot_gprobe = probe this mode?
343
;    preboot_gprobe = probe this mode?
352
; b) preboot_dma_write  = use DMA write?
344
; b) preboot_dma  = use DMA access?
353
; c) preboot_vrrm = use VRR?
345
; c) preboot_vrrm = use VRR?
354
; d) preboot_device = from what boot?
346
; d) preboot_device = from what boot?
355
    mov    di, preboot_graph
347
        mov     di, preboot_graph
356
; check bootloader block
348
; check bootloader block
357
    cmp    [.loader_block], -1
349
        cmp     [.loader_block], -1
358
    jz    .noloaderblock
350
        jz      .noloaderblock
359
    les    bx, [.loader_block]
351
        les     bx, [.loader_block]
360
    cmp    byte [es:bx], 1
352
        cmp     byte [es:bx], 1
361
    mov    si, loader_block_error
353
        mov     si, loader_block_error
362
    jnz    sayerr
354
        jnz     sayerr
363
    test    byte [es:bx+1], 1
355
        test    byte [es:bx+1], 1
364
    jz    @f
356
        jz      @f
365
; image in memory present
357
; image in memory present
366
    cmp    [di+preboot_device-preboot_graph], 0
358
        cmp     [di+preboot_device-preboot_graph], 0
367
    jnz    @f
359
        jnz     @f
368
    mov    [di+preboot_device-preboot_graph], 3
360
        mov     [di+preboot_device-preboot_graph], 3
369
@@:
361
@@:
370
.noloaderblock:
362
.noloaderblock:
371
; determine default settings
363
; determine default settings
372
    mov    [.bSettingsChanged], 0
364
        mov     [.bSettingsChanged], 0
373
    cmp    byte [di], 0
365
        cmp     byte [di], 0
374
    jnz    .preboot_gr_end
366
        jnz     .preboot_gr_end
375
    mov    [di+preboot_gprobe-preboot_graph], 0
367
        mov     [di+preboot_gprobe-preboot_graph], 0
376
    mov    al, [vervesa+vervesa_off]
368
        mov     al, [vervesa+vervesa_off]
377
    cmp    al, 'x'
369
        cmp     al, 'x'
378
    jz    .novesa
370
        jz      .novesa
379
    cmp    al, '1'
371
        cmp     al, '1'
380
    jz    .vesa12
372
        jz      .vesa12
381
    mov    [di+preboot_gprobe-preboot_graph], 2
373
        mov     [di+preboot_gprobe-preboot_graph], 2
382
    mov    al, 3
374
        mov     al, 3
383
    jmp    @f
375
        jmp     @f
384
.vesa12:
376
.vesa12:
385
    mov    al, 7
377
        mov     al, 7
-
 
378
        jmp     @f
386
    jmp    @f
379
.novesa:
387
.novesa:
380
        mov     al, 10
388
    mov    al, 10
381
@@:
389
@@:
382
        mov     [di], al
390
    mov    [di], al
383
.preboot_gr_end:
391
.preboot_gr_end:
384
; following 6 lines set variables to 1 if its current value is 0
392
    cmp    [di+preboot_dma_write-preboot_graph], 1
385
        cmp     [di+preboot_dma-preboot_graph], 1
393
    adc    [di+preboot_dma_write-preboot_graph], 0
386
        adc     [di+preboot_dma-preboot_graph], 0
394
    cmp    [di+preboot_vrrm-preboot_graph], 1
387
        cmp     [di+preboot_vrrm-preboot_graph], 1
395
    adc    [di+preboot_vrrm-preboot_graph], 0
388
        adc     [di+preboot_vrrm-preboot_graph], 0
396
    cmp    [di+preboot_device-preboot_graph], 1
389
        cmp     [di+preboot_device-preboot_graph], 1
397
    adc    [di+preboot_device-preboot_graph], 0
390
        adc     [di+preboot_device-preboot_graph], 0
398
; notify user
391
; notify user
399
    mov    si, linef
392
        mov     si, linef
400
    call    print
393
        call    print
401
    mov    si, start_msg
394
        mov     si, start_msg
402
    call    print
395
        call    print
403
    mov    si, time_msg
396
        mov     si, time_msg
404
    call    print
397
        call    print
405
; get start time
398
; get start time
406
    call    .gettime
399
        call    .gettime
407
    mov    [.starttime], eax
400
        mov     [.starttime], eax
408
    mov    word [.timer], .newtimer
401
        mov     word [.timer], .newtimer
409
    mov    word [.timer+2], cs
402
        mov     word [.timer+2], cs
410
.printcfg:
403
.printcfg:
411
    _setcursor 9,0
404
        _setcursor 9,0
412
    mov    si, current_cfg_msg
405
        mov     si, current_cfg_msg
413
    call    print
406
        call    print
414
    mov    si, curvideo_msg
407
        mov     si, curvideo_msg
415
    call    print
408
        call    print
416
    mov    al, [preboot_graph]
409
        mov     al, [preboot_graph]
417
    cmp    al, 8
410
        cmp     al, 8
418
    ja    .pnovesa
411
        ja      .pnovesa
419
    mov    dl, al
412
        mov     dl, al
420
    and    eax, 3
413
        and     eax, 3
421
    mov    si, [modes_msg+eax*2]
414
        mov     si, [modes_msg+eax*2]
422
    call    printplain
415
        call    printplain
423
    mov    si, modevesa20
416
        mov     si, modevesa20
424
    cmp    dl, 4
417
        cmp     dl, 4
425
    jbe    @f
418
        jbe     @f
426
    mov    si, modevesa12
419
        mov     si, modevesa12
427
@@:
420
@@:
428
    call    printplain
421
        call    printplain
429
    cmp    dl, 4
422
        cmp     dl, 4
430
    ja    .x
423
        ja      .x
431
    mov    si, probeno_msg
424
        mov     si, probeno_msg
432
    cmp    [preboot_gprobe], 2
425
        cmp     [preboot_gprobe], 2
433
    jnz    @f
426
        jnz     @f
434
    mov    si, probeok_msg
427
        mov     si, probeok_msg
435
@@:
428
@@:
436
    call    printplain
429
        call    printplain
437
.x:
430
.x:
438
    jmp    .c
431
        jmp     .c
439
.pnovesa:
432
.pnovesa:
440
    cmp    al, 9
433
        cmp     al, 9
441
    mov    si, mode9
434
        mov     si, mode9
442
    jz    @b
435
        jz      @b
-
 
436
        mov     si, mode10
443
    mov    si, mode10
437
        jmp     @b
444
    jmp    @b
438
.c:
-
 
439
        mov     si, linef
-
 
440
        call    printplain
-
 
441
        mov     si, dma_msg
-
 
442
        call    print
-
 
443
        cmp     [preboot_dma], 2
-
 
444
        mov     si, on_msg
445
.c:
445
        jb      @f
446
    mov    si, linef
446
        mov     si, off_msg
447
    call    printplain
447
        ja      @f
448
    mov    si, dma_msg
448
        mov     si, readonly_msg
449
    cmp    [preboot_dma_write], 1
449
@@:
450
    call    .say_on_off
450
        call    printplain
451
    mov    si, vrrm_msg
451
        mov     si, vrrm_msg
452
    cmp    [preboot_vrrm], 1
452
        cmp     [preboot_vrrm], 1
453
    call    .say_on_off
453
        call    .say_on_off
454
    mov    si, preboot_device_msg
454
        mov     si, preboot_device_msg
455
    call    print
455
        call    print
456
    mov    al, [preboot_device]
456
        mov     al, [preboot_device]
457
    and    eax, 3
457
        and     eax, 3
458
    mov    si, [preboot_device_msgs+eax*2]
458
        mov     si, [preboot_device_msgs+eax*2]
459
    call    printplain
459
        call    printplain
460
.wait:
460
.wait:
461
    _setcursor 25,0        ; out of screen
461
        _setcursor 25,0         ; out of screen
462
; set timer interrupt handler
462
; set timer interrupt handler
463
    cli
463
        cli
464
    push    0
464
        push    0
465
    pop    es
465
        pop     es
466
    mov    eax, [es:8*4]
466
        mov     eax, [es:8*4]
467
    mov    [.oldtimer], eax
467
        mov     [.oldtimer], eax
468
    mov    eax, [.timer]
468
        mov     eax, [.timer]
469
    mov    [es:8*4], eax
469
        mov     [es:8*4], eax
470
    sti
470
        sti
471
; wait for keypressed
471
; wait for keypressed
472
    mov    ah, 0
472
        mov     ah, 0
473
    int    16h
473
        int     16h
474
    push    ax
474
        push    ax
475
; restore timer interrupt
475
; restore timer interrupt
476
    push    0
476
        push    0
477
    pop    es
477
        pop     es
478
    mov    eax, [.oldtimer]
478
        mov     eax, [.oldtimer]
479
    mov    [es:8*4], eax
479
        mov     [es:8*4], eax
480
    mov    [.timer], eax
480
        mov     [.timer], eax
481
    _setcursor 7,0
481
        _setcursor 7,0
482
    mov    si, space_msg
482
        mov     si, space_msg
483
    call    printplain
483
        call    printplain
484
    pop    ax
484
        pop     ax
485
; switch on key
485
; switch on key
486
    cmp    al, 13
486
        cmp     al, 13
487
    jz    .continue
487
        jz      .continue
488
    or    al, 20h
488
        or      al, 20h
489
    cmp    al, 'a'
489
        cmp     al, 'a'
490
    jz    .change_a
490
        jz      .change_a
491
    cmp    al, 'b'
491
        cmp     al, 'b'
492
    jz    .change_b
492
        jz      .change_b
493
    cmp    al, 'c'
493
        cmp     al, 'c'
494
    jz    .change_c
494
        jz      .change_c
495
    cmp    al, 'd'
495
        cmp     al, 'd'
496
    jnz    .wait
496
        jnz     .wait
497
    _setcursor 15,0
497
        _setcursor 15,0
498
    mov     si,bdev
498
        mov     si, bdev
499
    call    print
499
        call    print
500
    mov     bx,'13'
500
        mov     bx, '13'
501
    call    getkey
501
        call    getkey
502
    mov    [preboot_device], al
502
        mov     [preboot_device], al
503
    _setcursor 13,0
503
        _setcursor 13,0
504
.d:
504
.d:
505
    mov    [.bSettingsChanged], 1
505
        mov     [.bSettingsChanged], 1
506
    mov    si, space_msg
506
        mov     si, space_msg
507
    call    printplain
507
        call    printplain
508
    _setcursor 15,0
508
        _setcursor 15,0
509
    mov    cx, 6
509
        mov     cx, 6
510
@@:
510
@@:
511
    call    printplain
511
        call    printplain
512
    loop    @b
512
        loop    @b
513
    jmp    .printcfg
513
        jmp    .printcfg
514
.change_a:
514
.change_a:
515
    _setcursor 15,0
515
        _setcursor 15,0
516
    mov    si, gr_mode
516
        mov     si, gr_mode
517
    call    printplain
517
        call    printplain
518
    mov     bx, '09'
518
        mov     bx, '09'
519
    call    getkey
519
        call    getkey
520
    mov    [preboot_graph], al
520
        mov     [preboot_graph], al
521
    cmp    al, 4
521
        cmp     al, 4
522
    ja    @f
522
        ja      @f
523
    mov    si, probetext
523
        mov     si, probetext
524
    call    printplain
524
        call    printplain
525
    mov    bx, '12'
525
        mov     bx, '12'
526
    call    getkey
526
        call    getkey
527
    mov    [preboot_gprobe], al
527
        mov     [preboot_gprobe], al
528
@@:
528
@@:
529
    _setcursor 10,0
529
        _setcursor 10,0
530
    jmp    .d
530
        jmp    .d
531
.change_b:
531
.change_b:
532
    _setcursor 15,0
532
        _setcursor 15,0
533
    mov    si, ask_dma
533
        mov     si, ask_dma
534
    call    print
534
        call    print
535
    mov    bx, '12'
535
        mov     bx, '13'
536
    call    getkey
536
        call    getkey
537
    mov    [preboot_dma_write], al
537
        mov     [preboot_dma], al
538
    _setcursor 11,0
538
        _setcursor 11,0
539
    jmp    .d
539
        jmp     .d
540
.change_c:
540
.change_c:
541
    _setcursor 15,0
541
        _setcursor 15,0
542
    mov    si, vrrmprint
542
        mov     si, vrrmprint
543
    call    print
543
        call    print
544
    mov    bx, '12'
544
        mov     bx, '12'
545
    call    getkey
545
        call    getkey
546
    mov    [preboot_vrrm], al
546
        mov     [preboot_vrrm], al
547
    _setcursor 12,0
547
        _setcursor 12,0
548
    jmp    .d
548
        jmp     .d
549
.say_on_off:
549
.say_on_off:
550
    pushf
550
        pushf
551
    call    print
-
 
552
    mov    si, on_msg
551
        call    print
553
    popf
552
        mov     si, on_msg
554
    jz    @f
553
        popf
555
    mov    si, off_msg
554
        jz      @f
556
@@:    call    printplain
555
        mov     si, off_msg
557
    ret
556
@@:     jmp     printplain
558
; novesa and vervesa strings are not used at the moment of executing this code
557
; novesa and vervesa strings are not used at the moment of executing this code
559
virtual at novesa
558
virtual at novesa
560
.oldtimer dd ?
559
.oldtimer dd ?
561
.starttime dd ?
560
.starttime dd ?
562
.bSettingsChanged db ?
561
.bSettingsChanged db ?
563
.timer dd ?
562
.timer dd ?
564
end virtual
563
end virtual
565
.loader_block dd -1
564
.loader_block dd -1
566
.gettime:
565
.gettime:
567
    mov    ah, 0
566
        mov     ah, 0
568
    int    1Ah
567
        int     1Ah
569
    xchg    ax, cx
568
        xchg    ax, cx
570
    shl    eax, 10h
569
        shl     eax, 10h
571
    xchg    ax, dx
570
        xchg    ax, dx
572
    ret
571
        ret
573
.newtimer:
572
.newtimer:
574
    push    ds
573
        push    ds
575
    push    cs
574
        push    cs
576
    pop    ds
575
        pop     ds
577
    pushf
576
        pushf
578
    call    [.oldtimer]
577
        call    [.oldtimer]
579
    pushad
578
        pushad
580
    call    .gettime
579
        call    .gettime
581
    sub    eax, [.starttime]
580
        sub     eax, [.starttime]
582
    sub    ax, 18*5
581
        sub     ax, 18*5
583
    jae    .timergo
582
        jae     .timergo
584
    neg    ax
583
        neg     ax
585
    add    ax, 18-1
584
        add     ax, 18-1
586
    mov    bx, 18
585
        mov     bx, 18
587
    xor    dx, dx
586
        xor     dx, dx
588
    div    bx
587
        div     bx
589
if lang eq ru
588
if lang eq ru
590
; ¯®¤®¦¤¨â¥ 5 ᥪ㭤, 4/3/2 ᥪ㭤ë, 1 ᥪ㭤ã
589
; ¯®¤®¦¤¨â¥ 5 ᥪ㭤, 4/3/2 ᥪ㭤ë, 1 ᥪ㭤ã
591
    cmp    al, 5
590
        cmp     al, 5
592
    mov    cl, ' '
591
        mov     cl, ' '
593
    jae    @f
592
        jae     @f
594
    cmp    al, 1
593
        cmp     al, 1
595
    mov    cl, 'ã'
594
        mov     cl, 'ã'
596
    jz    @f
595
        jz      @f
597
    mov    cl, 'ë'
596
        mov     cl, 'ë'
598
@@:    mov    [time_str+9], cl
597
@@:     mov     [time_str+9], cl
599
else if lang eq et
598
else if lang eq et
600
    cmp    al, 1
599
        cmp     al, 1
601
    ja     @f
600
        ja      @f
602
    mov    [time_str+9], ' '
601
        mov     [time_str+9], ' '
603
    mov    [time_str+10],' '
602
        mov     [time_str+10],' '
604
@@:
603
@@:
605
else
604
else
606
; wait 5/4/3/2 seconds, 1 second
605
; wait 5/4/3/2 seconds, 1 second
607
    cmp    al, 1
606
        cmp     al, 1
608
    mov    cl, 's'
607
        mov     cl, 's'
609
    ja    @f
608
        ja      @f
610
    mov    cl, ' '
609
        mov     cl, ' '
611
@@:    mov    [time_str+9], cl
610
@@:     mov     [time_str+9], cl
612
end if
611
end if
613
    add    al, '0'
612
        add     al, '0'
614
    mov    [time_str+1], al
613
        mov     [time_str+1], al
615
    mov    si, time_msg
614
        mov     si, time_msg
616
    _setcursor 7,0
615
        _setcursor 7,0
617
    call    print
616
        call    print
618
    _setcursor 25,0
617
        _setcursor 25,0
619
    popad
618
        popad
620
    pop    ds
619
        pop     ds
621
    iret
620
        iret
622
.timergo:
621
.timergo:
623
    push    0
622
        push    0
624
    pop    es
623
        pop     es
625
    mov    eax, [.oldtimer]
624
        mov     eax, [.oldtimer]
626
    mov    [es:8*4], eax
625
        mov     [es:8*4], eax
627
    mov    sp, 0EC00h
626
        mov     sp, 0EC00h
628
.continue:
627
.continue:
629
    sti
628
        sti
630
    _setcursor 6,0
629
        _setcursor 6,0
631
    mov    si, space_msg
630
        mov     si, space_msg
632
    call    printplain
631
        call    printplain
633
    call    printplain
632
        call    printplain
634
    _setcursor 6,0
633
        _setcursor 6,0
635
    mov    si, loading_msg
634
        mov     si, loading_msg
636
    call    print
635
        call    print
637
    _setcursor 15,0
636
        _setcursor 15,0
638
    cmp    [.bSettingsChanged], 0
637
        cmp     [.bSettingsChanged], 0
639
    jz    .load
638
        jz      .load
640
    cmp    [.loader_block], -1
639
        cmp     [.loader_block], -1
641
    jz    .load
640
        jz      .load
642
    les    bx, [.loader_block]
641
        les     bx, [.loader_block]
643
    mov    eax, [es:bx+3]
642
        mov     eax, [es:bx+3]
644
    push    ds
643
        push    ds
645
    pop    es
644
        pop     es
646
    test    eax, eax
645
        test    eax, eax
647
    jz    .load
646
        jz      .load
648
    push    eax
647
        push    eax
649
    mov    si, save_quest
648
        mov     si, save_quest
650
    call    print
649
        call    print
651
.waityn:
650
.waityn:
652
    mov    ah, 0
651
        mov     ah, 0
653
    int    16h
652
        int     16h
654
    or    al, 20h
653
        or      al, 20h
655
    cmp    al, 'n'
654
        cmp     al, 'n'
656
    jz    .loadc
655
        jz      .loadc
657
    cmp    al, 'y'
656
        cmp     al, 'y'
658
    jnz    .waityn
657
        jnz     .waityn
659
    call    putchar
658
        call    putchar
660
    mov    byte [space_msg+80], 186
659
        mov     byte [space_msg+80], 186
661
    pop    eax
660
        pop     eax
662
    push    cs
661
        push    cs
663
    push    .cont
662
        push    .cont
664
    push    eax
663
        push    eax
665
    retf
664
        retf
666
.loadc:
665
.loadc:
667
    pop    eax
666
        pop     eax
668
.cont:
667
.cont:
669
    push    cs
668
        push    cs
670
    pop    ds
669
        pop     ds
671
    mov    si, space_msg
670
        mov     si, space_msg
Line 672... Line 671...
672
    mov    byte [si+80], 0
671
        mov     byte [si+80], 0
Line 673... Line 672...
673
    _setcursor 15,0
672
        _setcursor 15,0
674
    call    printplain
673
        call    printplain
675
    _setcursor 15,0
674
        _setcursor 15,0
676
.load:
675
.load:
677
; \end{diamond}[02.12.2005]
676
; \end{diamond}[02.12.2005]
678
 
677
 
679
; ASK GRAPHICS MODE
678
; ASK GRAPHICS MODE
680
 
679
 
681
    movzx    ax, [preboot_graph]
680
        movzx   ax, [preboot_graph]
682
    push    0
681
        push    0
683
    pop    es
682
        pop     es
684
; address is gr_table+6*(ax-1)
683
; address is gr_table+6*(ax-1)
685
        add    ax, ax
684
        add     ax, ax
686
        lea    si, [gr_table + eax + eax*2 - 6]
685
        lea     si, [gr_table + eax + eax*2 - 6]
687
        mov     bx,[si+0]
686
        mov     bx, [si+0]
688
        mov     cx,[si+2]
687
        mov     cx, [si+2]
689
        mov     dx,[si+4]
688
        mov     dx, [si+4]
690
        cmp    al, 9*2
689
        cmp     al, 9*2
691
        mov    al, 32    ; BPP
690
        mov     al, 32    ; BPP
692
        jb    @f
691
        jb      @f
Line 693... Line 692...
693
        mov    [es:0x9000], al
692
        mov     [es:0x9000], al
Line 694... Line 693...
694
        mov    dword [es:0x9018], 0xFFFFFFFF; 0x800000
693
        or      dword [es:0x9018], 0xFFFFFFFF; 0x800000
695
       @@:
694
@@:
696
        mov     [es:0x9008],bx
695
        mov     [es:0x9008], bx
Line 697... Line 696...
697
        mov     [es:0x900A],cx
696
        mov     [es:0x900A], cx
698
        mov     [es:0x900C],dx
697
        mov     [es:0x900C], dx
699
        test    bh, bh
698
        test    bh, bh
700
        jz    nov
699
        jz      nov
701
 
700
 
702
; USE DEFAULTS OR PROBE
701
; USE DEFAULTS OR PROBE
Line 703... Line 702...
703
 
702
 
704
; bx - mode : cx - x size : dx - y size
703
; bx - mode : cx - x size : dx - y size
705
    cmp    [preboot_gprobe], 1
704
        cmp     [preboot_gprobe], 1
706
    jz    noprobe
705
        jz      noprobe
707
 
-
 
708
        mov     bx,0x100
706
 
709
     newprobe:
707
        mov     bx, 0x100
710
        inc     bx
708
     newprobe:
Line 711... Line 709...
711
        cmp     bx,0x17f
709
        inc     bx
712
        mov    si,prnotfnd
710
        cmp     bx, 0x17f
713
        jz    sayerr
711
        mov     si, prnotfnd
714
 
712
        jz      invalid_video_mode
715
     probemore:
713
 
716
         push    cx
714
     probemore:
717
        mov     ax,0x4f01
715
        push    cx
718
        mov     cx,bx
716
        mov     ax, 0x4f01
719
        and     cx,0xfff
717
        mov     cx, bx
720
        mov     di,0xa000
718
        mov     di, 0xa000
721
        int     0x10
719
        int     0x10
722
        pop    cx
720
        pop     cx
Line 723... Line 721...
723
 
721
 
Line 724... Line 722...
724
    test    byte [es:di], 80h    ; lfb?
722
        test    byte [es:di], 80h    ; lfb?
Line 725... Line 723...
725
    jz    newprobe
723
        jz      newprobe
726
    cmp    [es:di+0x12], cx    ; x size?
724
        cmp     [es:di+0x12], cx    ; x size?
727
    jnz    newprobe
725
        jnz     newprobe
728
    cmp    [es:di+0x14], dx    ; y size?
726
        cmp     [es:di+0x14], dx    ; y size?
729
    jnz    newprobe
727
        jnz     newprobe
730
    cmp    byte [es:di+0x19], 32 ;24
728
        cmp     byte [es:di+0x19], 32 ;24
731
    jb    newprobe
729
        jb      newprobe
732
 
730
 
733
;       add     bx,0100000000000000b
731
;       add     bx, 0100000000000000b
734
    or    bh, 40h
732
        or      bh, 40h
735
        mov     [es:0x9008],bx
733
        mov     [es:0x9008], bx
736
 
734
 
737
     noprobe:
735
     noprobe:
738
 
736
 
739
 
737
 
740
; FIND VESA 2.0 LFB & BPP
738
; FIND VESA 2.0 LFB & BPP
741
 
739
 
742
        mov     ax,0x4f01
740
        mov     ax, 0x4f01
743
        mov     cx,bx
741
        mov     cx, bx
744
        and     cx,0xfff
742
        and     cx, 0xfff
745
        mov     di,0xa000
743
        mov     di, 0xa000
746
        int     0x10
744
        int     0x10
747
        ; LFB
745
        ; LFB
-
 
746
        mov     eax, [es:di+0x28]
-
 
747
        mov     [es:0x9018], eax
-
 
748
        ; ---- vbe voodoo
-
 
749
        BytesPerLine equ 0x10
748
        mov     eax,[es:di+0x28]
750
        mov     ax, [es:di+BytesPerLine]
-
 
751
        mov     [es:0x9001], ax
749
        mov     [es:0x9018],eax
752
        ; BPP
750
        ; ---- vbe voodoo
753
        mov     al, byte [es:di+0x19]
Line 751... Line 754...
751
        BytesPerLine equ 0x10
754
        mov     [es:0x9000], al
Line 752... Line 755...
752
        mov ax, [es:di+BytesPerLine]
755
nov:
753
        mov [es:0x9001],ax
756
        cmp     al, 24
754
        ; BPP
757
        mov     si, bt24
755
        mov     al,byte [es:di+0x19]
758
        jz      bppl
756
        mov     [es:0x9000],al
759
        cmp     al, 32
757
       nov:
760
        mov     si, bt32
758
        cmp     al,24
761
        jz      bppl
759
        mov    si,bt24
762
        mov     si, btns
760
        jz    bppl
763
invalid_video_mode:
761
        cmp     al,32
764
        call    print
762
        mov     si,bt32
765
        _setcursor (d80x25_top_num+2), 0
763
        jz     bppl
766
        mov     si, start_msg
764
        mov     si,btns
767
        call    print
Line 765... Line 768...
765
        jmp    sayerr
768
        jmp     cfgmanager.printcfg
766
       bppl:
769
bppl:
767
        call    print
770
        call    print
Line 768... Line 771...
768
 
771
 
Line 769... Line 772...
769
 
772
 
770
; FIND VESA 1.2 PM BANK SWITCH ADDRESS
773
; FIND VESA 1.2 PM BANK SWITCH ADDRESS
Line 771... Line 774...
771
 
774
 
Line 772... Line 775...
772
    push    es
775
        push    es
773
        mov     ax,0x4f0A
776
        mov     ax, 0x4f0A
774
        xor    bx, bx
777
        xor     bx, bx
Line 775... Line 778...
775
        int     0x10
778
        int     0x10
Line 776... Line 779...
776
        xor     eax,eax
779
        xor     eax, eax
777
        mov     ax,es
780
        mov     ax, es
778
        shl     eax,4
781
        shl     eax, 4
Line 779... Line 782...
779
        movzx   ebx,di
782
        movzx   ebx, di
Line 780... Line 783...
780
        add     eax,ebx
783
        add     eax, ebx
781
        mov     bx,[es:di]
784
        mov     bx, [es:di]
782
        add     eax,ebx
785
        add     eax, ebx
783
        pop     es
786
        pop     es
784
        mov     [es:0x9014],eax
787
        mov     [es:0x9014], eax
785
 
788
 
786
 
789
 
787
; GRAPHICS ACCELERATION
790
; GRAPHICS ACCELERATION
788
; force yes
791
; force yes
789
        mov     [es:0x901C], byte 1
792
        mov     [es:0x901C], byte 1
790
 
793
 
Line 1002... Line 1005...
1002
;        push    ax
1005
;        push    ax
1003
;        jnz     reads
1006
;        jnz     reads
1004
;       readdone:
1007
;       readdone:
1005
;        pop     ax
1008
;        pop     ax
Line 1006... Line 1009...
1006
 
1009
 
1007
        mov     si,backspace2
1010
        mov     si, backspace2
1008
        call    printplain
1011
        call    printplain
1009
        mov     si,okt
1012
        mov     si, okt
1010
        call    printplain
1013
        call    printplain
1011
       no_sys_on_floppy:
1014
no_sys_on_floppy:
1012
        xor    ax, ax        ; reset drive
1015
        xor     ax, ax          ; reset drive
1013
        xor    dx, dx
1016
        xor     dx, dx
1014
        int     0x13
1017
        int     0x13
1015
       mov dx,0x3f2 ; floppy motor off
1018
        mov     dx, 0x3f2       ; floppy motor off
1016
       mov al,0
1019
        mov     al, 0
Line 1017... Line 1020...
1017
       out dx,al
1020
        out     dx, al
Line 1018... Line 1021...
1018
 
1021
 
1019
 
1022
 
Line 1020... Line 1023...
1020
; SET GRAPHICS
1023
; SET GRAPHICS
1021
 
1024
 
1022
        xor ax, ax
1025
        xor     ax, ax
1023
        mov es, ax
1026
        mov     es, ax
1024
 
1027
 
1025
        mov   ax,[es:0x9008]        ; vga & 320x200
1028
        mov     ax, [es:0x9008]         ; vga & 320x200
1026
        mov    bx, ax
1029
        mov     bx, ax
1027
        cmp     ax,0x13
1030
        cmp     ax, 0x13
1028
        je      setgr
1031
        je      setgr
1029
        cmp     ax,0x12
1032
        cmp     ax, 0x12
1030
        je      setgr
1033
        je      setgr
1031
        mov     ax,0x4f02            ; Vesa
1034
        mov     ax, 0x4f02              ; Vesa
1032
setgr:
1035
setgr:
1033
        int     0x10
1036
        int     0x10
1034
        test    ah,ah
1037
        test    ah, ah
Line 1035... Line 1038...
1035
        mov    si, fatalsel
1038
        mov     si, fatalsel
1036
        jnz    sayerr
1039
        jnz     sayerr
1037
; set mode 0x12 graphics registers:
1040
; set mode 0x12 graphics registers:
1038
        cmp     bx,0x12
1041
        cmp     bx, 0x12
1039
        jne     gmok2
1042
        jne     gmok2
1040
 
1043
 
1041
        mov     al,0x05
1044
        mov     al, 0x05
1042
        mov     dx,0x03ce
1045
        mov     dx, 0x03ce
1043
        push    dx
1046
        push    dx
1044
        out     dx,al      ; select GDC mode register
1047
        out     dx, al      ; select GDC mode register
1045
        mov     al,0x02
1048
        mov     al, 0x02
1046
        inc    dx
1049
        inc     dx
1047
        out     dx,al      ; set write mode 2
1050
        out     dx, al      ; set write mode 2
1048
 
1051
 
1049
        mov     al,0x02
1052
        mov     al, 0x02
1050
        mov     dx,0x03c4
1053
        mov     dx, 0x03c4
1051
        out     dx,al      ; select VGA sequencer map mask register
1054
        out     dx, al      ; select VGA sequencer map mask register
1052
        mov     al,0x0f
1055
        mov     al, 0x0f
1053
        inc    dx
1056
        inc     dx
1054
        out     dx,al      ; set mask for all planes 0-3
1057
        out     dx, al      ; set mask for all planes 0-3
1055
 
1058
 
1056
        mov     al,0x08
1059
        mov     al, 0x08