nullplan wrote: ↑Mon Aug 03, 2026 1:25 am
Looks to me like you spent a whole lot of effort reimplementing one of x86's weirder design choices but worse. x86 has the IOPB with which an OS can cede control of certain ports to userspace processes without requiring system call indirection.
All RISC architectures I am aware of (AVR, ARM, PowerPC, OpenRISC, and RISC-V) do not implement IO space separately, so the question does not even turn up. The OS can grant access to any particular range of physical memory by allowing it to be mapped into unprivileged memory.
As I already told you, the implementation was ZERO cost.
I'm aware that some operating systems allow you to select certain processes to use privileged instructions without generating TRAPS, but... which ones?
Honestly, I don't know, and I don't know if this is the best solution.
So, it's fine like this: two address spaces and clear separation of instructions.
nullplan wrote:
]Bravo. The four normal privilege levels of x86 protected mode also cost "nothing" as in, they are already part of all the tables. But still two of those four levels typically go unused. The smart design would be to learn from the mistakes of the past.
I was just told that RISC uses four privilege levels.
With just one trit, I couldn't have four.
nullplan wrote:
Thus requiring a fat kernel that does everything. The more code is privileged, the more likely it is to have some error that is exploitable to at least get a denial of service, if not outright privilege escalation going. A strictly security-first approach would be a microkernel approach that pushes as much logic as possible into unprivileged userspace processes, so that errors (that will happen) cannot take down the entire system.
In practice this is hard to implement, I know. An evil driver can make DMAing hardware overwrite all memory it wants to, including the page tables (and if you can overwrite the page tables, you can map your own code with the highest privilege, and thus usurp the highest privilege). But pushing code into kernel space that does not belong there is definitely not the security-centric approach.
I know the exact opposite.
As far as I know (correct me if I'm wrong), seL4 uses user-mode drivers, but they still need to switch to kernel mode at least for hardware configuration when they need to access hardware devices.
In any case, if you don't like it, there's nothing stopping you from implementing memory I/O, and you always have the separate space approach, which, as I said, was cost-free.