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?!
API interrupts
Re:API interrupts
Because if you ever *do* need them then you'll be quite screwed Forward planning is a major part of OS design
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:API interrupts
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.
Re:API interrupts
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