syscalls: start implementing some basic syscalls

This commit is contained in:
2025-06-20 21:59:08 +03:00
parent a9789b7f57
commit 4ccae473ca
8 changed files with 110 additions and 12 deletions
+7
View File
@@ -2,6 +2,7 @@
#define TASK_H
#include <stdint.h>
#include "../include/fat.h"
// Сегменты для ядра и пользователя
#define SEG_KCODE 0x08 // Сегмент кода ядра
@@ -14,6 +15,8 @@
// Флаги процессора
#define FL_IF 0x202 // Разрешить прерывания
#define MAX_OPEN_FILES 32
typedef enum TaskState
{
Ready,
@@ -58,8 +61,12 @@ typedef struct Process
TrapFrame* tf; // Trap frame (только для ring 3)
uint32_t ring; // Уровень привилегий (0 или 3)
struct Process* next; // Следующий процесс
file_t* file_descriptors[MAX_OPEN_FILES];
} Process;
extern Process* current;
Process* task_create(uint32_t func, uint32_t user_esp, uint32_t ring, uint32_t* pagedir);
void scheduler_init();
void schedule();