当前位置:网站首页>Introduce the overall process of bootloader, PM, kernel and system startup
Introduce the overall process of bootloader, PM, kernel and system startup
2022-06-24 21:44:00 【Sweet galier】
BootLoader、PM、kernel And the overall process of system startup
- One 、 Overall startup process
- Two 、 Related subsystems
- 3、 ... and 、 What has been done in each link
- Four 、bootloader Introduction to
- 1、 frequently-used bootloader:uboot
- 2、uboot What to do
- 3、U Disk upgrade
- 4、AB Zoning and recovery
- 5、uboot Of ab Partition
- 6、bootcmd and bootargs
- 5、 ... and 、PM( Low power power management program )
- 1、PM Mainly responsible for
- 2、PM Reflected in the code
- 3、 Common wake-up methods
- 4、PM Notes for debugging and development
- 6、 ... and 、kernel
- 1、kernel Start-up phase
- 2、init process
One 、 Overall startup process

Two 、 Related subsystems
bootloader: Boot loader for embedded systems , Used for hardware device initialization
PM: Low power power management program , Standby and wake-up support
recovery:android Repair subsystem of , Reset and system upgrade support
kernel:linux kernel , Hardware maintenance , Underlying support .
Android: be based on linux Open source system , Framework and application layer .
3、 ... and 、 What has been done in each link

Four 、bootloader Introduction to
In an embedded operating system ,BootLoader It runs before the operating system kernel runs . Hardware devices can be initialized 、 Create a memory space map , In this way, the software and hardware environment of the system will be brought to a suitable state , In order to prepare the right environment for the final call to the operating system kernel .
1、 frequently-used bootloader:uboot
choice uboot The reason of :
- Support a variety of embedded operating system kernel , Such as Linux、NetBSD, VxWorks, QNX, RTEMS, ARTOS, LynxOS, android;
- Support multiple processor families , Such as PowerPC、ARM、x86、MIPS;
- High reliability and stability ;
- Highly flexible function settings , fit U-Boot debugging 、 Different boot requirements of the operating system 、 Product release, etc ;
- Rich device driver source code , Such as serial port 、 Ethernet 、SDRAM、FLASH、LCD、NVRAM、EEPROM、RTC、 Keyboard, etc ;
- Rich development and debugging documents and strong network technical support ;
2、uboot What to do

Hardware initialization ( Set processor mode 、 Turn off the watchdog 、 Mask interrupt 、 initialization sdram、 Set the stack 、 Set the clock 、 from flash Boot the kernel into memory )
Power on judgment :
AC/DC Turn it on :
AC,Alternating Current, Alternating current (ac) , We usually refer to hard power on
DC,Direct Current, Direct current , We usually refer to soft boot
Startup basis bootmode Judge the power on and startup 、 Power on for standby 、 Power on memory
3、U Disk upgrade

4、AB Zoning and recovery

5、uboot Of ab Partition
- Verify integrity (flash)
- Determine the partition active
- Start loading as needed active Partition data
6、bootcmd and bootargs
uboot Two environment variables of
uboot Environment variables of : It is essentially an array of characters , stay uboot Is actually used as a global variable in reading and writing . You can use the serial port to boot Of shell Window pass setenv,printenv,savenv Etc , Commonly used for debugging . uboot Runtime slave flash Load into DDR Use in . After modification , Use saveenv, Will be able to DDR The environment variables in are updated to flash in . Be careful ,saveenv In fact, the entire environment variable is saved once , Instead of just saving the changes .
- bootargs: Is the startup parameter of the system , adopt cmdline To pass on to kernel. Common debugging items such as loglevel,selinux Switches and so on pass through bootargs from boot Pass to kernel Realization .
- bootcmd: Are some commands executed by default when starting automatically , So you can define different configurations in the current environment , Parameter settings for different environments , Then set the bootcmd For the kind of parameter you often use .
5、 ... and 、PM( Low power power management program )
1、PM Mainly responsible for
- Standby power management
- Trigger wake-up
2、PM Reflected in the code
One main Function initialization , Then enter vTask, An endless loop waits to wake up .
3、 Common wake-up methods
IR Wake up the 、 Press the key to wake up 、CEC Wake up the 、RS232 Wake up the 、 Wake up on the Internet 、IO Wake up, etc
4、PM Notes for debugging and development
- PM Can be controlled by IO Co., LTD. , Most of the IO stay PM I can't control , Electronic design needs to consider , For standby control IO The mouth needs to be used PM mouth , Such as LED The lamp .
- PM Program space is limited , Cannot achieve multiple / Complex functions . Extreme cases require functional trade-offs .
6、 ... and 、kernel
system kernel ,Android Cornerstone
- Management process 、 Threads , Decide which process 、 Thread usage CPU, That is, the ability of process scheduling ;
- Manage memory , Determine the allocation and recycling of memory , The ability of memory management ;
- Managing hardware devices , Provides communication capabilities between processes and hardware devices , That's hardware communication capability ;
- Provide system calls , If the application wants to run a service with higher permissions , Then you need to have system calls , It's the interface between the user program and the operating system .

