MICROVM revision 1.2 1 # $NetBSD: MICROVM,v 1.2 2025/03/27 12:22:44 riastradh 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 i386 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_ELF32 # 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
116 include "dev/virtio/virtio.config"
117 no viomb* at virtio? # XXX ?
118 no vioscsi* at virtio? # XXX ?
119
120 pseudo-device md # memory disk device (ramdisk)
121 #options MEMORY_DISK_HOOKS # enable md specific hooks
122 #options MEMORY_DISK_DYNAMIC # enable dynamic resizing
123 #
124 pseudo-device vnd # disk-like interface to files
125 #options VND_COMPRESSION # compressed vnd(4)
126
127 ## network pseudo-devices
128 pseudo-device bpfilter # Berkeley packet filter
129 pseudo-device loop # network loopback
130
131 ## miscellaneous pseudo-devices
132 pseudo-device pty # pseudo-terminals
133 # userland interface to drivers, including autoconf and properties retrieval
134 pseudo-device drvctl
135
136 file-system PUFFS
137 pseudo-device putter
138