Close
0%
0%

POSEVEN

An architecture for OSes, languages and application processors, that emphasises speed, safety, security and modularity.

Public Chat
Similar projects worth following
Because POSIX (at the lower levels) is totally tied to the C language which descends from 60s era DEC PDPs idiosynchrasies, it too has become unsuitable for modern computing, holding it back more than helping. It survives from its tight integration with countless other software domains and the huge installed base, but the fundamentals have never been seriously challenged.
So let us take a deep breath and make an abstract and holistic definition for a system architecture, both hardware and software, revisit old classics and recombine them in hopefully more convenient and secure ways.

POSEVEN is not an operating system.

POSEVEN proposes a clean, clear, modern architecture where CPU design, programming languages and operating systems meet. Thus it is both a programming model and the underlying structure of post-microkernel OSes, designed such that derived microprocessors are simple, safe and efficient.

POSEVEN's threat model assumes corruption as the baseline, not purity, and promotes containment at the lowest levels, so it is capabilities-based. A POSEVEN system must sustain exposure to both accidental and adversarial alterations, whether from cosmic rays or black hats.

It sounds ambitious but it has become even more necessary.


This project discusses about general computer program organisation and ways to implement them. For lower-level CPU design tricks, dos and don'ts, please check it out: #PDP - Processor Design Principles :-)


Observation : The way we are used to program computers is a long evolution, and selective pressure has favoured countless bad habits and false good ideas, among others.

Safety and security are not guaranteed, ASLR and NoExecute flags don't prevent the constant stream of dumb and preventable vulnerabilities (out of range access, buffer overflows, stack smashing, various leaks, Return-Oriented-Programming and so many other exploit vectors). I'm not speaking about cache and buffer coherency/timing issues here, which are detailed architectural issues.

