I'm disassembling a bit of code and I came across:
我正在拆解一些代码,我遇到了:
mov eax, cr3
mov cr3, eax
What is the function of those lines?
这些线的功能是什么?
This is x86 low-level (bios/firmware/before boot loader) initialization code. We haven't even setup up caches yet.
这是x86低级别(bios / firmware /引导加载程序之前)初始化代码。我们还没有设置缓存。
1 个解决方案
#1
It is flushing the TLBs (Translation Lookaside Buffers) by loading cr3 with itself.
它通过加载cr3自身来刷新TLB(Translation Lookaside Buffers)。
Intel even mentions the code in their "Intel 64 and IA-32 Architectures Software Develoment Manual Volume 3A - System Programming Guide".
英特尔甚至在“Intel 64和IA-32架构软件开发手册第3A卷 - 系统编程指南”中提到了这些代码。
mov EAX,CR3 ; invalidate the TLB
mov CR3,EAX ; by copying CR3 to itself
You can find that and many more handy manuals at:
您可以在以下位置找到该手册以及更多便捷手册:
#1
It is flushing the TLBs (Translation Lookaside Buffers) by loading cr3 with itself.
它通过加载cr3自身来刷新TLB(Translation Lookaside Buffers)。
Intel even mentions the code in their "Intel 64 and IA-32 Architectures Software Develoment Manual Volume 3A - System Programming Guide".
英特尔甚至在“Intel 64和IA-32架构软件开发手册第3A卷 - 系统编程指南”中提到了这些代码。
mov EAX,CR3 ; invalidate the TLB
mov CR3,EAX ; by copying CR3 to itself
You can find that and many more handy manuals at:
您可以在以下位置找到该手册以及更多便捷手册: