From b65dc622574ec3918ca51823ec4b23ff6221357d Mon Sep 17 00:00:00 2001 From: Amoelle Date: Thu, 31 Jul 2025 13:05:09 +0300 Subject: [PATCH] fixed memory allocation in linker script but still have a panic error :( --- kernel.ld | 2 +- shell.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/kernel.ld b/kernel.ld index 9375d1b..c6d5a48 100644 --- a/kernel.ld +++ b/kernel.ld @@ -29,6 +29,6 @@ SECTIONS { . = ALIGN(4096); __free_ram = .; - . += 64 * 1024 * 1048; /* 64MB */ + . += 64 * 1024 * 1024; /* 64MB */ __free_ram_end = .; } diff --git a/shell.c b/shell.c index 55f1564..92f74cb 100644 --- a/shell.c +++ b/shell.c @@ -3,13 +3,13 @@ void main(void) { while (1) { prompt: - printf("# > "); + printf("> "); char cmdline[128]; for (int i = 0;; i++) { char ch = getchar(); putchar(ch); if (i == sizeof(cmdline) - 1) { - printf("too much yapping bro :(\n"); + printf("too much yapping bro\n"); goto prompt; } else if (ch == '\r') { printf("\n"); @@ -20,10 +20,9 @@ prompt: } } - if (strcmp(cmdline, "hello") == 0) { + if (strcmp(cmdline, "hello") == 0) printf("Hellow :3\n"); - } else { - printf("I don't know what is %s yet :(", cmdline); - } + else + printf("I don't know what is %s yet :(\n", cmdline); } }