
# Red Baron on FreeBSD

### Running a 1997 Linux browser on a modern FreeBSD system

Manitoba Unix Users Group · MUUG · October 2026

> - The demo jail is disposable. Follow along on a test system, not on production.
> - The host kernel is not modified by any step in this talk.

<!--
Presenter notes (about 1 minute):
This talk is for people who use Linux or Unix but do not write software.
We will explain every term we need. No source code reading is required.
The live work happened in an existing Bastille jail named baron.
The deck runs about 35-40 minutes at a relaxed pace; the two screenshots
and the optional modern Linux slides are the easiest places to save time.
-->

---

# What we will cover

- What Red Baron is, and why an old browser is interesting.
- Why an old program needs old system parts.
- How FreeBSD runs Linux programs without a Linux kernel.
- What memory allocation is, and what `malloc` and `brk` do.
- Why the browser crashed, and how we fixed it.
- How a modern browser can render pages for the old one.

> - The work happens in a disposable Bastille jail; the FreeBSD host kernel is not changed.
> - All commands run inside the jail unless a slide says otherwise.

<!--
Presenter notes (about 1 minute):
Set expectations: this is an installation and debugging story, not a
programming tutorial. The browser is proprietary; we cannot rebuild it.
-->

---

# What was Red Baron?

- Red Hat's commercial web browser, based on Spyglass technology.
- Sold only as a compiled program; no source code was published.
- Included with **Red Hat Linux 4.0** in October 1996.
- This copy is **Red Baron 3.10**, from **Red Hat Linux 4.2**, May 1997.
- A 32-bit Linux program for X11, an old Unix graphics system.

