i want to give applications running on the OS access to certaine routines in my OS, but without invoking interrupts
how can this be done using normal C libraries,what about passing pointers from the applications to such routines.
plz, if u could supply a simple example i would be very thankful
thnx
How can i expose OS services to applications?
RE:How can i expose OS services to applications?
it is not 'I cant use interrupts'
it is 'I dont want to use interrupts'
i just think that exposing services using library routines is more suitable for use in high level languages
it is 'I dont want to use interrupts'
i just think that exposing services using library routines is more suitable for use in high level languages
RE:How can i expose OS services to applications?
High level languages generally have a library that handles OS calls, for example, the C language has a library called libc that handles all OS calls, so C programs never have to call interrupts, they just call libc functions.
When you write the libc library, of course, that will have to use interrupts or whatever syscall mechanism your OS uses...
When you write the libc library, of course, that will have to use interrupts or whatever syscall mechanism your OS uses...
RE:How can i expose OS services to applications?
When I load my library in I create a Table with all Function names (mangled ie _Z5PrintPc) and the address which they are linked at when loaded, I then link the application at runtime from a elf.object (not linked).
The OS call mechanism I use is Syscall/Sysret (you could also use sysenter/sysleave if these are not supported) and have a single entry point to the System functions. When calling I have function number in eax, and copy the User stack to the system stack for parameters.
I am using paged memory and the kernel as well as library routines are mapped to every Apps User space.
hope this helps
pkd.
The OS call mechanism I use is Syscall/Sysret (you could also use sysenter/sysleave if these are not supported) and have a single entry point to the System functions. When calling I have function number in eax, and copy the User stack to the system stack for parameters.
I am using paged memory and the kernel as well as library routines are mapped to every Apps User space.
hope this helps
pkd.
RE:How can i expose OS services to applications?
that was really helpful, but can u give me some online resource on implementing system calls this way or even just 'a more detailed illustration' of system calls
thnx
thnx