mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Split loading from scheduler
In preparation for moving things to the init process, move process loading out of the scheduler. memory_bootstrap now has a load_simple_process function for mapping an args::program into memory, and the stack setup has been simplified (though all the initv values are still being added by the kernel - this needs rework) and normalized to use the thread::add_thunk_user code path.
This commit is contained in:
@@ -106,7 +106,9 @@ process::create_thread(uint8_t priority, bool user)
|
||||
vm_flags::zero|vm_flags::write);
|
||||
m_space.add(stack_top - stack_size, vma);
|
||||
|
||||
th->tcb()->rsp3 = stack_top;
|
||||
// Space for null frame - because the page gets zeroed on
|
||||
// allocation, just pointing rsp here does the trick
|
||||
th->tcb()->rsp3 = stack_top - 2 * sizeof(uint64_t);
|
||||
}
|
||||
|
||||
m_threads.append(th);
|
||||
|
||||
Reference in New Issue
Block a user