I have moved some code for keyboard handling/console out of my kernel and into GRUB boot modules. I have them loaded and also moved to 0xb0000000 onwards which is my module area. They are compiled to be relocatable code and looking at the ld disassembly dump this seems to be true.
*But* I am getting inexplicable page faults at 0x80000000 onwards which is my kernel area.
Anybody who has done this before, any ideas?
PS. They worked fine when simply linked into the kernel direct. And also they are self-contained and using interrupts to communicate with the kernel interfaces, so no problems there.
Relocatable code and GRUB
Re:Relocatable code and GRUB
grub modules are not loaded, they are just put in memory. so your modules will sit with ELF headers, etc. unless you have runtime linked them.
-- Stu --
Re:Relocatable code and GRUB
Ah, that might certainly explain things a little.
So is there an easy way of runtime linking them or do I need to write an elf loader?
So is there an easy way of runtime linking them or do I need to write an elf loader?
Re:Relocatable code and GRUB
Incidentally, does anybody know of any well documented elf loader code anywhere?
Thanks.
Thanks.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Relocatable code and GRUB
i do have a small ELF loader (for conversion purpose mainly, but it could help though ...)
check elfopen.c if you need some inspiration ...
check elfopen.c if you need some inspiration ...