中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » 有人能给一个关于内存探测(int15h,e820)的源码吗?
作者:
标题: 有人能给一个关于内存探测(int15h,e820)的源码吗? 上一主题 | 下一主题
clker
新手上路





积分 8
发帖 3
注册 2008-1-15
状态 离线
『楼 主』:  有人能给一个关于内存探测(int15h,e820)的源码吗? 使用 LLM 解释/回答一下

rt


2008-1-21 17:56
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
clker
新手上路





积分 8
发帖 3
注册 2008-1-15
状态 离线
『第 2 楼』:   使用 LLM 解释/回答一下

在dos下好像没有这样的程序哦。mem.exe好像不能显示3G以上内存。grub下的displaymem可以的。


2008-1-21 17:57
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
AlexZhang
系统支持





积分 995
发帖 427
注册 2007-2-8
状态 离线
『第 3 楼』:   使用 LLM 解释/回答一下

grub是开源的
自己去sf之类的地方找吧


2008-1-21 20:05
查看资料  访问主页  发短消息  网志   编辑帖子  回复  引用回复
CrispH
初级用户





积分 108
发帖 49
注册 2007-3-9
状态 离线
『第 4 楼』:   使用 LLM 解释/回答一下

E820 的源代码? 什么意思啊? 不明白?
你是要查看系统的 E820 表吗?


2008-2-18 18:26
查看资料  发短消息  网志   编辑帖子  回复  引用回复
zyl910
中级用户





积分 282
发帖 126
注册 2006-5-17
状态 离线
『第 5 楼』:   使用 LLM 解释/回答一下

INT 15 - newer BIOSes - GET SYSTEM MEMORY MAP
AX = E820h
EAX = 0000E820h
EDX = 534D4150h ('SMAP')
EBX = continuation value or 00000000h to start at beginning of map
ECX = size of buffer for result, in bytes (should be >= 20 bytes)
ES:DI -> buffer for result (see #00581)
Return: CF clear if successful
EAX = 534D4150h ('SMAP')
ES:DI buffer filled
EBX = next offset from which to copy or 00000000h if all done
ECX = actual length returned in bytes
CF set on error
AH = error code (86h) (see #00496 at INT 15/AH=80h)
Notes: originally introduced with the Phoenix BIOS v4.0, this function is
now supported by most newer BIOSes, since various versions of Windows
call it to find out about the system memory
a maximum of 20 bytes will be transferred at one time, even if ECX is
higher; some BIOSes (e.g. Award Modular BIOS v4.50PG) ignore the
value of ECX on entry, and always copy 20 bytes
some BIOSes expect the high word of EAX to be clear on entry, i.e.
EAX=0000E820h
if this function is not supported, an application should fall back
to AX=E802h, AX=E801h, and then AH=88h
the BIOS is permitted to return a nonzero continuation value in EBX
and indicate that the end of the list has already been reached by
returning with CF set on the next iteration
this function will return base memory and ISA/PCI memory contiguous
with base memory as normal memory ranges; it will indicate
chipset-defined address holes which are not in use and motherboard
memory-mapped devices, and all occurrences of the system BIOS as
reserved; standard PC address ranges will not be reported
SeeAlso: AH=C7h,AX=E801h"Phoenix",AX=E881h,MEM xxxxh:xxx0h"ACPI"

Format of Phoenix BIOS system memory map address range descriptor:
Offset Size Description (Table 00580)
00h QWORD base address
08h QWORD length in bytes
10h DWORD type of address range (see #00581)

(Table 00581)
Values for System Memory Map address type:
01h memory, available to OS
02h reserved, not available (e.g. system ROM, memory-mapped device)
03h ACPI Reclaim Memory (usable by OS after reading ACPI tables)
04h ACPI NVS Memory (OS is required to save this memory between NVS
sessions)
other not defined yet -- treat as Reserved
SeeAlso: #00580




人类存在的目的就是试图理解人类为何存在
2008-2-19 12:34
查看资料  发送邮件  访问主页  发短消息  网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: