MICROVM revision 1.1 1 # $NetBSD: MICROVM,v 1.1 2025/01/15 13:16:22 imil Exp $
2 #
3 # MICROVM kernel configuration, for use with Qemu microvm machine type
4 # or Firecracker.
5 # Stripped-down configuration with no PCI, use VirtIO over MMIO virtual
6 # bus instead. ACPI is disabled as Firecracker doesn't support it,
7 # use legacy MP tables instead.
8 #
9 # Exemple qemu usage on a Linux host to boot a NetBSD guest:
10 #
11 # qemu-system-x86_64 \
12 # -M microvm,x-option-roms=off,rtc=on,acpi=off,pic=off,accel=kvm \
13 # -m 256 -cpu host -kernel ${KERNEL} \
14 # -append "root=ld0a console=com rw -z" \
15 # -display none -device virtio-blk-device,drive=hd0 \
16 # -drive file=${IMG},format=raw,id=hd0 \
17 # -device virtio-net-device,netdev=net0 \
18 # -netdev user,id=net0,ipv6=off,hostfwd=::2200-:22 \
19 # -global virtio-mmio.force-legacy=false -serial stdio
20
21 machine amd64 x86 xen
22 include "conf/std" # MI standard options
23 include "arch/xen/conf/std.xenversion"
24
25 options CPU_IN_CKSUM
26 options EXEC_ELF64 # exec ELF binaries
27 options EXEC_SCRIPT # exec #! scripts
28 options MTRR
29 options MULTIPROCESSOR
30
31 options CHILD_MAX=1024 # 160 is too few
32 options OPEN_MAX=1024 # 128 is too few
33
34 mainbus0 at root
35 cpu* at mainbus?
36 ioapic* at mainbus? apid ?
37
38 options INCLUDE_CONFIG_FILE # embed config file in kernel binary
39 maxusers 8 # estimated number of users
40
41 options INSECURE # disable kernel security levels - X needs this
42
43 options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT
44
45 options PIPE_SOCKETPAIR # smaller, but slower pipe(2)
46
47 # Xen PV support for PVH and HVM guests, needed for PVH boot
48 options XENPVHVM
49 options XEN
50 hypervisor* at mainbus? # Xen hypervisor
51 xenbus* at hypervisor? # Xen virtual bus
52 xencons* at hypervisor? # Xen virtual console
53
54 # Include NetBSD 10 compatibility
55 options COMPAT_100
56 #
57 # Because gcc omits the frame pointer for any -O level, the line below
58 # is needed to make backtraces in DDB work.
59 #
60 makeoptions COPTS="-O2 -fno-omit-frame-pointer"
61
62 # File systems
63 #include "conf/filesystems.config"
64 file-system FFS
65 file-system EXT2FS
66 file-system KERNFS
67 file-system MFS
68 file-system TMPFS
69 file-system PTYFS
70 file-system MSDOSFS
71 file-system PROCFS
72
73 options DKWEDGE_AUTODISCOVER
74 options DKWEDGE_METHOD_GPT
75 # File system options
76 # ffs
77 options FFS_NO_SNAPSHOT # No FFS snapshot support
78 options WAPBL # File system journaling support
79
80 # Networking options
81 #options GATEWAY # packet forwarding
82 options INET # IP + ICMP + TCP + UDP
83 options INET6 # IPV6
84
85 # Kernel root file system and dump configuration.
86 config netbsd root on ? type ?
87
88 #
89 # Device configuration
90 #
91
92 # ACPI will be used if present. If not it will fall back to MPBIOS
93 options MPBIOS # configure CPUs and APICs using MPBIOS
94 # Provide bug-for-bug compatibility with Linux in MP Table searching
95 # and parsing. Firecracker relies on these bugs.
96 options MPTABLE_LINUX_BUG_COMPAT
97
98 #pci* at mainbus? bus ?
99 #acpi0 at mainbus0
100
101 # ISA bus support
102 isa0 at mainbus?
103
104 # ISA serial interfaces
105 com0 at isa? port 0x3f8 irq 4 # Standard PC serial ports
106
107 # Virtual bus for non-PCI devices
108 pv* at pvbus?
109
110 ## Virtio devices
111 # Use MMIO by default
112 virtio* at pv?
113 #virtio* at acpi?
114 #virtio* at pci? dev ? function ? # Virtio PCI device
115 #viomb* at virtio? # Virtio memory balloon device
116
117 ld* at virtio? # Virtio disk device
118 vioif* at virtio? # Virtio network device
119 viornd* at virtio? # Virtio entropy device
120 viocon* at virtio?
121
122 vio9p* at virtio? # Virtio 9P device
123 #vioscsi* at virtio?
124 #scsibus* at vioscsi?
125
126 pseudo-device md # memory disk device (ramdisk)
127 #options MEMORY_DISK_HOOKS # enable md specific hooks
128 #options MEMORY_DISK_DYNAMIC # enable dynamic resizing
129 #
130 pseudo-device vnd # disk-like interface to files
131 #options VND_COMPRESSION # compressed vnd(4)
132
133 ## network pseudo-devices
134 pseudo-device bpfilter # Berkeley packet filter
135 pseudo-device loop # network loopback
136
137 ## miscellaneous pseudo-devices
138 pseudo-device pty # pseudo-terminals
139 # userland interface to drivers, including autoconf and properties retrieval
140 pseudo-device drvctl
141
142 file-system PUFFS
143 pseudo-device putter
144