Subversion Repositories Kolibri OS

Rev

Rev 641 | Rev 713 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 641 Rev 709
Line 9... Line 9...
9
;;  KolibriOS 16-bit loader,                                    ;;
9
;;  KolibriOS 16-bit loader,                                    ;;
10
;;                        based on bootcode for MenuetOS        ;;
10
;;                        based on bootcode for MenuetOS        ;;
11
;;                                                              ;;
11
;;                                                              ;;
12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 13... Line 13...
13
 
13
 
Line 14... Line 14...
14
$Revision: 641 $
14
$Revision: 709 $
15
 
15
 
16
 
16
 
Line 339... Line 339...
339
; \begin{diamond}[30.11.2005]
339
; \begin{diamond}[30.11.2005]
340
cfgmanager:
340
cfgmanager:
341
; settings:
341
; settings:
342
; a) preboot_graph = graphical mode
342
; a) preboot_graph = graphical mode
343
;    preboot_gprobe = probe this mode?
343
;    preboot_gprobe = probe this mode?
344
; b) preboot_dma  = use DMA access?
344
; b) preboot_biosdisk  = use BIOS disks through V86 emulation?
345
; c) preboot_vrrm = use VRR?
345
; c) preboot_vrrm = use VRR?
346
; d) preboot_device = from what boot?
346
; d) preboot_device = from what boot?
347
        mov     di, preboot_graph
347
        mov     di, preboot_graph
348
; check bootloader block
348
; check bootloader block
349
        cmp     [.loader_block], -1
349
        cmp     [.loader_block], -1
Line 379... Line 379...
379
.novesa:
379
.novesa:
380
        mov     al, 10
380
        mov     al, 10
381
@@:
381
@@:
382
        mov     [di], al
382
        mov     [di], al
383
.preboot_gr_end:
383
.preboot_gr_end:
384
; following 6 lines set variables to 1 if its current value is 0
384
; following 8 lines set variables to 1 if its current value is 0
385
        cmp     [di+preboot_dma-preboot_graph], 1
385
        cmp     [di+preboot_dma-preboot_graph], 1
386
        adc     [di+preboot_dma-preboot_graph], 0
386
        adc     [di+preboot_dma-preboot_graph], 0
-
 
387
        cmp     [di+preboot_biosdisk-preboot_graph], 1
-
 
388
        adc     [di+preboot_biosdisk-preboot_graph], 0
387
        cmp     [di+preboot_vrrm-preboot_graph], 1
389
        cmp     [di+preboot_vrrm-preboot_graph], 1
388
        adc     [di+preboot_vrrm-preboot_graph], 0
390
        adc     [di+preboot_vrrm-preboot_graph], 0
389
        cmp     [di+preboot_device-preboot_graph], 1
391
        cmp     [di+preboot_device-preboot_graph], 1
390
        adc     [di+preboot_device-preboot_graph], 0
392
        adc     [di+preboot_device-preboot_graph], 0
391
; notify user
393
; notify user
Line 436... Line 438...
436
        mov     si, mode10
438
        mov     si, mode10
437
        jmp     @b
439
        jmp     @b
438
.c:
440
.c:
439
        mov     si, linef
441
        mov     si, linef
440
        call    printplain
442
        call    printplain
441
        mov     si, dma_msg
443
;        mov     si, dma_msg
442
        call    print
444
;        call    print
443
        cmp     [preboot_dma], 2
445
;        cmp     [preboot_dma], 2
444
        mov     si, on_msg
446
;        mov     si, on_msg
445
        jb      @f
447
;        jb      @f
446
        mov     si, off_msg
448
;        mov     si, off_msg
447
        ja      @f
449
;        ja      @f
448
        mov     si, readonly_msg
450
;        mov     si, readonly_msg
449
@@:
451
;@@:
450
        call    printplain
452
;        call    printplain
-
 
453
        mov     si, usebd_msg
-
 
454
        cmp     [preboot_biosdisk], 1
-
 
455
        call    .say_on_off
451
        mov     si, vrrm_msg
456
        mov     si, vrrm_msg
452
        cmp     [preboot_vrrm], 1
457
        cmp     [preboot_vrrm], 1
453
        call    .say_on_off
458
        call    .say_on_off
454
        mov     si, preboot_device_msg
459
        mov     si, preboot_device_msg
455
        call    print
460
        call    print
Line 528... Line 533...
528
@@:
533
@@:
529
        _setcursor 10,0
534
        _setcursor 10,0
530
        jmp    .d
535
        jmp    .d
531
.change_b:
536
.change_b:
532
        _setcursor 15,0
537
        _setcursor 15,0
533
        mov     si, ask_dma
