简体   繁体   English

XSetgv在我的裸机软件中崩溃

[英]XSetgv crashes in my bare metal software

I am developing a bare metal program. 我正在开发一个裸机程序。 The platform is x86, 32 bit, protected mode, I am at ring 0. I would like to enable AVX by using xsetgv instruction. 平台是x86,32位,保护模式,我在环0上。我想使用xsetgv指令启用AVX。 18th bit of CR4 is 1, if I use xgetgv then nothing wrong happens, but the xsetgv crashes (the virtualbox reports fatal error). CR4的第18位为1,如果我使用xgetgv,则不会发生任何错误,但是xsetgv会崩溃(virtualbox报告致命错误)。 The problematic code is the following: 有问题的代码如下:

mov ecx, 0
mov eax, 0x7
mov edx, 0
xsetbv

What is the problem? 问题是什么?

问题出在虚假的虚拟盒子上,我的代码在真正的硬件和最新的虚拟盒子上都可以很好地工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM