[Ilugc] Query on drivers?

  • From: cyborg4k@xxxxxxxxx (Shakthi Kannan)
  • Date: Tue Aug 23 13:42:17 2005

Hi,

--- Raja Mallik <raja.mallik@xxxxxxxxxxx> wrote:

When a read system call is issued on some opened
file etc... why is that
the driver has to copy data from the HDD to kernel

Because, the read system call changes the state from
user-space to kernel-space. Data is then copied from
HDD to system RAM/buffers. Finally, it is copied from
kernel-space to user-space using copy_to_user(), for
example.

Why can't it be copied from HDD to
user space?

All addresses in kernel-space are virtual addresses.
You can't directly reference a physical address. You
will need to use ioremap() with it.

Assuming that the user space mem can be made not to
swap out.

Well, you really want to swap out user memory in case
you need some memory.
 
Regards,

SK

------------------------------------------------------------
Shakthi Kannan, MS
Software Engineer, Specsoft (Hexaware Technologies)
[E]: cyborg4k@xxxxxxxxx              [M]: (91) 98407-87007
[W]: http://www.shakthimaan.com      [L]: Chennai, India
------------------------------------------------------------

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com ;

Other related posts: