Board logo

标题: XMS分配大于64M问题 [打印本页]

作者: byxyk     时间: 2007-6-19 21:40    标题: XMS分配大于64M问题
如何使XMS分配大于64M空间?XMS3.0规范吗?具体调用格式是怎样的?
有知道的同志,请不吝指教!

作者: xuxuezeng     时间: 2007-6-25 12:12
我也想知道,但是好像没发现哟!

作者: duanml     时间: 2007-6-25 17:02
什么意思啊?

我在1998年的时候,将老机器的内存从16M扩到80M的时候,用dos622的himem.sys只能分配到64M,但是用win98(4.10.1998)的himem.sys就能分配到80M了。

作者: johnsonlam     时间: 2007-6-26 16:35    标题: 答 案

因 為 問 題 沒 有 說 甚 麼 語 言 , 我 假 設 是 在 談 匯 編 , 因 為 在 C 或 JAVA 環 境 下 要 向 系 統 分 配 64MB XMS 記 憶 應 該 挺 輕 鬆 的 , 匯 編 得 向 Jack Ellis 兄 詢 問 解 決 辦 法 :

Yes, they must load a V3.0 XMS manager, e.g. QHIMEM or V3.10+ HIMEM (MS-DOS V6.22+). They must use the program

steps shown below --

先 要 載 入 符 合 XMS 3.0 標 準 的 管 理 程 序 , 例 如 QHIMEM 或 HIMEM V3.10 ( MS-DOS V6.22 以 上 ) , 然 後 --

A) Find the "entry point" address of the XMS manager: ( 找 XMS 管 理 員 的 "進 入 地 址" )

XEnt: dd 0 ;XMS "entry address" holder. ( XMS "進 入 地 址" 儲 存 )
...
...
...

mov ax,04300h ;Inquire if we have an XMS manager. ( 有 沒 有 XMS 管 理 員 呢 ? )
int 02Fh
cmp al,080h ;Is an XMS manager installed? ( XMS 管 理 員 載 入 了 嗎 ? )
jne NoXMSDvr ;No? Take appropriate error action. ( 沒 有 就 宣 告 錯 誤 )
mov ax,04310h ;Get XMS manager "entry" address. ( 取 得 XMS 管 理 員 進 入 地 址 )
int 02Fh
push es ;Save XMS manager "entry" address ( 儲 存 起 "進 入 地 址" )
push bx ; in "XEnt" 32-bit word, above. ( 對 應 "XEnt" 32bit 字 組 )
pop XEnt

B) Ask the XMS manager for the desired XMS memory: ( 向 XMS 管 理 員 索 取 記 憶 體 )

mov ah,089h ;MUST use 089h (not 009h) for > 64-MB! ( 大 於 64MB 一 定 要 使 用 089h )
mov edx,MemKB ;MUST use EDX-reg. (not DX-reg.) for
; memory, which is number of KBytes. ( 一 定 要 使 用 EDX 暫 存 器 , 使 用 KBytes 為 單 位 )
call XEnt ;Call XMS manager with this request. ( 呼 叫 XMS 管 理 員 並 送 出 要 求 )
cmp ax,1 ;Did XMS manager return 1 = success? ( XMS 管 理 員 回 覆 1 嗎 ? 1 就 是 成 功 )
jne NoXMSMem ;No? Take appropriage error action. ( 宣 告 錯 誤 )


From then on, the steps to "lock" and use the XMS memory are the same
as for a V2.0 XMS manager and for using XMS memory blocks of 64-MB or
less. The IMPORTANT items are that the XMS "function code" used to
request over 64-MB of memory must be 089h (not 009h like before), and
the number of KBytes requested must be set in the 32-bit EDX register
(not the 16-bit DX register like before).

由 這 裡 開 始 , 鎖 定 64MB 以 下 的 XMS 記 憶 步 驟 和 XMS 2.0 是 一 樣 的 。

重 點 是 要 求 64MB 以 上 的 XMS 的 "功 能 號" 必 需 是 089h ( 並 非 一 般 的 009h ) , 並 必 需 將 正 確 的 KByte 數 字 設 定 在 32bit 的 EDX 暫 存 器 內 而 並 非 是 用 16bit 的 DX 暫 存 器 )

作者: byxyk     时间: 2007-6-28 20:20
谢谢johnsonlam。

作者: kinglin     时间: 2007-7-3 11:51
帮顶