Page 1 of 1

Function call problem

Posted: Thu Apr 24, 2003 12:40 pm
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

Re:Function call problem

Posted: Thu Apr 24, 2003 1:00 pm
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.

Re:Function call problem

Posted: Thu Apr 24, 2003 1:02 pm
by slacker
to me it sounds like a stack problem since the function is executed.................but thats just me..the slacker

Re:Function call problem

Posted: Thu Apr 24, 2003 2:05 pm
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

Re:Function call problem

Posted: Thu Apr 24, 2003 2:36 pm
by slacker
im pretty sure that C code uses the preexsiting stack. actually it has to--

Re:Function call problem

Posted: Thu Apr 24, 2003 3:26 pm
by pskyboy
Cheers

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

Re:Function call problem

Posted: Thu Apr 24, 2003 7:24 pm
by slacker
i called it....

Re:Function call problem

Posted: Thu Apr 24, 2003 8:19 pm
by _mark
Go slacker - your getting to be a regular expert. Watch out for this one Pype & Tim.

:)

good going slacker
_mark()

Re:Function call problem

Posted: Fri Apr 25, 2003 12:59 am
by distantvoices
He's a slack guy, our slacker.

pskyboy, take care that your stack is mapped too :-) Then: No problems.

Re:Function call problem

Posted: Sat Apr 26, 2003 12:52 pm
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.

Re:Function call problem

Posted: Sun Apr 27, 2003 5:45 am
by distantvoices
that's also a problem, pini. I used to load the amount of sectors, dd wrot onto disk.