Page 2 of 2

Re:Jumping to C Kernel

Posted: Thu Nov 28, 2002 3:58 pm
by pskyboy
Could that be it

It says that the Stack Segment is 16 bit surely if i am in protected mode and do a jump that will cause the registers to be pushed onto the stack and if its a 16 bit stack cause big problems?

Peter

Re:Jumping to C Kernel

Posted: Thu Nov 28, 2002 4:11 pm
by pskyboy
Nope not that segment thing

I tried creating a new segment but that didn't help wlthough i may have ste it up wrong.

The thing is if i have the
here:
jmp here

code in, and do a loop rather then trying to jump to my kernel it works fine whish suggestd the crash only happens when i try and jump outside my local memory area.

Peter

Re:Jumping to C Kernel

Posted: Fri Nov 29, 2002 2:57 am
by pskyboy
Tom

I was just looking at your boot code for fritzOS and it seems you never enable the a20 line to allow more then 1mb of memory. Is this not nessacary or do you do it later?

Peter

Re:Jumping to C Kernel

Posted: Fri Nov 29, 2002 7:33 am
by Tom
I didn't need a20 right then...but it will be in 0.8.

Re:Jumping to C Kernel

Posted: Sat Nov 30, 2002 5:51 am
by pskyboy
So has anyone got any ideas what i need to do to get into my C Kernel. Its just i have been stuck on this bootloader for months now and i would like to get on with the rest of my OS and get on to home teritory ie C rather then assembler where my knowledge is limited.

Also i would rather not use a pre made bootloader i wreally want to get my own working.

Cheers
Peter

Re:Jumping to C Kernel

Posted: Sat Nov 30, 2002 6:16 am
by Pype.Clicker
hmmm ...
things you still have to do in asm:
- a generic interrupt-handler stub
- setting up a stack
- jmp _main

Re:Jumping to C Kernel

Posted: Sat Nov 30, 2002 3:47 pm
by pskyboy
Hey Guys

this is the exact error message i know get when i try to jump to my kernel.

EIP > CS.limit

Does this mean i am trying to access memory outside of my code segment. Which doesn't make sense as my code segment is ment to be 0 - 4gb.

Cheers
Peter

Re:Jumping to C Kernel

Posted: Sat Nov 30, 2002 3:52 pm
by pskyboy
hmm

I think the problem with this is i don't truly get whats going on.

When i get into protected mode shouldn't that mean i have all 4gb of memory frelly available and any code in there houdl be jumpable to. Or have i completly mis understood how this works.

Peter

Re:Jumping to C Kernel

Posted: Sat Nov 30, 2002 4:29 pm
by Pype.Clicker
It really depends on how you configured your segments ... if you don't have a 4GB code segment, you can't jump anywhere ... that is what this mode is about ... protection ;)

you must have LIMIT fields set to 0xFFFFF and the "BIG" bit set to 1 (which will mean an effective limit of LIMIT*4096 + FFF)

maybe it's already the case ... that's too long i didn't use hand-written descriptors ...