SYSCALLS examples are needed
Posted: Mon Apr 26, 2004 9:54 am
Hello, I'm now at stage where software multitasking is enabled with priorities etc.
Now I tried to call system call form user app trought interrupt.
User app and kernel are written in C language, but I use asm inline. And I wonder how could I call syscalls trought interrupt directly to some kernel function.
I created mini syscall.h file what system functions can be available, for example:
When user app tries to call function lets say: it really calls that function in .h file:
it should leave 0x1 value in eax register after interrupt. But when this 0x33 interrupt triggers, I get in kernel side not this value in eax register.
So, could you help me? Or I wrote bad inline asm, or maybe after an interrupt is trigered some registers changes or etc.?
And one more question. If user app call a functon that requires some input values and stores these values in stack pointer memory, so after an interrupt these input values should leave in stack, right?
Could you point to some good system calls examples?
Thanks, bye
P.S.: sorry for my bad english.
Now I tried to call system call form user app trought interrupt.
User app and kernel are written in C language, but I use asm inline. And I wonder how could I call syscalls trought interrupt directly to some kernel function.
I created mini syscall.h file what system functions can be available, for example:
When user app tries to call function lets say:
Code: Select all
unsigned short WindowNr = SYSCALL_CreateWindow(Window);
Code: Select all
unsigned short SYSCALL_CreateWindow(GUIWindow ThisWindow)
{
__asm__(
"movl 0x1, %eax\n\t"
"int $0x33");
}
So, could you help me? Or I wrote bad inline asm, or maybe after an interrupt is trigered some registers changes or etc.?
And one more question. If user app call a functon that requires some input values and stores these values in stack pointer memory, so after an interrupt these input values should leave in stack, right?
Could you point to some good system calls examples?
Thanks, bye
P.S.: sorry for my bad english.