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