如何从16位实模式在x86程序集中重启? [英] How to reboot in x86 assembly from 16 bit real mode?

查看:146
本文介绍了如何从16位实模式在x86程序集中重启?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

APM关机已在 http://uefi.org/specifications 上,但它也在采用我有足够的头脑去分析它,我认为这是一个值得探讨的问题.

我找不到APM规范的URL,只能找到Microsoft RTF的Google缓存这个最小的APM关闭启动扇区示例可能是一个很好的起点.目标是将其转换为重新启动示例.

我已经在 arch/x86/realmode/rm/reboot.S ,但我不了解它的工作原理,因为我找不到这些命令与我的关机示例之间的区别.

有关超级用户的更多常规信息: https://superuser.com/questions/294681/如何重新启动计算机

有关保护模式的问题:以保护模式重启

解决方案

如果启动媒体上没有内核文件,我会在软盘启动映像中使用以下代码来重置PC.

Reboot:
    db 0x0ea 
    dw 0x0000 
    dw 0xffff 

基本上会汇编为以下指令:

jmp     far ptr 0FFFFh:0 

我认为这是热启动,即相当于按Ctrl-Alt-Delete,而不是按计算机前面的重置按钮.

APM shutdown has been covered at X86 instructions to power off computer in real mode?

How to reboot instead of shutting down the computer? Please quote and explain the relevant documentation / standard in your answer.

I've understood that APM and ACPI are the two main methods, and I'm interested in both. Let me know if there are others.

I have found the ACPI spec is at http://uefi.org/specifications but it's taking too much brainpower to parse it that I found it worthy of a question.

I could not find the URL for the APM spec, only a Google cache of a Microsoft RTF here.

If you need a way to test your answer, this minimal APM shutdown boot sector example may be a good starting point. The goal is to convert it to a reboot example instead.

I have read the Linux kernel 4.2 code at arch/x86/realmode/rm/reboot.S but I don't understand how it works, since I can't find the difference between those commands and my working shutdown example.

Related more generic on superuser: https://superuser.com/questions/294681/how-does-a-computer-restart-itself

Related question for protected mode: Rebooting in Protected Mode

解决方案

I use the following code in a floppy-disk boot image to reset the pc if the kernel files aren't present on the boot media.

Reboot:
    db 0x0ea 
    dw 0x0000 
    dw 0xffff 

Which essentially assembles to the following instruction:

jmp     far ptr 0FFFFh:0 

I think it's a warm-reboot, i.e equivalent to hitting Ctrl-Alt-Delete, as opposed to hitting the reset button on the front of the machine.

这篇关于如何从16位实模式在x86程序集中重启?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