Remove kernel prints, it's to much. Add simple text save function

This commit is contained in:
Maxime Bloch 2020-01-28 23:24:51 +01:00
parent 9589e2f804
commit 200e58b6f6
No known key found for this signature in database
GPG Key ID: CE32A7D95B7D6418
2 changed files with 9 additions and 4 deletions

View File

@ -57,11 +57,8 @@ void kernel_main(void) {
print(memory_str);
print(management_str);
print("Mem after freeing\n");
free(memory_str);
print_memory();
free(management_str);
print_memory();
print((are_interrupts_enabled()) ? "Interrupts!\n" : "No interrupts :(\n");

View File

@ -118,7 +118,13 @@ int ree(char *unused) {
}
int save_text(char *text) {
char *mem_block = alloc(strlen(text) * sizeof(char));
char *c;
int i = 0;
for (c = text; *c != '\0'; c++) {
mem_block[i] = *c;
i++;
}
}
// TODO This is ugly, fix this
@ -129,6 +135,7 @@ const char *shell_commands_strings[] = {
"ree",
"getgdt",
"memdump",
"savetext",
NULL
};
@ -139,6 +146,7 @@ int (*shell_commands_functions[])(char *) = {
ree,
get_gdt,
command_mem_dump,
save_text
};
int run_command(char *buffer) {