a little cleanup
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#define DivRoundUp(number, divisor) ((number + divisor - 1) / divisor)
|
#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_SIZE 0x4000 // 16KB stack (4 pages)
|
||||||
#define USER_STACK_BOTTOM (USER_STACK_TOP - USER_STACK_SIZE)
|
#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);
|
debug_log("file_size: %X\n", file_size);
|
||||||
|
|
||||||
uint8_t buf[512];
|
uint8_t buf[512];
|
||||||
//memset(buf, 0, 512);
|
|
||||||
debug_log("heh\n");
|
debug_log("heh\n");
|
||||||
|
|
||||||
*buffer = (uint8_t*)malloc(file_size);
|
*buffer = (uint8_t*)malloc(file_size);
|
||||||
//memset(*buffer, 0, file_size);
|
|
||||||
uint8_t* current = *buffer;
|
uint8_t* current = *buffer;
|
||||||
debug_log("eeee\n");
|
debug_log("eeee\n");
|
||||||
|
|
||||||
|
|
||||||
int cnt = fat_fread(&file, *buffer, file_size);
|
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);
|
return fat_fclose(&file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
debug_log("kstack: %X!!!!!!!!!!!!\n", p->kstack);
|
||||||
uint8_t* sp = (uint8_t*)(p->kstack + KSTACKSIZE);
|
uint8_t* sp = (uint8_t*)(p->kstack + KSTACKSIZE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sp -= sizeof(TrapFrame);
|
sp -= sizeof(TrapFrame);
|
||||||
p->tf = (TrapFrame*)sp;
|
p->tf = (TrapFrame*)sp;
|
||||||
memset(p->tf, 0, sizeof(TrapFrame));
|
memset(p->tf, 0, sizeof(TrapFrame));
|
||||||
|
|||||||
Reference in New Issue
Block a user