Why do the bytes “0xea 0000 ffff” in a bootloader cause the computer to reboot?

会有一股神秘感。 提交于 2019-12-10 18:21:23

问题


I was researching boot loaders and I found this interesting piece of assembly:

;Sends us to the end of the memory
;causing reboot
db 0x0ea
dw 0x0000
dw 0xffff

By the comment I know what it does; sends the computer to the end of memory, but what I can't figure out is how those numbers reboot the computer (x86_64 processor on 16-bit mode).


回答1:


Those bytes correspond to jmp word 0xffff:0000 (you can see this by assembling with NASM and then disassembling the resulting binary), which happens to be a jump to the x86 reset vector in real mode.




回答2:


It's a far jump instruction to the old 8086 reset address. When the 8086 was reset it would start executing instructions at FFFF:0000. For compatibility reasons modern BIOS implementation have a jump to their reset code here, though reset address of modern CPUs is different.



来源:https://stackoverflow.com/questions/31296422/why-do-the-bytes-0xea-0000-ffff-in-a-bootloader-cause-the-computer-to-reboot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!