如何在x86_64的输入64位模式 [英] How to enter 64-bit mode on a x86_64

查看:238
本文介绍了如何在x86_64的输入64位模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现装配在XV6一个不错位 https://开头的github .COM / chrisdew / XV6 / BLOB /主/ bootasm.S 这说明我如何从16位到32位保护模式移动。

I've found a nice bit of assembly in xv6 https://github.com/chrisdew/xv6/blob/master/bootasm.S which shows me how to move from 16 bit to 32 bit protected mode.

有谁知道进入64位模式类似的例子吗? (通过或不使用32位模式。)

Does anyone know of a similar example for entering the 64-bit mode? (Either through or without using 32 bit mode.)

推荐答案

为了使64位的能力了,你必须将CPU切换到长模式。

In order to enable 64 bit capabillities, you must switch the CPU to Long Mode.

要在6​​4位x86处理器进入长模式(X86-64):

To enter Long Mode on a 64-bit x86 processor (x86-64):

If paging is enabled, disable paging.
If CR4.PAE is not already set, set it.
Set IA32_EFER.LME = 1.
Load CR3 with a valid PML4 table.
Enable paging.
At this point you will be in compatibility mode. A far jump may be executed to switch to long mode. However, the offset must not exceed 32-bit.

这篇关于如何在x86_64的输入64位模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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