3 ms·
> Modern OSes, complicated software stacks, preemptive multi-tasking, and the need for flexible general purpose usage, eat up a huge percent (I'd say well over
by elihu 6y ago
> Modern OSes, complicated software stacks, preemptive multi-tasking, and the need for flexible general purpose usage, eat up a huge percent (I'd say well over ~70%) of the usable computing capacity in the devices we deal with every day.
I think a big part of it is security. Having to isolate address spaces is expensive.
(Sometimes I like to imagine being able to run a unikernel OS where applications are written in something like safe Rust, everything runs in the same address space, and the OS delegates enforcing memory separation to a trusted compiler. So, things like writing to disk or the network are just regular function calls with no context switch overhead. In this model, unsafe code is treated sort of the way we treat kernel code or setuid binaries in Linux: regular users aren't allowed to run arbitrary unsafe code. With Spectre, I don't know if this sort of approach is still feasible on modern processors, or if it's possible for a compiler to guarantee that the compiled code is not susceptible to any known side-channel attacks.)
- com2kid 6y ago> Sometimes I like to imagine being able to run a unikernel OS where applications are written in something like safe Rust, everything runs in the same address space, Better than that, static allocation. Embedded typically doesn't allow malloc anyway, so give me a platform that has the world's simplest MMU, static bounds checks that are put into write once read many memory upon boot. :-D
- elihu 6y agoI was thinking it terms of general purpose computing, but yeah, static-only allocation make a lot of sense in some contexts (embedded, some HPC workloads) and that would sidestep the usual overhead of the allocator.