Subversion Repositories Kolibri OS

Rev

Rev 5363 | Rev 7132 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5363 Rev 7122
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;  PCI16.INC                                                   ;;
6
;;  PCI16.INC                                                   ;;
7
;;                                                              ;;
7
;;                                                              ;;
8
;;  16 bit PCI driver code                                      ;;
8
;;  16 bit PCI driver code                                      ;;
9
;;                                                              ;;
9
;;                                                              ;;
10
;;  Version 0.2  December 21st, 2002                            ;;
10
;;  Version 0.2  December 21st, 2002                            ;;
11
;;                                                              ;;
11
;;                                                              ;;
12
;;  Author: Victor Prodan, victorprodan@yahoo.com               ;;
12
;;  Author: Victor Prodan, victorprodan@yahoo.com               ;;
13
;;                                                              ;;
13
;;                                                              ;;
14
;;  See file COPYING for details                                ;;
14
;;  See file COPYING for details                                ;;
15
;;                                                              ;;
15
;;                                                              ;;
16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17
 
17
 
18
$Revision: 5363 $
18
$Revision: 7122 $
19
 
19
 
20
 
20
 
21
init_pci_16:
21
init_pci_16:
22
 
22
 
23
        pushad
23
        pushad
24
 
24
 
25
        xor     ax, ax
25
        xor     ax, ax
26
        mov     es, ax
26
        mov     es, ax
27
        mov     byte [es:0x9020], 1;default mechanism:1
27
        mov     byte [es:BOOT_PCI_DATA], 1;default mechanism:1
28
        mov     ax, 0xb101
28
        mov     ax, 0xb101
29
        int     0x1a
29
        int     0x1a
30
        or      ah, ah
30
        or      ah, ah
31
        jnz     pci16skip
31
        jnz     pci16skip
32
 
32
 
33
        mov     [es:0x9021], cl;last PCI bus in system
33
        mov     [es:BOOT_PCI_DATA+1], cl;last PCI bus in system
34
        mov     [es:0x9022], bx
34
        mov     [es:BOOT_PCI_DATA+2], bx
35
        mov     [es:0x9024], edi
35
        mov     [es:BOOT_PCI_DATA+4], edi
36
 
36
 
37
; we have a PCI BIOS, so check which configuration mechanism(s)
37
; we have a PCI BIOS, so check which configuration mechanism(s)
38
; it supports
38
; it supports
39
; AL = PCI hardware characteristics (bit0 => mechanism1, bit1 => mechanism2)
39
; AL = PCI hardware characteristics (bit0 => mechanism1, bit1 => mechanism2)
40
        test    al, 1
40
        test    al, 1
41
        jnz     pci16skip
41
        jnz     pci16skip
42
        test    al, 2
42
        test    al, 2
43
        jz      pci16skip
43
        jz      pci16skip
44
        mov     byte [es:0x9020], 2; if (al&3)==2 => mechanism 2
44
        mov     byte [es:BOOT_PCI_DATA], 2; if (al&3)==2 => mechanism 2
45
 
45
 
46
pci16skip:
46
pci16skip:
47
 
47
 
48
        mov     ax, 0x1000
48
        mov     ax, 0x1000
49
        mov     es, ax
49
        mov     es, ax
50
 
50
 
51
        popad
51
        popad