yo almost, i guess...
This commit is contained in:
+6
-6
@@ -4,10 +4,10 @@
|
||||
#include <stdint.h>
|
||||
|
||||
// Сегменты для ядра и пользователя
|
||||
#define SEG_KCODE 1 // Сегмент кода ядра
|
||||
#define SEG_KDATA 2 // Сегмент данных ядра
|
||||
#define SEG_UCODE 3 // Сегмент кода пользователя
|
||||
#define SEG_UDATA 4 // Сегмент данных пользователя
|
||||
#define SEG_KCODE 0x08 // Сегмент кода ядра
|
||||
#define SEG_KDATA 0x10 // Сегмент данных ядра
|
||||
#define SEG_UCODE 0x18 // Сегмент кода пользователя
|
||||
#define SEG_UDATA 0x20 // Сегмент данных пользователя
|
||||
#define DPL_KERNEL 0 // Уровень привилегий ring 0
|
||||
#define DPL_USER 3 // Уровень привилегий ring 3
|
||||
|
||||
@@ -25,7 +25,7 @@ typedef enum TaskState
|
||||
typedef void (*EntryPoint)(void);
|
||||
|
||||
// Структура контекста для переключения между процессами
|
||||
typedef struct Context {
|
||||
typedef struct __attribute__((packed)) Context {
|
||||
uint32_t edi;
|
||||
uint32_t esi;
|
||||
uint32_t ebx;
|
||||
@@ -34,7 +34,7 @@ typedef struct Context {
|
||||
} Context;
|
||||
|
||||
// Структура trap frame для перехода в ring 3
|
||||
typedef struct TrapFrame {
|
||||
typedef struct __attribute__((packed)) TrapFrame {
|
||||
uint32_t edi;
|
||||
uint32_t esi;
|
||||
uint32_t ebp;
|
||||
|
||||
Reference in New Issue
Block a user