source AT alumni.cis:~/source/ Windows 掛點的主要來源是 driver 爛掉,或是記憶體 CRC 錯誤,這是由錯誤回報所得到的資訊。在 x86 上,效能並非問題,主要著重在系統穩定和安全性,所以 Windows 大量依賴 [[wp>Managed code]]。引述自 [[wp>Daniel A. Reed (computer scientist)|Daniel Reed]] ====== 設置環境 ====== - 符合要求之後,即可從 [[http://www.microsoft.com/education/facultyconnection/articles/articledetails.aspx?cid=2200&c1=en-us&c2=0|Suggested Resources for Operating Systems using Windows]] 下載 Windows Research Kernel v1.2。解壓後,執行 WRKCopy 會將目錄拷貝到 C:\WRK-v1.2。請先閱讀 Getting Started with WRK。開啟命令行輸入, cd C:\WRK-v1.2 Build.bat # C:\WRK-v1.2\base\ntos\BUILD\EXE\wrkx86.exe 即為內核 - 點選 [[http://www.microsoft.com/education/facultyconnection/articles/articledetails.aspx?cid=2200&c1=en-us&c2=0|Suggested Resources for Operating Systems using Windows]] 中的 Operating Systems Resource Kit,下載 Win2k3SP1 映像檔 (WRK)。 - 安裝 [[http://www.microsoft.com/taiwan/windows/virtual-pc/default.aspx|Virtual PC]] 或是 VMWare。載入 Win2k3SP1 映像檔 (WRK)。 注意! Windows Virtual PC 是後來透過更新內建在 Win 7 的虛擬機,它和 Virtual PC 2007 互斥。建議用 Virtual PC 2007。 * [[http://www.goodman-lai.idv.tw/2010/01/windows-xp-mode.html|Windows XP Mode安裝過程詳述]] * [[http://dotnetframework.blogspot.com/2010/01/windows-7-virtual-pc-2007-sp1.html|在windows 7 上安裝Virtual PC 2007 SP1]] * [[http://earthli.com/news/view_article.php?id=2736|How to convert a Virtual PC 2007 VMC file to work with Hyper-V]] * [[http://chenweichi.blogspot.tw/2012/01/hyper-v-hyper-v_16.html|邁向Hyper-V之路系列 (七) Hyper-V管理工具介紹及總結]] * [[http://www.microsoft.com/visualstudio/cht/products/visual-studio-express-for-windows-8|Visual Studio Express 2012 for Windows 8]] ====== 偵錯 ====== - 下載 [[wp>WinDbg]]。 - 虛擬機將 COM1 設為 \\.\pipe\debug,WinDbg 也是同樣設定。 請參考 [[http://www.books.com.tw/exep/prod/china/chinafile.php?item=CN10412141|Windows內核原理與實現 - 附錄 A]]。 [[http://support.microsoft.com/kb/2413970/zh-tw|一點通 - 如何在 Windows 7 的 Virtual PC 中啟用整合功能]] * [[http://kyletso.pixnet.net/blog/post/27121677|Windows Research Kernel (WRK) v1.2 編譯及安裝]] * [[http://blog.csdn.net/saict/article/details/3557103|初窥Windows内核——学习Windows Research Kernel手记(一) ]] * [[http://blogimg.chinaunix.net/blog/upfile2/080218141316.pdf|Windows Research Kernel Source overview & project]] * [[http://blog.csdn.net/panaimin|潘爱民的专栏]] ====== 概觀 ====== Windows 將系統中各項資源視為對象 (object),這較 Linux 將裝置視為文件的概念更為廣泛。[[http://www.longene.org/techdoc/0062506001224576605.html|漫谈兼容内核之二: 关于kernel-win32的对象管理]] 一文中提及若是要將 Windows 嫁接至 Linux 內核上,需要替每一個 Windows 進程維護一個打開對象表,此表中除了包含該進程打開的文件以外,還包含其它資源。此外,由於 Windows 進程和線程與其底下 Linux 對應物有所不同,必須在 Linux ''struct task_struct'' 附加一些資料結構。 Windows 內核由上至下分別為: 執行體、微內核和 HAL。 * [[http://www.longene.org/techdoc/0453131001224576519.html|漫谈兼容内核之一: ReactOS怎样实现系统调用]] 中可以看出 Windows 如何透過中斷向量表實現支援多個子系統,如: Windows、OS2 和 Posix。 * [[http://technet.microsoft.com/en-us/library/bb656290.aspx|UNIX Custom Application Migration Guide]] * [[wp>Interix]] * [[http://stephesblog.blogs.com/papers/usenix-interix.pdf|INTERIX: UNIX Application Portability to Windows NT via an Alternative Environment Subsystem]] ===== 系統呼叫 ===== * [[wp>Windows API]] ===== 創建進程 ===== [[http://www.longene.org/techdoc/0625005001224576737.html|漫谈兼容内核之十: Windows的进程创建和映像装入]] ====== 分層 ====== * [[wp>Graphics Device Interface]] * [[wp>Microsoft Windows library files]] ====== Registry ====== * [[wp>Windows Registry]] ====== WOW ====== * [[wp>WoW64]] * [[http://www.dotblogs.com.tw/jimmyyu/archive/2009/07/05/9128.aspx|WOW64的介紹]] * [[http://blog.miniasp.com/post/2009/05/13/How-to-install-32-bit-DLL-into-Windows-64-bit-WOW64.aspx|如何將32位元的DLL安裝到64位元的Windows中 (WoW64)]] * [[http://zachsaw.blogspot.tw/2010/11/wow64-bug-getthreadcontext-may-return.html|WOW64 bug: GetThreadContext() may return stale contents]] * [[http://blogs.msdn.com/b/craigmcmurtry/archive/2004/12/14/301155.aspx|64-Bit Windows Part 11: Windows On Windows 64]] ====== MS-DOS ====== * [[wp>MS-DOS API]] * 用軟中斷做系統調用。 ====== 術語 ====== * [[http://msdn.microsoft.com/en-us/library/windows/desktop/ms681951(v=vs.85).aspx|Asyncroneus Procedure Call (APC)]] * [[http://msdn.microsoft.com/en-us/library/windows/desktop/ms680657(v=vs.85).aspx|Structured Exception Handling (SEH)]] * [[http://www.longene.org/techdoc/0031255001224576939.html|Windows的结构化异常处理(一)]] * [[wp>Object Manager (Windows)]] * 在 Windows 中,所有資源基本上被視作物件 (object) 進行管理。 * [[http://stackoverflow.com/questions/902967/what-is-a-windows-handle|What is a Windows Handle?]] * [[wp>Windows Registry]] * [[wp>Virtual DOS machine|Virtual DOS machine (ntvdm.exe)]] * [[wp>Windows Driver Kit|Windows Driver Kit (Windows DDK)]] * [[wp>Client/Server Runtime Subsystem|Client/Server Runtime Subsystem (csrss.exe)]] ====== 外部連結 ====== * [[http://www.microsoft.com/resources/sharedsource/windowsacademic/researchkernelkit.mspx|Windows Research Kernel]] * [[http://www.microsoft.com/education/facultyconnection/articles/articledetails.aspx?cid=2200&c1=en-us&c2=0|Suggested Resources for Operating Systems using Windows]] * 寄信至 compsci@microsoft.com 詢問是否符合資格。 * [[http://www.books.com.tw/exep/prod/china/chinafile.php?item=CN10412141|Windows內核原理與實現]] * [[http://www.phei.com.cn|电子工业出版社]] * 下載資源 * [[http://bbs.nsysu.edu.tw/txtVersion/treasure/security/M.964399661.A/M.964399693.D.html|window系統下的遠程堆棧溢出 --《原理篇》]] * [[http://stud.usv.ro/~ctodosi/mwi.pdf|Windows Internals 4th]] * [[http://www.longene.org/|Linux 兼容内核]] * [[http://research.microsoft.com/en-us/events/wincore2010/default.aspx|Windows Core Workshop 2010]] * [[http://social.microsoft.com/Forums/en-US/kernel/threads|Windows Academic: Kernel]] * [[http://stackoverflow.com/questions/3743198/resources-to-help-learn-windows-kernel-development-in-an-operating-systems-class|Resources to help learn Windows kernel development in an operating systems class?]] * [[http://blog.sina.com.cn/msra|微软亚洲研究院]] * [[http://www.alex-ionescu.com/part1.pdf|Introduction to NT Internals]] * [[http://www.alex-ionescu.com/|Alex Ionescu’s Blog]] * [[http://www.google.com/url?sa=t&rct=j&q=&esrc=s&frm=1&source=web&cd=1&ved=0CGEQFjAA&url=http%3A%2F%2Fwww.csie.ncu.edu.tw%2F~hsufh%2FCOURSES%2FSPRING2008%2FWindows_6_1.ppt&ei=E8LAT9LuE6eJmQW3hMjUCw&usg=AFQjCNEH5HTEBAQb-qRYxhNZrHQoBZ-Umg&sig2=QqXLmY77qAWPozB-QOO9-g|Process Internals]] * [[wp>ReactOS]] * [[http://www.dcl.hpi.uni-potsdam.de/research/WRK/index.html|Windows Research Kernel @ HPI]]