Rust-based OS booting with UEFI (2)
All code of this tutorial can be accessed at my GitHub repo
What is an OS?
In modern days, the word 'OS' may denote many things.
OS can be used to name a kernel, e.g. Linux, Mach (the kernel of macOS), and etc.
OS can also be used to name a kernel and a set of userland programs, e.g. GNU/Linux, macOS, and etc.
In this series of articles, we mainly focus on the kernel part of an OS.
In term of an OS kernel, let's talk about what tasks should be done by an OS kernel.
The major role of an OS kernel is to provide a virtualization abstraction of hardware resources, and to provide a set of APIs for userland programs to use these resources.
In this definition, an OS kernel should:
- Manages computational (CPU, GPU, application specific accelerators) and storage resources (memory, disks, and etc.), and distribute them to userland programs.
- Provides a unified interface to operate periphrals (keyboard, mouse, network, and etc.).
Therefore, in this episode, we will try to detect the core hardware resources of the device via UEFI interface:
- CPU
- Memory layout
- Graphics