The Master said, “I am rich enough to be desired. If not, do what I please.” Analects of Confucius: A review
A hundred blog series. This is: the v18. Xx HongMeng kernel source code analysis (source JieGouPian) | kernel the meaning of each file
Antecedents and consequences:
- V08. Xx HongMeng kernel source code analysis (total directory) | millions of Chinese character annotation The blog analysis
- V09. Xx HongMeng kernel source code analysis (story) | says the kernel scheduling process with the story
- V10. Xx HongMeng kernel source code analysis (memory master slave) | the emperor and slave how to get along with
- V13. Xx HongMeng kernel source code analysis (source code comments) | HongMeng is bound to be successful, success is inevitable
- V18. Xx HongMeng kernel source code analysis structure (source code) | kernel the meaning of each file
- V52. Xx HongMeng kernel source code analysis (static) | 51 what also didn’t go for it
Hongmeng kernel source code annotation analysis
Click file to view the source code
- kernel_liteos_a_note
- kernel
- base
- Core -> -> This core refers to the file associated with CPU core
- Los_bitmap. c -> -> What does the bitmap manager do? What scenarios are commonly used in the kernel?
- Los_process. c -> Process is a kernel resource management unit, it is how to manage tasks, memory, files? How do processes collaborate?
- Los_sortlink. c -> -> sort linked list implementation, its application scenario is what?
- Los_swtmr.c -> -> Kernel timer is how to implement and manage?
- Los_sys. c -> -> Several tick-related conversion functions
- Los_task. c -> Task is a kernel scheduling unit, it solves what problems? How to schedule?
- Los_tick. c -> Clock management -> Who is triggering the scheduling? What did hard clock interrupts do?
- Los_timesice. C -> -> Can processes and tasks always occupy the CPU? How to spend your time properly?
- What are the methods of IPC -> -> interprocess communication? Name three, please? How is it done?
- What problem does the los_event.c -> -> event solve? How is it managed?
- Los_futex.c -> -> FUtex is short for Fast Userspace muTexes.
- Los_ipcdebug. c -> -> How to debug interprocess communication?
- Los_mux.c -> -> Mutex, why mutex when you have a zero-sum game? How is it done?
- Los_queue.c -> -> Kernel message queues are implemented. Are there any restrictions on length and size?
- Los_queue_debug. c -> -> How to debug message queues?
- What problem does los_sem.c -> -> semaphore solve? What is its nature?
- Los_sem_debug. c -> -> How to debug semaphore?
- Los_signal.c -> -> What problem does the signal solve? What signals do you know?
- mem -> -> Memory management module Manages the memory resources of the system. It is one of the core modules of the operating system
- bestfit -> -> The advantage of dynamic memory management is allocation on demand, what is the disadvantage?
- Los_memory. c -> -> What are the three parts of the dynamic memory pool in the Hongmeng kernel?
- Los_multipledlinkhead. C -> -> What is the best adaptive algorithm? How is it done?
- bestfit_little -> -> BestFIT_little algorithm is an algorithm formed by adding slab mechanism on the basis of the bestfit algorithm.
- How does the los_heap.c -> -> slab algorithm work? How is it done?
- common -> ->
- membox -> -> The advantage of static memory pool is efficient allocation and free fragmentation, but the disadvantage?
- Los_membox.c -> -> What is static memory used for? How is it done?
- bestfit -> -> The advantage of dynamic memory management is allocation on demand, what is the disadvantage?
- misc -> ->
- kill_shellcmd.c -> -> shell command kill implementation, familiar kill 9 18 behind what happened?
- los_misc.c -> ->
- Los_stackinfo. c -> -> What is the stack information? How do I detect if the stack is abnormal?
- Mempt_shellcmd. c -> -> What are the memory-related shell commands?
- Swtmr_shellcmd. c -> -> What are the shell commands related to soft clock?
- Sysinfo_shellcmd. c -> -> What are the shell commands related to system information?
- Task_shellcmd. c -> -> What are the shell commands related to the task?
- Vm_shellcmd. c -> -> What are the shell commands related to virtual memory?
- mp -> -> MP indicates a module that supports multiple processors
- Los_lockdep. c -> -> How do deadlocks occur? How do I detect deadlocks?
- Los_mp. c -> -> How many cpus does Hongmeng support? How do they work? How do cpus communicate with each other?
- Los_percpu. c -> -> What information does the CPU have?
- Los_stat. c -> -> How do I collect statistics about CPU running information?
- om -> ->
- los_err.c -> ->
- sched/sched_sq -> ->
- Los_priqueue. c -> The kernel source code analysis (scheduling queue article) -> Why only ready state will have queue?
- Los_sched. c -> Los_sched. c -> What conditions trigger scheduling? What is the scheduling algorithm?
- vm -> Hongmeng kernel source code analysis (memory rules)-> What is virtual memory? What does the virtual memory panorama look like?
- Los_vm_boot. c -> -> How is the memory initialized during boot?
- Los_vm_dump. c -> -> How to dump memory data?
- Los_vm_fault. c -> -> Why is the page missing? How to deal with missing pages?
- Los_vm_filemap. c -> -> How are files and memory mapped? What is copy-on-write technology (COW)?
- Los_vm_iomap. c -> -> How are devices and memory mapped?
- Los_vm_map. c -> Hong Mon kernel source code analysis (memory mapping section) -> kernel space, user space, linear area is how to allocate, virtual memory is how to map physical memory?
- Los_vm_page. c -> -> What is a physical page frame and where is it used?
- Los_vm_phys. C -> Hongmonkernel source code analysis (physical memory) -> section page management, physical memory is how to allocate and recycle?
- How does the LOs_vm_SCans. c -> -> LRU algorithm work?
- Los_vm_syscall. c -> -> System call memory, how do user processes apply for memory? What’s going on at the bottom?
- Oom. C -> -> How is memory overflow detected?
- How is shm.c -> -> shared memory implemented?
- common -> ->
- Console. c -> -> How is the familiar console implemented?
- Hwi_shell. c -> -> How to query hardware interrupts?
- Los_cir_buf.c -> -> How is reading and writing to the ring buffer implemented? In what situations is it commonly used?
- Los_config. c -> -> What configuration information does the kernel have?
- Los_exc_interaction. c -> -> How to detect an exception in the task?
- Los_excinfo.c -> -> What information does the exception contain? How do I record exception information?
- Los_hilog. c -> -> How does the kernel encapsulate logs?
- Los_magickey. c -> -> What does the magickey do?
- Los_printf.c -> -> What does the kernel do to wrap printf?
- Los_rootfs. c -> -> What is the root file system? Why is it needed?
- los_seq_buf.c -> ->
- Virtual_serial. c -> -> How to access the serial port as easy as accessing files?
- extended -> ->
- cppsupport -> ->
- How does los_cppsupport-c -> -> support C++?
- cpup -> ->
- Cpup_shellcmd. c -> -> How do I query the CPU usage in real time?
- Los_cpup.c -> -> How does the kernel count CPU performance in real time?
- dynload/src ->
- Los_exec_elf. c -> -> How to run ELF? What is the escape cage for bird technology?
- Los_load_elf. c -> -> How to load ELF dynamically?
- liteipc -> ->
- Hm_liteipc. c -> -> How to read message queue in file mode? What are the differences between LiteiPC and a normal message queue?
- tickless -> ->
- Los_tickless. c -> -> Where is the new timing mechanism? What problems does it solve?
- trace -> ->
- Los_trace.c -> -> How to trace? What is the kernel tracking?
- vdso -> What are the ways in which user space can access kernel space?
- src -> ->
- Los_vdso. c -> -> VDSO(Virtual Dynamically- Linked Shared Object) how to implement?
- los_vdso_text.S -> ->
- usr -> ->
- src -> ->
- cppsupport -> ->
- user/src -> ->
- los_user_init.c -> ->
- kernel
Intensive reading of the kernel source code
Four code stores synchronous annotation kernel source code, >> view the Gitee repository
Analysis of 100 blogs. Dig deep into the core
Add comments to hongmeng kernel source code process, sort out the following article. Content based on the source code, often in life scene analogy as much as possible into the kernel knowledge of a scene, with a pictorial sense, easy to understand memory. It’s important to speak in a way that others can understand! The 100 blogs are by no means a bunch of ridiculously difficult concepts being put forward by Baidu. That’s not interesting. More hope to make the kernel become lifelike, feel more intimate. It’s hard, it’s hard, but there’s no turning back. 😛 and code bugs need to be constantly debug, there will be many mistakes and omissions in the article and annotation content, please forgive, but will be repeatedly amended, continuous update. Xx represents the number of modifications, refined, concise and comprehensive, and strive to create high-quality content.
Compile build | The fundamental tools | Loading operation | Process management |
---|---|---|---|
Compile environment The build process Environment script Build tools Designed.the gn application Ninja ninja |
Two-way linked list Bitmap management In the stack way The timer Atomic operation Time management |
The ELF format The ELF parsing Static link relocation Process image |
Process management Process concept Fork Special process Process recycling Signal production Signal consumption Shell editor Shell parsing |
Process of communication | Memory management | Ins and outs | Task management |
spinlocks The mutex Process of communication A semaphore Incident control The message queue |
Memory allocation Memory management Memory assembly The memory mapping Rules of memory Physical memory |
Total directory Scheduling the story Main memory slave The source code comments Source structure Static site |
The clock task Task scheduling Task management The scheduling queue Scheduling mechanism Thread concept Concurrent parallel The system calls Task switching |
The file system | Hardware architecture | ||
File concept The file system The index node Mount the directory Root file system Character device VFS File handle Pipeline file |
Compilation basis Assembly and the cords Working mode register Anomaly over Assembly summary Interrupt switch Interrupt concept Interrupt management |
HongMeng station | into a little bit every day, the original is not easy, welcome to reprint, please indicate the source.