Home About

Base and Bound Protection

#os #operating system #linux #security #kernel
~3 min read by Christian Lehnert, 2025-09-21

I’m talking about base and bound registers, the old-school method of keeping your processes from stepping on each other’s toes in RAM. We’ll break down what base and bound mean, peek into some low-level register action, and then contrast that with how modern Linux rolls with memory isolation using segmentation, paging, and virtual memory.

What Exactly Are Base and Bound Registers?

Imagine you’re the bouncer at a club: The base register sets the minimum address your process can access (the club’s front door), and the bound register caps the max address (the bouncer’s "no entry beyond here" line). Together, these two registers define a safe memory sandbox, preventing your code from wandering into memory owned by other programs or the OS itself.

Technically, the CPU holds these two registers per process. The base register contains the starting physical memory address, while the bound register holds the size limit or max address. Every memory access shifts by the base to check if it lies within the bound. If not, boom trap triggered, protection fault, or whatever the hardware calls a memory violation.

In assembly, it might look something like this:

Base register (BR) = 0x1000
Bound register (BN) = 0x1FFF
Accessing memory at address 0x0800 + BR would be 0x1800, which is within bound, so all is good.

If you try to access 0x2000 + BR (0x3000 overall), the CPU flags an error because it’s past the bound. Simple but effective.

Why Base and Bound Fizzled Out

Fast forward a few decades, and modern processors and operating systems (hello Linux!) have mostly retired pure base and bound protection. Why? Because the method is too “coarse-grained” and inflexible for the complex multitasking and massive apps we run today. Memory usage patterns got too dynamic; processes need to share libraries and memory regions; and paging and segmentation offer much more power.

Linux, for example, leans heavily on paging and virtual memory. Instead of just protecting a chunk using base and bound, the OS divides memory into pages (usually 4KB chunks). Each process gets its own virtual address space, which the kernel maps transparently to physical RAM. It’s like giving every process its own chroot jail—but on steroids where each page has access rights (read, write, execute), and if you try to sneak out, the kernel triggers a page fault.

Segmentation, once popular, still exists at a low hardware level on x86 systems, but Linux rarely uses traditional segmentation for memory protection anymore. Instead, it’s paging, along with Address Space Layout Randomization (ASLR), and control groups (cgroups) that keep processes nicely sandboxed.

So, if base and bound registers were the bouncers of memory in the 1980s, today’s Linux has a highly trained security team working 24/7 including containerization and namespaces to isolate everything. Messing with ulimit or spinning up a Docker container? You’re playing in the same sandbox but one that’s way more nuanced, and much harder to escape.

Why Should You Care?

Even though base and bound protection is something of a vintage OS toy, it’s still a great way to grasp the fundamental idea of memory protection without diving headfirst into complex paging tables. For OS students, kernel hackers, or anyone curious about how machines keep software from crashing or snooping on each other, base and bound is a neat mental model.

Plus, it gives you a new appreciation for Linux’s elegant modern setup: infinite virtual address spaces per process, hardware-backed page tables, and syscall-level sandboxing all layered on top. It’s like trading your trusty old bicycle (base and bound) for a hyper-smooth electric motorcycle (paging and virtual memory).