General protection fault on iret

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
digo_rp
Member
Member
Posts: 233
Joined: Sun Jun 05, 2005 11:00 pm

General protection fault on iret

Post by digo_rp »

Hi all, I have been not developing my os since a long time, now I restart back to develop but I don´t know what I did last time,
now if I enable interrupts and on iret I got general protection fault with error code 0x28,

could anyone help me ? I try change so much things... everything looks right. but...

I don´t know what happens!

sorry about my poor english.

tnx in advance.
User avatar
eryjus
Member
Member
Posts: 286
Joined: Fri Oct 21, 2011 9:47 pm
Libera.chat IRC: eryjus
Location: Tustin, CA USA

Re: General protection fault on iret

Post by eryjus »

I just happen to have the Intel manual open to that page....
Intel wrote:The processor pushes an error code onto the exception handler's stack. If the fault condition was detected while loading a segment descriptor, the error code contains a segment selector to or IDT vector number for the descriptor; otherwise, the error code is 0.
I'm willing to bet Combuster's crystal ball will tell you that you are loading a user-space segment register (like DS) with an associated bad GDT entry. At least that is where I would look first.
Adam

The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal

"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: General protection fault on iret

Post by Schol-R-LEA »

If I might add something of a side note: it is often useful for us to be able to see the code in question, but if you aren't sure where the problem lies, you may have to post very large sections of code which we would have to wade through. To this end, it may make sense to have your code posted to some site like Pastebin or Google Code, if you are willing to share it. However, since you also should be using version control - and I hope you are, as it will save you a world of headaches later if you do - it makes the most sense to have your code in an online repository where it can be inspected, updated, and even backtracked by yourself and others who are assisting you. In other words, it would be a great service to both you and anyone helping you if you could join someplace like SourceForge or GitHub and make a repo for your code there.

If you do, don't forget to include some sort of license statement, even if it is just a file saying that the code is free to use so long as you attribute ownership back to you. While I have my own code under the LGPL for reasons of my own, if you don't want the hassle of that, the Creative Commons Public Licenses are simple and to the point, and you can choose the one which suits your desires best.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
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 on iret

Post by Combuster »

eryjus wrote:I'm willing to bet Combuster's crystal ball (...)
I'm just missing the mandatory Bochs log.
"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 ]
digo_rp
Member
Member
Posts: 233
Joined: Sun Jun 05, 2005 11:00 pm

Re: General protection fault on iret

Post by digo_rp »

tnx so much guys, I was using grub4dos, and when I change to grub 0.97, evething get back to works again...


Thanks so much, a lot!
Post Reply