diff options
Diffstat (limited to 'fs/elf.c')
| -rw-r--r-- | fs/elf.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -65,6 +65,25 @@ typedef struct { } Elf32_Phdr; +void elf_multiboot_read(multiboot_information *info) +{ + uint32_t num=info->syms[0]; + uint32_t addr=info->syms[2]; + uint32_t stridx=info->syms[3]; + + klog("ELF Kernel Sections:"); + // iterate over section headers. + Elf32_Shdr *shdr=addr; + for(int i=0;i<num;i++) + { + uint32_t nameidx=shdr[i].sh_name; + char *name=shdr[stridx].sh_addr+nameidx; + klog("section %d: %s addr: 0x%08X offset: 0x%08X size: 0x%08X",i,name,shdr[i].sh_addr,shdr[i].sh_offset,shdr[i].sh_size); + + + } +} + // returns elf entry point uint32_t load_elf(char *name, uint32_t *alloc) { |
