system call

Javier Martinez Canillas martinez.javier at gmail.com
Sat Jun 11 13:59:33 EDT 2011


On Sat, Jun 11, 2011 at 6:39 PM, Venkateswarlu P
<p.venkatesh551 at gmail.com> wrote:
>
>
> Where do i find system call implementation code?
>
> for  read, write, open, close

For file system related syscalls, it would depend on the fs
implementation. The Virtual File System only defines a uniform common
high level layer but is the responsibility of every fs to actually
implement the file operations (open, read, write, etc).

There is some generic file operations in linux/fs/read_write.c that
are used for simple fs like romfs and ramfs. I would recommend start
looking at these memory file systems first.

Then you could look how real file systems operations are implemented.
Every fs usually have a file.c file where a struct file_operations is
defined. This structure has a function pointer for every file
operation. The functions asigned to these function pointers are the
ones that actually implements the operations. Some of these could be
generic operations and some of them are fs specific.

Hope it helps,

-- 
Javier Martínez Canillas
(+34) 682 39 81 69
PhD Student in High Performance Computing
Computer Architecture and Operating System Department (CAOS)
Universitat Autònoma de Barcelona
Barcelona, Spain



More information about the Kernelnewbies mailing list