I want to know how a read/write calls is accomplished in linux?
I mean how a function say read() will read the data from a file.
What all will be the steps from user mode read() function call to kernel mode?

Will anybody explain the steps or let me know any site from where I can get this info?

http://lxr.linux.no/+trees
Make sure you have a comfy chair and a lot of coffee on hand - you'll be a while :)

commented: Nice, not seen that site before...bookmarked! +3

Thanks jason and salem for the reply.
But I do not want the syntax.
I want to know the algorithm/logic of the read/write from user mode to kernel mode to the disk on which the actual data is stored.
I mean how the user's request to read/write data is handle by linux.
What all steps occur in user and kernel mode.
Hope this clarifies my question.

Yes, the two pages I linked to give details of the syntax, but if you read both of the pages in their entirety, they go on to explain some of the mechanics of the functions. I'll admit they don't go into detail about any differences between using them in user-mode or kernel mode, but it's a start at least!

However, there is nothing to stop you from browsing the Linux source code and taking a look at the read and write functions yourself. (Linux is open-source after all!). If you take a look at the sources, you should be able to work out what's going on for yourself! The site that Salem linked to would help with this.

Cheers for now,
Jas.

Yes, the two pages I linked to give details of the syntax, but if you read both of the pages in their entirety, they go on to explain some of the mechanics of the functions. I'll admit they don't go into detail about any differences between using them in user-mode or kernel mode, but it's a start at least!

ok thanks I will again read them completely

I actually need the explaination of read/write for linux as explained in the chapter IO systems of book Microsoft Windows Internals by Mark E. Russinovich and David A. Solomon

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.