No Beginning, No End, No Boundaries
How ferros eliminates fragmentation, exploits, and the entire concept of "first" and "last"
Since the 1960s, every operating system has thought about memory and storage the same way: rectangular blocks with fixed addresses. Your RAM starts at address 0x00000000 and ENDS at some power-of-2 boundary. See, now we already have two gaps, the beginning and the end. Your files live in 4KB blocks arranged in exact parking spots from the "beginning" of the disk.
This seems logical until you realize: circles don't have corners. And corners are where most exploits hide.
Memory allocations float in the continuously rotating ring. No fixed positions, no predictable patterns.
Instead of dividing memory into fixed-size blocks starting at address zero, ferros treats all memory - both RAM and storage - as a continuous ring. There is no "first byte" or "last byte". The address space wraps around using two's complement arithmetic.
Traditional systems panic at address boundaries. ferros embraces them:
Add 1 to +127 (max) → wraps to -128 (min) → seamless, no boundaries, no special cases
Here's where it gets beautiful. Every memory access in traditional systems requires dozens of instructions: page table walks, TLB lookups, permission checks, segmentation logic. ferros does it in two CPU instructions.
That's it. No branching, no page table walks, no TLB misses. The hardware does a subtract and a compare. If the compare succeeds, access granted. If not, denied.
addr + offsetresult < limitEarly systems (1960s-1980s) used segmentation with base+limit registers - similar to our approach. But they had problems:
Then paging arrived and everyone forgot segmentation was 90% of the way there. We just needed to add continuous rotation and stochastic offsets.
The secret sauce: rings are always rotating. Not when attacked. Not on a schedule. Always.
Every process has two offsets assigned by the kernel:
The kernel rotates these offsets continuously. Rotation speed is adaptive:
Rings nest inside rings. Each level of the process tree gets its own offset within its parent's allocation:
Notice: offsets are signed and random. No patterns, no predictability. Each allocation gets an arbitrary size - no rounding to 2^n pages.
The same principles apply to persistent storage. Files don't live in blocks numbered 0 to N. They live in the ring.
Traditional filesystems have a superblock at a known location (usually block 0). ferros? The superblock is at a random location, stored in UEFI and backed up across multiple SSDs:
An attacker who physically steals your SSD can't even find the filesystem metadata, let alone decrypt it.
Instead of a single filesystem header that gets updated in-place (risky!), ferros maintains a ring of headers with generation numbers:
Power loss mid-write? No problem. The kernel boots, scans the header ring, finds the highest valid generation number, and continues. No fsck, no journal replay, no "filesystem needs repair" messages.
When allocating storage for a file, ferros doesn't use the "first available block." It picks a random location in the ring where space is available. This has multiple benefits:
SSDs have limited write cycles. Random placement naturally distributes writes across all cells, maximizing drive lifespan.
Attacks like buffer overflows rely on predictable memory layouts. Random placement means even identical allocations land in different locations each time.
Traditional filesystems fragment because they allocate linearly. Rings rotate and churn - holes get filled naturally as the ring spins.
With dual SSDs from different manufacturers at different offsets, firmware bugs or hardware failures in one drive don't bring down the system.
The ring architecture isn't just a technical detail - it's a philosophical shift. Memory doesn't live in rigid blocks. It flows organically through the ring like water through a circular channel.
Blocks become ovals. Allocations aren't rectangular anymore - they're fluid regions in the ring with fuzzy, rotating boundaries.
Squares become rings. The entire coordinate system wraps. There is no "edge" to fall off.
Data flows around. Security and memory management happen naturally as the ring rotates, not through complex enforcement mechanisms.
Everyone got stuck in the block mindset. Even modern "innovations" like ASLR (Address Space Layout Randomization) just shuffle blocks around at boot time. The blocks themselves remain static.
ferros takes it further: the blocks never stop moving. It's not randomization - it's continuous, organic flow. By the time you've observed where something is, it's already somewhere else.
Ring memory is perfect for kill-switch ready systems. Because there are no boundaries, there's no "partial state" to clean up:
Traditional systems need complex shutdown procedures because they maintain invariants: "the page table must be consistent," "the superblock must be updated," etc. ferros has one invariant: the ring is always valid. And because it's a ring, any point on it is as good as any other.
2 instructions vs 5-10 memory accesses = 5-10x faster memory protection. No TLB shootdown on context switch = 50% faster process switching on mobile.
Rotating offsets make return-oriented programming (ROP) attacks impossible - gadgets move before the exploit completes. Buffer overflows land in empty ring space instead of adjacent data.
No page tables to maintain, no TLB to manage, no segmentation faults to debug. Memory access either works or doesn't - no complex error paths.
Fewer memory accesses = less power. No TLB means no cache pollution. Stochastic allocation spreads wear across SSD = longer device lifespan.
Ring memory architecture is part of ferros from day one. It's not a feature you can disable - it's the foundation everything else builds on.