使用 BIOS 中断 0x15 函数 0xE820 获取内存映射
Getting a memory map using BIOS interrupt 0x15 Function 0xE820
我看过 this 关于内存的教程,我有一个问题。我注意到使用 BIOS INT 0x15 函数 0xE820 获取内存映射的代码检查列表是否为一个条目长。我想知道为什么列表应该是一个条目长。我知道有些 BIOS 不支持此中断,但是否足以检查 EAX = SMAP?
我将这个问题通过电子邮件发送给了本杰明大卫伦特,他回复道:
There has been a lot of discussion in the past on alt.os.development
about this exact subject.
Even some tests have been performed to see if that test is sufficient.
Come to find out, there are some bugs in some BIOS' that you cannot
rely on that test.
Lately, most BIOS manufactures write code that will work for Windows
or Linux and its variations. If it works for those platforms, they
don't do anymore tests. If Windows, for example, only checks EBX for
zero, then they don't even bother making EAX = SMAP.
Therefore, you should test for all conditions so that it works on all
BIOS'.
我看过 this 关于内存的教程,我有一个问题。我注意到使用 BIOS INT 0x15 函数 0xE820 获取内存映射的代码检查列表是否为一个条目长。我想知道为什么列表应该是一个条目长。我知道有些 BIOS 不支持此中断,但是否足以检查 EAX = SMAP?
我将这个问题通过电子邮件发送给了本杰明大卫伦特,他回复道:
There has been a lot of discussion in the past on alt.os.development about this exact subject.
Even some tests have been performed to see if that test is sufficient.
Come to find out, there are some bugs in some BIOS' that you cannot rely on that test.
Lately, most BIOS manufactures write code that will work for Windows or Linux and its variations. If it works for those platforms, they don't do anymore tests. If Windows, for example, only checks EBX for zero, then they don't even bother making EAX = SMAP.
Therefore, you should test for all conditions so that it works on all BIOS'.