<small>Sources: [Fedora's Red Hat history](https://fedoraproject.org/wiki/History_of_Red_Hat_Linux), [Red Hat's 4.2 announcement](https://www.redhat.com/en/about/press-releases/press-redhat42).</small>

> - It is a proprietary i386 Linux binary that also uses Motif, an old graphical toolkit, and **libc5**.
> - Keep the original RPM files; they are the only copy of its runtime.

<!--
Presenter notes (about 1.5 minutes):
Distinguish browser version 3.10 from distribution version 4.2.
Fedora dates the release May 19; Red Hat's shipping announcement is May 29.
Say "May 1997" rather than treating those as the same event.
-->

---

# Why is old software hard to run?

A program needs other software to run:

- a **kernel** to manage memory, processes, files, and network;
- a **C library** for basic functions such as `malloc` and `printf`;
- other **libraries** for graphics, fonts, and compression;
- a matching **binary interface**, called an **ABI**.

FreeBSD is a separate Unix-like system, not a Linux distribution. The 1997 Linux ABI and the 2026 FreeBSD ABI are not the same. FreeBSD can imitate the Linux ABI. That imitation is called **Linuxulator**.

> - Installing FreeBSD's native 32-bit runtime does not provide a Linux libc5 runtime.
> - A Linux binary does not contain its libraries; it records their names.

<!--
Presenter notes (about 1.5 minutes):
The key idea is compatibility, not age. A program needs the exact interfaces
it was built for. Similar C functions do not guarantee a compatible ABI.
-->

---

# How FreeBSD runs Linux programs

```text
Red Baron + Linux libraries       FreeBSD shell + FreeBSD libraries
             |                                  |
       Linux system calls                FreeBSD system calls
             |                                  |
        Linuxulator ----------------> FreeBSD kernel
```

- The CPU runs the 32-bit i386 instructions directly; this is not emulation.
- Linuxulator translates Linux system calls (requests to the kernel) into FreeBSD work.
- The old Linux libraries stay in the running program.
- There is no Linux kernel inside the jail.

<small>Source: [FreeBSD Handbook: Linux Binary Compatibility](https://docs.freebsd.org/en/books/handbook/linuxemu/).</small>

> - Enable Linux support on the host with `sysrc linux_enable=YES` and `service linux start`.
> - A jail shares its host kernel, so enabling Linux support inside the jail is not enough.

<!--
Presenter notes (about 2 minutes):
Linuxulator is an ABI layer, not a virtual machine and not a CPU emulator.
The jail supplies isolation; Linuxulator supplies the Linux interface.
-->

---

# What is a system call?

- A system call is a request from a program to the kernel.
- Programs use system calls to read files, send network data, and get memory.
- The kernel does these jobs because programs cannot access hardware directly.
- A system call has a number, arguments, and a return value.
- Linux and FreeBSD use different numbers. Linuxulator maps them.

```text
Program -> C library wrapper -> int $0x80 -> Linuxulator -> FreeBSD kernel
```

> - A system-call trace (`ktrace` and `kdump`) records the requests a program makes.
> - It shows where an old program stops, but not which C function made the call.

<!--
Presenter notes (about 1.5 minutes):
Keep this conceptual. Novices do not need the register layout.
The important point: the kernel is the only path to privileged resources.
-->

---

# What is `malloc`?

- `malloc` is a C library function that gives a program memory.
- It takes memory from an area called the **heap**.
- It asks the kernel for memory in large blocks, then splits them.
- The old Linux C library, **libc5**, grew the heap with a call named **`brk`**.
- Modern allocators often use **`mmap`**, which maps a new block of memory.

```text
Red Baron -> libc5 malloc -> brk or mmap -> Linuxulator -> FreeBSD kernel
```

> - `malloc` returns `NULL` when it cannot provide memory.
> - Red Baron did not check for `NULL`.

<!--
Presenter notes (about 2 minutes):
malloc is not a syscall. It manages memory that the kernel has already given it.
Only when the heap runs out does it ask the kernel for more.
-->

---

# What is `brk`?

- `brk` moves the **program break**, the end of the program's data area.
- The heap grows upward from that point.
- It comes from early Unix, before the POSIX standard and the Single UNIX Specification.
- POSIX later deprecated `brk` and its companion `sbrk` as legacy interfaces.
- Linux and FreeBSD still provide `brk` for old programs.
- Red Baron's old C library, libc5, uses it.

```text
1970s Unix     1988 POSIX     1990s SUS     today
   brk           already old    legacy       kept for compatibility
```

> - Deprecated does not mean unused; removing `brk` breaks old binaries.
> - A modern allocator may use `brk` for small requests and `mmap` for large ones.

<!--
Presenter notes (about 2.5 minutes):
This is the key background slide. Slow down.
brk is older than the standards that later described it. POSIX marked the
C interfaces brk/sbrk as legacy; the kernel interface remains for compatibility.
The bug in this talk is about the return value of brk, not about deprecation.
-->

---

# The lab setup

| Piece | Verified setup |
|---|---|
| Jail | Bastille VNET jail **`baron`**, `192.168.3.31` |
| System | FreeBSD 15.1-RELEASE-p4, amd64 |
| Linux runtime | Five RPMs under **`/compat/linux`**, plus X11 data |
| Files | `/root/redbaron-install` inside the jail |
| Desktop | Xvnc `:1`, 800x600x24, Fluxbox |
| Access | SSH tunnel to **127.0.0.1:5901** |
| Modern web | WRP + Chromium on **127.0.0.1:8080** |

- **X11** is the old Unix graphics system. **VNC** is a remote desktop protocol.
- Xvnc serves the X11 desktop over VNC. Fluxbox is a small window manager.
- A VNET jail has its own virtual network interface.

> - A jail is an isolated FreeBSD environment that shares the host kernel.
> - Bastille is a tool that creates and manages jails.

<!--
Presenter notes (about 1.5 minutes):
Explain VNC as a remote desktop. Xvnc is an X server with a built-in VNC server.
Fluxbox is a small window manager. The viewer only needs an SSH tunnel.
-->

---

# Steps 1-2: connect and copy the files

**On the workstation:**

```sh
ssh baron
ssh baron 'install -d /root/redbaron-install /compat/linux'
scp -r redbaron-freebsd-jail/media baron:/root/redbaron-install/
scp redbaron-freebsd-jail/malloc_shim.c baron:/root/redbaron-install/
```

**Inside `baron`, as root:**

```sh
pkg install -y tigervnc-server fluxbox xauth xset xsetroot \
  xwininfo curl font-misc-misc font-adobe-75dpi \
  font-adobe-100dpi font-bh-75dpi
```

- Connect to the jail over SSH.
- Copy the RPMs and the memory-replacement source.
- Install the FreeBSD desktop packages.
- The browser's Linux libraries stay separate from FreeBSD's.

> - Native FreeBSD fonts work with native Xvnc.
> - Keep Linux libraries and FreeBSD libraries apart.

<!--
Presenter notes (about 1.5 minutes):
The RPMs and the shim source are copied from the project directory.
The desktop packages are already installed in the live jail.
-->

---

# Step 3: unpack the Linux RPMs and X11 data

Assume `media/XFree86-3.2-9.i386.rpm` is already present.

```sh
cd /root/redbaron-install
for rpm in redbaron-3.1-1.i386.rpm \
  libc-5.3.12-18.i386.rpm ld.so-1.7.14-4.i386.rpm \
  XFree86-libs-3.2-9.i386.rpm xpm-3.4i-1.i386.rpm; do
    bsdtar -xf "media/$rpm" -C /compat/linux
done
bsdtar -xf media/XFree86-3.2-9.i386.rpm -C /compat/linux \
  usr/X11R6/lib/X11
brandelf -t Linux /compat/linux/usr/lib/redbaron/redbaron_3.10
```

- An RPM is a Red Hat package: files plus metadata.
- `bsdtar` extracts the files; it does not run installer scripts.
- The sixth RPM, **XFree86**, supplies X11 keyboard, locale, and font data.
- Extract only the X11 data subtree, not the old X server programs.
- `brandelf` marks the browser as a Linux program.

> - This is payload extraction, not a package transaction; no dependency resolution runs.
> - `XFree86` is a different RPM from `XFree86-libs`.

<!--
Presenter notes (about 2 minutes):
Six RPMs supply the browser, its Linux libraries, and the X11 data.
The XFree86 RPM is assumed present in media/; do not fetch it here.
Extracting only the X11 data subtree keeps the old X server binaries out.
-->

---

# Step 4: restore the library names

```sh
ln -sf libc.so.5.3.12 /compat/linux/lib/libc.so.5
ln -sf libm.so.5.0.6 /compat/linux/lib/libm.so.5
ln -sf libdl.so.1.7.14 /compat/linux/lib/libdl.so.1
cat > /compat/linux/etc/ld.so.conf <<'EOF'
/lib
/usr/lib
/usr/X11R6/lib
EOF
/compat/linux/sbin/ldconfig
```

- Programs ask for libraries by a short runtime name, called the **SONAME**.
- The files on disk have versioned names.
- The Linux `ldconfig` creates the short links and a cache.
- Use the Linux `ldconfig`, not FreeBSD's.

> - Do not create `libXpm.so.6`. The file is `libXpm.so.4.9`, and its SONAME is `libXpm.so.4`.
> - The old Linux `ldconfig` is statically linked, so it runs without the runtime.

<!--
Presenter notes (about 1.5 minutes):
A SONAME is the name a library expects to be found under at runtime.
ldconfig reads the libraries and builds links and a cache.
-->

---

# Step 5: resolve the dependencies

```sh
LD_TRACE_LOADED_OBJECTS=1 \
  LD_LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib \
  /compat/linux/usr/lib/redbaron/redbaron_3.10
```

- The check lists every library the program needs.
- All seven libraries resolved: Xt, X11, Xext, Xpm, SM, ICE, and libc5.
- The paths are Linux-visible paths under the jail's Linux root directory.

> - The loader variables apply only to this Linux program.
> - If a library is missing, the output names it; fix extraction or `ldconfig`.

<!--
Presenter notes (about 1.5 minutes):
There is no fetching here. The X11 data is already in place from step 3.
This check proves the Linux loader can find all seven libraries before launch.
-->

---

# The crash, in plain terms

- Red Baron asks libc5 for memory.
- libc5 asks Linuxulator to grow the heap with `brk`.
- Linuxulator returns a different address than Linux would.
- libc5 treats that as failure and returns `NULL`.
- Red Baron copies the string `"Spyglass"` to address zero, which points to no valid memory, and crashes.

**Two defects:** the incompatible return value, and the unchecked allocation.

> - The crash is a `SIGSEGV` at address zero.
> - A crash alone does not prove the cause; the trace and the crash dump did.

<!--
Presenter notes (about 2 minutes):
This is the whole story at a high level.
A NULL pointer points to no valid memory. Writing through it causes SIGSEGV.
-->

---

# How we found out

- A system-call trace showed the `brk` request and its rounded result.
- A crash dump, a copy of the process memory at the crash, showed the exact instruction: a string copy to address zero.
- The source string was `"Spyglass"`.
- The call chain led back to `malloc`.
- The program never checked `malloc`'s result.

```text
CALL  linux_brk(0x82ee290)
RET   linux_brk 137293824/0x82ef000
PSIG  SIGSEGV SIG_DFL code=SEGV_MAPERR
```

> - Set `kern.coredump=1` on the host and `ulimit -c unlimited` in the jail to capture a dump.
> - Restore the host setting afterwards; it affects other processes too.

<!--
Presenter notes (about 1.5 minutes):
Do not teach core-file hex decoding here. The point is the method:
trace the syscalls, then inspect the crash dump.
-->

---

# The actual bug: `brk` returned the wrong address

```text
Requested logical heap end:  0x082ee290
Returned address:            0x082ef000  (next 4 KiB page)
```

- Linux `brk` returns the exact new break.
- FreeBSD's Linuxulator returned an address rounded up to the next 4 KiB (4096-byte) page.
- libc5 compares the two addresses; they differ.
- libc5 reports "out of memory", and `malloc` returns `NULL`.
- Page rounding is correct for memory mappings, but the `brk` return must match the exact request.

> - This is an ABI compatibility bug, not a memory shortage.
> - The program had plenty of memory; the kernel gave the wrong answer.

<!--
Presenter notes (about 2 minutes):
This is the crucial technical point of the talk.
The raw Linux brk syscall returns the new logical break on success.
FreeBSD's implementation rounded it to a page boundary, which is valid for
its own accounting but not for the Linux ABI.
-->

---

# Two ways to fix it

| Option | What changes | Where it runs |
|---|---|---|
| **1. Replace memory functions** | Use `mmap` instead of `brk`. | Existing `baron` jail. |
| **2. Repair `brk`** | Fix Linuxulator's return value. | Separate **BARONVM** guest. |

- Option 1 works with the current host kernel.
- Option 2 needs a rebuilt kernel and matching Linuxulator modules.
- Both keep the original browser and its Linux libraries.

> - The jail cannot change its host kernel, so option 1 is the deployable fix today.
> - Option 2 is a local review proposal, not a FreeBSD release update.

<!--
Presenter notes (about 1.5 minutes):
We finish option 1's installation first, then mention the kernel repair.
The kernel repair is a local review proposal, not a FreeBSD release update.
-->

---

# Option 1: `LD_PRELOAD`

- The **loader** is the small program that starts a program and connects it to its libraries.
- `LD_PRELOAD` names a library the loader must load first.
- If that library defines `malloc`, its `malloc` is used.
- The rest of the program and its libraries stay the same.
- This is **interposition**: same function name, different implementation.

```text
Ordinary launch:   imported malloc -> libc5 malloc
With preload:      imported malloc -> shim malloc
```

> - The working variable here is `LD_PRELOAD`, because the Linux loader reads it.
> - `LD_32_PRELOAD` belongs to FreeBSD's native 32-bit loader and did not work here.

<!--
Presenter notes (about 1.5 minutes):
Interposition does not replace code that is inlined, hidden, or statically linked.
Here the allocation functions are imported, so the loader can redirect them.
-->

---

# What the shim replaces

- The shim is a small shared library, a file of functions that programs load at runtime.
- It replaces `malloc`, `calloc`, `realloc`, `free`, and `strdup` with the same names libc5 uses.
- These functions allocate, resize, release, and duplicate memory.
- All five must use one allocation layout, or one function cannot free another's memory.
- It uses `mmap` and `munmap` instead of `brk`.

> - Replace the whole family; replacing `malloc` alone lets libc5 `free` and `realloc` receive pointers they cannot interpret.
> - The header's magic number is a sanity check, not full pointer validation.

<!--
Presenter notes (about 1.5 minutes):
Four of these were weak undefined imports; strdup was an ordinary undefined import.
The shim does not repair Linuxulator. It bypasses the broken allocation path.
-->

---

# Build and install the shim

```sh
cd /root/redbaron-install
cc -target i386-unknown-linux-gnu -m32 -O2 -fPIC \
  -ffreestanding -fno-builtin -fno-stack-protector \
  -fno-asynchronous-unwind-tables -c malloc_shim.c
ld -m elf_i386 --hash-style=sysv -shared \
  -soname libredbaron_compat.so \
  -o libredbaron_compat.so malloc_shim.o
brandelf -t Linux libredbaron_compat.so
install -m 0755 libredbaron_compat.so \
  /compat/linux/usr/lib/redbaron/libredbaron_compat.so
```

- Build a 32-bit Linux shared library with FreeBSD's compiler.
- Link it in the old format the 1997 loader understands.
- Mark it as a Linux binary.
- Install it next to the browser.

> - Audit with `file`, `readelf -d`, and `readelf -Ws`: 32-bit, SysV hash, five exports, no libc dependency.
> - Check undefined symbols too, not only `DT_NEEDED`.

<!--
Presenter notes (about 1.5 minutes):
These commands ran successfully in baron with its native FreeBSD toolchain.
-->

---

# The launcher

```sh
cat > /usr/local/bin/redbaron <<'EOF'
#!/bin/sh
set -eu
export DISPLAY="${DISPLAY:-:1}"
export HOME="${HOME:-/root}"
export XAUTHORITY="${XAUTHORITY:-$HOME/.Xauthority}"
export REDBARON=/usr/lib/redbaron
export LANG=C
export LC_ALL=C
export XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib
export LD_PRELOAD=/usr/lib/redbaron/libredbaron_compat.so
exec /compat/linux/usr/lib/redbaron/redbaron_3.10 "$@"
EOF
chmod 0755 /usr/local/bin/redbaron
```

- Sets the X11 display, language, and X11 data path.
- Sets the Linux library path and preloads the shim.
- `exec` replaces the shell with the browser.

> - `exec` matters: the browser should be the process, not a child of a shell that may exit.
> - A single `LD_PRELOAD` assignment is enough.

<!--
Presenter notes (about 1.5 minutes):
Walk through the environment variables one group at a time.
The launcher is the only thing users need to remember.
-->

---

# Launch and verify

```sh
/usr/local/bin/redbaron -url file:/usr/lib/redbaron/help/index.htm
```

```sh
/usr/local/bin/vnc-session status
pgrep -fl redbaron
sockstat -4 -l | grep 5901
tail -n 20 /root/.vnc/redbaron.log
DISPLAY=:1 xwininfo -root -tree | grep 'Help Index'
```

- Use `-url`. A bare address prints usage and exits.
- Check the process, the VNC port, and the window title.
- A running process alone does not prove the page rendered.

> - Inspect the visible page in VNC, not only the process list.
> - The window title is a useful cheap check.

<!--
Presenter notes (about 1.5 minutes):
The live check found a Help Index window, a running browser, and no font
warnings in the launch log.
-->

---

# It works: local help

![height:480px](muug-baron-assets/baron-redbaron.png)

- The original browser rendered its own Help Index.
- This verifies the memory workaround.
- The screenshot is from an earlier `:2` demo; the guide uses `:1`.

> - The same runtime also worked in the patched-kernel guest, with the shim disabled.
> - That comparison is what ties the crash to `brk`, not to the shim.

<!--
Presenter notes (about 1 minute):
A screenshot is evidence that the page rendered, not just that a process started.
-->

---

# The web moved on

- Red Baron understands only 1997 HTML.
- It has no modern HTTPS, CSS, or JavaScript.
- It cannot verify modern certificates or run modern scripts.
- We still want it to show today's pages.
- A modern browser can do the modern work.

> - Do not expose the old browser directly to the internet.
> - It has no modern TLS and no modern sandboxing.

<!--
Presenter notes (about 1 minute):
This is the transition from "revive the old browser" to "make it useful today".
-->

---

# WRP: modern pages for the old browser

```text
Inside the Bastille jail baron:

Red Baron           WRP                Native Chromium
Linux/i386          FreeBSD/amd64       FreeBSD/amd64
    |                  |                     |
    |-- HTTP/forms --->|-- browser control -->|
    |                  |                     |-- HTTPS --> Website
    |<-- GIF + map ----|<-- rendered page ----|
    |-- click x,y ---->|-- click in page ---->|
```

- WRP means **Web Rendering Proxy**.
- Red Baron asks WRP for a page; WRP asks Chromium to render it.
- Chromium returns a picture (GIF) and a clickable image map.
- Clicks go back to Chromium.
- All three components run inside the jail.

> - WRP listens only on `127.0.0.1:8080` inside the jail.
> - Chromium runs headless (without a visible window) as the dedicated `wrp` user.

<!--
Presenter notes (about 2 minutes):
The old browser still handles the page it receives: old-style HTML and a GIF.
Chromium handles HTTPS, CSS, and JavaScript.
-->

---

# Install Chromium

```sh
install -d /usr/local/etc/pkg/repos
cat > /usr/local/etc/pkg/repos/FreeBSD.conf <<'EOF'
FreeBSD-ports: {
  url: "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/latest"
}
EOF
pkg update
pkg install -y chromium ca_root_nss font-bh-75dpi
/usr/local/bin/chrome --version
```

- Chromium was missing from the default package repository but available in the **latest** one.
- This changes the package repository for this jail only.
- Verified: **Chromium 156.0.8078.47**.

> - Preserve any existing local repository configuration first.
> - Chromium and its dependencies added about 1 GiB.

<!--
Presenter notes (about 1 minute):
The base system and the old Linux libraries stay separate from this repository change.
-->

---

# Install the WRP program

```sh
install -d /root/redbaron-install/wrp
cd /root/redbaron-install/wrp
fetch -o wrp-amd64-freebsd \
  https://github.com/tenox7/wrp/releases/download/4.10.3/wrp-amd64-freebsd
expected=2d433c5fea4aa29906f68a8d366cb18025e8f1fab74a31a89c5f3d311ca91d7d
test "$(sha256 -q wrp-amd64-freebsd)" = "$expected" && \
  install -m 0755 wrp-amd64-freebsd /usr/local/bin/wrp
```

- The expected SHA256 checksum comes from the **4.10.3** GitHub release.
- Stop if the checksum does not match.
- The release asset's internal version says **4.9.3**; trust the release URL and checksum.

> - Always verify a downloaded binary against its published checksum.
> - Use the release tag and checksum to identify the binary, not the internal banner.

<!--
Presenter notes (about 1 minute):
The version mismatch between the release name and the internal banner is
an upstream packaging quirk, not a sign of corruption.
-->

---

# Give WRP its own account and log

```sh
pw usershow wrp >/dev/null 2>&1 || \
  pw useradd wrp -d /var/db/wrp -m \
  -s /usr/sbin/nologin -c 'Web Rendering Proxy'
install -d -o wrp -g wrp -m 0700 /var/db/wrp
install -o wrp -g wrp -m 0600 /dev/null /var/log/wrp.log
```

- WRP and Chromium run as **`wrp`**, with home directory `/var/db/wrp`.
- Chromium runs **headless**, without a visible desktop window.
- Creating the log with `install` is a one-time setup step.

> - Rerunning the log command clears an existing log.
> - WRP's Chromium profile is temporary by default.

<!--
Presenter notes (about 1 minute):
A dedicated account limits the damage if the rendering proxy is compromised.
-->

---

# Install the WRP service

Save this as **`/usr/local/etc/rc.d/wrp`**:

```sh
#!/bin/sh
# PROVIDE: wrp
# REQUIRE: NETWORKING
# KEYWORD: shutdown

. /etc/rc.subr
name=wrp
rcvar=wrp_enable
load_rc_config "$name"
: ${wrp_enable:=NO}

pidfile=/var/run/wrp.pid
procname=/usr/local/bin/wrp
# Chromium workers can outlive their parent on this FreeBSD build.
stop_postcmd='pkill -U wrp -x chrome || true'
command=/usr/sbin/daemon
command_args="-f -p ${pidfile} -u wrp -o /var/log/wrp.log \
/usr/local/bin/wrp -b /usr/local/bin/chrome \
-l 127.0.0.1:8080 -t gif -g 640x400x216 -ua="

run_rc_command "$1"
```

- WRP and Chromium run as a dedicated user, `wrp`.
- Chromium runs headless; there is no visible desktop window.
- The service starts WRP, which starts Chromium.

> - `daemon -u` sets the service account and HOME.
> - The stop hook targets only the `wrp` user's Chromium workers, not the root desktop.

<!--
Presenter notes (about 1.5 minutes):
Enable it with sysrc wrp_enable=YES, then service wrp start.
-->

---

# Browse a modern page

```sh
chmod 0755 /usr/local/etc/rc.d/wrp
sysrc wrp_enable=YES
service wrp start
service wrp status
curl --retry 5 --retry-connrefused --retry-delay 1 \
  --max-time 30 --fail --silent --show-error \
  -o /dev/null 'http://127.0.0.1:8080/?url=https%3A%2F%2Fexample.com%2F'
```

```sh
/usr/local/bin/redbaron -url http://127.0.0.1:8080/
```

1. Enter `https://example.com/` in the WRP form and click **Go**.
2. Click a link in the image; WRP forwards the coordinates to Chromium.
3. Use **Bk**, **Up**, and **Dn** to navigate.

> - The workstation only needs VNC and an SSH tunnel to port 5901.
> - WRP stays on loopback; do not expose port 8080.

<!--
Presenter notes (about 1.5 minutes):
The HTTP listener may need a moment after service startup.
-->

---

# Red Baron showing a modern page

![height:440px](muug-baron-assets/baron-wrp.png)

- Verified: WRP form submission loaded **`https://www.freebsd.org/`**.
- Clicking the image opened the site's mobile menu.
- WRP logged the forwarded click coordinates **`593,40`**.

> - The check covers two HTTPS pages, form submission, and an image-map click.
> - A sustained browsing workload remains untested.

<!--
Presenter notes (about 1 minute):
This is the payoff slide. The old browser is showing a page rendered by 2026 Chromium.
-->

---

# What this does not fix

- Rendering is slow; every page is an image.
- Some sites reject automated browsers.
- Logins and sensitive data should stay out of the demo.
- Sustained browsing was not tested.
- The shim changes memory behavior; overall stability is not proven.

> - WRP adds modern rendering, not modern security.
> - Treat this as a lab demonstration, not a daily browser.

<!--
Presenter notes (about 1.5 minutes):
The shim bypasses the observed allocation failure.
It can hide bugs or produce different crashes.
A stability claim would need comparable browsing workloads.
-->

---

# Running it on modern Linux: the runtime

Most modern Linux systems use a modern C library (glibc) and loader; Red Baron needs the 1997 runtime.

- Put the six original RPMs in a private directory, rebuild the old library cache, and point the copies at a loader the system already has.
- Replace libc5's allocator with an `mmap` allocator, and make `free` do nothing to avoid stale-pointer crashes. Memory leaks remain.
- Build with the old binary format and stack layout the 1997 program expects.
- Run the browser with `setarch i386 -L` for an old-style address layout, and pass `LD_PRELOAD` through `env`.

> - The allocator uses `mmap2` (syscall 192); the build uses `--hash-style=sysv`, `-mno-sse`, and `-mstackrealign`.
> - The reported Linux `malloc` failure does not prove Linux has FreeBSD's `brk` bug.

<!--
Presenter notes (about 2 minutes):
These two modern Linux slides are optional; skip them if time is short.
The six RPMs are the same historical runtime, but modern Linux needs a private
tree and a loader shim because its glibc and loader are modern.
-->

---

# Running it on modern Linux: fonts, DNS, desktop

Most modern Linux systems no longer supply the old bitmap fonts, DNS behavior, and desktop details.

- Decompress and index the bitmap fonts, add aliases, and patch the crash when no font is found.
- After the allocator works, call `res_init()` so libc5 reads the DNS settings.
- Supply the OSF key names the old Motif toolkit expects, and enable menu shortcuts.
- Set a visible cursor, and fix clipboard conversion failures under Xwayland, the X11 layer for Wayland.

> - Fix the font patch's swapped arguments so text lines have separate baselines; remaining issues include bold-italic text, odd `<TT>` spacing, and sites that require a `Host:` header.
> - The browser still has its original parser and rendering limits.

<small>Source: [Modern Linux experiment](blog-linux-redbaron.md).</small>

<!--
Presenter notes (about 2 minutes):
Modern Linux is not the same failure as FreeBSD. Its allocator workaround
avoids libc5's broken path rather than repairing a kernel bug.
-->

---

# Recap

- Linuxulator runs Linux programs with their original Linux libraries.
- `malloc` is a library function; `brk` is an old Unix call for growing the heap.
- POSIX later deprecated `brk`, but old programs still use it.
- Linuxulator's rounded `brk` return broke libc5 and caused the crash.
- Option 1 replaces memory functions; option 2 fixes `brk` in the kernel.
- WRP and Chromium render modern pages for the old browser.

> - The preload workaround is the deployable fix for the current jail.
> - The kernel repair is a review proposal, validated in a separate VM.

<!--
Presenter notes (about 1 minute):
Repeat the two fixes and the two separate features: revival and modern rendering.
-->

---

# Questions

- Full guide: `muug-baron.md`
- Diagnostics: `diagnostics/baron-2026-10-26/README.md`
- `brk` investigation: `LINUXULATOR_BRK.md`
- Kernel patch: `../linux-brk/upstream/`
- WRP: [github.com/tenox7/wrp](https://github.com/tenox7/wrp)

> - Start with the full guide; it has the exact commands and file hashes.
> - The diagnostics directory records the live checks and their limits.

<!--
Presenter notes (about 2 minutes):
Open the floor. Likely questions: why not use a virtual machine, why not
rewrite the browser, and why not just use a modern browser.
Short answers: a VM would work but is heavier; the source is not available;
the point is the compatibility story and the old interface.
-->
