pcireg: Make Linux port official

This commit is contained in:
RichardG867
2024-10-23 11:22:17 -03:00
parent 6bb247de74
commit 69e2af495d
4 changed files with 20 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ jobs:
steps:
- name: Install build tools
run: sudo apt update && sudo apt install build-essential xz-utils
run: sudo apt update && sudo apt install build-essential crossbuild-essential-i386 xz-utils
- name: Download OpenWatcom
if: steps.cache.outputs.cache-hit != 'true'
run: |
@@ -23,6 +23,14 @@ jobs:
mkdir /opt/watcom
wget -qO- https://github.com/open-watcom/open-watcom-v2/releases/download/2023-12-01-Build/ow-snapshot.tar.xz | tar -Jxv -C /opt/watcom
echo "/opt/watcom/binl64:/opt/watcom/binl" >> $GITHUB_PATH
- name: Download and build libpci
if: steps.cache.outputs.cache-hit != 'true'
run: |
rm -rf /opt/pciutils-*
wget -qO- https://github.com/pciutils/pciutils/releases/download/v3.13.0/pciutils-3.13.0.tar.gz | tar -zxv -C /opt
cd /opt/pciutils-*
make CC=i686-linux-gnu-gcc ZLIB=no DNS=no SHARED=no
sudo make install-lib
- uses: actions/checkout@v2
- name: Build `cp437`
run: |
@@ -49,6 +57,7 @@ jobs:
cd ${{ github.workspace }}/pcireg
wmake
make -f Makefile.uefi ARCH=x86_64
make -f Makefile.gcc CC=i686-linux-gnu-gcc CFLAGS=-I/usr/local/include LDFLAGS=-static
python3 pciids.py
- name: Build `usblgoff`
run: |
@@ -60,6 +69,7 @@ jobs:
path: |
**/*.EXE
**/*.EFI
pcireg/pcireg
**/*.BIN
ac97/*.md
acpi/*.md

View File

@@ -16,14 +16,15 @@
#
VPATH = . ../clib
CC ?= "gcc"
default: $(DEST)
%.o: %.c $(HEADERS)
gcc -I../clib -c $< -o $@
$(CC) -I../clib $(CFLAGS) -c $< -o $@
$(DEST): $(OBJS)
gcc $(OBJS) $(CFLAGS) -o $@
$(CC) $(OBJS) $(LDFLAGS) -o $@
chmod +x $@ || true
clean:

View File

@@ -17,6 +17,6 @@
export OBJS = pcireg.o clib_pci.o clib_std.o clib_sys.o clib_term.o
export DEST = pcireg
export CFLAGS = -lpci
override LDFLAGS += -lpci
include ../clib/gcc.mk

View File

@@ -1,6 +1,6 @@
pcireg
======
DOS and UEFI tool for reading, writing and dumping PCI configuration space registers; scanning the PCI bus; and more.
DOS, UEFI and Linux tool for reading, writing and dumping PCI configuration space registers; scanning the PCI bus; and more.
Usage
-----
@@ -42,6 +42,10 @@ Building
* **Linux:** Run `make -f Makefile.uefi ARCH=x86_64` with a GCC toolchain installed.
* Note that 32-bit UEFI targets are not supported yet.
### Linux target
* **Linux:** Run `make -f Makefile.gcc` with a GCC toolchain and development files for `libpci` installed.
### PCI ID database
* Run `python3 pciids.py` to update the `PCIIDS.BIN` file.