Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Possible Duplicate:
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.

share|improve this question

marked as duplicate by Walter, gnat, Karl Bielefeldt, TMN, psr Sep 17 '12 at 18:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

there is actually a good answer to this somewhere already, on here or stackoverflow ... –  NimChimpsky Sep 17 '12 at 16:28
@NimChimpsky : the link is not there. –  Ashwin Sep 17 '12 at 16:29
Similar to: stackoverflow.com/q/3312177/576750. –  Badar Sep 17 '12 at 17:10
@Ashwin - You claim you know these programming languages but this question indicates your complete lack of understanding, since even a basic understand of Java would answer ALL of your questions. –  Ramhound Sep 18 '12 at 15:51
@Ramhound : how would java answer all my questions, expert? –  Ashwin Sep 18 '12 at 17:14

3 Answers 3

Short Answer: It is all coming to the notion of translating the text commands to 0's and 1's that are wired to electric signals that proceed this operation/command further.

However, there are number of abstraction layers that help programmers to avoid low level programming.There is a good continuation of this idea in this SE post - How does Software/Code actually communicate with Hardware?

share|improve this answer

Since you mention flip-flops, Code might be interesting to you (Code: The Hidden Language of Computer Hardware and Software, by Charles Petzold). It starts from very basic principles/items and works the way up. I'm not sure if it'll help if what you're looking for is training purposes (i.e. if you want to learn to program drivers or kernel modules), but it's a very interesting book that builds from small components to a working computer.

share|improve this answer
Eep, and just now when I read the questions linked to from this one I realize that Code had already been suggested. –  frozenkoi Sep 17 '12 at 19:01
+ Petzold is an awesome author! –  Mike Dunlavey Sep 18 '12 at 1:25

I think the best way to learn it is bottom-up. I'm not sure if this is a good place to start, but Harry Porter's Relay Computer is a favorite of mine.

The basic structure is simple. You have a memory box with addresses, and each address holds a number of a certain maximum size. A program is a block of addresses in the memory, where the numbers in those addresses cause the computer to do different things, one at a time. The kinds of things it can do (called instructions) are very limited, like copying a number from a memory address to a special holder called a "register", or copying back the other way, or adding a number to the register, or jumping to some instruction other than just the next one.

Everything grows out of this. When you get that, you're off to a good start!

share|improve this answer
He cheated with the memory though :-) –  Stephen C Sep 18 '12 at 13:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.