I understand that you can write a complete operating system in a high-level language like C++, compile it into machine code, and then write it to storage, and then sell it or give it away. But is this historically what was done? Did the compiler come first, or the operating system? When you download a compiler today, it's for a specific operating system (because you need to be able to type in your program into a text file, open a program to translate it into machine code, and instruct your hardware how to write your program to storage - all of which require the operating system). This seems to suggest the operating system came first. But it could have been the case that the first computer was programmed in machine code to only have the basics: input/output, a compiler, and a way to write to storage. Once this computer is made, an operating system could be created by using the high-level language compiler and writing it to storage. Also, what is the relationship between libraries and the operating system? I heard that both Mac and PC have the same processor (x-86 chip), but they don't run the same programs. But surely the same 0s and 1s on the same processor should give the same results? I heard the reason has to do with libraries, but don't libraries become obsolete once you have the 0s and 1s of the program? Once the 0s and 1s are loaded in your CPU, then nothing else matters.