Good resources to understand how a program interacts with machine hardware
I don't know if this is the correct StackExchange site to ask this question. But I could not find any other. I want to understand how a computer works from the software level to the internal structure. For example what happens when I press a button on keyboard. The OS interprets it and then what changes happen in the flip-flops. How is an operating system written? If it is written using some programming language, then how is that interpreter written. At some point it has to come down to the hardware, right?
I know to program in c, c++ and java. But after all these years I am still not sure about what is happening inside.
I would be grateful to anyone who points me to to a link or a video that explains this to the deep.