Repository navigation
feat(ipc): bring up minimal Wayland compositor and wl_shm client on /dev/fb0 and evdev - #278
Merged
marcobuschini merged 2 commits intoDec 4, 2026
Conversation
Implement the kernel ABI primitives and userspace binaries required to run a minimal Wayland compositor and wl_shm client on /dev/fb0 and evdev: - SCM_RIGHTS FD passing over AF_UNIX (sendmsg/recvmsg, MSG_CMSG_CLOEXEC, MSG_CTRUNC, stream boundary framing, refcounted File* transfer) - Cross-process MAP_SHARED on tmpfs (get_page hook, up to 4 MiB files), sys_memfd_create (279), and /dev/shm tmpfs mount - epoll (epoll_create1/epoll_ctl/epoll_pwait), eventfd2, and timerfd (timerfd_create/settime/gettime) event loop primitives - Userspace threads (clone CLONE_THREAD with refcounted SharedProcessState, exit vs exit_group, gettid, tkill/tgkill) and sys_futex (WAIT/WAKE) - Minimal Wayland compositor (user/wl_compositor.c) and threaded wl_shm client (user/wl_client.c) speaking Wayland wire protocol over /tmp/wayland-0, compositing to /dev/fb0, and forwarding /dev/input/event* - Host ASan/UBSan tests (tests/host/wayland_abi_test.cpp) and QEMU shell verification suite (kernel/shell/tests/test_wayland.cpp) Closes #264
3 tasks
…e run-vnc - Send SIGHUP (or SIGKILL if ignored/blocked) to remaining session members when a root session leader exits without PID 1 init, and reap zombie session children during Process::destroy() so interactive shells return immediately to milo> with zero leaked PCBs or PFA frames - Handle SIGHUP cleanly in user/wl_compositor.c to unlink /tmp/wayland-0 and unmap /dev/fb0 on shutdown - Add make run-vnc target using -vnc 0.0.0.0:0 -serial mon:stdio so Ctrl-A X exits QEMU cleanly while viewing /dev/fb0 over VNC - Add host test covering root session-leader zombie reaping
marcobuschini
deleted the
264-issue-bring-up-minimal-wayland-compositor-and-wl_shm-client-on-devfb0-and-evdev
branch
December 4, 2026 16:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements all 5 milestones of #264 to bring up a minimal Wayland compositor and threaded
wl_shmclient running on Milo OS over/dev/fb0(virtio-gpu) and/dev/input/event*(virtio-input):SCM_RIGHTSFD Passing overAF_UNIXUnixRightsBatchframing onAF_UNIXSOCK_STREAMrings (preserving message boundaries across rights batches) andSOCK_DGRAMqueues, with automaticvfs_closecleanup of unreceived FDs.SOL_SOCKET/SCM_RIGHTS,MSG_CMSG_CLOEXEC, andMSG_CTRUNChandling tosys_sendmsg/sys_recvmsg.MAP_SHAREDontmpfs&memfd_createInodeOperations::get_pageandtmpfs_get_page(zero-copy physical frame sharing across processes) and expandedtmpfsfiles up to 4 MiB via inline direct + lazy indirect page tables.sys_memfd_create(AArch64 syscall 279) and mountedtmpfsat/dev/shm.epoll,eventfd, andtimerfdEvent Loop PrimitivesEventFd,TimerFd, andEpollInstanceinkernel/ipc/EventLoop.{hpp,cpp}and syscallseventfd2(19),epoll_create1(20),epoll_ctl(21),epoll_pwait(22),timerfd_create(85),timerfd_settime(86), andtimerfd_gettime(87) with LP64 AArch64 UAPI structs (kernel/uapi/event.hpp).CLONE_THREAD) &sys_futexProcessto shareAddressSpace,FdTable,SignalTable,brk, andmmaparena through refcountedSharedProcessState.CLONE_THREADsupport insys_clone, splitexit(93) vsexit_group(94), addedgettid(178),tkill(130),tgkill(131), and physical-address-keyedsys_futex(98,FUTEX_WAIT/FUTEX_WAKE).wl_shmClientuser/wl_proto.h,user/wl_compositor.c, anduser/wl_client.c, packaged into all initrds (busybox.cpio,bash.cpio,debian-bash.cpio)./tmp/wayland-0, runs anepoll+eventfd+timerfd+evdevevent loop, maps receivedwl_shmpools viaSCM_RIGHTS+MAP_SHARED, composites client ARGB8888 surfaces to/dev/fb0(FBIO_FLUSH), and forwards/dev/input/event0/event1events aswl_keyboard/wl_pointerprotocol events.wl_shmbuffer viamemfd_create, transfers it overSCM_RIGHTS, renders animated frames on apthread(CLONE_THREAD) +futexworker thread, and synchronizes commits withwl_surface.framecallbacks.Verification
make format && make clean-tests && make -j"$(nproc)" all && make -j"$(nproc)" quality: passed (0 formatting violations, 0 license violations, 0clang-tidyissues, 89/89 host tests / 464,648 assertions under ASan/UBSan).milo> test wayland -v: passed=11 failed=0 (verifies/dev/shm, compositor + client exit 0, rendered/dev/fb0pixels,evdevdrain, and zero PCB/thread/heap/PFA leaks).milo> test all: passed=270 failed=0.bash+ HMP monitor verification: injectedvirtio-keyboard(KEY_A) andvirtio-tablet(BTN_LEFT) events received bywl_client(ptr_ev=2,key_ev=2) and verified 1280×800virtio-gpuscreendump(3,070,570/3,072,000 non-zero RGB bytes).Closes #264