Email or username:

Password:

Forgot your password?
Ferris™ ♥️
wondering about how the operating system runs multiple processes, like how it gives control to the process and takes it back when it's time to switch to another process

found osdev wiki

<-- suddenly interested in os development
2 comments
Ferris™ ♥️
waiwaitwait ok I don't know anything about this and I just skimmed some webpage but correct me if I'm wrong

- the kernel keeps track of processes/threads
- running programs need to do syscalls to allocate memory and do other things
- when the syscalls happen it's the kernel's time to do things and it can decide whether to return to the calling process or to run other processes

is that how it works :akko_derp:

(got that idea from this paragraph)

> The other place you might want to update the amount of time a task has consumed is immediately after the CPU changes from user-space code to kernel code and immediately before the CPU changes from kernel code to user-space code

https://wiki.osdev.org/Brendan's_Multi-tasking_Tutorial
there's a lot of buzzwords that I need to look up
this is interesting
waiwaitwait ok I don't know anything about this and I just skimmed some webpage but correct me if I'm wrong

- the kernel keeps track of processes/threads
Ferris™ ♥️
> For a real OS (regardless of which scheduling algorithm/s the scheduler uses) most tasks switches are caused because the currently running task has to wait for something to happen (data received from a different task or storage devices/file system or network, or time to pass, or for user to press a key or move the mouse, or for a mutex to become available, etc), or happen because something that a task was waiting for happened causing a task to unblock and preempt the currently running task.

ooooh *learning noises*

hmm wondering if you could craft a process that will not wait for anything and just block forever

wait that's just a `while(true){}` so how does it switch if that's the case :think_bread:
> For a real OS (regardless of which scheduling algorithm/s the scheduler uses) most tasks switches are caused because the currently running task has to wait for something to happen (data received from a different task or storage devices/file system or network, or time to pass, or for user to press a key or move the mouse, or for a mutex to become available, etc), or happen because something that a task was waiting for happened causing a task to unblock and preempt the currently running task.
Go Up