BSDun, a module for running FreeBSD executables, has been published. Linux

The BSDun project, a development module for the kernel, has been published. Linux, which allows you to recognize, load and run in Linux Unmodified executables in ELF format, built for FreeBSD. They run in an emulated FreeBSD environment located in the /compat/freebsd directory. Overall, the project is the complete opposite of FreeBSD. Linuxulator. The code is distributed under the GPLv2+ license and was written using the Claude Code AI assistant.

Using BSDun I was able to successfully run Linux Many applications from FreeBSD packages, including pkg, nginx, mc, ping, xeyes, xfce4-panel, Thunar, xfce4-terminal, Libreoffice, Midori, Epiphany, Chromium, and VScode. To run Chromium and VScode, you need to disable sandbox isolation and limit video memory using the options "--no-sandbox --force-gpu-mem-available-mb=1024."

The module does not claim to be included in the main kernel, since the Solaris ABI has been removed from the kernel architecture Linux Doesn't allow the inclusion of other executable handlers (OS Personalities) and requires only one system call table. To circumvent this issue, BSDun utilized the kprobe mechanism, which intercepts all system calls.

Using kprobe, FreeBSD system calls were separated from system calls Linux and were wrapped in a separate table. One part of the FreeBSD system calls was directly bound to the system calls Linux, for another, the structure of parameters and results was repackaged, the third was replaced with stubs (for example, related to Capcicum), and the fourth was implemented based on the internal structures of the kernel LinuxTo implement the kevent/kqueue mechanism on top of epoll(), a separate modification of user-space components was applied, which is automatically performed when loading each FreeBSD executable.

In total, about 250 system calls are implemented. SystemV IPC, network functions, futexes, sysctl MIB, prctl, timers, and ioctl are also implemented. A chroot environment is used on the side to separate file systems. Linux (during experiments without chroot, the author, by executing “pkg install …”, overwrote the contents of /usr/local/* in Linux). However, some utilities can still work without chroot.

The proposed module can be used to develop, build and port software for FreeBSD without using virtual machinesBrief instructions for use: make make load ./bsdun-freebsd-root-resetup.sh ./bsdun-freebsd-enter.sh uname -a FreeBSD host 16.0-CURRENT FreeBSD 16.0-CURRENT (bsdun) amd64

Source: opennet.ru

Buy reliable hosting for sites with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster