如何确定启动设备
我再次有一个不太容易通过谷歌搜索的问题。假设 BIOS 已从指定设备加载了我的引导加载程序,我现在如何找出它是哪个设备,以便我可以将操作系统的其余部分加载到 RAM 中?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我再次有一个不太容易通过谷歌搜索的问题。假设 BIOS 已从指定设备加载了我的引导加载程序,我现在如何找出它是哪个设备,以便我可以将操作系统的其余部分加载到 RAM 中?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
如果它是 MBR bootstrap (也可能是其他情况?我不是 100% 确定)
DL
将包含驱动器号,即您可以执行类似的操作(替换您自己的内存布局等):
If it's MBR bootstrap (And possibly also otherwise? I'm not 100% sure)
DL
will containthe drive number i.e. you can do something like this (substitute your own memory layout and so on):
实际上有固件和引导程序之间的完整协议位于#0扇区。但是,正如您所看到的,其中大部分仅存在于标准文档的页面中,而不是现实中。实际上,当以旧的 PC/AT 和 PC98 方式启动时,人们使用 DL 作为固件驱动器号,并使用 BIOS 参数块(或者,更不优选,使用某种形式的专业工具维护的“嵌入式块列表”)用于确定驱动器中卷的位置。
当然,如果您以新的方式(至少是 x86 PC 世界)进行引导,那么 事情有很大不同。操作系统引导加载程序是引导管理器菜单上的一个条目,引导管理器菜单条目具有一个参数系统,这些参数在运行时由引导管理器传递给加载程序。参数之一是引导卷的位置,操作系统引导加载程序使用该位置来查找操作系统文件。事实上,Windows NT 长期以来就是这样工作的。
There's actually a whole protocol between the firmware and the bootstrap program in sector #0. As you can see, however, most of it exists only in the pages of standards documents and not in reality. In reality, when booting in the old PC/AT and PC98 way one uses
DL
for the firmware drive number and uses the "hidden sectors" field in the BIOS Parameter Block (or, far less preferably, an "embedded block list" maintained with some form of specialist tool) for the location of the volume within the drive.If one is bootstrapping in the new (to the x86 PC world at least) way, of course, then things are a lot different. The operating system boot loader is an entry on the boot manager menu, and boot manager menu entries have a system of parameters, that are passed to the loader programs by the boot manager when they are run. One of the parameters is the location of the boot volume, which the operating system boot loader uses to find the operating system files. This is how Windows NT has worked for a long time, in fact.