I'm a programmer, learning the nameProgramMember. Farmer's uncle lives by farming, and I live by farmingCodeFor a living, crops grow in the land, and programs break out on the keyboard. I graduated from a game company, worked for six and a half years, worked for five years on servers, and spent one and a half years on clients. The client is mainly engaged in hard work on the PC, the server gets FreeBSD, and the client has to mix windows with the boss of M $. After so much coding, I also tried to sum up my knowledge, which is the architecture.
Computer Architecture/hardware (PC/PS3/Wii/iPhone/Google Glass)
Several decades ago, von noriman and Turing's brother developed a theoretical system to seed computers. Today, there is always a CPU in the computer for computing; there is memory, hard disk, for storage; you have to add a video card, otherwise you will not be able to play the game; plug the previous several things into the motherboard, A display, mouse, and keyboard are connected, and the most standard ibm pc is coming out. Later, with the USB interface, the USB flash drive was born. Then, with an RJ45 interface, you can access the internet. The Internet also needs to be connected to the network cable, which is troublesome, so you have wifi.
The CPU itself has some registers (register), the fastest access. The interaction between CPU and memory is not fast enough, so L1/L2 cache is obtained.
The access speed is register> L1> L2> memory> harddisk/usedisk.
CPU is just a fool, only responsible for eating data (processing data), each time first find L1 cache to get data, not L1 cache, and then L2 cache to get data, not L2 cache, to find the memory. The data cannot be found, which is called cache-miss. What if the memory cannot be found? This is not a matter of CPU management. Operating System personnel are responsible for this task.
In addition to the standard ibm pc, there are actually mainframes (this buddy has a lot of CPUs, a lot of memory) and single-chip microcomputer (51 single-chip microcomputer, to write a compilation of OH ). However, in the past few years, it turned out to be a single-chip computer. Now it is an embedded PC, and the hardware is too cheap.
There is also a variety of game hosts, such as PS2/PS2/gamecube/Wii, which are all variants of the standard ibm pc, designed for better computing and graphics capabilities. However, these buddies are not mixed up recently, because the iPhone has come out, and the computing and graphics capabilities of ordinary PCs are getting stronger and stronger. programmers who write games cannot use so many hardware resources at all, no more dedicated game host design is required. Recently, at the launch of PS4, we found that it is already very similar to PC. Valve is about to go out of steam box, just a PC.
Now, smartphones and tablets are everywhere, and the structure of PC is penetrating every corner of life in various forms. Google Glass is about to buy it soon. The glasses in the "seven dragons and beads" contained in bagita will soon become a reality.
Operating System (Windows/Linux/MacOSX/IOS/Android)
With hardware, you must have software. Computers need a big manager to manage the heap of CPU, video card, and memory in the previous article so that they can work.
In fact, the early operating systems were not so complicated. The simplest thing was 51 single-chip microcomputer. Maybe it would be better to write the CPU directly under the Assembly control. I have never played with it.
Later, the hardware became more complex, and UCOS came out in the embedded system. The author wrote a preemptible multi-thread scheduling system, wrote a book, and then bought books and sent code ~
And ibm pc with a MS-DOS, as far as thousands of homes, the Microsoft fat.
After that, the PC becomes more and more complex. I want to view the interface. I don't need command lines, I want to play games, I need a video card, I want a USB flash drive, and I want to access the Internet. The operating system becomes more and more complex.
The Butler needs to manage the CPU first, and the CPU speed is still fast. It is a waste to do only one thing at a time. Therefore, process schedule subsystem is required. When process a reads data from the disk, process B can work without wasting CPU computing resources. With a bunch of processes, communication between processes is required, and communication requires memory copy. Sometimes the data volume is large and the communication cost is too high. What should I do? Then another thread will be created in the process. The thread can share the data of the process and access the data directly without communication.
The CPU has to manage the memory, so the virtual memory subsystem (virtual memory subsystem) is available ). From the process perspective, to simplify memory operations, both process a and process B access the same virtual address and the physical address they actually access (physic address ), is different. Modern CPUs map virtual addresses to physical addresses to hardware, so the operating system must have a virtual memory subsystem.
The optical tube memory is not enough, the power supply is disconnected, and the data is gone, so you have to write the data to the disk, so there is a file management subsystem ). Hard Disk/USB flash disk, just blank paper. How do I plan the data format? It is necessary to provide the file system format, such as Windows FAT32/NTFS, Mac osx hfs +, which also belongs to the File Subsystem Management.
If the data can be stored and displayed, you must use a video card. However, there are many video card brands and the operating system does not know which brands will be available. Design a PNP system and manage the PCI, USB, and other slots, then, let the video card manufacturer write the driver and manage their own graphics card hardware. The NIC is similar. The keyboard and mouse are much more standard and can be used as a universal driver without being written by the manufacturer.
In the past few years, no network will work, so we have to have a network subsystem, also known as a network stack ). Responsible for implementing TCP/IP.
Programming Language(C/C ++/Java/C #/Python/Lua/Erlang/go)
?
Data structure (array/partition list/hashtable/stack/tree)
?
Domain knowledge (game development/ERP/Web)
?
To be continue...