question regarding interrupt and trap gate?

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
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

question regarding interrupt and trap gate?

Post by os64dev »

Can somebody explain what de differences between an interrupt gate and a trag gate is? the manuals are not very clear about this, it seems that they behave identical.

regards
Author of COBOS
User avatar
mystran
Member
Member
Posts: 670
Joined: Thu Mar 08, 2007 11:08 am

Post by mystran »

The practical difference is that when you call an interrupt-gate, interrupts get disabled, and when you call a trap-gate, they don't. (edit: well... practical... checked the intel manual and it says there is no other difference whatsoever)

I can't think of a single reason you would "need" to use trap-gates for anything, but then again we've got lots of stuff in x86 you'll never need for anything anyway...
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
User avatar
ces_mohab
Member
Member
Posts: 77
Joined: Wed Oct 18, 2006 3:08 am

Post by ces_mohab »

mystran wrote:I can't think of a single reason you would "need" to use trap-gates for anything, but then again we've got lots of stuff in x86 you'll never need for anything anyway...
I use trap gates for system calls.
To write an OS you need 2 minds one for coding and other for debugging.
User avatar
mystran
Member
Member
Posts: 670
Joined: Thu Mar 08, 2007 11:08 am

Post by mystran »

Yeah, well, you can use trap-gates ofcourse, but there's nothing they allow you to do which isn't quite trivially done with interrupt gates...

Basicly, all you save is checking from the pushed flags if interrupts were enabled and enabling them back if this was the case...
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
Post Reply