Re: [問題] dos為何要有記憶體配置的中斷指令?

看板Programming作者時間18年前 (2007/04/14 00:01), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串20/24 (看更多)
> ==>發信人: jeunder.bbs@ptt.cc (), 信區: programming > http://www.ctyme.com/intr/rb-2980.htm > DOS 2+ internal - SET CURRENT PROCESS ID (SET PSP ADDRESS) > AH = 50h > BX = segment of PSP for new process > Notes: DOS uses the current PSP address to determine which processes own > files and memory; it corresponds to process identifiers used by other OSs. > Under DOS 2.x, this function cannot be invoked inside an INT 28h handler > without setting the Critical Error flag. Under MS-DOS 3.0+ and DR DOS 3.41+, > this function does not use any of the DOS-internal stacks and may thus be > called at any time, even during another INT 21h call. Some Microsoft > applications such as Quick C 2.51 use segments of 0000h and FFFFh and direct > access to the SDA (see #01687 at AX=5D06h) to test whether they are running > under MS-DOS rather than a compatible OS; although one should only call this > function with valid PSP addresses, any program hooking it should be prepared > to handle invalid addresses. This function is supported by the OS/2 > compatibility box. This call was undocumented prior to the release of DOS 5.0 > See Also: AH=26h - AH=51h - AH=62h > Category: DOS Kernel - Int 21h - D =============================================== MS-DOS 1.0 是 CP/M 80 的 8086 clone 版, CP/M-80 原先是用 PL/M 高階語言 寫的, 8086 CPU 出來後, 高階語言沒有那麼快出來, 所以 IBM 找了當時代理微 電腦所有高階語言軟體銷售的 MicroSoft 希望儘快完成 OS , 而 MS-DOS 1.0 版就是用了反組譯的 CP/M-80 再用 8086 相當於 8080 指令同功能的一部份指令 做替代, 在 16bit 的 CPU 上只沿用 8bit 部份做模擬(現在較流行的術語), 用 8086 組語就比 Digital Research 早一步做出了 CP/M-80 的 8086 版. 這是一 個典型的 "以快打慢, 趁虛而入". 當時的 Digital Research 已經有 MP/M-80 , 這是 CP/M-80 的 multi-user 版, 而且與 CP/M-80 算是具有相當多的相容性(但還是不完全是, 尤其那個 ^P screen dump printing 就難隔離老式 CP/M-80 程式), DR 後來推出單用戶版的 Concurrent CP/M (CCP/M , 宏碁最早外銷 PC 用的 OS , 使用指令式多視窗) 與 MS-DOS 競爭. MS-DOS 2.0 當時最大的改變是使用 UNIX 的 Tree Directory file 但仍與 V1.0 CP/M-86 相容, 同時去做了 Xenix OS. 因為 MS-DOS 本來就來自於 CP/M , 所以 PSP (program segment prefix, 這是 MS 另起的名稱)就沿用了大部份的功能, 但 MP/M 在此區塊做的記號是 user number , 所以就用每個載入程式的 segment 做區分, 而 segment 的用法就是原 先 8080/85 時代 Bank Memory (MP/M 在 8085/Z80 CPU 使用的擴大記憶體方法, 每個 user 獨立使用一個 Bank, Bank2 就相當於 segment prefix 2000) 的改良 版. 在沒有網路時代的 PC , 每個 user 就是每個 user program 也就是每個 user process , 而每個 User Program 確實也是由 command.com 這個 CLI (CP/M 稱為 CCP)載入程式執行(這是通稱的 Process, A Running Program)而來. 但 DOS 與 Concurrent DOS (CCP/M 對 DOS File System 相容的 DR OS) 兩者的最大不同就是 一個是沒有 Multi-Process 能力, 一個有. 只是沒有的那個就說是 Single Process Seriously Operation . 很多多工作業系統, 事實上是先於 MS-DOS , 在多工下早就使用 Process 這個 稱呼, 而 Process 執行時不只要佔據記憶體還得能分配得到 CPU 執行, 為了在 Single Processor 與 Multi-Processor 的機器都能一致解釋與應用(就是 Hardware Abstraction), 甚至捨棄 Task 而改用 Process , 而 Process 含有 VM 的 Virtual Processor 概念, 是會有 Processor 去照顧的. 如果要說 PC 用的 DOS 有 Process 的概念與實質的會是 Concurrent DOS ,若 說純原始的 MS-DOS 就會有誤解. Win3.1 跟 C-DOS/386 比較起來, Window 的勝出其實是很謹慎的處理使用者喜 歡 Graphic Display 及很多 AP 不經 OS 直接使用顯示卡(Game)這個事實. 由於 DR 的 MP/M CCP/M C-DOS 跨不過讓顯示需求與 Real Mode I/O 持續相容的難題, 就被 該衝就衝(CP/M-86), 該縮就縮(Win3.1)的 MicroSoft 給端了. MicroSoft 在 Multi -Process 的概念與應用上也是很謹慎的在區隔傳統主機上 Multi-Processing 的差 異, 為了就是不要引起過度的預期, 以免有不愉快的使用經驗. MS-DOS 2.X 時代, 如果 MS 猛宣揚保證是跟傳統單用戶程式能相容又能有多工效率, 那大概被 UNIX 給 端了(因為 UNIX 下少有單用戶的 AP 軟體, 不會有那種難替所有 AP 善後的麻煩). ====== MS-DOS 是 Single User , Single Process , Single Thread 的系統,早就發展 出 user space multiple thtreads 的 Micro-Kernel 概念啦. 這樣說能被接受嗎 ? -- ◎ Origin: 中央松濤站□bbs.csie.ncu.edu.tw From: 140.115.6.234

04/14 08:23, , 1F
又來了,講不出道理,就開始背歷史..
04/14 08:23, 1F

04/15 00:09, , 2F
他幾時講的出道理過...
04/15 00:09, 2F
文章代碼(AID): #1681c-00 (Programming)
討論串 (同標題文章)
完整討論串 (本文為第 20 之 24 篇):
文章代碼(AID): #1681c-00 (Programming)