hawkw / mycelium

🍄 an alleged 'operating system'
https://mycelium.elizas.website
MIT License
541 stars 19 forks source link

are we a microkernel? #3

Open hawkw opened 4 years ago

hawkw commented 4 years ago
iximeow commented 4 years ago

maybe you can if we provide wasm binaries with an expressive enough HAL interface?

the biggest issue i'd imagine is that wasm is a 32-bit machine. it's not a showstopper, but there'd probably be complications somewhere along the way.

what i think is super interesting is that the "layer" of HAL is fairly permissible if drivers are wasm - you could do load-time codegen and inlining of HAL routines such that the separation introduces a pretty small penalty. i'll get into that in #4 because i extremely have opinions.

there are probably some routines that couldn't be wasm because we must precisely control instruction selection but barring address space limits i think it should work. from a design perspective, i don't have strong opinions but think a hybrid approach would be interesting. this doesn't necessitate an elf loader exactly (if a kernel module is wasm the kernel could codegen at load-time from whatever format), but i have other reasons we might want one

hawkw commented 4 years ago

but i have other reasons we might want one

🤔

iximeow commented 4 years ago

:thinking:

not for that!! i want to have a linux emulation layer so we can in theory maybe possibly run linux programs

hawkw commented 4 years ago

i want to have a linux emulation layer so we can in theory maybe possibly run linux programs

ah yeah, that seems handy. but, this could just be in userspace? it's not like "context switches" are a reason to put it in the kernel, if we don't have those