8 #define DEFAULT_STACK_SIZE 0x8000
17 SAYORI_INLINE
const char* thread_state_string(thread_state_t state) {
32 typedef volatile struct {
36 physical_addr_t page_dir;
44 virtual_addr_t page_dir_virt;
48 size_t page_tables_virts[1024];
55 typedef volatile struct
76 uint32_t eax, ebx, ecx, edx, esi, edi, ebp;
86 extern void task_switch_v2(thread_t*, thread_t*);
89 bool kernel,
bool suspend);
91 void kill_process(
size_t id);
94 thread_t* thread_create(process_t* proc,
109 size_t create_process(
void* entry_point,
char name[256],
bool suspend,
bool is_kernel);
115 extern void user_mode_switch(
void* entry_point, uint32_t user_stack_top);
118 void init_user_mode(
void* entry_point,
size_t stack_size);
120 int32_t spawn(
const char *name,
int argc,
char* eargv[]);
122 void scheduler_mode(
bool on);
Основные определения ядра
struct registers __attribute__((packed))
Структура данных пакета от мыши
volatile process_t * get_current_proc(void)
Получить текущий обработчик процесса
void thread_exit(thread_t *thread)
Завершить текущий поток
thread_t * _thread_create_unwrapped(process_t *proc, void *entry_point, size_t stack_size, bool kernel, bool suspend)
Создание потока
void init_task_manager(void)
Инициализация менеджера задач
void thread_suspend(thread_t *thread, bool suspend)
Остановить поток
bool is_multitask(void)
Получение состояния о мультипотоке