1、kernel Start-up phase
- Kernel boot phase . It is usually written in assembly language , It mainly checks whether the kernel matches the current hardware . This part is also related to the hardware architecture . The code related to the kernel boot phase is mainly located in kernel /arch/arm/kernel/head.S and kernel /arch/arm/kernel/head-common.S.
- Kernel boot phase . Before the end of the boot phase , Will call start_kernel() Enter the kernel boot phase . The code related to the kernel startup phase is mainly located in kernel/init/main.c.
2、init process
Android The core process of the system ,kernel After starting , Start in user space init process , Re pass init process , To read init.rc Related configuration in , So as to start other related processes and other operations .Init The process connects the preceding and the following , yes Android Start the core process .
边栏推荐
- (待补充)GAMES101作业7提高-实现微表面模型你需要了解的知识
- EditText controls the soft keyboard to search
- Static routing experiment
- VirtualBox virtual machine installation win10 Enterprise Edition
- Slider controls the playback progress of animator animation
- Use of kubernetes storage volumes
- [cloud native learning notes] kubernetes practice command
- how to install clustershell
- 188. the best time to buy and sell stocks IV
- Big factories go out to sea and lose "posture"
猜你喜欢

虚拟机CentOS7中无图形界面安装Oracle(保姆级安装)

去掉录屏提醒(七牛云demo)

Memcached full profiling – 1 Fundamentals of memcached

Bld3 getting started UI

Multi view function in blender

66 pitfalls in go programming language: pitfalls and common errors of golang developers

memcached全面剖析–3. memcached的删除机制和发展方向

Football information query system based on C language course report + project source code + demo ppt+ project screenshot

Station B takes goods to learn from New Oriental

Alibaba cloud lightweight servers open designated ports
随机推荐
Memcached comprehensive analysis – 3 Deletion mechanism and development direction of memcached
Alibaba cloud lightweight servers open designated ports
Pattern recognition - 1 Bayesian decision theory_ P1
Tso hardware sharding is a header copy problem
Graduation summary of phase 6 of the construction practice camp
力扣每日一题-第26天-496.下一个更大元素Ⅰ
Blender's landscape
BPF_ PROG_ TYPE_ SOCKET_ Filter function implementation
2022国际女性工程师日:戴森设计大奖彰显女性设计实力
煮茶论英雄!福建省发改委、市营商办领导一行莅临育润大健康事业部交流指导
[Web Security Basics] some details
2022 international women engineers' Day: Dyson design award shows women's design strength
BBR bandwidth per second conversion logic
[cloud native learning notes] learn about kubernetes configuration list yaml file
Analysis of tcpdump packet capturing kernel code
Unity about conversion between local and world coordinates
MySQL optimizes query speed
[cloud native learning notes] deploy applications through yaml files
SYSCALL_ Define5 setsockopt code flow
memcached全面剖析–2. 理解memcached的内存存储