Luna/kernel/include/thread/Scheduler.h
apio f8b3567042 Kernel: Add an exec() syscall
Very bare-bones for now. Doesn't support arguments or environment (we don't have that stuff right now), and the executable is not a valid ELF, it terminates the task.

But it's a start!
2022-10-12 17:42:01 +02:00

29 lines
649 B
C++

#pragma once
#include "thread/Task.h"
#define TASK_PAGES_IN_STACK 4
namespace Scheduler
{
void init();
void yield();
void exit(int status);
void sleep(unsigned long ms);
void add_kernel_task(void (*task)(void));
void add_user_task(void* task);
void load_user_task(const char* filename);
void task_exit(Context* context, int64_t status);
void task_misbehave(Context* context, int64_t status);
Task* current_task();
void task_yield(Context* context);
void task_tick(Context* context);
void reap_task(Task* task);
void reap_tasks();
void reset_task(Task* task, ELFImage* new_image);
}