General protection fault leading to triple fault

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.
Locked
User avatar
hegde1997
Member
Member
Posts: 40
Joined: Mon Jan 30, 2012 7:36 am
Location: Bangalore, India
Contact:

General protection fault leading to triple fault

Post by hegde1997 »

In my kernel i am getting hell lots of general protection faults which is leading to triple fault.
I believe that no where i have given cli and missed to give sti and yet no interrupts would occur. so in my kernel i gave a sti and the screen is full of message "General protection fault" and finally triple fault and so machine reset within about 10 secs of execution of my kernel.
I know that it might be hard to tell without having a look at the code. But do any one have ideas why this might have happened?
Walking my way in making my OS
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: General protection fault leading to triple fault

Post by Combuster »

Because you refuse to blame your lack of coding skill and therefore repeat the question, possibly in the hope people do not realize the association and accidentally give you an answer?

You have enough homework to do. Just get to it.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
vjain20
Member
Member
Posts: 73
Joined: Wed Apr 04, 2012 9:12 pm

Re: General protection fault leading to triple fault

Post by vjain20 »

Refer to Intel Software Developer Manual Vol 3 or http://en.wikipedia.org/wiki/General_protection_fault.
Intel manual is a must read for developing a kernel.
- Thanks
Vaibhav jain
User avatar
hegde1997
Member
Member
Posts: 40
Joined: Mon Jan 30, 2012 7:36 am
Location: Bangalore, India
Contact:

Re: General protection fault leading to triple fault

Post by hegde1997 »

Something wrong with cs register. bochs says fetch raw descriptor. i recompiled my kernel and this time it didn't install a new gdt after grub and now bochs tells check_cs not a valid segment. i am unable to find out wth has gone wrong.

Code: Select all

00076710677e[CPU0 ] fetch_raw_descriptor: GDT: index (af) 15 > limit (27)
00076712194e[CPU0 ] fetch_raw_descriptor: GDT: index (af) 15 > limit (27)
00076714301e[CPU0 ] check_cs(0x11ad): not a valid code segment !
00076716021e[CPU0 ] check_cs(0x11ad): not a valid code segment !
00076717741e[CPU0 ] check_cs(0x11ad): not a valid code segment !
00076719461e[CPU0 ] check_cs(0x11ad): not a valid code segment !
00076721181e[CPU0 ] check_cs(0x11ad): not a valid code segment !
00076722901e[CPU0 ] check_cs(0x11ad): not a valid code segment !
00076724621e[CPU0 ] check_cs(0x11ad): not a valid code segment !
00076726341e[CPU0 ] check_cs(0x11ad): not a valid code segment !
00
Walking my way in making my OS
Locked