项目一 iMX21整体方案(2): OS设计及系统启动
时间:2009-05-02 来源:anabelle
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.
500)this.width=500;" border="0"> <link rel="File-List" href="file:///C:/Users/CHENHU%7E1/AppData/Local/Temp/msoclip1/01/clip_filelist.xml"><style> </style>
<link rel="File-List" href="file:///C:/Users/CHENHU%7E1/AppData/Local/Temp/msoclip1/01/clip_filelist.xml"><style> </style>
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).