3 ms·
Eight layers? That made me curious about how many are there really, though? My understanding is rather vague at this level, though hopefully good enough to know
by chousuke 9y ago
Eight layers? That made me curious about how many are there really, though? My understanding is rather vague at this level, though hopefully good enough to know when I need to look deeper.
So the compiler is obviously one layer. Then there's the assembler and the linker. Does the C runtime count too?
You think you have a "string", but it's actually just an address to a (hopefully) nul-terminated chunk of "contiguous" virtual memory.
If you wanted to read the first byte of that array, it would first go through the OS's virtual memory system, so that's one rather large abstraction. (I'm lumping in the hardware's virtual memory support here, too)
Then when you actually access a piece of "real" memory, there are a number of caches between your data and the request to fetch it. And what about the DRAM itself? Can it access only a single byte of memory at a time, or is that too an abstraction?
Instruction decoding is one or two layers at least, since chances are the processor doesn't actually execute x86 opcodes directly.
And when you run out of software abstractions, how many levels of abstraction is there in the actual hardware?
I only have vague ideas of what actually happens at this level, and whenever I stop to think about it, it's pretty amazing our software stacks work at all...