
This course overview does not include practical content, but it explains the basic concepts of an operating system, assembly code, and other very important fundamental principles. If you want to jump directly into practical applications, skipping this course will not be a problem.
1. Operating System
An operating system is a very complex program. Its task is to organize and manage other programs on the computer, including sharing the computer’s time, memory, hardware, and other resources. Some of the larger desktop operating system families you may have heard of include GNU/Linux, Mac OS X, and Microsoft Windows. Other devices, such as phones, also require an operating system, which may use operating systems like Android, iOS, and Windows Phone[1].
Since the operating system is used to interact with the hardware on the computer system, it must understand the proprietary information of the hardware on the system. To make the operating system applicable to various types of computers, the concept of drivers was invented. A driver is a small piece of code that can be added (and removed) from the operating system to enable interaction between the operating system and specific hardware. In this course, we do not cover how to create removable drivers but focus on a specific piece of hardware: the Raspberry Pi.
Operating systems have various design approaches, and in this course, we will only touch the surface of operating system design. We mainly focus on the interaction between the operating system and various hardware, as this is often the trickiest part and also the part with the least documentation and help available online.
2. Assembly Code
The processor can execute millions of instructions per second, but these instructions must be simple.
This course will rely almost entirely on assembly code. Assembly code is very close to the low level of the computer. The computer actually works with a device called a processor, which can perform simple tasks like addition, and a set of chips called RAM, which can be used to store numbers. When the computer is powered on, the processor executes a series of instructions given by the programmer, which will change the numbers in memory and interact with the connected hardware. Assembly code simply converts these machine commands into human-readable text.
In regular programming, programmers use programming languages like C++, Java, C#, Basic, etc., to write code, and then a program called a compiler converts the code written by the programmer into assembly code, which is then further converted into binary code[2]. Binary code is what the computer can truly understand, but it is something that humans cannot read. Assembly code is a bit better than binary code, as its commands are human-readable, but it can still be frustrating. Remember, every command you write in assembly code is something the processor can directly recognize, so these commands are designed to be simple because the physical circuits must be able to handle each command.
Compiler process
Just like regular programming, there are many different assembly code programming languages, but unlike regular programming, each assembly programming language is targeted at different processors, and each processor is designed to understand a different language. Therefore, assembly code written in an assembly language designed for a specific machine cannot run on other types of machines. In many cases, this can be a disaster, so every program must be rewritten for the different types of machines it will use, but for operating systems, this is not a problem because it must be rewritten for different hardware. Nevertheless, most operating systems are written in C++ or C so that they can be easily used on different types of hardware, only needing to rewrite the parts that must be implemented in assembly code.
Now, you are ready to enter the first lesson, which is Course 1 OK01[3]
via: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/introduction.html
Author: Robert Mullins[5] Topic: lujun9972 Translator: qhwdw Proofreader: wxy
This article was originally translated and compiled by LCTT, and is proudly presented by Linux China