China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 19:41
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » How to write a program in C language under DOS to control PCI read and write? View 1,552 Replies 2
Original Poster Posted 2006-10-13 01:49 ·  中国 辽宁 大连 中移铁通
新手上路
Credits 4
Posts 1
Joined 2006-10-12 22:50
19-year member
UID 65512
Gender Male
Status Offline
How to write a program in C language under DOS to control PCI reading and writing? I hope all experts can give a reference program, thank you!
Floor 2 Posted 2006-11-09 02:36 ·  中国 浙江 杭州 华数宽带
新手上路
Credits 10
Posts 3
Joined 2006-11-09 02:12
19-year member
UID 70076
Gender Male
From zj
Status Offline
All are operated through address mapping. The original ISA bus all operate in an address-data manner. PCI is similar, mapping the base address of the PCI device to the 1M memory range (the memory area accessible by the C compiler). By reading and writing the base address and its offset, the internal resources of the PCI device can be accessed.
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +2 2006-11-09 02:39
Floor 3 Posted 2006-11-09 22:11 ·  中国 河北 石家庄 电信
初级用户
Credits 98
Posts 34
Joined 2006-11-03 02:31
19-year member
UID 69366
Gender Male
Status Offline
PCI BIOS can be used. The interrupt number of PCI BIOS is 1Ah, where AH is B1 and AL is the function number. Its function list is:

01h: INSTALLATION CHECK
02h: FIND PCI DEVICE
03h: FIND PCI CLASS CODE
06h: PCI BUS-SPECIFIC OPERATIONS
08h: READ CONFIGURATION BYTE
09h: READ CONFIGURATION WORD
0Ah: READ CONFIGURATION DWORD
0Bh: WRITE CONFIGURATION BYTE
0Ch: WRITE CONFIGURATION WORD
0Dh: WRITE CONFIGURATION DWORD
0Eh: GET IRQ ROUTING INFORMATION
0Fh: SET PCI IRQ
81h: INSTALLATION CHECK (32-bit)
82h: FIND PCI DEVICE (32-bit)
83h: FIND PCI CLASS CODE (32-bit)
86h: PCI BUS-SPECIFIC OPERATIONS (32-bit)
88h: READ CONFIGURATION BYTE (32-bit)
89h: READ CONFIGURATION WORD (32-bit)
8Ah: READ CONFIGURATION DWORD (32-bit)
8Bh: WRITE CONFIGURATION BYTE (32-bit)
8Ch: WRITE CONFIGURATION WORD (32-bit)
8Dh: WRITE CONFIGURATION DWORD (32-bit)
8Eh: GET IRQ ROUTING INFORMATION (32-bit)
8Fh: SET PCI IRQ (32-bit)
In addition, it can also be implemented by accessing ports CF8h and CFCh
Forum Jump: