Open-source contributor · github.com/pkgdemon
.local (mDNS) Resolution
Getting mDNS name resolution working on Debian/Devuan.
$HOME is on NFS: the server doesn't register NLM, SQLite POSIX locks block in fcntl(), and the main thread stops servicing X events. Evidence, root cause, and fix.
reboot -r reroot to eliminate the kernel/userspace namespace split. Deferred — the simpler symlink trick (cdroot/boot/firmware → /sysroot/boot/firmware) verified working on real hardware, addressing the firmware-loading problem without architectural rewrite. Plan preserved as a reference if some future need genuinely requires kernel-and-userspace-share-a-root semantics.
init_script with the init_chroot + in-kernel-unionfs (tmpfs upper / uzip lower) pivot — the whole root becomes one writable union, the real rc.d scripts run, nothing is neutered. Ports the /boot/firmware → /sysroot/boot/firmware symlink; splits loader.conf into a live-only tier and an everywhere loader.conf.d/gershwin.conf. Changes gershwin-system's installer to copy the pristine uzip with bsdtar --acls --xattrs --fflags from a read-only mount of /dev/md0.uzip, instead of a broken cp -a tree copy — full metadata fidelity, off unionfs entirely, no live-session cruft. Net: minimal divergence between the livecd and the installed system.
Copier.framework scoping plan Scoping
Follow-up to the livecd plan: a fully-native, cross-platform GNUstep file-level copier to eventually replace the interim bsdtar installer step. A Copier.framework (libs-base citizen) + CLI — GSFileCopier / GSCopyOptions / GSFileMetadata / GSInodeMap / GSExcludeMatcher — with a ~600-800 line platform shim (extattr_*/acl_*_link_np/lchflags on FreeBSD, *xattr/acl_*_file/FS_IOC_*FLAGS on Linux). No incremental deps since the ISO always ships GNUstep. Documents the load-bearing per-file operation ordering, the unpreservable bits (ctime, birthtime), and a local-only v1 scope.
varrun → cron, syslogd-first, and dhcpcd-after-kmodloader work declaratively rather than by alphabetical-filename luck. netconfigd is one downstream consumer of the same primitives; the doc walks both layers.
mach.ko — out-of-tree kernel module feasibility (v1) Superseded
Predecessor investigation that led to freebsd-launchd-mach (v2). Earlier framing: build a minimal mach.ko from scratch covering the ~15-call subset configd and launchd's bootstrap actually use. Stable-KPI-only diet so the artifact rebuilds only at major FreeBSD bumps. Shipped from freebsd-launchd's CI as a per-major release tarball alongside the live ISO. Superseded by v2 once direct inspection of NextBSD and ravynOS revealed a working module already exists, but kept for the API-surface analysis (the configd Mach-surface inventory in §8 and the stable-KPI / KBI diet in §5 are cited in-body from v2).
freebsd-launchd on the AF_UNIX track unchanged; create a new freebsd-launchd-mach repo that extracts ravynOS's sys/compat/mach/ as an out-of-tree mach.ko, lifts their launchd / liblaunch / libxpc / libdispatch, integrates the configd Apple source already imported by freebsd-launchd, and reuses the existing CI / ISO scaffolding. Apple source covers only the system-services layer (Mach, launchd, configd, notifyd, asl, dispatch, xpc); GNUstep stays for the framework layer (Foundation, AppKit, libobjc2). Stays ELF; no dyld, no Mach-O execution, Linux compat unaffected. Status: mach.ko builds + kldloads on stock FreeBSD-15; 4 wired trap-family syscalls + libmach + lazy Mach init + end-to-end userland mach_msg proof; 19/19 smoke green, zero kernel patches.
launchctl.c is 4,549 LOC of CF-heavy code. Audits three candidates — gnustep/libs-base, gnustep/libs-corebase, swiftlang/swift-corelibs-foundation — against the exact symbol set launchctl.c uses, with a buy/build/skip decision per candidate. Settles the CF choice that the v2 plan's lede references.
ualoc_localizationsToUse). Mid-plan vendor-source pivot: started with apple-oss-distributions/ICU, found that swift-corelibs CF actually expects apple/swift-foundation-icu (purpose-built, native _foundation_unicode/ namespace, Apache 2.0). Final shape: vendor swift-foundation-icu at src/swift-foundation-icu/, build via CMake to /usr/lib/system/libicucore.so (~40–50 MB installed, matching macOS's libicucore.dylib).
launchd-842.92.1 (2014, ~28.5k LOC, last open source pre-libxpc-split) onto our mach.ko + libsystem_kernel + libdispatch + libxpc + bootstrap_server stack. Drafted from four parallel research passes through the verbatim Apple source: build-system map (7 MIG .defs files), Mach/IPC gap analysis (audit-trailer materialization + dead-name notifications + port sets are the hard items), PID-1 vs daemon-mode split (single pid1_magic gate; per-user mode is the natural non-PID-1 analogue), and launchctl + control protocol (25 subcommands, launch_msg over Unix socket, CFPropertyList plist parsing). Phases I1 (build + exec only, LAUNCHD-BUILD-OK), I2 (core functionality with multiple test daemons: KeepAlive, StartInterval, WatchPaths, Sockets), then explicit user checkpoint before any PID 1 work.
event_mach_freebsd.c shipped as a patch to gershwin-developer); subsequent phases fork libxpc from ravynOS's tree, add a bootstrap server, swap freebsd-launchd's daemon for a clean Apple launchd-842.92.1 import, build a hybrid CoreFoundation library, and finally bring up configd. Audits related daemons (asl, notifyd, mDNSResponder, IPConfiguration, DiskArbitration). NSXPCConnection documented as a downstream GNUstep contribution.
libs-corebase, Apple CF-Lite-1153.18 (2015), and swift-corelibs-foundation's CoreFoundation. Per-port symbol audit: configd (12,968 CF calls, 42 CFMachPort sites), SystemConfiguration framework (6,925 CF, 0 NS), asl/notifyd/libnotify (zero CF). Recommends hybrid: GNUstep value-type CF + a supplementary libCFRuntime.so sourced from swift-corelibs CF for the runtime parts (CFMachPort, CFRunLoop v1, CFPreferences, CFBundle plugin loader). libgnustep-base for Foundation; no swift-corelibs Foundation.
DISPATCH_SOURCE_TYPE_MACH_RECV (libxpc, libnotify, notifyd, notifyutil, SystemConfiguration framework). Three options analyzed: patch libdispatch once, polling threads per consumer, or a small bridge library. Recommends Option 1. Includes the comprehensive "all in-scope apps" dispatch-dep matrix, the existing gershwin kqueue performance patches we inherit, install-path comparison (/System/Library/Libraries vs /usr/lib vs /usr/local/lib), Block.h coordination with FreeBSD pkgbase.
mach.ko, libmach, libdispatch, libxpc, liblaunch, launchd (+launchctl), asl family (syslogd + aslmanager + libasl + syslog), notifyd (+libnotify + notifyutil), configd (+scutil + SystemConfiguration framework + plugins), CoreFoundation hybrid, mDNSResponder, IPConfiguration (+ipconfig + bootpd + helpers), DiskArbitration (framework + daemon + agent), Block.h, GNUstep stack. Four columns: Apple macOS / /usr/lib/system/ (Apple-like) / Gershwin /System/Library/ / FreeBSD base /usr/lib. Documents project policies: /Local/Library never /Library; GNUstep core always at /System/Library/; /System/Applications/ for system .app bundles; gershwin conditional-skip pattern; /System/Library/Tools/ as daemon alternative on every binary.
lkmnosys slot range (210–219); adding an 11th fails with ENFILE. Forward-demand estimate puts total Mach syscalls at 30–40 by the time launchd+configd+notifyd+asl are ported. This is an audit plan, not a design decision: outlines why the 10-slot limit exists, what Apple does differently (separate mach_trap_table with negative syscall numbers), the risk profile of each expansion path (RESERVED-slot claiming, multiplexer dispatcher, base-kernel patch), and the four sub-agent audits to run before picking a path.
88694f0, leaving no kldload-on-nomatch and no notification mechanism for hardware events. This plan builds hwregd as a registry-first cohesive block: Phase 0 (~3-4 wk) lifts devmatch's search_hints() parser into a daemon that reads /dev/devctl directly, kldload's on ?nomatch, and emits Mach events. Phase 1 (~5-6 wk) grows it into a full IORegistry + IOKit-shape Mach-RPC API. Then HardwareMatch launchd plist key (~1.5 wk) + IOKitUser facade K1+K2 (~6 wk). At step 4 devd+devmatch are fully replaced and ioreg -l works — this is the foundation block, ~4 months. Then a demand-driven decision point: configd+IPConfiguration (~7 wk, network mgmt) vs. powerd+IOKitUser K3 (~4 wk, power mgmt) vs. cuse-backed DriverKit-shape framework (~4-8 mo, native userspace drivers). Verdicts on related paths: kernel kext support skip (3-5 yr ABI emulation diversion); Apple DriverKit binary compat defer (8-18 mo).
netconfigd: one daemon owns network state, hostname, DNS. Drops Mach IPC for GNUstep Distributed Objects; libdispatch for kernel events.
wpa_supplicant): wifid + Apple80211 + CoreWLAN, mostly closed source. Only the eap8021x EAP/802.1X code is open. We ship wpa_supplicant from ports; sketches a hypothetical wifid-fbsd wrapper if Apple-shape API symmetry ever matters.
kld_list= editing.
/usr/sbin/syslogd. Structured log records (Sender/Facility/PID/Time queries without grep), binary-store + BSD-text dual output (tail /var/log/messages still works).
libnotify + notifyd). Cross-process event coordination for gershwin desktop — theme changes, network state, power events — via the same C API Apple-derived apps already speak.
.local hostnames, automatic printer / file-share discovery on the LAN. Surprise win — Apple's source already has a cross-platform mDNSPosix layer with zero Mach surface; the port is mostly a configuration exercise.
kqueue(EVFILT_FS) polling with Apple's clean event API. Workspace File Viewer's "Devices" sidebar wants this. The hard one: replaces IOKit with libgeom + devctl(4).
More examples, including forks I've contributed fixes to, can be found on my GitHub.