Quote:
Originally Posted by
jlliagre
If by main memory you mean kernel memory, no. A process has no access to the kernel memory.
So once the bytes are transferred stored over in the main memory through the DMA, how is what was read returned to the caller? So if I wanted to read 3 bytes from a file containing "Hello", how is "Hel" returned to the library function? What sees this and how/where is it returned from?
Quote:
Yes (bytes)Same as read.I don't get what you mean here.
[/quote]
What I'm talking about what is needed for the write.
What I meant was this:
Your library function is passing a reference to a buffer storing the bytes to replace a certain block in a file (for example). So, the goal is just to replace those bytes in the file with what is in the buffer (the second argument passed in).
What I am confused about is HOW exactly the modification takes place. How those bytes within the user area buffer replace the target file block of bytes.
Are the bytes within the user area buffer somehow transferred over to the buffer which resides on the device controller for let's say, a disk (the file to modify is on the disk)? And then from there, what's in the buffer of the controller somehow replaces the targeted block within the file you are trying to modify?
So you're passing in bytes to modify some block within the target file. I don't get how this takes place for a write.
That was what I was saying. I don't get the process of how write takes place in terms of a file let's say.