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
25 lines
445 B
Bash
Executable file
25 lines
445 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# reload.sh - Rebuild and reload the chapter driver.
|
|
#
|
|
# Run from the chapter root (one directory above shared/).
|
|
|
|
set -eu
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
if kldstat -qm myblk >/dev/null 2>&1; then
|
|
echo "Unloading existing myblk..."
|
|
umount /mnt/myblk 2>/dev/null || true
|
|
kldunload myblk
|
|
fi
|
|
|
|
echo "Building..."
|
|
make clean
|
|
make
|
|
|
|
echo "Loading..."
|
|
kldload ./myblk.ko
|
|
|
|
echo "Loaded. /dev/myblk0 should now exist."
|
|
ls -l /dev/myblk0 || true
|