Drew Galbraith
b58186265e
Split Yield and Preempt into separate scheduling functions.
...
This switch makes the logic for each much easier to parse.
2023-05-29 23:09:39 -07:00
Drew Galbraith
3fee5ac9d7
Rework scheduler to store the current thread separately.
...
This works better with the sleep thread and lets us check state
transitions more easily.
2023-05-29 22:54:22 -07:00
Drew Galbraith
80d2bf1aaa
Move Processes and Threads to be stored in SharedPtr
...
Reference counting lets us pass these around a bit more easily.
SharedPtr was lightly tested using uint64_t in the main zion funcion.
Also add a sleep functionality instead of panicking. Functionally the
same right now since we don't preempt.
2023-05-29 15:50:38 -07:00
Drew Galbraith
9f3ffbf5b4
Move Process to storing Threads in a linked list.
...
This should really be a vector or hashmap of some sort but this is fine
for now.
2023-05-29 15:08:02 -07:00
Drew Galbraith
5cab9f843e
Move process list to a linked list.
...
Add basic iteration ability to the linked list.
2023-05-29 14:59:23 -07:00
Drew Galbraith
71196dc90f
Move scheduler threads to a linked list implementation.
...
Removes the internal next ptr from the Thread class.
We avoid doing a memory operation when scheduling on yield because we
simply cycle the item to the back of the list.
2023-05-29 14:32:49 -07:00
Drew Galbraith
a06c9dced4
Add thread and process states.
...
Add a thread exit call.
2023-05-29 13:51:03 -07:00
Drew Galbraith
aefb4f082b
Add a kernel ELF module and load it in a new process.
...
Don't yet jump to userspace.
2023-05-29 00:32:54 -07:00
Drew Galbraith
d3024211a7
Cycle through multiple tasks in multiple processes
2023-05-18 13:56:54 -07:00
Drew Galbraith
0d275c72a1
Have processes enqueue their own threads
2023-05-18 13:28:22 -07:00
Drew Galbraith
cb41953354
Scheduler with working threads.
...
Currently only one process but it is a start.
2023-05-18 13:24:02 -07:00
Drew Galbraith
960cbf9519
Add Scheduler wireframe.
...
Right now does nothing but has containing classes for process and thread
information.
2023-05-18 12:43:53 -07:00