diff options
Diffstat (limited to 'src/userspace/programs')
-rw-r--r-- | src/userspace/programs/init.c | 46 | ||||
-rw-r--r-- | src/userspace/programs/sh.c | 42 |
2 files changed, 0 insertions, 88 deletions
diff --git a/src/userspace/programs/init.c b/src/userspace/programs/init.c deleted file mode 100644 index 8e5887f..0000000 --- a/src/userspace/programs/init.c +++ /dev/null @@ -1,46 +0,0 @@ -#include <common.h> -#include <gui.h> -#include <stdio.h> -#include <stdlib.h> -#include <syscall.h> -#include <unistd.h> - -u32 cpu_flags() -{ - u32 flags; - asm volatile("pushf\n" - "pop %0\n" - : "=rm"(flags)::"memory"); - return flags; -} - -int interrupts_enabled() -{ - return (cpu_flags() & 0x200) == 0x200; -} - -void main() -{ - while (1) { - }; - if (get_pid() != 1) { - printf("Wrong PID!\n"); - exit(1); - } - - if (interrupts_enabled()) - printf("INTs enabled :)\n"); - else - printf("INTs disabled :(\n"); - - // TODO: Fix page fault when mallocing - printf("Initializing userspace... %d\n", 42); - - // TODO: Fix scheduler turning off after spawn - spawn("/bin/sh"); - - printf("Looping in init\n"); - while (1) { - //printf("B"); - }; -}
\ No newline at end of file diff --git a/src/userspace/programs/sh.c b/src/userspace/programs/sh.c deleted file mode 100644 index 2575c26..0000000 --- a/src/userspace/programs/sh.c +++ /dev/null @@ -1,42 +0,0 @@ -#include <common.h> -#include <gui.h> -#include <stddef.h> -#include <stdint.h> -#include <stdio.h> -#include <syscall.h> -#include <unistd.h> - -void test(u8 *data) -{ - printf("."); -} - -u32 cpu_flags() -{ - u32 flags; - asm volatile("pushf\n" - "pop %0\n" - : "=rm"(flags)::"memory"); - return flags; -} - -int interrupts_enabled() -{ - return (cpu_flags() & 0x200) == 0x200; -} - -void main() -{ - printf("Shell started\n"); - if (interrupts_enabled()) - printf("INTs enabled :)\n"); - else - printf("INTs disabled :(\n"); - - //syscall_map(MAP_KEYBOARD, (u32)&test); - - printf("Looping in shell\n"); - while (1) { - //printf("A"); - }; -}
\ No newline at end of file |