API interrupts

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
OSMAN

API interrupts

Post by OSMAN »

Hej!

I think it's a cool way of implementing API by making it through some interrupts. Linux uses 0x80 interrupt, right? But I've been wondering why just 0x80. There are 256 interrupts and only less than 50 are used by machine exceptions and irq:s. So why not to use about 200 software interrupts for API (just for fun) because nobody needs them otherways, right?!
Kemp

Re:API interrupts

Post by Kemp »

Because if you ever *do* need them then you'll be quite screwed ;) Forward planning is a major part of OS design
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:API interrupts

Post by Pype.Clicker »

plus not all architectures have 256 vectors (some even just have a 'trap' instruction that takes no vector number). As linux wants to be as portable as possible they decided to use a single interrupt vector and use EAX to tell what service is required.
GLneo

Re:API interrupts

Post by GLneo »

plus, making a switch case is easier than writing 200 IDT entery's, and the data will come in on registers which for c code needs to be on a stack then popped off for return so you will need 200 asm stub's, sounds fun ;D
Post Reply