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