我想要理解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-1fhttps://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/x86/boot/header.S#n298
特别是最后一行.byte start_of_setup-1f
发布于 2016-07-21 14:48:52
1:是一个local label。
1f是对当前行前面的标签1的引用。(一个文件可以包含多个数字标签。这对于可以在多个位置插入相同代码块的内联asm或汇编宏最有用。)
所以
.byte start_of_setup - 1f是两个标签之间的距离(以字节为单位),如有必要,将其截断为一个字节。
有关文档和指南的更多链接,请参阅x86 tag wiki。
https://stackoverflow.com/questions/38494102
复制相似问题