Search This Blog

Saturday, May 17, 2008

Basic procedure/activities when an application calls a libray procedure

when an user application calls a libray procedure it puts some value according to the system service required into a register and int 30 will be executed.
When this is executed Operating systm system service will be called and sytem changes to kernel mode also, so that system service can call privileged instruction set.

In linux system service is exectued by a s/s interrupt which transfers the call to the architecture specific entry.s where a method system_entry is there and according to the number in the register this will executes the needed System service

Also every systm call is specified using a number in linux the relation can be seen in the asm/unistd.h file

Also the error returned status will be stored in the globakl variable errnoh which is stored in the errno.h file
Error constants can also be seen here.

Process Related
For each process that is maintained by the system a double linked list of struct task_struct(which is stored in <sched.h>) is stored

Inorder to spped the search a hash list is also kept in fork.c which names #pdhash

No comments: