Skip to content

Commit

Permalink
pcireg: Make Linux port official
Browse files Browse the repository at this point in the history
  • Loading branch information
richardg867 committed Oct 23, 2024
1 parent 6bb247d commit 69e2af4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ 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: |
rm -rf /opt/watcom
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: |
Expand All @@ -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: |
Expand All @@ -60,6 +69,7 @@ jobs:
path: |
**/*.EXE
**/*.EFI
pcireg/pcireg
**/*.BIN
ac97/*.md
acpi/*.md
Expand Down
5 changes: 3 additions & 2 deletions clib/gcc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pcireg/Makefile.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion pcireg/README.md
Original file line number Diff line number Diff line change
@@ -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
-----
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 69e2af4

Please sign in to comment.