当前位置: 首页 > news >正文

kernel header解析

一、kernel header定义: 

======aarch64 kernel header========
u32 code0;          /* Executable code */
u32 code1;          /* Executable code */
u64 text_offset;        /* Image load offset, little endian */
u64 image_size;     /* Effective Image size, little endian */
u64 flags;          /* kernel flags, little endian */
u64 res2    = 0;        /* reserved */
u64 res3    = 0;        /* reserved */
u64 res4    = 0;        /* reserved */
u32 magic   = 0x644d5241;   /* Magic number, little endian, "ARM\x64" */
u32 res5;           /* reserved (used for PE COFF offset) */
====================================

//TEXT_OFFSET是kernel镜像在内存中的偏移量。

注意事项: 

Header notes:

  • As of v3.17, all fields are little endian unless stated otherwise.

  • code0/code1 are responsible for branching to stext.

  • when booting through EFI, code0/code1 are initially skipped. res5 is an offset to the PE header and the PE header has the EFI entry point (efi_stub_entry). When the stub has done its work, it jumps to code0 to resume the normal boot process.

  • Prior to v3.17, the endianness of text_offset was not specified. In these cases image_size is zero and text_offset is 0x80000 in the endianness of the kernel. Where image_size is non-zero image_size is little-endian and must be respected. Where image_size is zero, text_offset can be assumed to be 0x80000.

  • The flags field (introduced in v3.17) is a little-endian 64-bit field composed as follows:

    Bit 0

    Kernel endianness. 1 if BE, 0 if LE.

    Bit 1-2

    Kernel Page size.

    • 0 - Unspecified.
    • 1 - 4K
    • 2 - 16K
    • 3 - 64K

    Bit 3

    Kernel physical placement

    0

    2MB aligned base should be as close as possible to the base of DRAM, since memory below it is not accessible via the linear mapping

    1

    2MB aligned base may be anywhere in physical memory

    Bits 4-63

    Reserved.

 参考:https://github.com/torvalds/linux/blob/ff1176468d368232b684f75e82563369208bc371/Documentation/arm64/booting.rst

http://www.lryc.cn/news/388437.html

相关文章:

  • MQ运行时遇到的问题
  • EDI是什么?与ERP有何关系
  • 【MotionCap】在wsl2 ubuntu20.04构建及运行
  • iptables 防火墙(二)
  • 【机器学习】在【PyCharm中的学习】:从【基础到进阶的全面指南】
  • idea Error running ‘Application‘
  • 数据结构和顺序表
  • 【一步一步了解Java系列】:对这个系列的总结以及对缺漏内部类知识的补充
  • TCP和UDP
  • 【ai】tx2 nx:ubuntu18.04 yolov4-triton-tensorrt 成功部署server 运行
  • 类与对象的创建
  • 基于单片机的 LED 照明灯智能调光系统设计
  • 客户满意度调查方法有哪些
  • 为什么企业应用开发,c++干不过java?
  • 基于盲信号处理的声音分离——最小化增益的ICA算法
  • 自动化代码规范检查--Sonarqube部署
  • 基于uni-app与图鸟UI的移动应用模板构建研究
  • AI智能在Type-C领域的应用
  • INS-GPS组合导航——卡尔曼滤波
  • day 58 739. 每日温度 496.下一个更大元素 I 503.下一个更大元素II
  • Dns被莫名篡改的问题定位(笔记)
  • JVM原理(八):JVM虚拟机工具之基础故障工具
  • Eureka的桥梁:服务消费者交互全解析
  • 13_网络安全
  • C++ 中的数据类型
  • CSS|04 复合选择器伪类选择器属性选择器美化超链接
  • 探索Batch注释的奥秘:REM与::的细微差别
  • C语言 求数列 S(n) = a + aa + aaa + …aa…a (n 个 a)的和
  • MysqlDump
  • 某安全公司DDoS攻击防御2024年6月报告