- 论坛徽章:
- 0
|
OS Design and Architecture
In the imx21
operating system, the hardware driver presents abstraction of external devices
as well as firmware. Particularly, there are APIs to control touchscreen and
framebuffer in QT GUI environment.
In the user space, there is one interface to realize
the Input/Output control of external devices and firmware. Then user applications make use of this
interface to realize the hardware control. Such a design makes the whole system
easy to port on multiple platforms.
![]()
Normal
0
Normal
0
System
Booting
In the
design of Linux, the root file system is designed to put on flash and mmc block
optionally.
The NOR
flash is divided into three sections for bootloader, kernel and root
file-system separately.
Here I
would like to show the booting procedure. Bootloader will set the SDRAM and
other setting of CPU as well as UART. After that bootloader will load kernel
into SDRAM and jump to kernel. Then we begins to run Linux Kernel.
Linux
Kernel begins to execute the code in head.s.
-
Turn on the cache. We need to setup some PAGE tables so that we can have both the I & D caches on
-
Decompress the kernel
-
Call_kernel will clean flush cache and turn off cache
-
Go to entry of the kernel and go to execute it
From
/arch/arm/boot/compressed/Makefile, we can see the head of zImage include codes
in head.s.
Execute the kernel
-
Read the process id register and calculate the offset of procinfo
-
Get the machine type
-
Create page table
-
Initialize processor
-
Start bss
-
Get the processor id
-
……
-
start_kernel is called, go to start kernel
Start kernel
-
setup architecture
-
setup parsing option
-
initialize trap, a sort of initialization
-
kernel_thread call init, init() will open the console and
execute shell command.
-
Unlock kernel can setup cpu to be idle
User application
All the
user application is called up in the shell/busybox.
Above it a primary introduction of system
booting on imx21 platform. This is also applicable for arm-Linux (version
2.4.x).
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/7273/showart_1916142.html |
|