hi
i have a working keyboard and clock handler
i even got multitasking to work, so now i have 2 tasks that are executing alternatively, each displaying some message in a tight loop
now i tried to install a system call handler
i wrote a simple routine that just prints out some message like "hi i'm a system call"
next i hooked this routine with an interrupt task gate, the exact same way as i did for my keyboard and clock handler
then i inserted some int(32) instruction into one of my tasks, but they still execute as before (i was of course expecting the system call message!)
can someone help me? is there something special with the int instruction as opposed to hardware interrupts?
thanks
martin
what's special about syscall?
-
- Member
- Posts: 199
- Joined: Fri Jul 13, 2007 6:37 am
- Location: Stuttgart/Germany
- Contact:
Re: what's special about syscall?
Hi,
Cheers,
Brendan
Um, why are you using interrupt task gates (with slow hardware task switches, and a complete lack of re-entrancy) rather than trap gates and/or interrupt gates?sancho1980 wrote:next i hooked this routine with an interrupt task gate, the exact same way as i did for my keyboard and clock handler
The only difference between software interrupts and hardware interrupts is that you don't need to send an EOI, and the interrupt flag (CLI/STI) has no effect on software interrupts.sancho1980 wrote:can someone help me? is there something special with the int instruction as opposed to hardware interrupts?
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
-
- Member
- Posts: 199
- Joined: Fri Jul 13, 2007 6:37 am
- Location: Stuttgart/Germany
- Contact:
Re: what's special about syscall?
Then how come it doesn't work? Am I allowed to hook my system call to just about ANY vector number, or are there restrictions?Brendan wrote:
The only difference between software interrupts and hardware interrupts is that you don't need to send an EOI, and the interrupt flag (CLI/STI) has no effect on software interrupts.
Which vector number *should* I use?
Thanks
Martin
Re: what's special about syscall?
Other than reserving Ints 0x00-0x1F for CPU exceptions, you can pretty much do what you like. Many people seem to like mapping the IRQs to ints 0x20-0x2F, but the only restriciton on this is that using the PIC's, IRQ's must be mapped to a base that is divisisble by 8.
One other word of warning. If you are thinking of using int 0x80 (used by Linux), it may be worth making your syscalls equivalent to Linux's to avoid later confusion.
Cheers,
Adam
One other word of warning. If you are thinking of using int 0x80 (used by Linux), it may be worth making your syscalls equivalent to Linux's to avoid later confusion.
Cheers,
Adam