What’s Inside: Microsoft Developer Talks Computer Architecture
This Tuesday, Andrey Artemiev, a software engineer at Microsoft, gave an open lecture at ITMO University. The developer talked about his career and described the principles that are at work inside the computers that we use every day. Read on to learn the key points of the lecture.
How to land a job at Microsoft
Andrey Artemiev has been working at Microsoft’s Redmond campus since 2015. He received an offer after having done an internship there in 2012 as a student of Belarusian State University of Informatics and Radioelectronics. During these four years at the company, he managed to contribute to such projects as Xbox, Windows 10 and Windows Live. He is currently working in the team developing the core for the new generation of the Windows OS.
According to Andrey, getting an internship at Microsoft, Google or Apple is challenging, but if you succeed at all the tests and interviews, your internship may become the beginning of your career at one of these companies.
“I advise everyone to keep sending your applications to all of these companies every year until you receive an invitation. There is an 80% possibility that an internship will end with either an invitation to the next one or a job offer. You simply have to try, even more so because it is easier to get a visa, which will not be the case with a job permit. It took me several years to get mine, so use your chance for an easy visa application process and apply everywhere,” shared his advice Andrey Artemiev.
Inside a computer
The Windows operating system was first created in 1985. Today there are over 1.5 billion devices running on it, with 900 million of them using the latest Windows 10 version. Over its history, Windows supported 8 different architectures. It was initially designed as a flexible operating system that could be used by a great number of devices. For instance, Windows has been used in smart bracelets, portable gadgets, gaming consoles, augmented reality glasses, server stations, ATMs and even in cars (Ford and Lincoln).
If we consider Windows as an ecosystem, then user programs are at the very top of the food chain. These programs are everything you code on Java or PHP. The next level is taken by the operating system itself, which comprises mechanisms that allow your programs to work by making the hardware comply with the code you have written. If we go further down, we will reach the actual computer architecture. Here, it means the motherboard and its BIOS. Then comes the microarchitecture, the structure of the processor and the microcontrollers. On a deeper level, there are logical units that can complete simple logical operations. Deeper still are arithmetic units that work with ones and zeros. These arithmetic units consist of analog units: semiconductor radio elements that abide by the laws of physics. And on the last level are semiconductor elements: transistors, diodes, resistors.
The heart and brain of a computer
According to the traditional definition, an operating system is a virtual machine with the functions of a resource manager. As for the user operating system, it has three additional elements: an ecosystem, a platform and an infrastructure.
An operating system is always seen in two modes: User mode and Kernel mode. How does this divide appear? Both of these modes use the same resources, memory and CPU, and are located on the same harddrive. There are two main ways to separate the fields that a user and a server may influence: CPU modes (protection rings) and memory division.
A protection ring means that everything that interacts with the system is categorized into Ring 0 (the most privileged) and Ring 3 (less privileged). The majority of CPUs actually have 4 Rings, but Windows uses only 2 of them because of the ‘flexible operating system for various devices’ policy.
Consequently, the memory stored on a harddrive is separated into code and user data. User access to server data is limited.
To understand the way a keyboard works, let’s consider a single key. It is actually a copper layer placed over two wires that do not touch each other. When you press the key, the wires touch, creating a current. This voltage spike is recognized by the microprocessor at the base of the keyboard. There, a program is at work, checking the voltage on every key on an infinite loop by sending a current to one of the wires and seeing if it comes back. Then, in its turn, the microprocessor sends this information to the computer.
Motherboard and hard drive
Every computer has a motherboard at its base. It is not unlike a primitive organism with no consciousness but a highly developed nervous system in the form of controllers. These microcontrollers communicate via buses. The motherboard architecture includes two bridges: the northbridge and the southbridge. All of the slow controllers (the keyboard, hard drive and USB) close on the southbridge. The northbridge is for fast controllers like interrupt, RAM and graphics memory.
Finally, the hard drive. It is a ribbon divided into clusters. Each cluster equals 512 bytes. It would have been irrational to store less, because it would still require a lot of resources to change the magnetic disc angle, slowing down the recording. That is why the operating system reads 512 bytes in one take and puts them to work.