Triple fault with RSP > 1MB

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
spectrum
Member
Member
Posts: 37
Joined: Wed Jun 13, 2007 7:06 am

Triple fault with RSP > 1MB

Post by spectrum »

I have the same issue.

In my case bochs crash and the message is:

00017908527e[CPU0 ] interrupt(long mode): IDT entry extended attributes DWORD4 TYPE != 0
00017908527e[CPU0 ] interrupt(long mode): IDT entry extended attributes DWORD4 TYPE != 0
00017908527e[CPU0 ] interrupt(long mode): IDT entry extended attributes DWORD4 TYPE != 0
00017908527i[CPU0 ] CPU is in long mode (active)
00017908527i[CPU0 ] CS.mode = 64 bit
00017908527i[CPU0 ] SS.mode = 64 bit

It happens olnly if after entering long mode i set rsp to a value > 1MB.
Last edited by Combuster on Thu Oct 01, 2015 1:50 am, edited 1 time in total.
Reason: No, it's not the same issue. Thread split.
User avatar
BASICFreak
Member
Member
Posts: 284
Joined: Fri Jan 16, 2009 8:34 pm
Location: Louisiana, USA

Re: Strange error after moving to 64-bit

Post by BASICFreak »

Taking over a thread? Not to mention it is (nearly) 6 years old...

Either way not enough info...
Do you have A20 enabled, if not only odd MBs are available.
BOS Source Thanks to GitHub
BOS Expanded Commentary
Both under active development!
Sortie wrote:
  • Don't play the role of an operating systems developer, be one.
  • Be truly afraid of undefined [behavior].
  • Your operating system should be itself, not fight what it is.
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Re: Strange error after moving to 64-bit

Post by Roman »

spectrum wrote:It happens olnly if after entering long mode i set rsp to a value > 1MB.
Does any other memory access to >1MiB cause a crash? Do you have proper page tables for the memory you use? If you use C, the stack also must be properly aligned.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: Strange error after moving to 64-bit

Post by SpyderTL »

Bochs is telling you the problem.

The fourth DWORD of each 64-bit IDT must be zero. The interrupt that is occurring has a value other than zero in that entry, making it invalid. You may get this if you are trying to use a 32-bit IDT structure in 64-bit.

Make sure you have created a whole new 64-bit IDT and reloaded it with the LIDT instruction before enabling interrupts in 64-bit mode.

You can find the 64-bit IDT structure here: Interrupt Descriptor Table
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Post Reply