Hey Guys
I am currently loading my Kernel at 1Mb physical address but looks like 3Gb virtually using the GDT. My problem is in my kernel if i jump to a function written in another file from the main one it will crash and bochs reports a running in bogus memory error. Has anyone got any ideas of this. To me its like the object files for the other source files with my functions in are not being linked correctly.
Any Ideas?
Cheers Peter
Linking problem
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Linking problem
i think you should try a disassembly of your final object file to see if jumps are linked correctly ...
Re:Linking problem
Ive tried dissasembling it but its a bit hard to follow due to the fact i am using c++.
Peter
Peter
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Linking problem
What is the final format of your object file (i.e. what is it linked to ?) did you check all your functions were there ...
could you provide a small sample of misworking jump/call with the relocation entries that are related to it ?
could you provide a small sample of misworking jump/call with the relocation entries that are related to it ?
Re:Linking problem
All my functions are definately there as i had it working fine when it was linked to 1Mb it was only when i tried to link it to 0xC0000000 that all the problems arose. Im not quite sure what you want in terms of the jmp and relocation entries. Do you want a dissasembled version of my final binary file or some of it?
Also do you knwo of a viewer that will display object files ie the header info etc.
cheers
Peter
Also do you knwo of a viewer that will display object files ie the header info etc.
cheers
Peter
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Linking problem
objdump displays quite alot of informations, which avoid you from needing a detailed hexdump of the section headers, etc.
It is available in every distribution of Binutils (and should be available with your Linux/DjGPP distro)
It is available in every distribution of Binutils (and should be available with your Linux/DjGPP distro)