summaryrefslogtreecommitdiff
path: root/bootmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootmain.c')
-rw-r--r--bootmain.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bootmain.c b/bootmain.c
index 4a70652..8985776 100644
--- a/bootmain.c
+++ b/bootmain.c
@@ -45,18 +45,18 @@ cmain(void)
readseg((uint32_t) ELFHDR, SECTSIZE*8, 0);
// is this a valid ELF?
- if (ELFHDR->e_magic != ELF_MAGIC)
+ if (ELFHDR->magic != ELF_MAGIC)
goto bad;
// load each program segment (ignores ph flags)
- ph = (struct Proghdr *) ((uint8_t *) ELFHDR + ELFHDR->e_phoff);
- eph = ph + ELFHDR->e_phnum;
+ ph = (struct Proghdr *) ((uint8_t *) ELFHDR + ELFHDR->phoff);
+ eph = ph + ELFHDR->phnum;
for (; ph < eph; ph++)
- readseg(ph->p_va, ph->p_memsz, ph->p_offset);
+ readseg(ph->va, ph->memsz, ph->offset);
// call the entry point from the ELF header
// note: does not return!
- ((void (*)(void)) (ELFHDR->e_entry & 0xFFFFFF))();
+ ((void (*)(void)) (ELFHDR->entry & 0xFFFFFF))();
bad:
outw(0x8A00, 0x8A00);