From cd3ad989210dc8a3f5805dd5d4c4a6bd74e281db Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 16 Jan 2020 17:15:53 +0100 Subject: Quite a different approach to userspace paging Hope this works soon! --- src/userspace/main.c | 3 +++ src/userspace/mlibc/stdio/printf.c | 6 +----- src/userspace/start.asm | 4 +--- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src/userspace') diff --git a/src/userspace/main.c b/src/userspace/main.c index 6149573..c2307a8 100644 --- a/src/userspace/main.c +++ b/src/userspace/main.c @@ -14,6 +14,9 @@ void user_main() char text[] = "> Successfully switched to usermode!\n"; printf(text); + // TODO: PLEASE + printf("If this message shows up, I'll be happy.\n"); + while (1) { char *input = readline(); if (starts_with(input, "ls")) { diff --git a/src/userspace/mlibc/stdio/printf.c b/src/userspace/mlibc/stdio/printf.c index b582897..5617d03 100644 --- a/src/userspace/mlibc/stdio/printf.c +++ b/src/userspace/mlibc/stdio/printf.c @@ -1,14 +1,10 @@ #include #include -#include -#include void printf(const char *fmt, ...) { - char *format = (char *) malloc(strlen(fmt)); - strcpy(format, fmt); va_list args; va_start(args, fmt); - vprintf(format, args); + vprintf(fmt, args); va_end(args); } \ No newline at end of file diff --git a/src/userspace/start.asm b/src/userspace/start.asm index 7348825..c6bb2a0 100644 --- a/src/userspace/start.asm +++ b/src/userspace/start.asm @@ -4,6 +4,4 @@ section .text global _start extern user_main _start: - mov esp, ebp - call user_main - jmp $ \ No newline at end of file + call user_main \ No newline at end of file -- cgit v1.2.3