apa*_*paz 5 assembly linux-kernel
我想了解linux内核中x86实模式入口点的含义:
_start:
# Explicitly enter this as bytes, or the assembler
# tries to generate a 3-byte jump here, which causes
# everything else to push off to the wrong offset.
.byte 0xeb # short (2-byte) jump
.byte start_of_setup-1f
Run Code Online (Sandbox Code Playgroud)
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/x86/boot/header.S#n298
具体来说最后一行.byte start_of_setup-1f
1:这是一个本地标签。
1f1是对当前行标签 Forward 的引用。(一个文件可以包含多个数字标签。这对于可以在多个位置插入相同代码块的内联汇编或汇编器宏最有用。)
所以
.byte start_of_setup - 1f
Run Code Online (Sandbox Code Playgroud)
是两个标签之间的距离(以字节为单位),截断(如有必要)至一个字节。
另请参阅x86标签 wiki,获取更多文档和指南链接。
| 归档时间: |
|
| 查看次数: |
395 次 |
| 最近记录: |