diff options
author | Marvin Borner | 2019-12-11 21:22:15 +0100 |
---|---|---|
committer | Marvin Borner | 2019-12-11 21:22:15 +0100 |
commit | e7d88df7a5a7e11677b68303a0d05455bf9a60d6 (patch) | |
tree | c727ea585e21bc68de6add2720e47af7c2506def /src/kernel/syscall | |
parent | 68915f46e66ed65ce2d32009fdfa2f5dca116842 (diff) |
Some user-side graphics
Diffstat (limited to 'src/kernel/syscall')
-rw-r--r-- | src/kernel/syscall/actions/sys_get_pointers.c | 18 | ||||
-rw-r--r-- | src/kernel/syscall/syscall.c | 5 | ||||
-rw-r--r-- | src/kernel/syscall/syscall.h | 2 |
3 files changed, 23 insertions, 2 deletions
diff --git a/src/kernel/syscall/actions/sys_get_pointers.c b/src/kernel/syscall/actions/sys_get_pointers.c new file mode 100644 index 0000000..adbdd36 --- /dev/null +++ b/src/kernel/syscall/actions/sys_get_pointers.c @@ -0,0 +1,18 @@ +#include <stdint.h> +#include <kernel/graphics/vesa.h> +#include <kernel/graphics/font.h> +#include <kernel/paging/paging.h> + +struct userspace_pointers { + unsigned char *fb; + struct font *font; +}; + +uint32_t sys_get_pointers() +{ + struct userspace_pointers *pointers = (struct userspace_pointers *) paging_alloc_pages(1); + pointers->fb = fb; + pointers->font = font; + paging_set_user((uint32_t) pointers, 1); + return (uint32_t) pointers; +}
\ No newline at end of file diff --git a/src/kernel/syscall/syscall.c b/src/kernel/syscall/syscall.c index 3a1b011..24f2445 100644 --- a/src/kernel/syscall/syscall.c +++ b/src/kernel/syscall/syscall.c @@ -13,8 +13,9 @@ uint32_t (*syscalls[])() = { [2] = sys_read, [3] = sys_writec, [4] = sys_readc, - [5] = sys_paging_alloc, - [6] = sys_paging_free + [5] = sys_get_pointers, + [6] = sys_paging_alloc, + [7] = sys_paging_free }; void syscall_handler(struct regs *r) diff --git a/src/kernel/syscall/syscall.h b/src/kernel/syscall/syscall.h index a037d7f..378b5e3 100644 --- a/src/kernel/syscall/syscall.h +++ b/src/kernel/syscall/syscall.h @@ -13,6 +13,8 @@ uint32_t sys_read(char *buf); uint32_t sys_readc(char *ch); +uint32_t sys_get_pointers(); + uint32_t sys_paging_alloc(uint32_t count); uint32_t sys_paging_free(uint32_t virt, uint32_t count); |