首页 > 其他分享 >20230826 step03 获取当前异常等级 CurrentEL

20230826 step03 获取当前异常等级 CurrentEL

时间:2023-08-26 16:44:07浏览次数:43  
标签:step03 CurrentEL point make boot 20230826 start X5

  armV8-A  架构文档的  C5.2.1

 在EL0不可用,EL1时。。。。。,返回值前60bits 和后2bits都为0

修改一下boot.S

// The entry point is in its own section ".text.boot".
.section ".text.boot"

// The symbol "_start" is the kernel's entry point, make it global.
.global _start

// Entry point for the main core.
_start:
        MRS X5,CurrentEL        //read current  Exception level.EL, bits [3:2]
        LSR X5,X5,2     //Shift out two 0 at the tail

// Hang forever in a loop.
hang_forever:
        wfe                   // Allow the CPU to go to low-power mode.
        b hang_forever

  make

make run-gdb

new teminal:  make gdb

读取内存

  反汇编

  si   step instruction, i r 查看寄存器;这里可以看到EL等于2,当前为EL2

 

标签:step03,CurrentEL,point,make,boot,20230826,start,X5
From: https://www.cnblogs.com/yangdinshan/p/17659058.html

相关文章

  • 20230826 使用qemu boot gdb
    macOS:brewinstallqemuqemu-system-aarch64--version去https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads下载交叉编译工具链 PREFIX=/Applications/ArmGNUToolchain/12.3.rel1/aarch64-none-elf/bin/aarch64-none-elf-参考https://github......
  • 环AD20230826
    0x00这是笔者对一些琐碎事物的观点。本文与笔者曾述的补完以及理解论相承,前作两者尽力地使用语言呈现环,但对大多读者似乎并无启发。现在笔者十分怠惰,仅为此时所成之环从简记录。对笔者而言的重要启发是不久前的一个梦,梦中笔者成为一个不存在视觉与听觉的恐鱼,甚至无法理解方位。......