Subversion Repositories Kolibri OS

Rev

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

Rev 3762 Rev 3774
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: 3762 $
14
$Revision: 3774 $
15
 
15
 
16
 
16
 
Line 432... Line 432...
432
        mov     ecx, 1*10000h + 1*100h + 0x8A
432
        mov     ecx, 1*10000h + 1*100h + 0x8A
433
        mov     [es:BOOT_IDE_PI_16], cx
433
        mov     [es:BOOT_IDE_PI_16], cx
434
        xor     si, si  ; device index = 0
434
        xor     si, si  ; device index = 0
435
        int     0x1A
435
        int     0x1A
436
        jnc     .found_1 ; Parallel IDE Controller
436
        jnc     .found_1 ; Parallel IDE Controller
437
 
-
 
-
 
437
; Controller not found!
-
 
438
        xor     ax, ax
-
 
439
        mov     [es:BOOT_IDE_PI_16], ax
438
        jmp     .nopci
440
        jmp     .nopci
-
 
441
;--------------------------------------
439
.found_1:
442
.found_1:
440
; get memory base BAR4
443
; get memory base BAR4
441
        mov     ax, 0xB10A
444
        mov     ax, 0xB10A
442
        mov     di, 0x20        ; memory base is config register at 0x20
445
        mov     di, 0x20        ; memory base is config register at 0x20
443
        push    cx
446
        push    cx
444
        int     0x1A
447
        int     0x1A
445
        jc      .no_BAR4        ;.nopci
448
        jc      .no_BAR4        ;.nopci
446
        and     cx, 0xFFF0      ; clear address decode type
449
        and     cx, 0xFFFC      ; clear address decode type
447
        mov     [es:BOOT_IDE_BASE_ADDR], cx
450
        mov     [es:BOOT_IDE_BASE_ADDR], cx
448
.no_BAR4:
451
.no_BAR4:
449
        pop     cx
452
        pop     cx
-
 
453
;--------------------------------------
450
.found:
454
.found:
451
; get Interrupt Line
455
; get Interrupt Line
452
        mov     ax, 0xB10A
456
        mov     ax, 0xB10A
453
        mov     di, 0x3c        ; memory base is config register at 0x3c
457
        mov     di, 0x3c        ; memory base is config register at 0x3c
454
        push    cx
458
        push    cx
455
        int     0x1A
459
        int     0x1A
456
        jc      .no_Interrupt        ;.nopci
460
        jc      .no_Interrupt        ;.nopci
457
 ;       and     cx, 0xFFF0      ; clear address decode type
-
 
-
 
461
 
458
        mov     [es:BOOT_IDE_INTERR_16], cx
462
        mov     [es:BOOT_IDE_INTERR_16], cx
459
.no_Interrupt:
463
.no_Interrupt:
460
        pop     cx
464
        pop     cx
-
 
465
;--------------------------------------
461
; get memory base BAR0
466
; get memory base BAR0
462
        mov     ax, 0xB10A
467
        mov     ax, 0xB10A
463
        mov     di, 0x10        ; memory base is config register at 0x10
468
        mov     di, 0x10        ; memory base is config register at 0x10
464
        push    cx
469
        push    cx
465
        int     0x1A
470
        int     0x1A
466
        jc      .no_BAR0        ;.nopci
471
        jc      .no_BAR0        ;.nopci
-
 
472
 
467
        mov     [es:BOOT_IDE_BAR0_16], cx
473
        mov     [es:BOOT_IDE_BAR0_16], cx
468
.no_BAR0:
474
.no_BAR0:
469
        pop     cx
475
        pop     cx
-
 
476
;--------------------------------------
470
; get memory base BAR1
477
; get memory base BAR1
471
        mov     ax, 0xB10A
478
        mov     ax, 0xB10A
472
        mov     di, 0x14        ; memory base is config register at 0x14
479
        mov     di, 0x14        ; memory base is config register at 0x14
473
        push    cx
480
        push    cx
474
        int     0x1A
481
        int     0x1A
475
        jc      .no_BAR1        ;.nopci
482
        jc      .no_BAR1        ;.nopci
-
 
483
 
476
        mov     [es:BOOT_IDE_BAR1_16], cx
484
        mov     [es:BOOT_IDE_BAR1_16], cx
477
.no_BAR1:
485
.no_BAR1:
478
        pop     cx
486
        pop     cx
-
 
487
;--------------------------------------
479
; get memory base BAR2
488
; get memory base BAR2
480
        mov     ax, 0xB10A
489
        mov     ax, 0xB10A
481
        mov     di, 0x18        ; memory base is config register at 0x18
490
        mov     di, 0x18        ; memory base is config register at 0x18
482
        push    cx
491
        push    cx
483
        int     0x1A
492
        int     0x1A
484
        jc      .no_BAR2        ;.nopci
493
        jc      .no_BAR2        ;.nopci
-
 
494
 
485
        mov     [es:BOOT_IDE_BAR2_16], cx
495
        mov     [es:BOOT_IDE_BAR2_16], cx
486
.no_BAR2:
496
.no_BAR2:
487
        pop     cx
497
        pop     cx
-
 
498
;--------------------------------------
488
; get memory base BAR3
499
; get memory base BAR3
489
        mov     ax, 0xB10A
500
        mov     ax, 0xB10A
490
        mov     di, 0x1C        ; memory base is config register at 0x1c
501
        mov     di, 0x1C        ; memory base is config register at 0x1c
491
        push    cx
502
        push    cx
492
        int     0x1A
503
        int     0x1A
493
        jc      .no_BAR3        ;.nopci
504
        jc      .no_BAR3        ;.nopci
-
 
505
 
494
        mov     [es:BOOT_IDE_BAR3_16], cx
506
        mov     [es:BOOT_IDE_BAR3_16], cx
495
.no_BAR3:
507
.no_BAR3:
496
        pop     cx
508
        pop     cx
-
 
509
;--------------------------------------
497
.nopci:
510
.nopci:
498
; \end{Mario79}
511
; \end{Mario79}
Line 499... Line 512...
499
 
512
 
500
        mov     al, 0xf6        ; Сброс клавиатуры, разрешить сканирование
513
        mov     al, 0xf6        ; Сброс клавиатуры, разрешить сканирование