-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Begin reorganizing the kernel with kernel-space typescript fs #10
base: master
Are you sure you want to change the base?
Conversation
1ad25a4
to
ee2caa7
Compare
/cc @dfordivam |
711344e
to
79830be
Compare
Of course, allocating a new SharedArrayBuffer on each syscall is a bad plan. So we should try to share one between syscalls until it needs to grow for whatever reason. Also, of course not all syscalls will want to jump out to the kernel. Memory allocation, for instance, still needs to be done in the user space. |
Ideally, the buffer underlying the webassembly memory would be our sharedarraybuffer, but wasm doesn't support that yet. |
Hmm just realized we need to get the data back also.. and currently there is no way to do that.. so will have to use SharedArrayBuffer Also as the kernel is now a separate worker, it would be able to handle incoming messages (like jsaddle JS). |
@dfordivam We are using the I'm not sure what you mean when you say "handler." The "process" (the worker executing the wasm) will be blocked on at most one syscall at a time, so the kernel can always |
As for postMessage we would definitely use the regular messaging style (no SharedBufferArray). My point was SharedBufferArray is only useful for the return messaging, for doing postMessage we dont need that. Regarding handler I meant that the sequence of syscalls should be
|
I don't think we'll need any fancy JSON communication like that. Basically the only difference between operating on this As for interrupts: Well, we're not really considering interrupts yet :P But when we do, I think we'll just make it so that each syscall that blocks on the SharedArrayBuffer will just also respond to a special signal from the kernel that says "Hey this is a signal, not what you asked for." Then they'll enter a generic routine for signal handling. |
b275a21
to
b3d55d9
Compare
The plan here is to move all the syscall implementations into the kernel space. For each syscall the process makes to the kernel, it will
postMessage
aSharedArrayBuffer
containing all the relevant information to the kernel, thenAtomics.wait
on the buffer. The kernel will then do all the appropriate work andAtomics.wake
the process with results.To do all of this on nodejs, we can use the
worker_threads
module. It's experimental, but so is everything about WebGHC, so this doesn't bother me :PThis is WIP until the new kernel can actually run wasm programs.