ESP and EBP change not committed after return from interrupt

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.
DirectXtreme
Posts: 12
Joined: Mon Aug 06, 2012 12:19 pm
Location: Pretoria, South Africa

Re: ESP and EBP change not committed after return from inter

Post by DirectXtreme »

Ok, I have multitasking working!!! I can switch between tasks but if the task includes a call to a function my OS crashes with a Exception but this is due to invalid register values. The only reason I can think of is the fact that it tries to pop values back off the stack but ESP points to an incorrect location.
A living being seeks above all else to discharge its strength. Life itself is will to power. Nothing else matters.

Project: HazeOS, HazeAV
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: ESP and EBP change not committed after return from inter

Post by Owen »

Nable wrote:
You can simply discard it (increase ESP by 4 instead of popping anything).
AFAIK, it can be a bad idea if you care about performance: CPU's out-of-order and other execution units like when what pairs of call/ret, push/pop, interrupt/iret are balanced.
call/ret, yes. push/pop, no. interrupt/iret, I doubt they're common enough for them to care about (also, both cases are microcode monstrosities)
Post Reply