Kintsugi OS 0.5.0
x86 Monolithic OS
Loading...
Searching...
No Matches
process.c File Reference
#include "process.h"
#include "../cpu/idt.h"
#include "../drivers/keyboard.h"
#include "../drivers/terminal.h"
#include "../fs/vfs.h"
#include "../kernel/log.h"
#include "../kklibc/kklibc.h"
#include "../mm/memory.h"

Classes

struct  elf_segment_t
 
struct  syscall_regs_t
 

Macros

#define STACK_BOTTOM   (USER_TOP - 9 * PAGE_SIZE)
 
#define STACK_START   (STACK_BOTTOM + PAGE_SIZE)
 
#define USER_HEAP_BASE   0x60000000u
 
#define USER_HEAP_LIMIT   0x61000000u
 

Functions

static u8 kernel_stack[16384] __attribute__ ((aligned(16)))
 
static u32 gdt[12] __attribute__ ((aligned(8)))
 
int user_enter (u32 entry, u32 stack)
 
void user_leave (int status) __attribute__((noreturn))
 
void syscall_entry (void)
 
void process_init (void)
 
int process_active (void)
 
void process_exit (int status)
 
struct __attribute__ ((packed))
 
static int user_copy (u32 address, const void *source, u32 length)
 
int process_run (const char *path, int argc, char **argv)
 
static int user_range (u32 address, u32 length, int write)
 
static int user_path (u32 address, char path[VFS_PATH_MAX])
 
void syscall_dispatch (syscall_regs_t *r)
 

Variables

static u32 tss [26]
 
static u32 space
 
static u32 user_heap_end
 
 elf_header_t
 

Macro Definition Documentation

◆ STACK_BOTTOM

#define STACK_BOTTOM   (USER_TOP - 9 * PAGE_SIZE)

◆ STACK_START

#define STACK_START   (STACK_BOTTOM + PAGE_SIZE)

◆ USER_HEAP_BASE

#define USER_HEAP_BASE   0x60000000u

◆ USER_HEAP_LIMIT

#define USER_HEAP_LIMIT   0x61000000u

Function Documentation

◆ __attribute__() [1/3]

static u8 kernel_stack[16384] __attribute__ ( (aligned(16))  )
static

◆ __attribute__() [2/3]

static u32 gdt[12] __attribute__ ( (aligned(8))  )
static

◆ __attribute__() [3/3]

struct __attribute__ ( (packed)  )

◆ process_active()

int process_active ( void  )

◆ process_exit()

void process_exit ( int  status)

◆ process_init()

void process_init ( void  )

◆ process_run()

int process_run ( const char *  path,
int  argc,
char **  argv 
)

◆ syscall_dispatch()

void syscall_dispatch ( syscall_regs_t *  r)

◆ syscall_entry()

void syscall_entry ( void  )
extern

◆ user_copy()

static int user_copy ( u32  address,
const void *  source,
u32  length 
)
static

◆ user_enter()

int user_enter ( u32  entry,
u32  stack 
)
extern

◆ user_leave()

void user_leave ( int  status)
extern

◆ user_path()

static int user_path ( u32  address,
char  path[VFS_PATH_MAX] 
)
static

◆ user_range()

static int user_range ( u32  address,
u32  length,
int  write 
)
static

Variable Documentation

◆ elf_header_t

elf_header_t

◆ space

u32 space
static

◆ tss

u32 tss[26]
static

◆ user_heap_end

u32 user_heap_end
static