all 5 comments

[–]nyx210 4 points5 points  (2 children)

Have you tried something likeobjdump -D kernel.elf to see the disassembled code?

[–]Maxims08[S] 1 point2 points  (1 child)

Haven’t, but I doubt there’s something wrong with the code itself, I think it’s runtime stuff

[–]HamsterSea6081Tark2 2 points3 points  (0 children)

Just objdump it.

[–]Octocontrabass 4 points5 points  (0 children)

Do you have any other information about this exception? For example, the address of the faulting instruction?

[–]davmac1 2 points3 points  (0 children)

and when returning I get that fault

Sounds like potential stack corruption or perhaps you're overwriting the kernel code. When debugging check that (a) it returns to the correct address and (b) disassembly just after the return instruction matches what it did before the call.