Repository navigation
Plan files mmap memory and attach
Scope for the work between "the DRM core compiles" and "a first driver
(amdgpu) attaches and user space can map buffers". Written before
implementation; milestones are updated as they land. See
DRM integration for status and
Linux compatibility layer for the
principles (compat first, then glue, then replacement files; no
patches to dist).
Opening a device. /dev/dri/* are character devices of one
major. Opening one calls drm_stub_open(inode, file), which looks up
the minor by iminor(inode), switches the file to the driver's
file_operations (replace_fops) and calls their open (normally
drm_open). drm_open sets file->f_mapping to the device's shared
anon_inode->i_mapping, checks f_flags (O_EXCL) and
f_op->fop_flags & FOP_UNSIGNED_OFFSET, and records the opener
(task_tgid(current), capable(CAP_SYS_ADMIN)). Read, poll and
ioctl are plain file_operations; DRM has no kqueue.
Mapping a buffer. mmap on that file calls f_op->mmap(file, vma) = drm_gem_mmap, which finds the object by vma->vm_pgoff
(a fake offset from drm_vma_manager) and calls the object's
funcs->mmap and/or installs funcs->vm_ops. Pages arrive in one
of these ways:
| Way | Who |
|---|---|
vm_ops->fault calling vmf_insert_pfn(_prot)
|
TTM (amdgpu, radeon, nouveau, xe, vmwgfx), GEM shmem helper, xe |
eager remap_pfn_range / io_remap_pfn_range / dma_mmap_* at mmap time |
GEM DMA helper (ARM SoCs), a few small drivers |
apply_to_page_range (writes PTEs itself) |
i915 (i915_mm.c) |
Fault handlers may sleep (reservation locks, fences). Before
sleeping they call mmap_read_unlock(vmf->vma->vm_mm) and return
VM_FAULT_RETRY when vmf->flags allows a retry; TTM does this.
Revoking mappings. When a buffer moves (VRAM ↔ system,
eviction, reset, unplug), drivers call unmap_mapping_range(mapping, offset, len, 1) on the device's address_space — via
drm_vma_node_unmap, TTM, amdgpu and i915 directly. Every user
mapping of that range must fault again afterwards.
Pages. TTM allocates system pages itself (alloc_pages, orders
0,
GFP_DMA32), sets their caching (set_pages_array_wc/uc/wb), maps them for the CPU (kmap_local_page,vmap) and the device (dma_map_page,dma_alloc_coherent), keeps pools onlist_lruwith ashrinker, and swaps out to shmem (shmem_file_setup, folios) under pressure. VRAM is reached throughioremap_wc,io_mapping_*,memremap.drm_gem_object_init(i915, shmem-helper drivers) backs objects with shmem.
Attaching. A driver's module_init calls
pci_register_driver; the PCI core calls probe(pdev, id), which
allocates the DRM device, loads the hardware, registers minors and
sets up fbdev through DRM clients (drm_client_setup →
register_framebuffer). remove and driver.pm undo and suspend.
It patched dist: drm_gem_object embedded a UVM object, TTM had a
UVM pager and allocated through bus_dma (ttm_bus_dma.c), drivers
called pmap_pv_track on their apertures and pmap_pv_protect /
pmap_page_protect to revoke, and per-driver glue
(amdgpu_pci.c, amdgpufb.c) called drm_dev_alloc /
drm_dev_register by hand. The mechanisms are sound and are reused
below; the patches are what we avoid.
One VM object per VMA with a "managed device" pager; the fault op
fills a vm_fault and calls vm_ops->fault; vmf_insert_pfn_prot
inserts fake pages into the object; NOPAGE with nothing inserted is
retried with a time bound. Its unmap_mapping_range does not have
Linux's semantics (callers pass vm_private_data): drm-kmod patches
the call sites. So FreeBSD has no generic answer for revocation.
Decided: keep CONFIG_X86_PAT (amdgpu uses write-combining as on
Linux) and do the pmap work before the compat memory layer, so that
layer asks "what mode is this page in?" from day one.
-
Per-page mode in two spare bits of x86
pp_attrs; everypmap_enterof a managed page applies it, so no two mappings of a page disagree.pmap_page_set_cacheattr(pgs, n, mode),pmap_page_cacheattr(pg),pmap_kva_set_cacheattr(va, len, mode)(newsys/arch/x86/x86/pmap_cacheattr.c). Refuses (EBUSY) a second non-WB mode and pages that are mapped; a UVM hook (PMAP_PAGE_FREEinuvm_pagefree) restores WB if an owner forgets. - Direct map: a 2 MiB page is split into 4 KiB entries on first change (same translations), the one entry changed, all TLBs shot down, caches flushed when leaving WB (not on self-snooping CPUs). AMD Family 10h (erratum 383) splits inside an all-CPU rendezvous.
-
Only RAM is direct-mapped now: PCI window, firmware and ACPI
ranges are absent;
mm_md_direct_mapped_phys()answers for RAM only, so/dev/mem, EFI and physmap use proper mappings for the rest. -
Linux compat:
set_pages_array_wc/uc/wb,set_pages_uc/wb,set_memory_wc/uc/wb(asm/set_memory.h,linux_set_memory.c);map_page_into_agpmakes pages uncached as Linux does. -
Tests:
t_cacheattrwith thecacheattr_testerkernel module (amd64): split, all modes across a 2 MiB boundary, coherence, enforcement and refusals, kernel VA, free safety net, the erratum path (forced), stress on all CPUs (both paths), holes. Still to do: real AMD and Intel hardware.
Done as designed; kqueue added (below). drm_cdevsw.c is now a
cdevsw whose d_open is linux_chrdev_open(DRM_MAJOR, ...);
drm_gem_vm.c is gone (mmap returns ENODEV until M2). Still to do:
the accel major.
-
register_chrdev(major, name, fops)recordsmajor → fops(today a no-op). A generic cdevswd_openbuilds an inode withi_rdev = dev, a Linux file with the recorded fops, callsf_op->open, and installs it withfd_clone(..., &linux_fileops).drm_cdevsw.cshrinks to that cdevsw; the open/read/poll/close code in it goes (DRM's own functions run instead). - Errors:
-ERESTARTSYS→ERESTART;f_flagsfrom the open flags. - accel (
/dev/accel) has its own major: same mechanism, later.
-
linux_fileops.fo_mmap(every Linux file: DRM, dma-buf) builds avm_area_structand callsf_op->mmap(file, vma), then returns a UVM object (one per mmap call) whose pager bridges to the VMA. -
Object-relative addresses. At
fo_mmaptime UVM has not chosen an address, and later fork, partial munmap and mremap change addresses. So the VMA usesvm_start = 0,vm_end = size, andvmf->address = (page index in object) << PAGE_SHIFT. Handlers only use addresses relative tovm_startwithvm_pgoff, so this is invisible to them, and the mapping survives entry splits/moves. - Fault:
pgo_faultfillsstruct vm_fault(vma,address,pgoff,flagswithFAULT_FLAG_ALLOW_RETRY) and callsvm_ops->fault.vmf_insert_pfn_prot(vma, addr, pfn, prot)pmap_enters into the faulting map at the entry address for that object page (clipped to the entry: TTM prefaults 16 pages), with cacheability fromprot(PMAP_WRITE_COMBINE,PMAP_NOCACHE). Eager inserts at mmap time (remap_pfn_range,dma_mmap_*) are recorded and served at fault time. -
mmap_read_unlock(vmf->vma->vm_mm)inside a fault =uvmfault_unlockall; return codes:RETRY→ERESTART,NOPAGE→ 0 (retry access; bounded in time as in FreeBSD),SIGBUS→EFAULT/EINVAL,OOM→ENOMEM. -
vm_ops->open/closeonpgo_reference/pgo_detach(one per map entry, as Linux has one per VMA). Private (copy-on-write) mappings are refused, as NetBSD's TTM did.
By mapping, as Linux does, not by physical page: each address_space
lists its VMAs, each VMA records the spans (process, vmspace, entry
range) it was faulted in, and unmap_mapping_range pmap_removes the
range from the entries that still map it. This replaced the planned
pv-tracking design: no device memory needs tracking (pv tracking of a
resizable BAR would cost about 1% of VRAM in RAM), and it works on
every architecture, so core change 5 is no longer needed. See
Memory and DMA.
- Pages (done):
alloc_pages/__free_pagesonuvm_pagealloc/uvm_pglistalloc,struct pagefields overlaid on unusedvm_pagefields. See Memory and DMA. - CPU mappings (done):
kmap_local_pagethrough the direct map;vmap/vunmap/vmap_pfn,ioremap*,memremaponpmap_kenter_pa, every mapping of a page in that page's cache mode. - DMA (done): the Linux
struct devicecarries the device's 32- and 64-bitbus_dma_tag_ts (frompci_attach_args);dma_map_page/sg,dma_alloc_coherent/attrsonbus_dmamap_*/bus_dmamem_*, with a red-black tree from DMA address to map for unmapping (FreeBSD's approach) and an untracked 1:1 fast path on x86; Linux-layout scatterlists ported from LinuxKPI. See Memory and DMA. -
list_lru(plain locked lists) andshrinker(done, on UVM reclaim hooks; core change 2),cc_platform_has(done: false). - shmem and folios (done): shmem files on UVM anonymous objects,
page references as wirings, single-page folios. Tested through real
swap (
t_linux_mm shmem_swap). See Memory and DMA.
Done as designed: pci_driver, registry and Linux-style id matching
and PM ordering in linux_pci_driver.c (tested in rump), the autoconf
side in linux_pci.c (struct linux_pci_softc,
linux_pci_driver_match/attach/detach). pci/drm_pci.c and
drm_pci_busid.c removed. Per-driver cfattach conversion happens with
each driver port (amdgpu first); real attach is tested then.
-
pci_register_driverrecords the driver (from itsmodule_init). - Generic helpers for a NetBSD attachment: match walks the recorded
drivers'
id_table; attach sets up thepci_devand callsprobefrom aconfig_mountrootcallback (firmware needs the root file system); detach callsremove; pmf callsdriver.pm. - Per-driver glue becomes a cfattach of ~30 lines. The glue's
pci/drm_pci.c(upstream has its own),drm_pci_busid.c(rewrite onpdev), hand-writtendrm_dev_alloc/registergo.
register_framebuffer attaches a drmfb (a genfb on the fbdev
emulation's shadow buffer) under the DRM driver's device; damage reaches
the scanout through genfb's damage hook. A GPU driver takes the console
over from the firmware framebuffer, at boot and when loaded later, and
gives it back if its probe fails. See DRM integration.
The principle: Linux drivers underneath, NetBSD's own interfaces on top. Everything users and administrators touch goes through wscons and the usual NetBSD tools; Linux-style settings are the advanced option.
Console modes, one setting (a module property, e.g. boot.cfg
load=drmkms console=...):
| Mode | Console | Follows output changes |
|---|---|---|
| no DRM | genfb on the firmware framebuffer | no |
DRM, fbdev emulation (default, console=fbdev) |
DRM's fbdev client through drmfb
|
no: fixed at the first mode, as on Linux |
DRM, console client (console=wscons) |
a NetBSD DRM client owning its buffer | with hw.drm2.console_follow; hw.drm2.video at any time |
| DRM, no console | console on serial or another display | -- |
Pieces, in order (1-4 done in M9; how they work: The console, Booting and kernel modules, events):
-
One resolution setting. (done) The console takes the mode chosen with efiboot's
gopcommand, as genfb does; avideo=setting (fb_get_options/video_get_options, fed from a module property) covers several outputs. -
The console client. (done) A DRM client (
drm/drm_client.cAPI, as Linux'sdrm/clients/drm_log.c) owning its framebuffer, setting the mode and flushing damage (drm_client_framebuffer_flush). It leaves the display alone while a DRM master (X, a compositor) owns it. Linux's fbdev layer leaves the console path. -
Resizing in place. (done)
genfb_retarget(a new framebuffer for a genfb) andvcons_resize(every screen re-initialized, as loading a font already does), with the terminals' window size updated andSIGWINCHsent; a switch (hw.drm2.console_follow, off by default) lets the console client follow output changes. -
Hotplug events. (done; libudev-bsd's side is open) Output changes reach user space through drvctl device events, handled by
devpubdhooks -- what a compositor or an administrator's script listens to. -
Modes through wscons. Mode get/set through wscons, implemented by the console client with DRM's modes and
videomode(9), sowsconsctlsets the resolution whatever is underneath. -
Screens and graphics sessions. DRM master handover tied to wscons screen switches: several graphical sessions on different
ttyEscreens. What a seat manager needs on top (item 13): a switch announced to the session before it leaves and after it returns (wscons's process-controlled switching, as the USLVT_*emulation already does for X), DRM master dropped and taken at those points, and input devices revoked from a session switched away (evdev'sEVIOCREVOKE, roadmap K3). -
The rest of the display through NetBSD interfaces: brightness as wsdisplay parameters, GPU sensors in envsys, genfb's splash screen, and a panic-time drawing path (Linux's
drm_panic) behind genfb's polling hooks for ddb. -
Console configuration, as Debian's console-setup does it.
wscons.confstays the one source of truth. Added: a boot-time font choice (boot.cfg, used from the first message, as the mode is); shortrc.confknobs for the common case (one font for all screens); an interactive helper (orsysinstmenu) that lists fonts with the rows x columns they give in the current mode, previews them live and writes the configuration; and font choice by target size that survives mode changes. -
The console's terminal type from its device. (done)
/etc/ttysgivesconsoleandconsttythe typevt100, because the same entry must serve a serial console and a display; on a wscons display that is the wrong description, and its padding ($<n>delays, which less(1) turns into real sleeps) makes every pager crawl (The console). getty(8) decides the type when it opens the line:- only for the console line, recognized by its device (the console
driver's major, so any entry naming
/dev/consttyor/dev/consolecounts), since only there/etc/ttyscannot know what kind of device it describes; - the screen's emulation gives the type, through a new ioctl
WSDISPLAYIO_GEMUL(constty passes ioctls to the real console device):vt100giveswsvt25,sungivessun,dumbgivesdumb; otherwise (a serial line, an unknown emulation, an older kernel) the/etc/ttystype stands, so a serial console keepsvt100; - a
tt=capability in the line'sgettytabentry always wins; every other line keeps its/etc/ttystype as written; - getty exports the type as
TERMto login(1) (login -pkeeps it) and uses it for its own clear-screen.
Decided again at each login, so it stays right if the console's device changes between logins; a running session keeps its
TERM. Proof:man lspaging timed on a drmfb console before and after; a serial console still getsvt100. - only for the console line, recognized by its device (the console
driver's major, so any entry naming
-
Screens independent of displays (moving the console at run time). Today a wscons screen belongs to one wsdisplay: its minor encodes the display (
WSDISPLAYMINOR(unit, screen)), and when the display detaches (genfb evicted by a GPU driver, a driver unloaded) its screens are revoked and their sessions end./dev/consttyredirects every read, write and ioctl to the current console device (cn_redirect,cn_tab->cn_dev), so re-pointing the console under an open session would hand that session a terminal its getty never opened. The model is Linux's: a virtual terminal (tty, emulation state, text buffer) is separate from the head that draws it, and fbcon'scon2fbmapmaps one to the other.
-
Split
struct wsscreeninto what stays (tty, minor,wsemulstate, vcons text and attribute buffers) and the head binding that can change (emulops, cookie,wsscreen_descr). -
Move = create the screen on the target head through that
driver's own
vcons_init_screen, redraw fromscr_charsandscr_attrs, release it on the old head. A different size goes through the resize path that exists (wsdisplay_screen_resized: emulation resize,t_winsize,SIGWINCH). Keyboard focus (kbdmux) follows. -
The kernel console keeps pointing at the same screen;
cn_tab->cn_devdoes not change, soconsttysessions continue. The drawing target is swapped under the quiescewsdisplay_cnquiescealready provides, soprintffrom interrupts and ddb never see half a switch. -
A display that goes away hands its text screens to another
display instead of revoking them. This replaces today's takeover
(genfb detached, screens revoked, drmfb starting fresh) and
linux_pci_give_back's reverse: sessions survive a GPU driver loading, failing or unloading, and the console's GPU driver can be unloaded once its screens have moved. -
Limits. Screens in mapped or framebuffer mode
(
WSDISPLAYIO_MODE_MAPPED,DUMBFB: X, a compositor) hold a mapping of one framebuffer and do not move (EBUSY); on detach they are revoked as today. Displays without vcons (text-mode vga) have no text buffer to redraw from and take no part. -
Compatibility. Device names, minors, ioctls and structures
are unchanged; per-display ioctls on a moved screen answer for its
current head. The interface is an addition: a
wsconsctlfield or ioctl moving screen N to display M, and a sysctl naming the console's display. -
First: list which display drivers use vcons, check how
wsemul_vt100and X's VT handling react to a size change, then implement on genfb ↔ drmfb in the VM, then on real hardware. - Serial ↔ display moves are not part of this.
Proof: a shell on the console survives modload and modunload of the
GPU driver (today it loses the terminal), and a screen moved
between two heads keeps its contents.
11. A console display per output. Today the console client and
drmfb give a DRM device one framebuffer, shown on every output (as
Linux's fbdev does). Instead the console client makes a framebuffer
per active CRTC and a wsdisplay for each, so every output has its own
screens (ttyE0... on one, ttyE256... on the next: the minor
already carries the display unit). Ctrl+Alt+Fn switches screens on
the display the keyboard is attached to, as now. Outputs appearing
and disappearing:
- a new output gets a new display with one screen (more through
wsconscfg, as for any display); - an output that disconnects parks its text screens: tty,
emulation and text buffer stay, output goes into the buffer and
never blocks, nothing is drawn. When an output appears again the
screens attach to it and redraw, with
SIGWINCHif the size differs. A disconnect does not move screens at once, since DisplayPort monitors report one when they only go to standby; they move by command (item 12) or once the output has stayed away for a while; - when the GPU itself goes, its screens move to another display or park (item 10);
- graphics sessions get DRM's hotplug events (drvctl
device-change) and arrange their outputs themselves; when the whole device goes, DRM's unplug fails their ioctls withENODEVand revokes their mappings (M3), and their screen in mapped mode is revoked.
The rule: a display going away never ends or blocks a text session.
12. Keyboard focus between outputs. Keyboards reach a display
through a wsmux (kbdmux), which can be reconnected while running.
A keyboard command (Ctrl+Alt+Left/Right, say) moves the focus to
the next display, parked screens included; the same by ioctl and a
wsconsctl field. If the focused display goes away, focus moves
to one that remains. The mouse stays per display (wsmoused
selection and paste); the pointer does not cross outputs.
13. Seats. A wsdisplay with its own keyboard mux and mouse is a
text seat already; several are multiseat with configuration only.
Graphical sessions get theirs from a seat manager: seatd with a
wscons backend (its FreeBSD one is the model), so libseat users
(wlroots compositors such as sway and labwc) run unchanged; X keeps
using the USL emulation. Needs item 6 and evdev. This settles
the roadmap's open question for the seat manager in favour of
seatd.
Where the console stops. The kernel console is the surface for
booting, administration and emergencies: it must work in a panic and
in ddb, and stay small. It provides independent screens per output,
focus moved explicitly, selection and paste within a display, hotplug,
and clean handover to graphics sessions. It does not arrange outputs
into one desktop, move a pointer between them, draw windows or
overlays, or shape text beyond rasops (complex scripts, emoji,
ligatures): that is a compositor's work, and a rich text console
belongs in user space (a terminal alone in a kiosk compositor, or a
DRM console program such as Linux's kmscon). Linux went the same way:
fbcon is being reduced, and its new in-kernel pieces (drm_log,
drm_panic) are deliberately minimal.
-
Small driver ports first, to shake out the compat layer and glue
while cheap:
vgem(GEM, dma-buf, fences; no hardware),vkms(vblank, page flips, writeback; no hardware),qxl(TTM in QEMU),cirrus-qemu; then build-only ports (vboxvideo,ast,mgag200,udl,gud); thenvmwgfx,radeon, Intel.vgemandvkmsalso give CI a GPU-less display test bed. (vgem,vkmsandastare done.) - 3D in a VM (virgl through virtio-gpu, Mesa from the xsrc fork), then amdgpu on real hardware. The dma-buf and sync file ioctls, which Mesa's Vulkan window-system code needs, are done.
-
A perf-class profiler: one front end over tprof (PMC sampling),
DTrace and lockstat, writing formats existing viewers read; kernel
work for call chains in tprof samples, per-thread counting, and
Linux
TRACE_EVENTs as DTrace SDT probes (the compat layer makes them empty functions today; about 250 in DRM).
-
sys/modules/drmkms/Makefilematchesfiles.drmkms(the staledrm_gem_cma_helper.c,drm_hdcp.c,drm_memory.c,drm_vm.care gone;drm_displayanddrm_schedsources belong to their own modules), anddrm_gem_vm.cis deleted. No generator: compare the module'sSRCSwith thedrmkms/drmfblines offiles.drmkmsafter changing either.
M0 first (done). Phase A, to compile (declarations; stubs fail cleanly): M1, M5,
headers of M2–M4 and M6. Phase B, to run: M2 → M3 (needs M2) and M4
(independent), then M6. First driver: amdgpu (TTM, no shmem GEM, no
apply_to_page_range). i915 needs i915_mm.c handled (replacement
file or an apply_to_page_range built on the same inserts) and
shmem; later.
- M1, M4 (allocation, tables): rump on Linux and NetBSD.
- M4 DMA: a real kernel (rump has no bus_dma and no physical
addresses): the
linux_mm_testermodule, which loadsdrmkms_linux, run byt_linux_mmin the dev VM (also pages,struct pagefields, vmap, ioremap). - M2, M3 need a real kernel (rump has no faulting pmap): a test kernel
module exposing a Linux-file character device with
vm_ops->faultand an ioctl that revokes and moves pages; an ATF test maps it, reads, revokes, checks the refault sees the new page, and covers fork, partial munmap, mremap, MAP_PRIVATE refusal, retry/NOPAGE. Runs in the dev VM.
All deferred work, these included, is collected in the Backlog.
Policy: where the NetBSD core lacks something whose absence users would feel, aiBSD changes the core rather than living with a stub. Stubs may still be used to get code compiling first. Each item is scoped when reached; all are small, separate, tested and upstream-offerable.
- Cache aliasing (x86): done — M0 (per-page cache attributes, RAM-only direct map).
-
Memory reclaim for Linux shrinkers — done: UVM reclaim
hooks run by the page daemon (
uvm/uvm_reclaim.c), shrinkers andlist_lruon them, tested under real pressure (t_reclaim). Was: UVM's page daemon only drainspool(9)caches. Without a hook, TTM page pools and GEM caches never give memory back under pressure. Add a reclaim-hook interface to UVM's page daemon;register_shrinkeruses it. -
userptr (
mmu_interval_notifier,pin_user_pages): used by amdgpu/radeon userptr BOs (Vulkan external host memory, compute). Needs notification when a process's mapping changes — an MMU notifier interface in UVM — and page pinning on UVM. -
In-kernel eventfd signalling for
DRM_IOCTL_SYNCOBJ_EVENTFD. -
pv tracking on more architectures— not needed: revocation works by mapping (M3), not by physical page. -
Runtime power management of GPUs (laptops: discrete GPU in
D3cold when idle; Linux
pm_runtime_*, PCI power states, ACPI power resources), and hybrid graphics (vga_switcheroo): NetBSD has neither framework. Fleshed out as a roadmap milestone (Roadmap: P1). -
HDMI/DisplayPort audio: DRM exposes it as a sub-device for the
sound subsystem (
platform_device, ELD); it needs a bridge to NetBSD's audio (hdaudio) — compat plus audio-side work. -
Bounce buffers for
bus_dmamap_load_rawon x86: x86's raw load returnsEINVAL("XXX TBD bounce") when a segment lies beyond the tag's limit, sodma_map_sgfails for a device whose DMA mask is below the top of RAM (32-bit-only devices on large machines). Modern GPUs address 40+ bits and do not hit it; implement when one does (or with an IOMMU, item to scope then). -
Resizable BAR: amdgpu enlarges its VRAM BAR
(
pci_resize_resource) so the CPU can reach all of video memory; NetBSD's PCI code can read the capability but not resize a BAR or the bridge windows above it. Without it a GPU keeps the BAR size the firmware chose: all of VRAM when the firmware's resizable-BAR setting is on, 256 MiB otherwise, which costs performance (buffers must be moved into the window to be reached). Needs BAR and bridge-window reassignment indev/pci; scope when the attach path runs on real hardware. -
A machine-independent DMA tag for system memory. Linux gives a
device with no bus (a faux device) direct mapping: bus address =
physical address. NetBSD has no MI way to ask for "system memory,
no IOMMU": each port has its own tag (x86's
pci_bus_dma_tag, arm'sarm_generic_dma_tag), andlinux_faux.cpicks one with#ifdefs. An MIbus_dmacall with an MD hook would serve this, bounce buffers, and IOMMU-backed tags later.
-
Built-in kernels: autoconf matches before module init; the
*_guarantee_initializedkludge must run initcalls (and sopci_register_driver) before match. -
Shared wait queues and kqueue (compat, not core): a wait queue
carries one
selinfo, so when several files poll the same queue only the first is notified; fix by letting a queue notify several.
aiBSD system development guide
Tutorial
II — Building
III — The kernel
- Kernel basics
- Booting and kernel modules
- The boot loader
- System calls and other numbered ABIs
- The auxiliary vector and CPU features
- Locales in libc
- Threads, processes, tasks
- Devices and drivers
- Files, descriptors, device nodes
- PCI
- Virtual memory
- Memory and DMA
- Page tables, TLBs, memory types
- Firmware
- State and events
- The console
- Power management
IV — Linux compat layer
V — DRM
VI — Testing
VII — Upstreams
Appendices