From cbd2c52c201224a8b326f744f81c978c5710c45e Mon Sep 17 00:00:00 2001 From: Ruslan Isaev Date: Tue, 24 Jun 2025 17:41:38 +0300 Subject: [PATCH] a little cleanup --- src/tasking/exec_from_file.c | 20 +------------------- src/tasking/task.c | 2 -- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/tasking/exec_from_file.c b/src/tasking/exec_from_file.c index 0725410..e0b0e8a 100644 --- a/src/tasking/exec_from_file.c +++ b/src/tasking/exec_from_file.c @@ -8,7 +8,7 @@ #define DivRoundUp(number, divisor) ((number + divisor - 1) / divisor) -#define USER_STACK_TOP 0xBFFFFFF0//0xC0000000 // Top of user space memory +#define USER_STACK_TOP 0xBFFFFFF0 // Top of user space memory #define USER_STACK_SIZE 0x4000 // 16KB stack (4 pages) #define USER_STACK_BOTTOM (USER_STACK_TOP - USER_STACK_SIZE) @@ -31,32 +31,14 @@ int read_file(const char* path, uint8_t** buffer) debug_log("file_size: %X\n", file_size); uint8_t buf[512]; - //memset(buf, 0, 512); debug_log("heh\n"); *buffer = (uint8_t*)malloc(file_size); - //memset(*buffer, 0, file_size); uint8_t* current = *buffer; debug_log("eeee\n"); - int cnt = fat_fread(&file, *buffer, file_size); - - /*for (;;) - { - int cnt = fat_fread(&file, buf, 512); - if (cnt < 0) - return cnt; - - //printf("%s\n", buf); - memcpy(current, buf, 512); - current += 512; - - if (cnt < 512) - break; - }*/ - return fat_fclose(&file); } diff --git a/src/tasking/task.c b/src/tasking/task.c index 760e9a7..ac26ab9 100644 --- a/src/tasking/task.c +++ b/src/tasking/task.c @@ -35,8 +35,6 @@ Process* task_create(uint32_t func, uint32_t user_esp, uint32_t ring, uint32_t* debug_log("kstack: %X!!!!!!!!!!!!\n", p->kstack); uint8_t* sp = (uint8_t*)(p->kstack + KSTACKSIZE); - - sp -= sizeof(TrapFrame); p->tf = (TrapFrame*)sp; memset(p->tf, 0, sizeof(TrapFrame));