flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Problem with loading ELF header |
Author |
|
Szustarol 06 Mar 2017, 19:04
Hi!
I somehow encounter a triple fault when loading ELF header Code of my second stage bootloader is here: https://github.com/cuaox/RIOS/blob/master/BOOTLOADER/stage2.asm with jmp $ i have noticed that if i place it before the loop directive it is not crashing, so why is the loop .loadloop triple faulting my OS? Thanks for any help |
|||
06 Mar 2017, 19:04 |
|
revolution 07 Mar 2017, 02:12
You have altered rcx within the loop with this line:
Code: mov rcx, r10 |
|||
07 Mar 2017, 02:12 |
|
Szustarol 07 Mar 2017, 15:44
Okay but before I do this, I do
mov r15, rcx and then I mov rcx, r15 so its value should be restored, shouldn't it? |
|||
07 Mar 2017, 15:44 |
|
Szustarol 07 Mar 2017, 20:00
So i have updated my repo.
I am sure it crashes at loop rcx is fffffffffffffffe hex when the loop jumps so i guess thats the problem any ideas? I have no idea why the rcx is loaded wrongly can you take a look at my makefile? I dont think elf is malformed |
|||
07 Mar 2017, 20:00 |
|
alkap 08 Mar 2017, 10:00
Not sure this is it, but I've noticed that your offsets are all 8 bytes except for the mov r10. is that by design, or an oversight?
Code: mov r8, [rsi + 8] mov r9, [rsi + 0x10] mov r10, [rsi + 0x20] ; 16-byte offset mov r11, [rsi + 0x28] |
|||
08 Mar 2017, 10:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.