LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Hardware (http://www.linuxquestions.org/questions/forumdisplay.php?f=18)
-   -   Keeping device functionality in device controller instead of kernel. (http://www.linuxquestions.org/questions/showthread.php?t=4175435905)

noman.butt31 11-06-2012 08:38 AM

Keeping device functionality in device controller instead of kernel.
 
A friend of mine asked me this question in the class and I could not answer it. He asked:

Since we know kernel controls the physical hardware via device drivers. What if all this functionality is kept inside the device controller itself rather than kernel managing them. What would be the consequences of such scenario? Good or Bad?

I searched online for this question but could not get information about this scenario. May be I'm not googling in the right keyword.

You insight into this will help me getting clearing my concepts.

Please answer.

Thanks.

TobiSGD 11-07-2012 04:32 AM

This concept is pretty old. You can see it for example with the Commodore C64 and its floppy drive VC1541. The 1541 had a separate CPU that controlled the drive independent from the main system. AFAIK, this concept was given up because a) modern CPUs can control other devices without serious impact on performance, and b) it is much cheaper to let the main CPU do the work. It should in fact nowadays be faster to let the kernel directly control the device than having a communication overhead between two independent threads.

onebuck 11-08-2012 06:04 AM

Member Response
 
Hi,

I would like to add to what 'TobiSGD' stated: Modern subsystems like the HDD does contain and support local control via interface. Direct control and controlled access are still used widely in device control or subsystem to remove any unwarranted loads via DMA. DMA load cycles for modern HDD are good but even better for SSD devices.

DMA is widely used in device control intermediately or controlled access to off load from the central system. Device driver will handle intermediate control where as the device controller will handle memory transfers between the system and subsystem. Look at: Direct Memory Access and Bus Mastering for a general description.

Modern CPU are capable of implementation for multiple device control. There are times when a subsystem with local management surpasses the capabilities of the main CPU(Master). Some Data controllers, DAS or remote DMA will be often served by local control then presenting data back to the master via DMA, Network device or even scheduled data transfers via interrupt. Even with DMA one must be careful not to load the system via errant data transfers which can cause major issues for other system handlers if the buffers are not managed properly by the device handler.

Another good example for comparative reasons would be a NAS which utilizes network subsystem for exchanges but the NAS itself as an appliance does have the means to control, manage or store data locally for later transfer when requested.
HTH!

H_TeXMeX_H 11-08-2012 06:39 AM

Quote:

Originally Posted by noman.butt31 (Post 4823390)
A friend of mine asked me this question in the class and I could not answer it. He asked:

Since we know kernel controls the physical hardware via device drivers. What if all this functionality is kept inside the device controller itself rather than kernel managing them. What would be the consequences of such scenario? Good or Bad?

They may be called device drivers but for many devices they should be called controller drivers. For example, take the SATA/AHCI controller. There are no kernel drivers for HDDs or SSDs or DVD+-RW drives, there are only drivers for sata_brand and ahci. So, this is the way it actually works, the drivers are for controllers, like the SATA/AHCI controller, USB controller UHCI/EHCI/xHCI, etc.

As said above, controllers are used to offload the CPU from work that can be done by specialized controllers.


All times are GMT -5. The time now is 11:42 AM.