diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-13 22:44:10 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-13 22:44:10 +0100 |
commit | 706c69d40fcc46e7d7f170dab932d3c7fcc7c34e (patch) | |
tree | 5248ff8712eced5bc4fdd76e9399654ce5224a37 /src/kernel/include | |
parent | 47e6cd42f0744f6c04b8347093f6549339a856c9 (diff) | |
download | kogata-706c69d40fcc46e7d7f170dab932d3c7fcc7c34e.tar.gz kogata-706c69d40fcc46e7d7f170dab932d3c7fcc7c34e.zip |
Begin implementation of syscalls.
Diffstat (limited to 'src/kernel/include')
-rw-r--r-- | src/kernel/include/process.h | 7 | ||||
-rw-r--r-- | src/kernel/include/syscall.h | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/kernel/include/process.h b/src/kernel/include/process.h index 661aaa6..82ba8dd 100644 --- a/src/kernel/include/process.h +++ b/src/kernel/include/process.h @@ -35,15 +35,22 @@ process_t *new_process(process_t *parent); // void delete_process(process_t *p); // TODO define semantics for freeing stuff pagedir_t *proc_pagedir(process_t *p); +int proc_pid(process_t *p); bool start_process(process_t *p, proc_entry_t entry); // maps a region for user stack bool proc_add_fs(process_t *p, fs_t *fs, const char* name); fs_t *proc_find_fs(process_t *p, const char* name); +bool proc_rm_fs(process_t *p, const char* name); bool mmap(process_t *proc, void* addr, size_t size, int mode); // create empty zone bool mmap_file(process_t *proc, fs_handle_t *h, size_t offset, void* addr, size_t size, int mode); bool mchmap(process_t *proc, void* addr, int mode); bool munmap(process_t *proc, void* addr); +// for syscalls : check that process is authorized to do that +// (if not, process exits with a segfault) +void probe_for_read(const void* addr, size_t len); +void probe_for_write(const void* addr, size_t len); + /* vim: set ts=4 sw=4 tw=0 noet :*/ diff --git a/src/kernel/include/syscall.h b/src/kernel/include/syscall.h new file mode 100644 index 0000000..c6c0ed4 --- /dev/null +++ b/src/kernel/include/syscall.h @@ -0,0 +1,10 @@ +#pragma once + +#include <idt.h> +#include <syscallid.h> + +void setup_syscalls(); + +void syscall_handler(registers_t *regs); + +/* vim: set ts=4 sw=4 tw=0 noet :*/ |