Some confusions about the I/O moudle.
I'm reading the book,<COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE> 9th edion, by William Stallings.
In chapter 7 input/output,it talks about the I/O moudles,such as progarmmed I/O,interrupted I/O,DMA I/O,that exist in computers. I wonder what's the relationships between these moudles and the Linux I/O architecture talks about in book <understanding the linux kernel 3rd>? I was really confused on how the I/O works in hardware level and kernel level. Hope someone can give me some suggestions. Thank you. |
Do you mean “modules”?
I have not read the books, but programmed IO probably means that the driver copies data from memory to interface (writing), initiates the IO operation, then polls the interface for IO completion. When reading, it initiates IO, polls the interface, then copies data from interface to memory. Interrupt IO is the same except that the driver doesn’t poll. Instead, the kernel can do something else while IO is taking place, and the interface raises an interrupt to indicate IO completion. This interrupt is handled by the driver’s interrupt code. DMA means that the interface copies data between kernel memory and the interface’s memory. Which method is adequate for which use case is left as an exercise for the reader. |
Thank you.
Only must I read a lot books maybe I can figure out the confusions. But I can't wait to figure out this quesiton that is : When we make some I/O operations in our program(let say a java program runs on a linux environment and a x86-64 cpu) such as an read operation,this read operation should be implemented by(I'm not sure) invoke the a system call maybe ,int_w(),read a word once time. The function int_w() is the kernel offers to supply to read a word,but what behind the int_w() (the read operation implementation of the kernel) should be a invoke of an assemble language instruction such as in() or insw() offered by intel x86-64 cpu(I'm not sure,I read the intel 64 Developer’s Manual(https://software.intel.com/en-us/art...l-sdm#combined) volume 1,chapter 5,5.1.9,I/O instructions).But how the instructions in(),insw() was implemented? Does the implementation of in() or insw() will consider whether the I/O just suport programmed I/O or interrupted I/O or DMA? Or it's the kernel's consideration when implements the int_w() or what else read operation? Note:I even didn't know whether my question is a reasonable quetion.Ah,if it is not a reasonable question,I'm sorry. |
I don’t know the Intel CPU architecture, but there is no need for specific IO instructions. IO can be done by reading/writing memory locations that are mapped to interface registers, and I guess that most IO is done by accessing interface registers.
|
Thank you.
Obviously,I need a lot books to read.:study: |
The question I want to figure out seems to be what happened underneath(from software level to hardware level) when invoke a java InputStream.read() or a C read();:banghead:
|
Life should always be easy,but I don't know why I always make it hard.:mad:
|
Quote:
Computer science is all about abstraction. My recommendation: Stay at one abstraction level, don't go down to the bottom. When you drive a car with combustion engine, you don't analyse how exactly the petrol is burnt in the cylinders, do you? |
You are right. I will take your advice. Try to make life easy.
|
All times are GMT -5. The time now is 08:58 AM. |