diff --git a/cpu/i386/tasking.c b/cpu/i386/tasking.c index 612fe4c..5e8402b 100644 --- a/cpu/i386/tasking.c +++ b/cpu/i386/tasking.c @@ -35,7 +35,7 @@ static Task* createTaskKmode(void* eip,char kmode) { task->regs.edi=0; asm volatile("pushfl; movl (%%esp), %%eax; movl %%eax, %0; popfl;":"=m"(task->regs.eflags)::"%eax"); task->regs.eip=(uint32_t)eip; - task->regs.cr3=new_address_space(); + task->regs.cr3=(uint32_t)new_address_space(); uint32_t cr3; asm volatile("movl %%cr3, %%eax; movl %%eax, %0;":"=m"(cr3)::"%eax"); load_address_space(task->regs.cr3); diff --git a/fs/ext2.c b/fs/ext2.c index 432c2b8..70b6991 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -177,7 +177,7 @@ int write_char(inode node,uint8_t c,uint64_t pos,FILE* f,int num) { return EFBIG; } else { if (node.i_block[blk_idx]==0) { - for (int i=0;i<=blk_idx;i++) { + for (uint32_t i=0;i<=blk_idx;i++) { // node.i_block[blk_idx]=reserve_block(f,num); return 0; } @@ -187,7 +187,7 @@ int write_char(inode node,uint8_t c,uint64_t pos,FILE* f,int num) { } } uint32_t offset=pos%blk_size[num]; - if (blk_idx>12||(node.i_block[blk_idx]==0)) return; + if (blk_idx>12||(node.i_block[blk_idx]==0)) return 0; uint32_t blk=node.i_block[blk_idx]; uint8_t* block=read_blk(blk,f,num); block[offset]=c; diff --git a/kernel/kernel.c b/kernel/kernel.c index 29ac763..83146a2 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -16,6 +16,7 @@ #include "elf.h" #include #include "../drivers/ide.h" +#include "parts.h" #include "../fs/ext2.h" static long initrd_sz; diff --git a/kernel/parts.c b/kernel/parts.c index 13d2100..18c5775 100644 --- a/kernel/parts.c +++ b/kernel/parts.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "../fs/devfs.h" typedef struct { @@ -13,7 +14,7 @@ typedef struct { uint32_t length; } partition; -static char** part_devs=NULL; +static const char** part_devs=NULL; static partition** parts=NULL; static uint32_t num_part_devs=0; static uint32_t max_part_devs=0; @@ -37,7 +38,7 @@ int drv(char* filename,int c,long pos,char wr) { char* str=malloc(sizeof(char)*(strlen(filename)+1)); strcpy(str,filename); str[strlen(str)-1]='\0'; - int i; + uint32_t i; for (i=0;i