Subversion Repositories Kolibri OS

Rev

Rev 509 | Rev 523 | Go to most recent revision | Show entire file | Regard 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 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 155... Line 158...
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
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
163
end if
166
end if
Line 164... Line 167...
164
 
167
 
Line 175... Line 178...
175
    lodsb
178
        lodsb
176
    stosw
179
        stosw
177
    loop    @b
180
        loop    @b
178
; draw spaces
181
; draw spaces
179
    mov    si, space_msg
182
        mov     si, space_msg
180
    mov    cx, 25 - d80x25_top_num - d80x25_bottom_num
183
        mov     dx, 25 - d80x25_top_num - d80x25_bottom_num
181
dfl1:
184
dfl1:
182
    push    cx
-
 
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
191
    loop    dfl1
193
        jnz     dfl1
192
; draw bottom
194
; draw bottom
193
    mov    si, d80x25_bottom
195
        mov     si, d80x25_bottom
194
    mov    cx, d80x25_bottom_num * 80
196
        mov     cx, d80x25_bottom_num * 80
195
@@:
197
@@:
196
    lodsb
198
        lodsb
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 282... Line 284...
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
284
        loopnz  wait_loop
286
        loopnz  wait_loop
Line 285... Line 287...
285
 
287
 
286
; --------------- APM ---------------------
-
 
287
    push    0
-
 
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
Line 311... Line 311...
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
313
        xor     bx, bx
314
    int    0x15
314
        int     0x15
Line 315... Line -...
315
 
-
 
316
    push 0
-
 
317
    pop es
-
 
318
 
315
 
319
    mov [es:0x9040], ebx
316
        mov     [es:0x9040], ebx
320
    mov [es:0x9050], ax
317
        mov     [es:0x9050], ax
321
    mov [es:0x9052], cx
318
        mov     [es:0x9052], cx
Line 322... Line 319...
322
    mov [es:0x9054], dx
319
        mov     [es:0x9054], dx
323
 
320
 
Line 324... Line 321...
324
apm_end:
321
apm_end:
Line 325... Line -...
325
        _setcursor d80x25_top_num, 0
-
 
326
 
-
 
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
327
        mov     di, 0xa000
333
        int     0x10
-
 
334
        cmp     ax,0x004f
-
 
335
        mov    si, novesa
-
 
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 347... Line 339...
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
Line 387... Line 379...
387
.novesa:
379
.novesa:
388
    mov    al, 10
380
        mov     al, 10
389
@@:
381
@@:
390
    mov    [di], al
382
        mov     [di], al
391
.preboot_gr_end:
383
.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
Line 444... Line 437...
444
    jmp    @b
437
        jmp     @b
445
.c:
438
.c:
446
    mov    si, linef
439
        mov     si, linef
447
    call    printplain
440
        call    printplain
448
    mov    si, dma_msg
441
        mov     si, dma_msg
-
 
442
        call    print
449
    cmp    [preboot_dma_write], 1
443
        cmp     [preboot_dma], 2
450
    call    .say_on_off
444
        mov     si, on_msg
-
 
445
        jb      @f
-
 
446
        mov     si, off_msg
-
 
447
        ja      @f
-
 
448
        mov     si, readonly_msg
-
 
449
@@:
-
 
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
Line 530... Line 530...
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
Line 551... Line 551...
551
    call    print
551
        call    print
552
    mov    si, on_msg
552
        mov     si, on_msg
553
    popf
553
        popf
554
    jz    @f
554
        jz      @f
555
    mov    si, off_msg
555
        mov     si, off_msg
556
@@:    call    printplain
556
@@:     jmp     printplain
557
    ret
-
 
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 ?
Line 689... Line 688...
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
693
        mov    [es:0x9000], al
692
        mov     [es:0x9000], al
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
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
Line 708... Line 707...
708
        mov     bx,0x100
707
        mov     bx, 0x100
709
     newprobe:
708
     newprobe:
710
        inc     bx
709
        inc     bx
711
        cmp     bx,0x17f
710
        cmp     bx, 0x17f
712
        mov    si,prnotfnd
711
        mov     si, prnotfnd
713
        jz    sayerr
712
        jz      invalid_video_mode
Line 714... Line 713...
714
 
713
 
715
     probemore:
714
     probemore:
716
         push    cx
715
        push    cx
717
        mov     ax,0x4f01
716
        mov     ax, 0x4f01
718
        mov     cx,bx
-
 
719
        and     cx,0xfff
717
        mov     cx, bx
720
        mov     di,0xa000
718
        mov     di, 0xa000
721
        int     0x10
719
        int     0x10
Line 722... Line 720...
722
        pop    cx
720
        pop     cx
Line 760... Line 758...
760
        jz    bppl
758
        jz      bppl
761
        cmp     al,32
759
        cmp     al, 32
762
        mov     si,bt32
760
        mov     si, bt32
763
        jz     bppl
761
        jz      bppl
764
        mov     si,btns
762
        mov     si, btns
-
 
763
invalid_video_mode:
-
 
764
        call    print
-
 
765
        _setcursor (d80x25_top_num+2), 0
-
 
766
        mov     si, start_msg
765
        jmp    sayerr
767
        call    print
-
 
768
        jmp     cfgmanager.printcfg
766
       bppl:
769
bppl:
767
        call    print
770
        call    print
Line 768... Line 771...
768
 
771
 
Line 786... Line 789...
786
 
789
 
787
; GRAPHICS ACCELERATION
790
; GRAPHICS ACCELERATION
788
; force yes
791
; force yes
Line 789... Line 792...
789
        mov     [es:0x901C], byte 1
792
        mov     [es:0x901C], byte 1
Line 790... Line 793...
790
 
793
 
791
; DMA WRITE
794
; DMA ACCESS TO HD
Line 792... Line 795...
792
 
795
 
Line 793... Line 796...
793
        mov     al, [preboot_dma_write]
796
        mov     al, [preboot_dma]