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.
General protection fault on iret
- eryjus
- 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
I just happen to have the Intel manual open to that page....
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.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.
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
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
- Schol-R-LEA
- Member
- Posts: 1925
- Joined: Fri Oct 27, 2006 9:42 am
- Location: Athens, GA, USA
Re: General protection fault on iret
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.
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.
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.
- Combuster
- 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
I'm just missing the mandatory Bochs log.eryjus wrote:I'm willing to bet Combuster's crystal ball (...)
Re: General protection fault on iret
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!
Thanks so much, a lot!