wip: fork()

This commit is contained in:
0x35c
2025-11-12 15:07:36 +01:00
parent 02d196fab5
commit 34aa0f0eb4
9 changed files with 115 additions and 28 deletions

View File

@ -1,10 +1,11 @@
#pragma once
#include "process.h"
#include <stdint.h>
#define STACK_SIZE PAGE_SIZE * 4
#define STACK_SIZE PAGE_SIZE * 4
#define CURRENT_TCB ((struct tcb *)current_tcb->content)
typedef uint16_t tid_t;
typedef enum {
NEW,
@ -16,10 +17,9 @@ typedef enum {
struct tcb {
uint32_t *esp;
uint32_t *esp0;
uint16_t tid;
tid_t tid;
state_t state;
struct pcb *process;
struct tcb *next;
};
struct tcb *create_thread(struct pcb *process, void (*entry)(void));