21 TASK_STOPPED, TASK_RUNNING
30 size_t kernel_stack_len,
40 size_t kernel_stack_len);
42 size_t kernel_stack_len,
size_t user_stack_len,
void* elf);
uint8_t task_get_vm86(task_pid_t pid)
Returns whether a task is a VM86 task.
void * elf
if this is an ELF task, this points to the ELF file
task_pid_t task_get_next_task(task_pid_t pid)
Returns the next task from the task list.
task_state_t state
whether the task is running or stopped
task_pid_t task_create_kernel(void *entry_point, page_directory_t *page_directory, size_t kernel_stack_len)
Creates a kernel task.
task_stack_t * kernel_stack
stack for handling interrupts
static page_directory_t * page_directory
the current page directory
uint32_t ticks
how many ticks the task may run per time slice
The CPU's state when an interrupt occurs.
task_pid_t task_create_user(void *entry_point, page_directory_t *page_directory, size_t kernel_stack_len, size_t user_stack_len, void *elf)
Creates a user task.
task_pid_t task_add(task_t *task)
Adds a new task to the task list and associates a PID.
cpu_state_t * cpu
saved CPU state when entering/leaving interrupts
size_t user_stack_len
user stack length
void task_set_cpu(task_pid_t pid, cpu_state_t *cpu)
Sets a task's CPU state.
uint8_t task_stack_t
stacks are measured in bytes
cpu_state_t * task_get_cpu(task_pid_t pid)
Returns a task's CPU state.
page_directory_t * page_directory
this task's virtual memory map
uint32_t task_pid_t
unique process ID
internal representation of a task
task_pid_t task_get_next_task_with_state(task_pid_t pid, task_state_t state)
Returns the next task from the task list with a specified state.
void task_dump()
Dumps the task list.
uint8_t vm86
whether this task is running in Virtual 8086 mode
void task_stop(task_pid_t pid)
Stops a task.
task_stack_t * user_stack
stack for the actual task's code
An entry in a page directory.
page_directory_t * task_get_page_directory(task_pid_t pid)
Returns a task's page directory.
task_state_t
state of a task
void * task_get_elf(task_pid_t pid)
Returns a task's ELF file.
task_state_t task_get_ticks(task_pid_t pid)
Returns a task's number of remaining ticks.
void task_destroy(task_pid_t pid)
Destroys a task.
uint32_t task_set_ticks(task_pid_t pid, uint32_t ticks)
Sets a task's number of remaining ticks.