2011-10-14 23:38:50 +02:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
2015-01-08 21:10:22 +01:00
|
|
|
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
|
2011-10-14 23:38:50 +02:00
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;; PCI16.INC ;;
|
|
|
|
;; ;;
|
|
|
|
;; 16 bit PCI driver code ;;
|
|
|
|
;; ;;
|
|
|
|
;; Version 0.2 December 21st, 2002 ;;
|
|
|
|
;; ;;
|
|
|
|
;; Author: Victor Prodan, victorprodan@yahoo.com ;;
|
|
|
|
;; ;;
|
|
|
|
;; See file COPYING for details ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
$Revision$
|
|
|
|
|
|
|
|
|
|
|
|
init_pci_16:
|
|
|
|
|
|
|
|
pushad
|
|
|
|
|
|
|
|
xor ax, ax
|
|
|
|
mov es, ax
|
2017-12-17 03:12:53 +01:00
|
|
|
mov byte [es:BOOT_LO.pci_data], 1;default mechanism:1
|
2011-10-14 23:38:50 +02:00
|
|
|
mov ax, 0xb101
|
|
|
|
int 0x1a
|
|
|
|
or ah, ah
|
|
|
|
jnz pci16skip
|
|
|
|
|
2017-12-17 03:12:53 +01:00
|
|
|
mov [es:BOOT_LO.pci_data+1], cl;last PCI bus in system
|
|
|
|
mov word[es:BOOT_LO.pci_data+2], bx
|
|
|
|
mov dword[es:BOOT_LO.pci_data+4], edi
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
; we have a PCI BIOS, so check which configuration mechanism(s)
|
|
|
|
; it supports
|
|
|
|
; AL = PCI hardware characteristics (bit0 => mechanism1, bit1 => mechanism2)
|
|
|
|
test al, 1
|
|
|
|
jnz pci16skip
|
|
|
|
test al, 2
|
|
|
|
jz pci16skip
|
2017-12-17 03:12:53 +01:00
|
|
|
mov byte [es:BOOT_LO.pci_data], 2; if (al&3)==2 => mechanism 2
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
pci16skip:
|
|
|
|
|
|
|
|
mov ax, 0x1000
|
|
|
|
mov es, ax
|
|
|
|
|
|
|
|
popad
|