Since my primary language is C++, and is often praised for its hardware capabilities, I decided to get into computer architecture a little more. As I was looking through some stuff, I stumbled upon device drivers. So, naturally, I decided to look it up. From my understanding, the device driver is a computer program that handles specific hardware components. I also know that the kernel is a computer program that acts as a bridge from software to hardware. For some reason, my mind can't differentiate the two. When it comes to the windows platform, can somebody explain the difference to me and explain the different roles that they play. Thanks in advance.
Difference Between Kernel and Driver?
Moderators - Reputation: 11560
Posted 12 July 2013 - 01:11 PM
The details vary widely depending on the exact operating system and type of driver. The short version is that a driver is a module that allows the kernel to communicate with a specific type or model of hardware device. The kernel can manage devices, applications, memory blocks, etc but it does not actually know how to interact with the hardware attached to the computer except through a driver. In the case of most modern operating systems, Windows included, there are a lot of generic and built-in drivers that we take for granted, but almost everything the computer does is funneled through driver code.
While I or someone else could go into more detail, it's probably best to approach this topic in a more structured way, using an actual operating systems textbook such as Operating System Concepts or the classic Modern Operating Systems. There are also Windows specific books, like Windows Internals.
Crossbones+ - Reputation: 8262
Posted 12 July 2013 - 01:13 PM
Part of the job of the kernel (or more specifically, part of the job of parts of the kernel) have to do with process managing (priorities, how much time is assigned for each process, what to do with incoming processes, what processes swap back to disk, what processes swap back to main memory, etc), memory managing (how to assign memory chunks to processes, what memory has to be moved, what pages have to be loaded, how the pages are set up, etc) and filesystem stuff (file control blocks, sectors, etc). Threading uses a few of the concepts of process managing, except that every thread belongs to some process. A process can be run on multiple threads, but those multiple threads belong to one process.
Drivers provide an interface to the hardware, the kernel operates that hardware and provides a general way for the applications to operate the hardware too.
"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"
GDNet+ - Reputation: 13252
Posted 15 July 2013 - 01:48 PM
Another way of thinking about it is that its the hardware vendors' job to translate between what the Operating System wants (allocate a texture, transfer some data, clear the screen) and how the hardware implements those things. All that driver code *could* go into the kernel, but the driver is basically just a convenient module of code that can be changed out when the underlying hardware changes, and to facilitate the myriad of hardware configurations found in the wild.
throw table_exception("(ノ ゜Д゜)ノ ︵ ┻━┻");