Jumping to C Kernel

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.
pskyboy

Re:Jumping to C Kernel

Post 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
pskyboy

Re:Jumping to C Kernel

Post 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
pskyboy

Re:Jumping to C Kernel

Post 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
Tom

Re:Jumping to C Kernel

Post by Tom »

I didn't need a20 right then...but it will be in 0.8.
pskyboy

Re:Jumping to C Kernel

Post 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
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Jumping to C Kernel

Post by Pype.Clicker »

hmmm ...
things you still have to do in asm:
- a generic interrupt-handler stub
- setting up a stack
- jmp _main
pskyboy

Re:Jumping to C Kernel

Post 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
pskyboy

Re:Jumping to C Kernel

Post 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
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Jumping to C Kernel

Post 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 ...
Post Reply