diff options
| author | Miguel <m.i@gmx.at> | 2018-09-09 11:49:30 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-09 11:49:30 +0200 |
| commit | e85a68e1536a0f6505300e1cb79f06b9743b00f7 (patch) | |
| tree | c503a7681720925c5f4923e26c01f7b2e697023d /fs | |
| parent | fc1d491479abd74a1e038ad9ff7d4d330d79e4a8 (diff) | |
fixing implicit func declarations!
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/elf.c | 5 | ||||
| -rw-r--r-- | fs/elf.h | 1 | ||||
| -rw-r--r-- | fs/ext2.c | 22 | ||||
| -rw-r--r-- | fs/file.h | 2 | ||||
| -rw-r--r-- | fs/fs.h | 2 | ||||
| -rw-r--r-- | fs/mount.h | 2 |
6 files changed, 20 insertions, 14 deletions
@@ -1,6 +1,7 @@ #include "kernel/kernel.h" #include <stdint.h> #include "ext2.h" +#include "lib/string/string.h" #define EI_NIDENT 16 @@ -149,14 +150,14 @@ uint32_t load_elf(char *name, uint32_t *alloc) //uint8_t *data=vaddr+phdr->p_offset; uint8_t *data=vaddr+phdr->p_offset+phdr->p_filesz-1; - for(uint8_t *addr=phdr->p_vaddr+phdr->p_filesz-1; addr>=phdr->p_vaddr; addr--) + for(uint8_t *addr=phdr->p_vaddr+phdr->p_filesz-1; (uint32_t)addr>=phdr->p_vaddr; addr--) { *addr=*data; data--; } // let's zero init bss and set alloc (heap) just right after it! - for(uint8_t *addr=phdr->p_vaddr+phdr->p_filesz; addr<=phdr->p_vaddr+phdr->p_memsz; addr++) + for(uint8_t *addr=phdr->p_vaddr+phdr->p_filesz; (uint32_t)addr<=phdr->p_vaddr+phdr->p_memsz; addr++) { *addr=0; } @@ -1,2 +1 @@ - uint32_t load_elf(char *name, uint32_t *alloc); @@ -1,6 +1,9 @@ #include "kernel/kernel.h" // ext2 minidriver // based on osdev wiki article: http://wiki.osdev.org/Ext2 +// +// +#include "lib/string/string.h" @@ -116,12 +119,13 @@ int ext2_check(uint8_t *ram) ext2_superblock super; ext2_superblock_ext super_ext; uint8_t *ptr=ram+1024; - ram_read(ptr,&super,sizeof(super),1); + ram_read((char*)ptr,&super,sizeof(super),1); if(super.ext2_sig!=0xef53){ klog("addr: 0x%08X",ram); kpanic("no ext2 signature found, where ram-image expected"); } + return 1; } ext2_inode ext2_get_inode(uint8_t *ram,int inode_num) @@ -133,7 +137,7 @@ ext2_inode ext2_get_inode(uint8_t *ram,int inode_num) ext2_inode inode; uint8_t *ptr=ram+1024; - ram_read(ptr,&super,sizeof(super),1); + ram_read((char*)ptr,&super,sizeof(super),1); if(super.ext2_sig!=0xef53) { klog("addr: 0x%08X",ram); @@ -150,13 +154,13 @@ ext2_inode ext2_get_inode(uint8_t *ram,int inode_num) ptr=ram+block_size*descriptor_start_block; ptr+=sizeof(desc)*block_group; // skip to our descriptor; - ram_read(ptr,&desc,sizeof(desc),1); // read descriptor + ram_read((char*)ptr,&desc,sizeof(desc),1); // read descriptor // read our inode; ptr=ram+block_size*desc.addr_inode_table; ptr+=128*((inode_num-1)%super.inodes_per_group); - ram_read(ptr,&inode,sizeof(inode),1); //get inode 2 (rood-directory) + ram_read((char*)ptr,&inode,sizeof(inode),1); //get inode 2 (rood-directory) return inode; @@ -189,8 +193,8 @@ void* ext2_get_indirectstart_double(void *start, uint32_t block_size, uint32_t i int ext2_inode_content(char *ram,int inode_nr,uint8_t *ramdest,int max) { - ext2_check(ram); - ext2_inode inode=ext2_get_inode(ram,inode_nr); + ext2_check((uint8_t *)ram); + ext2_inode inode=ext2_get_inode((uint8_t*)ram,inode_nr); int pos=0; int block=0; @@ -248,7 +252,7 @@ int ext2_inode_content(char *ram,int inode_nr,uint8_t *ramdest,int max) } klog("Fool Check Sum: 0x%08X for %d bytes",sum,count); - + return 1; } int ext2_filename_to_inode_traverse(uint8_t *ram, char *path,int inode_start) @@ -322,11 +326,11 @@ int ext2_read_dir(uint8_t *ram, int inode_nr,fs_dirent *dirs,int max) // read dir data ext2_dir dir; - ram_read(ptr,&dir,sizeof(dir),1); + ram_read((char*)ptr,&dir,sizeof(dir),1); // read name ptr+=sizeof(dir); - ram_read(ptr,&buf,sizeof(char),dir.name_length_low); + ram_read((char*)ptr,&buf,sizeof(char),dir.name_length_low); ptr+=dir.name_length_low; buf[dir.name_length_low]=0; @@ -13,7 +13,7 @@ typedef struct int(* wrtie)(char *buf, int len); int(* close)(); - int(* stat)(struct stat *buf); + int(* stat)(void *buf); void *data; //opaque @@ -20,6 +20,8 @@ typedef struct fs_dirent_struct }fs_dirent; int fs_readdir(const char *name,fs_dirent *dirs,int max); +void fs_content(char *path, uint32_t dest, uint32_t max_bytes); void fs_mount(multiboot_information *info); // mounts ext2 ramimage from module as root +uint32_t fs_get_root_ext2_ramimage(); #endif @@ -12,7 +12,7 @@ typedef struct mount_struct char path[256]; // where are we mounted int (*getdents) (struct mount_struct*, uint32_t file_desciptor, fs_dirent *entries, uint32_t max_count); file (*open) (struct mount_struct*,char *path); - void *data //opaque + void *data; //opaque }mount; |
