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.
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.
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.
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 04:16 PM.|