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
37 lines
985 B
Bash
37 lines
985 B
Bash
#!/bin/sh
|
|
#
|
|
# bhyve-launch.sh.sample - sample bhyve launch script for Chapter 34
|
|
# Lab 6 (remote GDB stub debugging).
|
|
#
|
|
# Adjust the VM name, disk image, and network settings for your
|
|
# environment. The important piece is the serial line: -l
|
|
# com1,/dev/nmdmXA gives the host a matching /dev/nmdmXB that you
|
|
# can open from kgdb.
|
|
#
|
|
# This is a sample. Do not copy it blindly.
|
|
|
|
VMNAME=bugdemo-debug
|
|
DISK=/vms/bugdemo-debug.img
|
|
MEM=2G
|
|
CPUS=2
|
|
|
|
# The null-modem pair. XA is the guest side; XB is what the host
|
|
# reads from.
|
|
NMDM_GUEST=/dev/nmdm34A
|
|
NMDM_HOST=/dev/nmdm34B
|
|
|
|
bhyve \
|
|
-c ${CPUS} \
|
|
-m ${MEM} \
|
|
-H -w \
|
|
-s 0,hostbridge \
|
|
-s 1,lpc \
|
|
-s 2,virtio-blk,${DISK} \
|
|
-s 3,virtio-net,tap0 \
|
|
-l com1,${NMDM_GUEST} \
|
|
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
|
|
${VMNAME}
|
|
|
|
echo "Serial device on the host: ${NMDM_HOST}"
|
|
echo "Attach with: kgdb /boot/kernel/kernel"
|
|
echo "Then in kgdb: target remote ${NMDM_HOST}"
|