Scheduling and DPL0 stack

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
User avatar
XCHG
Member
Member
Posts: 416
Joined: Sat Nov 25, 2006 3:55 am
Location: Wisconsin
Contact:

Scheduling and DPL0 stack

Post by XCHG »

I'm rewriting my scheduler. I've forgotten if I'm right about this or not. Suppose there are two DPL0 tasks running at the given moment. When IRQ0 is fired, are these the registers that are pushed onto the stack?

1) EFLAGS
2) CS
3) EIP

And for DPL3 to DPL0:

1) SS
2) ESP
3) EFLAGS
4) CS
5) EIP


Could somebody please confirm or correct this?
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

yes, but I'm not certain about the order. Check the intel manuals. (volume 2.1: instruction 'INT')
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post by JAAman »

JamesM wrote:yes, but I'm not certain about the order. Check the intel manuals. (volume 2.1: instruction 'INT')
better section would be: 3A:5.12.1 (and figure 5-4 in same section)

this section does a better and simpler job of explaining exactly how the stack is used in these situations... from an OSdevers POV
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post by bewing »

You have all the orders correct. EIP is always the value at the very bottom of the stack after any INT. SS and ESP are put on the stack before the EIP/CS/EFLAGS.
Post Reply