Subversion Repositories Kolibri OS

Rev

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

Rev 3711 Rev 3712
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: 3711 $
14
$Revision: 3712 $
15
 
15
 
16
 
16
 
Line 403... Line 403...
403
        jnz     .nopci
403
        jnz     .nopci
404
; find PCI class code
404
; find PCI class code
405
; class 1 = mass storage
405
; class 1 = mass storage
406
; subclass 1 = IDE controller
406
; subclass 1 = IDE controller
407
; a) class 1, subclass 1, programming interface 0x80
407
; a) class 1, subclass 1, programming interface 0x80
-
 
408
; This is a Parallel IDE Controller which uses IRQs 14 and 15.
408
        mov     ax, 0xB103
409
        mov     ax, 0xB103
409
        mov     ecx, 1*10000h + 1*100h + 0x80
410
        mov     ecx, 1*10000h + 1*100h + 0x80
410
        mov     [es:BOOT_IDE_PI_16], cx
411
        mov     [es:BOOT_IDE_PI_16], cx
411
        xor     si, si  ; device index = 0
412
        xor     si, si  ; device index = 0
412
        int     0x1A
413
        int     0x1A
413
        jnc     .found_1
414
        jnc     .found_1 ; Parallel IDE Controller
414
; b) class 1, subclass 1, programming interface 0x8f
415
; b) class 1, subclass 1, programming interface 0x8f
415
        mov     ax, 0xB103
416
        mov     ax, 0xB103
416
        mov     ecx, 1*10000h + 1*100h + 0x8f
417
        mov     ecx, 1*10000h + 1*100h + 0x8f
417
        mov     [es:BOOT_IDE_PI_16], cx
418
        mov     [es:BOOT_IDE_PI_16], cx
418
        xor     si, si  ; device index = 0
419
        xor     si, si  ; device index = 0
Line 424... Line 425...
424
        mov     [es:BOOT_IDE_PI_16], cx
425
        mov     [es:BOOT_IDE_PI_16], cx
425
        xor     si, si  ; device index = 0
426
        xor     si, si  ; device index = 0
426
        int     0x1A
427
        int     0x1A
427
        jnc     .found
428
        jnc     .found
428
; d) class 1, subclass 1, programming interface 0x8A
429
; d) class 1, subclass 1, programming interface 0x8A
-
 
430
; This is a Parallel IDE Controller which uses IRQs 14 and 15.
429
        mov     ax, 0xB103
431
        mov     ax, 0xB103
430
        mov     ecx, 1*10000h + 1*100h + 0x8A
432
        mov     ecx, 1*10000h + 1*100h + 0x8A
431
        mov     [es:BOOT_IDE_PI_16], cx
433
        mov     [es:BOOT_IDE_PI_16], cx
432
        xor     si, si  ; device index = 0
434
        xor     si, si  ; device index = 0
433
        int     0x1A
435
        int     0x1A
434
        jnc     .found
436
        jnc     .found_1 ; Parallel IDE Controller
Line 435... Line 437...
435
 
437
 
436
        jmp     .nopci
438
        jmp     .nopci
437
.found_1:
439
.found_1:
438
; get memory base BAR4
440
; get memory base BAR4
Line 446... Line 448...
446
.no_BAR4:
448
.no_BAR4:
447
        pop     cx
449
        pop     cx
448
.found: 
450
.found: 
449
; get memory base BAR0
451
; get memory base BAR0
450
        mov     ax, 0xB10A
452
        mov     ax, 0xB10A
451
        mov     di, 0x10        ; memory base is config register at 0x20
453
        mov     di, 0x10        ; memory base is config register at 0x10
452
        push    cx
454
        push    cx
453
        int     0x1A
455
        int     0x1A
454
        jc      .no_BAR0        ;.nopci
456
        jc      .no_BAR0        ;.nopci
455
        mov     [es:BOOT_IDE_BAR0_16], cx
457
        mov     [es:BOOT_IDE_BAR0_16], cx
456
.no_BAR0:
458
.no_BAR0:
457
        pop     cx
459
        pop     cx
458
; get memory base BAR1
460
; get memory base BAR1
459
        mov     ax, 0xB10A
461
        mov     ax, 0xB10A
460
        mov     di, 0x14        ; memory base is config register at 0x20
462
        mov     di, 0x14        ; memory base is config register at 0x14
461
        push    cx
463
        push    cx
462
        int     0x1A
464
        int     0x1A
463
        jc      .no_BAR1        ;.nopci
465
        jc      .no_BAR1        ;.nopci
464
        mov     [es:BOOT_IDE_BAR1_16], cx
466
        mov     [es:BOOT_IDE_BAR1_16], cx
465
.no_BAR1:
467
.no_BAR1:
466
        pop     cx
468
        pop     cx
467
; get memory base BAR2
469
; get memory base BAR2
468
        mov     ax, 0xB10A
470
        mov     ax, 0xB10A
469
        mov     di, 0x18        ; memory base is config register at 0x20
471
        mov     di, 0x18        ; memory base is config register at 0x18
470
        push    cx
472
        push    cx
471
        int     0x1A
473
        int     0x1A
472
        jc      .no_BAR2        ;.nopci
474
        jc      .no_BAR2        ;.nopci
473
        mov     [es:BOOT_IDE_BAR2_16], cx
475
        mov     [es:BOOT_IDE_BAR2_16], cx
474
.no_BAR2:
476
.no_BAR2:
475
        pop     cx
477
        pop     cx
476
; get memory base BAR3
478
; get memory base BAR3
477
        mov     ax, 0xB10A
479
        mov     ax, 0xB10A
478
        mov     di, 0x1C        ; memory base is config register at 0x20
480
        mov     di, 0x1C        ; memory base is config register at 0x1c
479
        push    cx
481
        push    cx
480
        int     0x1A
482
        int     0x1A
481
        jc      .no_BAR3        ;.nopci
483
        jc      .no_BAR3        ;.nopci
482
        mov     [es:BOOT_IDE_BAR3_16], cx
484
        mov     [es:BOOT_IDE_BAR3_16], cx
483
.no_BAR3:
485
.no_BAR3: