From 8a9208612eec8ddae4c418485d848ecfa0613699 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 30 Oct 2023 22:12:14 +0100 Subject: Meta: Move kernel and userland to their own folders. This is to allow both the kernel and the userland to share certain header files and to make the folder structure a bit more clear. --- sched/scheduler.h | 65 ------------------------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 sched/scheduler.h (limited to 'sched/scheduler.h') diff --git a/sched/scheduler.h b/sched/scheduler.h deleted file mode 100644 index fc92ff3..0000000 --- a/sched/scheduler.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef SCHEDULER_H -#define SCHEDULER_H -#include -#include -#include -#include -#include - -#define MAX_PATH 256 -#define KEYBOARD_HALT 0 -#define WAIT_CHILD_HALT 1 - -int fork(void); -int exec(const char *filename, char **argv); -void switch_task(); -void tasking_init(void); -void exit(int status); - -void *mmap(void *addr, size_t length, int prot, int flags, int fd, - size_t offset); -int munmap(void *addr, size_t length); -int msync(void *addr, size_t length, int flags); -int kill(pid_t pid, int sig); -void set_signal_handler(int sig, void (*handler)(int)); - -typedef struct { - void *u_address; - void *k_address; - uint32_t length; - int fd; -} MemoryMap; - -typedef struct Process process_t; - -struct Process { - uint32_t pid; - char program_name[100]; - char current_working_directory[MAX_PATH]; - uint32_t eip, esp, ebp; - uint8_t incoming_signal; - uint32_t signal_handler_stack; - void *signal_handlers[20]; - PageDirectory *cr3; - vfs_fd_t *file_descriptors[100]; - vfs_inode_t *read_halt_inode[100]; - vfs_inode_t *write_halt_inode[100]; - vfs_inode_t *disconnect_halt_inode[100]; - uint32_t halts[2]; - struct Halt *halt_list; - void *data_segment_end; - process_t *next; - process_t *parent; - // TODO: Create a linkedlist of childs so that the parent process - // can do stuff such as reap zombies and get status. - process_t *child; - MemoryMap *maps[100]; - uint32_t sleep_until; - int child_rc; - int dead; -}; - -process_t *get_current_task(void); -int get_free_fd(process_t *p, int allocate); -void free_process(void); -#endif -- cgit v1.2.3