How does the CPU read from the disk? How does the CPU read from the disk? linux linux

How does the CPU read from the disk?


I'd suggest reading:http://www.makelinux.net/books/ulk3/understandlk-CHP-13-SECT-1With a supplement of:http://en.wikipedia.org/wiki/Direct_memory_access

With regards to buffering in RAM: most programming languages and operating systems buffer at least part of I/O operations (read and write) to memory. This is usually done asynchronously: i.e. a buffer is created, filled, and then processed. For a read, the CPU would (working with the disk controller) create IO instructions to fetch data and a place to put it in memory, fill that space, and then present its contents to the program making the request. For a write request, this would be queuing write operations and their associated data and then sending them off to the IO controller and eventually the disk to be executed. Buffering can happen in multiple places: on the CPU's caches, in RAM, (sometimes) on the disk controller, or on the hard disk itself. How much buffering is done, and exactly how the abstract sequence of operations I've mentioned is handled, differs depending on your hardware architecture, OS, and task.


Main memory is the only large storage area (millions to bilions of bytes) that the processors can access directly.

"Operating System Concepts" said.

So if you want to run a program or manipulate some data, they (program and data) must be in Main memory.