assembly - Curiosity beyond abstractions: how is bytecode executed? how do device drivers work? -


Whatever I've seen * has been removed from under the hardware, but I'm curious how the hardware works .
I have programmed in the assembly, but it is still only a set of isolation

How does a processor understand assembly assembly (as bytecode)?
How do device drivers work (with an explanation on the lower level (abstract)?

Wow .... big question! At very root level, the processor can communicate with the hardware through special instructions eg In / O ports on some form of X86 hardware and / or memory mapped I / O areas

Different hardware has very different protocols / rules on how to communicate on these channels. If these rules are not followed then they will probably fail seriously. An example would be an output device that can only transmit a limited number of seconds, so the driver must check whether the hardware is ready to send more data before transmitting anything. You also need to ensure that there is no current time to reach the same equipment, which is one of the many good reasons, because the operating system does not allow user mode programs to access hardware directly, when They also like it.

Why not look at the Linux source code to satisfy your curiosity?

Note that most of these are written in C, not assembly language. Instructions are available to communicate with the hardware driver (which is true in C, but may not be true in some high level languages), there is no strict requirement to use assembly language to write device driver.


Comments