> compile NEMU
221220000 张三 Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 19:13:31 up 6 days, 14:19, 1 user, load average: 1.25, 0.81, 0.58
This commit is contained in:
@ -28,15 +28,15 @@ static uintptr_t loader(PCB *pcb, const char *filename) {
|
||||
|
||||
printf("phdr num is %d\n", ehdr.e_phnum);
|
||||
for (int i = 0; i < ehdr.e_phnum; i ++) {
|
||||
if (phdr[i].p_type != PT_LOAD) continue;
|
||||
if (phdr[i].p_type != PT_LOAD) {
|
||||
continue;
|
||||
}
|
||||
ret = ramdisk_read((void*)phdr[i].p_vaddr, phdr[i].p_offset, phdr[i].p_filesz);
|
||||
printf("phdr [%d] : [%x, %x)\n", i, phdr[i].p_vaddr, phdr[i].p_filesz);
|
||||
assert(ret == phdr[i].p_filesz);
|
||||
memset((uint8_t*)phdr[i].p_vaddr + phdr[i].p_filesz, 0, phdr[i].p_memsz - phdr[i].p_filesz);
|
||||
}
|
||||
|
||||
//assert(ehdr.e_entry == 0x83000000);
|
||||
return 0x83000000;
|
||||
return ehdr.e_entry;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user