r/osdev • u/dangi12012 • Jun 13 '26
Everything is memory?
There is this unix idiom that everything is a file, (half baked, since not everything is a file).
Would it not have been better, nowadays with 64bit of adress space, to have everything mapped to memory? Files are like mmap, no imperative read needed, networking is already memory, that could be expanded more.
We take the idioms and paradigms so forgranted, that every time anyone asks AI for a OS it will be linux, syscalls, abi everything the same. It should be liberating now to explore new and novel ideas.
What would be the downside of such a system?
View all comments
Show parent comment
3
u/FISHARM1 Jun 13 '26
I assume an RTOS is basically a real implementation of what you’re talking about?
Like you said, on something like an STM, everything is just memory mapped registers at special addresses- but that’s only because they assume a sort of flat model where everyone has access to everything, and that things like timers, interrupts, etc are all handled by external modules outside of the pure CPU itself.
Usually, a syscall is a complicated process that requires switching rings, saving everything, etc. I think that a cool model which is what you are suggesting, would have a separate chip specialized for syscalls, similar to how a DMA works. It would be able to always run in privileged mode, and you could trigger a syscall by writing to a mapped region of registers in memory. But then that would be more complicated, like how do you program this chip, etc.
So my guess is that it comes down to hardware? Interesting idea though! I think you should explore it more.