mirror of
https://github.com/ebrandi/FDD-book.git
synced 2026-12-06 00:23:30 +00:00
Organize companion code and materials by book part: part-01/ Foundations part-02/ Kernel & driver fundamentals part-03/ Character & block devices part-04/ Networking & storage part-05/ Buses & advanced topics part-06/ Debugging & performance part-07/ Real-world drivers appendices/ Supplementary material README.md Overview and build instructions
3.3 KiB
3.3 KiB
portdrv - Portability Notes
This document records the portability surface of the portdrv
reference driver that accompanies Chapter 29.
Supported Platforms
| Architecture | Status | Notes |
|---|---|---|
| amd64 | tested | Primary development platform. |
| i386 | tested | Builds cleanly; runtime tested under bhyve. |
| arm64 | builds | Cross-compile tested; runtime should work. |
| riscv64 | builds | Cross-compile tested; runtime not validated. |
| powerpc64 | builds | Cross-compile tested; validates endian paths. |
Supported FreeBSD Versions
| Version | Status | Notes |
|---|---|---|
| 14.3 | primary target | All labs assume this release. |
| 14.2 | tested | Builds and loads; API surface identical. |
| 13.x | not supported | Pre-bus_barrier work; would need backporting. |
Supported Buses
| Bus | Backend file | Status |
|---|---|---|
| PCI | portdrv_pci.c |
tested |
| SIM | portdrv_sim.c |
tested |
| FDT | (challenge) | planned |
| USB | (challenge) | planned |
Supported Build Configurations
| Configuration | Status |
|---|---|
make (defaults to SIM only) |
tested |
make PORTDRV_WITH_PCI=yes |
tested |
make PORTDRV_WITH_SIM=yes |
tested |
make PORTDRV_WITH_PCI=yes PORTDRV_WITH_SIM=yes |
tested |
Known Limitations
- The driver assumes little-endian hardware registers. Big-endian
hardware would require swapping the
htole/letohcalls in the data path tohtobe/betoh. - The simulation backend does not model DMA. A production driver with DMA would need a richer simulation.
- The driver does not currently support hotplug.
detachis only exercised onkldunload.
How to Report a Portability Bug
Include the output of:
uname -a
make -V CFLAGS
sysctl dev.portdrv
dmesg | grep portdrv
Along with the exact build command used and the platform on which the failure occurred. Bug reports that include these four items are much easier to triage.
Version History
| Version | Change |
|---|---|
| 1 | Initial monolithic driver (Lab 1). |
| 2 | Added backend interface (Lab 3). |
| 3 | Split into multiple files (Lab 4). |
| 4 | Added simulation backend (Lab 5). |
| 5 | Added conditional compilation (Lab 6). |
| 6 | Added endian helpers (Lab 7). |
| 7 | Added sysctl tree (Lab 10). |
| 8 | Added runtime backend selection (Lab 11). |