当前位置:网站首页>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 .
边栏推荐
- memcached全面剖析–3. memcached的删除机制和发展方向
- Ebpf XDP mount point analysis
- Shengzhe technology AI intelligent drowning prevention service launched
- Notes_ Vlan
- Interpretation of ebpf sockops code
- 福建省发改委福州市营商办莅临育润大健康事业部指导视察工作
- Intelligent fish tank control system based on STM32 under Internet of things
- 去掉录屏提醒(七牛云demo)
- 123. the best time to buy and sell shares III
- Use of kubernetes storage volumes
猜你喜欢

为什么生命科学企业都在陆续上云?

VirtualBox virtual machine installation win10 Enterprise Edition

socket(1)

Please open online PDF carefully

memcached完全剖析–1. memcached的基础

Alibaba cloud lightweight servers open designated ports

Failed to open after installing Charles without any prompt

Role of wait function

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

memcached全面剖析–5. memcached的应用和兼容程序
随机推荐
字节的软件测试盆友们你们可以跳槽了,这还是你们心心念念的字节吗?
Use of kubernetes storage volumes
ping: www.baidu.com: 未知的名称或服务
TCP specifies the source port
Three more days
升哲科技 AI 智能防溺水服务上线
使用Adb连接设备时提示设备无权限
Big factories go out to sea and lose "posture"
Analysis of BBR congestion control state machine
Understanding openstack network
一文理解OpenStack网络
煮茶论英雄!福建省发改委、市营商办领导一行莅临育润大健康事业部交流指导
Functional analysis of ebpf tracepoint
Station B takes goods to learn from New Oriental
Memcached comprehensive analysis – 2 Understand memcached memory storage
力扣每日一题-第25天-496.下一个更大元素Ⅰ
Analysis of tcpdump packet capturing kernel code
多路转接select
TCP_ Nodelay and TCP_ CORK
memcached全面剖析–2. 理解memcached的內存存儲