Of course, no program is flawless and "there will always be bugs" but so many of them depend on the platform allowing them. This project will not revolutionise software engineering but tries to define techniques, structures and features that prevent many of the above-mentioned exploitable side-effects of the current generation of monolithic kernels (which are themselves architectured around existing CPU's programming models, and vice versa). Let's break this spell.

This project also tries to enable a new generation of capability-based microkernels (quite close to the "actor model"), which influence this work. I tried to generalise their structure and keep the most fundamental features for inclusion as processor features.


Logs:
1. POSIX is a curse
2. Read as Zero
3. The cellular allegory
4. Introduction to the new model
5. The watered-down OO Paradigm
6. Code space structure and management
7. Executable files' structure
8. SSS : the Single-Stack Syndrome
9. Name change
10. Basics
11. Memory model
12. The trampoline
13. Auxiliary Input and Output space
14. Interrupts
15. Ideas to choose from Plan9
16. POSEVEN on x86
17. FRUTE and Scheme
18. The end of the linker
19. POSEVEN_86: ideas of a plan
20. OK but what about the compiler ?
21. Prototyping POSEVEN on other architectures
22. SYSCALL on x86-64
23. CHERI
.
.
.
.
.
.

  • CHERI

    Yann Guidon / YGDES • 7 days ago • 0 comments

    https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/

    This endeavour has progressed significantly, including a whole BSD port.

    • The good : it's capabilities based.
    • The bad : it's a messy ISA extension with tagged memory bolted on existing mainstream platforms, that requires weird large composite pointers à la IBM S/38...

    From there:

    CHERI was initially developed using a 256-bit format capable of storing a full 64-bit address, 64-bit base and 64-bit length as well as other metadata. The significant memory footprint of these capabilities motivated research into a potential compressed CHERI capability format.
    .

    OH DEAR.

    .

    (pun intended)

    And they managed to develop a "compression technique in the context of small 64-bit capabilities with 32-bit addresses."

    so they basically reinvent the x86 but without microcode.

    One of POSEVEN's core principles is that a (data) pointer is a scalar number that can be set or copied with one scalar instruction. CHERI moves to the visible programming/binary space what was previously in the x86 microcode, which at least doubles the size of the context and increases the code size too...

    Furthermore, if the pointer attributes are stored along with the user-visible field, then the safety is not ensured in case of hardware compromise (whether a hot neutron, a JTAG probe or RawHammer). POSEVEN is simpler/more rudimentary but it does not keep all the eggs in the same basket. If a pointer is bork, it's bork, and the other protections catch it. There is almost no risk that the "hidden" parts of the pointer (in RAM, in registers...) gets corrupted invisibly, because the pointer is a scalar.


    Furthermore, the separate addressing spaces simplify operations since a pointer does not have to check whether it points to stack, code, etc...

  • SYSCALL on x86-64

    Yann Guidon / YGDES • 11/18/2026 at 10:09 • 0 comments

    I solemnly declare that I haven't cared about x86 internals for the last 25+ years, since I wrote my DOS-extender for my Pentium. I have looked at optimisation-related topics (including MSRs for caching the video framebuffer or branch prediction) but no operating system-level details, as the 32-bit protected mode was complex enough.

    So I have not yet looked at the "new" SYSCALL, introduced in x86-64 (why would I ?). Now is the time to look at it and fortunately, https://kernel-internals.org/arch/x86/syscall-entry/ is very instructive.

    SYSCALL: There's good and there's bad and there's in-between.

    • The bad : sysenter/sysexit is the Intel version and Syscall/Sysret is the AMD version, different features... It seems that Intel has adopted the AMD version (?) so I stick to SYSCALL.
    • The good : fewer behind-the-scene segment and page things, compared to the old interrupt scheme. Fewer weird registers to configure, fewer Byzantine fields and formats to decypher.
    • The bad : It works only on x86-64 so I'll also have to manage this too and I'm not prepared. I only have code for i386. This also means my "emulator" will not work on the old PIII that I can hack.
    • The good : it's indeed somehow lightweight, the SYSCALL instruction takes no argument.
    • The bad : the "dispatch" code described in the x86-64 code is labyrinthine, with fetches/writes all over the place, function calls galore... Far from the almost direct execution of IPC.
    • The good : SYSCALL simply goes from ring 3 to ring 0.
    • The bad : But this affects the emulated system: all modules must run as ring 3 so there is a need to create a trampoline in ring 0, which sort of becomes a "kernel", going against the "no-kernel" claim (but i'm still ok since "it's just a prototype").
      More generally it's not possible to switch directly from a ring3 to another ring3. I'll have to check the doc, I seem to remember that "call gates" were a thing but never cared about them.
    • The bad : SYSCALL uses RCX to save RIP and R11 to save the flags, so either push RCX push R11 is required before SYSCALL, or make these registers invisible to the application ?

    Overall and apparently, it's technically possible without reinventing the whole wheel. The emulation still requires work (such as a "ring 0 trampoline/pseudopicokernel" that requires 64-b mode) but this should be much easier in 2026 (thanks Internet and LLMs).

    The intended IPC instruction does a lot of the work of SYSCALL and the following code. I haven't found yet a way to ensure that the target of an IPC goes to an IPE instruction, this will require more emulation...

  • Prototyping POSEVEN on other architectures

    Yann Guidon / YGDES • 11/17/2026 at 02:58 • 0 comments

    Log 19. POSEVEN_86: ideas of a plan has burst the dam by admitting that the ideas of POSEVEN could be tested on existing architectures, IF we compromise the security and safety model, in hope that the speed will be decent, particularly compared to a simulator/VM.

    This should work pretty well on x86 thanks to the segment thing in protected mode. I could even, maybe, find the dual-CPU code to test multiprocessing. But what about the other archis I can run right now, and how is it possible to program them as "baremetal" ?

    I own a good collection of Raspberry Pis, for projects (#Clunky McCluster and others) as well as to keep some libraries up-to-date ( #C SPI library for Raspberry Pi  and #C GPIO library for Raspberry Pi  which are almost obsolete, yes I gnaw). ARM is the type of CPU that, I believe, uses a flat memory layout for user programs and I am not comfortable with folding the control stack and the code space into the data space, even shielded by paging : the idea is that there would be no way a (data) pointer could exfiltrate or modify one of these spaces. But at least I could play with a SDcard and plop a binary to boot into the new system. It's relatively easy to program a Pi "baremetal" but the ARM architecture evolves significantly from model to model so which one to choose (2, 3, 4 or 5 ?) and then, can the specific CPU be easily sourced if I burn it, does it support multiple address spaces...

    Even weirder is that I still possess several Alpha EV6 machines, notably four XP1000 (in various conservation states). Maybe I could even recap the XP900, a marvelous PC-like RISC powerhouse from the late 90s. And I'll have to reflash the PAL code in the serial memory... I have no idea how to do it, or how to write the necessary code that handles all the hidden guts of the CPU.

    The x86 version will be developed rather fast, if I find a convenient system to upload binaries to execute after boot/BIOS init. I already have the setup code for 32-bit protected mode but this relied on MS-DOS, I can configure the VESA mode and get keyboard and PS2 mouse inputs. But if I could, I wouldn't use x86...

  • OK but what about the compiler ?

    Yann Guidon / YGDES • 11/13/2026 at 06:23 • 6 comments

    I have learned to not care.

    For a quarter of century the compiler issue was a major roadblock and I have learned to not be bothered, and I have found many excuses and pretexts.

    First, I don't care about writing thousands of lines of assembly language, at least I get a raw feeling of what the CPU does and how. But I might be an exception and "most people" want to... "run Linux and a web brower". So HLLs are an unavoidable requirement.

    The big issue with the compilers is their size and crazy complexity : teaching GCC to handle a new platform is easy as long as that new CPU is x86 or MIPS. If you make a MIPS derivative, just change the number and names of the registers in a config file. But if you really want to teach it new tricks, the kinds not common in the 80s, you have to deal with the intricate internals and if you don't, you can't compile Linux and the full GNU suite.

    So the industry has focused on a few architectures, meaning that actual architectural innovation has been out of question.

    LLVM came and ... Still the same situation. The weight of legacy source code has crushed everything.

    Think about all the source code out there that you want to run on your new shiny computer. So if you use a "tiny C compiler" (TCC and the likes) you get problems with performance and support for obscure features. On top of that, the makefiles are not prepared for your custom compiler. It's "GCC (or LLVM) or die".

    But today, we're in 2026 and LLM is the new compiler/linker. It's a lousy compiler since you will never get the same result or even be able to verify that it does what you want, only that and all of that.

    I know it's ugly but that's one more pretext I have now, if I'm asked again "how to you compile my code". Just use ChatGPT or Claude, if you can afford the tokens. If you can't then it becomes an incentive to design or adapt a compiler.

    I want to reverse the industrial dependency. Since the 80s, creating a new CPU has become way easier than rebuilding the Pisa Tower of software. The CPU should not be held back by whatever was convenient 4 decades ago and the compiler must accommodate for the hardware, which knows what is best at the electronic level. I find it ridiculous that the "soft" ware has become harder than "hardware".

    Moreover, I have a strong aversion for LLMs. This is mostly because the "AI craze"  is mostly based on the fantasy of a "DWIM" machine (Do What I Mean) that pretends to understand you. But as a pure tool, trained for a focused purpose, constrained for reproducibility and self-checking, devoid of anthropomorphising, it starts to make a bit of sense. In the absence of a well-working compiler program, that distillates all the architectural and algorithmic know-how, a LLM is an expensive but functional tool that brings some flexibility during the early design phases.

    And if things go well, new languages like Goose/Lobster will soon fill the gap (and Goose was designed/refined with a lot of help from LLM/AI)

  • POSEVEN_86: ideas of a plan

    Yann Guidon / YGDES • 11/12/2026 at 01:16 • 0 comments

    To make an approximate prototype of a POSEVEN system, simulation is possible but a bytecode generator and interpreter must be designed from scratch. It's possible and portable but slow and inherently limited in other ways.

    So using the plain x86 (32 and 64-bit protected mode) as a platform is not so ridiculous:

    • I still have good knowledge of the architecture and I'm not afraid to code in assembly language until a compiler is adapted,
    • the CISC demon has a complex, but rich set of features, including page tables, so I can kneecap them at will,
    • the code will execute at "native speed",
    • NASM is the best x86 assembler and disassembler, and (still) under active development, and I am in contact with one of the maintainers, so it will be easy to "thoroughly adapt" ;-)
    • NASM has a great macro system so it could emulate a RISC instruction set,
    • there are many IO options to make pretty demos, keyboard video and mouse are pretty done, 
    • people can test-drive with a boot media or in a VM

    Of course, the core promises of safety cannot be held, because the x86 architecture is too... hmmmm... but that lets me verify that my ideas and principles hold water for an actual functioning interactive system. Porting to a dedicated platform will be a breeze, hopefully.

    The plan so far:

    • Write pseudo-assembly code using the powerful macros of NASM, so the instructions look like RISC but they are converted to x86-64 under the hood. Since it's a macro-language, this would be a Macro Instruction Set (.mis extension)
    • In the module build script, call the disassembler to parse for any access to segments, stack pointer, computed jumps, stack pointer... or invokes forbidden instructions.
    • Get a computer that can boot from SD card or FreeDOS, and/or a virtual machine to boot the system.

  • The end of the linker

    Yann Guidon / YGDES • 11/11/2026 at 07:02 • 0 comments

    One unavoidable part of building a UNIX-like system, after the assembler and the compiler, is the linker. This is the piece that sticks all the parts of a program together, the system libraries, the program, the extra libraries, puts them in memory then patches the various areas such that code and data pointers have the right values. Salt and pepper with ASLR... The dynamic linker is an even tougher beast and several attacks have used this pathway.

    "Modules" in POSEVEN are static. The compiler can optimise the hell out of a module and not care about layout of code and private data.

    The only thing that needs load-time alteration is the instructions that call other modules since the numbers of the services are usually fixed, but the system may re-attribute them (substitution for debug, update, versioning etc.)

    • In a pure RISC system, the loader can simply scan the binary code and detect the IPC instructions to directly "patch" the immediate numbers with local system values. Note: the service/module number must be immediate (16 bits usually) and the function number (index in the trampoline) is usually a register operand, which should not vary.
    • On x86 PoC, the IPC instruction is emulated by a short sequence of instructions (macro), an address table maybe be present (alongside the code segment) to tell where to patch the immediate values, more shennanigans are possible as well, more or less dynamic.

    But aside from this...

    • There is no ASLR so no need to fix the code and data addresses. Most are immediate and absolute, to save on address calculations.
    • There is no need to assemble disparate code or data segments together, no need to resolve labels, no name collisions...

    Bye bye linker, the code to load another module has become incredibly small, because the cost of IPC (calling another module) has been reduced to almost nothing (in the intended platform, and x86 will of course be slow at the edges with the TLB things but at this point it does not matter).

  • FRUTE and Scheme

    Yann Guidon / YGDES • 11/11/2026 at 06:55 • 0 comments

    https://frute.net/ proposes a LISP machine-like environment.

    The premises start very well:

    "FRUTE asks what an operating system looks like when the CPU, language runtime, garbage collector, compiler, and authority model are designed together instead of bolted together after the fact."

    Then it focuses on one aspect:

    "Conventional systems make language runtimes recover structure from untyped words, make security policy chase ambient names, and make garbage collectors infer which machine values are pointers."

    From there, it goes a bit wild:

    "FRUTE moves those facts into the architecture: values are tagged, authority is explicit, and Scheme is treated as a first-class systems language."

    ...

    Overall, there are interesting ideas but

    1. POSEVEN does not (and should not) mandate a given programming language (unlike UNIX which is inherently C-centric, which is a strength until it isn't)
    2. Tagged memory is an industrial dead end (see IAPX432 and LISP machines).
    3. Types can not be exhaustively defined in a few bits (it's only a start)

    Tagging each memory location increases memory word widths or reduces useable space, or eats the SEC/DED bits and recovery is impossible. This also requires either a dedicated circuit, or explicit code to check the type. This is not a reasonable requirement and experience with early (non-optimising) Ada compilers (just an example among many) is a lesson from 4 decades ago.

    Asianometry has covered (superficially) LISP machines and I'm sure Duane will add more context and depth. But POSEVEN can not rely on word-granularity types. However, pages could be a good place to enforce this.

    LISP machines have a certain appeal, just like Forth machines. But their flexibility is reduced to a certain class of applications, not those that POSEVEN targets.

    POSEVEN does not tag each memory word, but implicitly the pointers, since their MSB already segregate the functions/access types. The applications are responsible for correctly handling the values and types. Segregation could be shrunk even more (for example, at the page level) but I doubt it would be practical, particularly for struct/record.

    Anyway, as it is, it's a reasonable compromise and structures such as #aStrA : Aligned Strings format with attributes  do a reasonable job at embedding some information in the pointers. Apple goes waaaayyyy further.

    Furthermore, the data space can not contain pointers to code and no instruction is allowed to access (read, write or execute) the stack or the code areas. It is not possible to "leak" info in any direction. And since the data stack and control stack are split, and the control stack is tagged, the worst "type confusion" attacks (on the mixed stack) are prevented.

    The control stack can be tagged because each level stores two words, one of them is the (short) instruction pointer and the remaining MSB contain the type. The control stack can be flushed to memory without changing/adapting the words sizes, which is impractical for general data.

  • POSEVEN on x86

    Yann Guidon / YGDES • 11/11/2026 at 06:28 • 0 comments

    Looking at Linux, one would think that POSEVEN would be hard to adapt to the x86 / x86-64 platform.

    But most of the basic infrastructure is already there ! it just has been mooted by the flat-layout UNIX kernels.

    The trampolines are not there, but can still be emulated with a trampoline trampoline ;-)

    But the 3 main memory spaces (+IO) are already part of the x86 architecture with the segments.

    "Segments are slow!" but they serve important purposes that have been sacrificed on the alter of raw performance. Today, the prefixes make almost no difference when x86 CPUs run at 2, 3 even 4GHz !

    • DS, ES : data segments.
    • CS : code segment.
    • SS : Stack segment
    • IN and OUT instructions already exist

    It's all here and implicit. Linux (and xBSD) just make them point to the same flat memory area.

    FS and GS are extra features that are not even required.

    So a quasi-POSEVEN kernel is possible on x86. Not that I want to get into this horrible mess again but I could at least NASM my way out of it easily.

    Of course, there would be strong limitations:

    • At least for most modules, segment prefixes are not allowed, as they would be the prime method to circumvent protection. The kernel would be allowed, though.
    • Playing with SP would be forbidden. Only PUSH/POP (POPA or PUSHA would be OK)
    • Only immediate calls and jumps/branches are allowed, so no computed jumps.

    These could be enforced by modification of the assembler. But given the hardware's nature, it can only "emulate" POSEVEN (and quite fast, at that) but can't ensure all the safety guaranties. So that would be a good way to prototype and demonstrate the principles and get the first system in working condition without having to write a JVM or something like that.

    It's feasible in a VM, at least, or with a bootstrap from FreeDOS.

    The risk would be to get carried away with all the x86-specific "features" and taint the pure RISC philosophy.

  • Ideas to choose from Plan9

    Yann Guidon / YGDES • 10/19/2026 at 17:48 • 0 comments

    After several years of work on one project, when it hits too many roadblocks, I often have this tradition: See everything that worked and what didn't. I keep what worked and do the reverse of what hadn't worked.
    I usually do this for my CPUs but here, let's talk about operating systems. POSEVEN is not an OS nor my second, but we can look at others and see what ultimately failed. I've ranted a LOT about UNIX because it's the main type in circulation (if you ignore MS Windows, but why wouldn't you ?)

    Now let's have a look at Plan 9.

    This post is inspired by a post by Arndt Mueller :

    Plan 9 from Bell Labs is a distributed research operating system created in the mid-1980s by the original creators of Unix (including Ken Thompson, Rob Pike, and Dennis Ritchie) as a planned successor to Unix.

    Key Concepts

    • Everything is a file: Building on Unix, Plan 9 extends the concept so that every resource, service, and device is represented as a file and accessed through a standard file tree.

    • The 9P Protocol (Styx): A lightweight network file protocol that allows local and remote file systems, hardware devices, and processes to be shared seamlessly across a network.

    • Per-process Namespaces: Each program can have its own customized, private view of the file system, a concept that later influenced modern Linux containers.

    • Native UTF-8: Plan 9 was designed and built to handle UTF-8 Unicode text throughout the entire system, shell, and text editors (like sam and acme).

    • Distributed Architecture: It was built to run across a network of specialized machines (separate CPU servers, terminal workstations, and storage servers like Venti) rather than a single monolithic computer.

    I must admit that I have a good amount of respect for Plan9, as I was (remotely) introduced to it around 1999-2000 at uni by my OS/CS prof Jean Méhat (RIP). It was to be the future... But still in raw form. Experimental, barebones and no practical use for it, yet, only distributed in binary blobs with an interface that was... terse.

    • Soon I would use the graphical interface port "9wm" on XWindow, regularly, a lot. It's small. It's simple. I even wrote an article about it. It's not the best but it's no fuss. I love simple things since they let me focus on the real work.
       
      So minimalist GUI : ok.
       
    • But I didn't use Plan9 for real. I could catch a few "party tricks" here and there as they filtered through Linux for example. That was... OK.
      Some applications are nice. Others are cumbersome. Since UNIX/POSIX loves treating/processing text streams, this creates a new problem: when you have complex resources, you must create complex parsers and serialisers. It becomes more work for both the driver and the userland program. And more attack surface.
       
      So I consider a dual track: some resources are "UNIX files" which is great for unstructured streams like regular files as well as /dev/random and such.
       
      But structured resources? They must be properly handled like the "objects" they are. I don't like objects but this paradigm has certain fundamental merits when well used. And the "modules" of POSEVEN are the right interface, even though they are binary. You can still make a binary<->text converter (an idea for another standard module... sounds a bit like regedit???)
       
    • The 9P Protocol (Styx):... A pretty great achievement. I like the idea though I don't know much more about it. And on POSEVEN nothing prevents you from transfering the IPC to a different machine using a buffer/translator/trampoline/surrogate module.
       
    • Per-process Namespaces: This translates to POSEVEN with each running thread having (inheriting and then updating) their own directory of available and "translated" modules. Alteration of the list and mapping to actual modules can be on-demand (for example selecting a particular revision of the module/service) or external (for example for debug, inspection, debugging or the module needing a translation layer,...
    Read more »

  • Interrupts

    Yann Guidon / YGDES • 09/12/2026 at 17:16 • 0 comments

    Handling interrupts is very easy : these signals are treated like a IPC instruction.

    Each class of interrupt (such as maskable, non-maskable, system, IO, SW faults...) has a dedicated register with the n° of the thread (and its thread descriptor address) that manages it (plus a "ready" flag). Vectored interrupts in the class are managed through the IPC service n°. Thus there is very little special hardware to add, and no new instruction.

    A handling thread must be spawned ("pre-fork" in other contexts) before the interrupt source can be serviced.

    There is no other requirement (yet), there may be as many classes as necessary and possible.

    The interrupt registers are not specified yet.

View all 23 project logs

Enjoy this project?

Share

Discussions

Yann Guidon / YGDES wrote 6 days ago • point

  Are you sure? yes | no

Yann Guidon / YGDES wrote 11/15/2026 at 15:51 • point

https://www.reddit.com/r/ProgrammerHumor/comments/1khql8g/memebroughttoyoubymycurrentworkproblem/
"Slow Processors create Good Code"

  Are you sure? yes | no

Yann Guidon / YGDES wrote 10/07/2024 at 08:12 • point

https://youtu.be/oNQLhcn5gvE?t=15728 (oh no.... it's ridiculous at this point)

  Are you sure? yes | no

Yann Guidon / YGDES wrote 03/16/2024 at 10:51 • point

So much is going on right now !!!
#A stack is progressing, I am currently writing an article on this subject.
I am also working on the addressing model, the MSB of the pointers in particular.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 07/03/2023 at 13:37 • point

https://www.youtube.com/watch?v=lc5Np9OqDHU Even Douglas Crockford agrees.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 06/25/2023 at 18:31 • point

https://chompie.rip/Blog+Posts/Put+an+io_uring+on+it+-+Exploiting+the+Linux+Kernel LOL.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates