GRUB会切换到保护模式吗? [英] Does GRUB switch to protected mode?

查看:198
本文介绍了GRUB会切换到保护模式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问的是,是GRUB在引导过程中将CPU切换到保护模式还是Linux内核做到了这一点.我还要问-内核本身(vmlinuz)是ELF还是纯二进制格式?谢谢.

I would like to ask if it is GRUB that switch the CPU to protected mode during boot up or is it the Linux kernel that does it. And also I would like to ask - is the kernel itself (vmlinuz) an ELF or is it plain binary format? Thanks.

推荐答案

GRUB 确实将您置于保护模式.

GRUB does drop you in protected mode.

GRUB Multiboot规范(0.6.96版) 3.2节告诉您这一点

The GRUB Multiboot Specification (version 0.6.96) Section 3.2 tells you this

"CR0"

‘CR0’

位31(PG)必须清除.必须设置位0(PE).其他位均未定义.

Bit 31 (PG) must be cleared. Bit 0 (PE) must be set. Other bits are all undefined.

CR0寄存器映射告诉您系统应该 >处于保护模式.

And CR0 Register mapping tells you that the system should be in protected mode.

Linux不是多启动内核,并且不依赖某些引导加载程序来切换PM,它遵循

Linux is not a multiboot kernel and does not rely on some bootloader for switching in the PM, it follows the Linux Boot Protocol. But linux does the protected mode switch itself, and does not rely in the bootloader

检查: http://lxr.linux .no/#linux + v2.6.39/arch/x86/boot/main.c

此处调用go_to_protected_mode();,然后调用protected_mode_jump (),然后执行CR0内容(将位设置为0)

Here it calls go_to_protected_mode(); when then calls protected_mode_jump () which then does the CR0 stuff (sets the bit 0)

(另一位表示已禁用分页)

(The other bit says that paging is disabled)

编辑

我能弄清楚的是 GRUB可以检测到Linux引导协议(GRUB2,也应该是legacy),并将linux加载到内存中,但是切换到保护模式.看一下此链接: http://www.gnu.org/软件/grub/manual/grub.html#GNU_002fLinux 和此链接中页面的第16节.

What i can figure out is that GRUB can detect linux boot protocol (GRUB2, and legacy should also) and loads linux on memory, but does not switch to protected mode. Have a look at this link: http://www.gnu.org/software/grub/manual/grub.html#GNU_002fLinux and section 16 of the page in this link.

这篇关于GRUB会切换到保护模式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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