Function call problem

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pskyboy

Function call problem

Post by pskyboy »

Hey Guys

Has anyone got any ideas why calling a function in another object file would cause my kernel to crash and through up "running in bogus memory".

I have linked the kernel at 3Gb and all the object files that i call functions in are linked together.

Peter
pskyboy

Re:Function call problem

Post by pskyboy »

Hey Guys

It seems to be working fine on the call of the function but as soon as the function tries to return it throws up the error.
slacker

Re:Function call problem

Post by slacker »

to me it sounds like a stack problem since the function is executed.................but thats just me..the slacker
pskyboy

Re:Function call problem

Post by pskyboy »

Hmm, I have probably asked this before but i will ask it agin does C automatically set up its own stack or do i need to make sure a stack has been set up for the C Kernel before i call it?

Peter
slacker

Re:Function call problem

Post by slacker »

im pretty sure that C code uses the preexsiting stack. actually it has to--
pskyboy

Re:Function call problem

Post by pskyboy »

Cheers

I managed to fix that now, it was the stack causing problems.
slacker

Re:Function call problem

Post by slacker »

i called it....
_mark

Re:Function call problem

Post by _mark »

Go slacker - your getting to be a regular expert. Watch out for this one Pype & Tim.

:)

good going slacker
_mark()
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Function call problem

Post by distantvoices »

He's a slack guy, our slacker.

pskyboy, take care that your stack is mapped too :-) Then: No problems.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
pini

Re:Function call problem

Post by pini »

Have you loaded enough sectors so that your entire kernel is loaded ?
If you're kernel isn't fully loaded you will get an error "running in bogus memory", but this error can also occur in other situations.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Function call problem

Post by distantvoices »

that's also a problem, pini. I used to load the amount of sectors, dd wrot onto disk.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
Post Reply