fixed memory allocation in linker script but still have a panic error :(
This commit is contained in:
@@ -29,6 +29,6 @@ SECTIONS {
|
|||||||
|
|
||||||
. = ALIGN(4096);
|
. = ALIGN(4096);
|
||||||
__free_ram = .;
|
__free_ram = .;
|
||||||
. += 64 * 1024 * 1048; /* 64MB */
|
. += 64 * 1024 * 1024; /* 64MB */
|
||||||
__free_ram_end = .;
|
__free_ram_end = .;
|
||||||
}
|
}
|
||||||
|
11
shell.c
11
shell.c
@@ -3,13 +3,13 @@
|
|||||||
void main(void) {
|
void main(void) {
|
||||||
while (1) {
|
while (1) {
|
||||||
prompt:
|
prompt:
|
||||||
printf("# > ");
|
printf("> ");
|
||||||
char cmdline[128];
|
char cmdline[128];
|
||||||
for (int i = 0;; i++) {
|
for (int i = 0;; i++) {
|
||||||
char ch = getchar();
|
char ch = getchar();
|
||||||
putchar(ch);
|
putchar(ch);
|
||||||
if (i == sizeof(cmdline) - 1) {
|
if (i == sizeof(cmdline) - 1) {
|
||||||
printf("too much yapping bro :(\n");
|
printf("too much yapping bro\n");
|
||||||
goto prompt;
|
goto prompt;
|
||||||
} else if (ch == '\r') {
|
} else if (ch == '\r') {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -20,10 +20,9 @@ prompt:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(cmdline, "hello") == 0) {
|
if (strcmp(cmdline, "hello") == 0)
|
||||||
printf("Hellow :3\n");
|
printf("Hellow :3\n");
|
||||||
} else {
|
else
|
||||||
printf("I don't know what is %s yet :(", cmdline);
|
printf("I don't know what is %s yet :(\n", cmdline);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user