上一页 1 2 3 4 5 6 7 8 9 ··· 20 下一页
摘要: 建议先看:https://www.cnblogs.com/zhangzhiwei122/p/16085238.html memblock 属于 “六、内存布局” 这一部分。收集物理内存信息 memblock 介绍 memblock 内存管理机制主要用于 Kernel 启动阶段的内存管理,可以认为从k 阅读全文
posted @ 2022-03-27 11:06 张志伟122 阅读(428) 评论(0) 推荐(0) 编辑
摘要: 上一篇:命令行参数获取 https://www.cnblogs.com/zhangzhiwei122/p/16060542.html start_kernel 中解析参数的几个入口 870 行 early 阶段参数解析 - setup_arch -> parse_early_params 871 行 阅读全文
posted @ 2022-03-27 10:03 张志伟122 阅读(525) 评论(0) 推荐(0) 编辑
摘要: 调用顺序 setup_arch(&command_line)->setup_machine_fdt(__fdt_pointer); 需要注意的是*command_line 是指向到 boot_command_line;而boot_command_line是一个静态数组,在 init/main.c 里 阅读全文
posted @ 2022-03-26 19:49 张志伟122 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 调用顺序 arch/arm64/kernel/setup.c setup_arch -> setup_machine_fdt setup_machine_fdt 171static void __init setup_machine_fdt(phys_addr_t dt_phys) 172{ 173 阅读全文
posted @ 2022-03-26 19:21 张志伟122 阅读(624) 评论(0) 推荐(0) 编辑
摘要: 1、初始化 arch/arm64/kernel/setup.c( setup_arch )-> arch/arm64/mm/ioremap.c( early_ioremap_init ) -> mm/early_ioremap.c ( early_ioremap_setup ) early_iore 阅读全文
posted @ 2022-03-26 18:24 张志伟122 阅读(260) 评论(0) 推荐(0) 编辑
摘要: arch/arm64/include/asm/fixmap.h 中的定义 enum fixed_addresses 地址类型枚举,在 101 行的函数 __set_fixmap(idx, phys) 第一个参数用到。 将一个物理地址,映射到 idx 代表的 VA 地址上面。 25/* 26 * He 阅读全文
posted @ 2022-03-26 14:06 张志伟122 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 1、线性空间下移 4.X 内核中 线性映射区域 位于 内核地址空间的高位处。介绍文章举例: https://blog.csdn.net/u012142460/article/details/105867221/ 线性映射区域下移 2019年8月的一个commit,将线性映射区域 下移了。 commi 阅读全文
posted @ 2022-03-26 11:31 张志伟122 阅读(804) 评论(0) 推荐(0) 编辑
摘要: 1、cpu_number 是一个 percpu 类型的 int 变量, arch/arm64/include/asm/smp.h。 34 行,声明 percpu 变量 cpu_number . 在 arch/arm64/kernel/smp.c 中定义。 2、raw_smp_processor_id 阅读全文
posted @ 2022-03-25 12:48 张志伟122 阅读(485) 评论(0) 推荐(0) 编辑
摘要: include/linux/percpu-defs.h 1、 SHIFT_PERCPU_PTR 230 ~ 231 定义了 SHIFT_PERCPU_PTR ,输入 __p 和 __offset ,直接使用 RELOC_HIDE 对两者进行相加。 RELOC_HIDE 见 https://www.c 阅读全文
posted @ 2022-03-25 12:28 张志伟122 阅读(645) 评论(0) 推荐(0) 编辑
摘要: 38 行定义 unsigned long 类型的 __ptr 39 行,将 输入 ptr 的值 放到 __ptr 里面。 40 行,__ptr 里面的值和 offset 的值相加。 但是返回的类型还是 ptr 的类型。 背景: 假设有对象类型 struct people { int age; int 阅读全文
posted @ 2022-03-25 11:34 张志伟122 阅读(225) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 20 下一页