538
;        mov     si, ask_dma
-
 
539
;        call    print
-
 
540
;        mov     bx, '13'
-
 
541
;        call    getkey
-
 
542
;        mov     [preboot_dma], al
-
 
543
        mov     si, ask_bd
534
        call    print
544
        call    print
535
        mov     bx, '13'
545
        mov     bx, '12'
536
        call    getkey
546
        call    getkey
537
        mov     [preboot_dma], al
547
        mov     [preboot_biosdisk], al
538
        _setcursor 11,0
548
        _setcursor 11,0
539
        jmp     .d
549
        jmp     .d
540
.change_c:
550
.change_c:
541
        _setcursor 15,0
551
        _setcursor 15,0
542
        mov     si, vrrmprint
552
        mov     si, vrrmprint
Line 815... Line 825...
815
        mov     si,diskload
825
        mov     si,diskload
816
        call    print
826
        call    print
817
        xor     ax, ax            ; reset drive
827
        xor     ax, ax            ; reset drive
818
        xor     dx, dx
828
        xor     dx, dx
819
        int     0x13
829
        int     0x13
-
 
830
; do we boot from CD-ROM?
-
 
831
        mov     ah, 41h
-
 
832
        mov     bx, 55AAh
-
 
833
        xor     dx, dx
-
 
834
        int     0x13
-
 
835
        jc      .nocd
-
 
836
        cmp     bx, 0AA55h
-
 
837
        jnz     .nocd
-
 
838
        mov     ah, 48h
-
 
839
        push    ds
-
 
840
        push    es
-
 
841
        pop     ds
-
 
842
        mov     si, 0xa000
-
 
843
        mov     word [si], 30
-
 
844
        int     0x13
-
 
845
        pop     ds
-
 
846
        jc      .nocd
-
 
847
        push    ds
-
 
848
        lds     si, [es:si+26]
-
 
849
        test    byte [ds:si+10], 40h
-
 
850
        pop     ds
-
 
851
        jz      .nocd
-
 
852
; yes - read all floppy by 18 sectors
-
 
853
        mov     cx, 0x0001      ; startcyl,startsector
-
 
854
.a1:
-
 
855
        push    cx dx
-
 
856
        mov     al, 18
-
 
857
        mov     bx, 0xa000
-
 
858
        call    boot_read_floppy
-
 
859
        mov     si, movedesc
-
 
860
        push    es
-
 
861
        push    ds
-
 
862
        pop     es
-
 
863
        mov     cx, 256*18
-
 
864
        mov     ah, 0x87
-
 
865
        int     0x15
-
 
866
        pop     es
-
 
867
        pop     dx cx
-
 
868
        test    ah, ah
-
 
869
        jnz     sayerr_floppy
-
 
870
        add     dword [si+8*3+2], 512*18
-
 
871
        inc     dh
-
 
872
        cmp     dh, 2
-
 
873
        jnz     .a1
-
 
874
        mov     dh, 0
-
 
875
        inc     ch
-
 
876
        cmp     ch, 80
-
 
877
        jae     ok_sys_on_floppy
-
 
878
        pusha
-
 
879
        mov     al, ch
-
 
880
        shr     ch, 2
-
 
881
        add     al, ch
-
 
882
        aam
-
 
883
        xchg    al, ah
-
 
884
        add     ax, '00'
-
 
885
        mov     si, pros
-
 
886
        mov     [si], ax
-
 
887
        call    printplain
-
 
888
        popa
-
 
889
        jmp     .a1
-
 
890
.nocd:
-
 
891
; no - read only used sectors from floppy
820
; now load floppy image to memory
892
; now load floppy image to memory
821
; at first load boot sector and first FAT table
893
; at first load boot sector and first FAT table
822
        mov     cx, 0x0001      ; startcyl,startsector
894
        mov     cx, 0x0001      ; startcyl,startsector
823
        xor     dx, dx          ; starthead,drive
895
        xor     dx, dx          ; starthead,drive
824
        mov     al, 1+9         ; no of sectors to read
896
        mov     al, 1+9         ; no of sectors to read
Line 1005... Line 1077...
1005
;        push    ax
1077
;        push    ax
1006
;        jnz     reads
1078
;        jnz     reads
1007
;       readdone:
1079
;       readdone:
1008
;        pop     ax
1080
;        pop     ax
Line -... Line 1081...
-
 
1081
 
1009
 
1082
ok_sys_on_floppy:
1010
        mov     si, backspace2
1083
        mov     si, backspace2
1011
        call    printplain
1084
        call    printplain
1012
        mov     si, okt
1085
        mov     si, okt
1013
        call    printplain
1086
        call    printplain