<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-34652574</id><updated>2026-08-14T00:12:54.160-07:00</updated><category term="IA32 相關基礎知識"/><category term="EFI BIOS相關知識"/><category term="BIOS相關"/><category term="Windows 程式相關"/><category term="軟體工具"/><category term="一些筆記"/><category term="C 語言相關知識"/><category term="其它"/><category term="BIOS 開發"/><category term="組合語言Assembly"/><category term="心情分享"/><category term="AD"/><category term="EDK2"/><category term="EFI教學"/><category term="分享"/><category term="網路遊戲"/><category term="EDKII"/><category term="思念"/><category term="攝影"/><category term="生活運用"/><category term="音樂分享"/><category term="音樂歌詞"/><title type='text'>小華的部落格</title><subtitle type='html'>將自己踏入BIOS領域中所學習到的知識做一些心得整理，像是Legacy BIOS、EFI BIOS、Windows Driver...etc.&#xa;&#xa;※版權與智慧財產權聲明:保留所有法律權利。我在寫文章時如果有引用到其他人的地方我會盡量說明參考出處，如果有遺漏的地方請告訴我，我會馬上註明! 而轉貼我的文章時也請您註明出處!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>179</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-34652574.post-5562615426305851393</id><published>2025-05-25T22:38:00.000-07:00</published><updated>2025-05-25T22:39:01.914-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BIOS 開發"/><category scheme="http://www.blogger.com/atom/ns#" term="BIOS相關"/><category scheme="http://www.blogger.com/atom/ns#" term="EDK2"/><title type='text'>Dump TCG log</title><content type='html'>&lt;p&gt;Dump TCG log&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; 一個簡易的方式在UEFI Shell底下，先找到TPM2 的ACPI Table ,再從Table中找到紀錄TCG log的記憶體位址(一般UEFI PCD目前都是設定0x10000 大小，但進入OS後，OS有可能會加大這塊的內容) ，然後分析TCG log中的每一筆紀錄的Event , 然後重新計算Digest ，這樣子可以呈現出BIOS交給OS前，TCG log中所記錄的TPM PCR可能的值會是甚麼. 底下是部分實作的程式碼，幫助大家了解流程.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Loop through all ACPI tables to find TPM2&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Status = GetAcpiTableBySignature(SIGNATURE_32(&#39;T&#39;,&#39;P&#39;,&#39;M&#39;,&#39;2&#39;), &amp;amp;Table);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tpm2Table =&amp;nbsp; (EFI_TPM2_ACPI_TABLE_V4 *) Table;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Tpm2Table == NULL) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;[Fail] TPM2 ACPI Table not found\n&quot;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return EFI_NOT_FOUND;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;TPM2 ACPI Table found\n&quot;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;Event Log Start Address: 0x%lx\n&quot;, Tpm2Table-&amp;gt;Lasa);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;Event Log Length: %u bytes\n&quot;, Tpm2Table-&amp;gt;Laml);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;******** TCG Log Dump ******** \n&quot;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PrintHexAndAscii((UINT8 *) Tpm2Table-&amp;gt;Lasa, (UINTN) Tpm2Table-&amp;gt;Laml); // Print partial event data&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;******** TCG Events ******** \n&quot;);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 儲存 PCR0 到 PCR23 的最後 Digest&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PCRDigest PcrDigests[PCR_COUNT];&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ZeroMem(PcrDigests, sizeof(PCRDigest) * PCR_COUNT);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MY_ACPI_TCG2_EVENT *TcgEvent = (MY_ACPI_TCG2_EVENT *)(UINTN)Tpm2Table-&amp;gt;Lasa;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UINT8 *LogEnd = (UINT8 *)(UINTN)(Tpm2Table-&amp;gt;Lasa + Tpm2Table-&amp;gt;Laml);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UINTN EventIndex = 0;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while ((UINT8 *)TcgEvent &amp;lt; LogEnd) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UINT8 *EventStart = (UINT8 *)TcgEvent;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//TODO:&amp;nbsp; 1. 處理EV_NO_ACTION&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.CalculateDigest (CombinedData, CombinedDataSize, PcrDigests[PcrIndex].Digest, AlgId);&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;// 1.找到事件起始位置。&lt;/div&gt;&lt;div&gt;// 2.依序讀出：&lt;/div&gt;&lt;div&gt;// PCRIndex（4 bytes）&lt;/div&gt;&lt;div&gt;// EventType（4 bytes）&lt;/div&gt;&lt;div&gt;// DigestCount（4 bytes）&lt;/div&gt;&lt;div&gt;// 3.每個 Digest 結構：&lt;/div&gt;&lt;div&gt;//&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AlgorithmId（2 bytes）&lt;/div&gt;&lt;div&gt;//&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Digest（對 SHA128 而言，是 20 bytes, SHA256 而言，是 32 bytes..etc）&lt;/div&gt;&lt;div&gt;// 3.接著是 EventDataSize（4 bytes）&lt;/div&gt;&lt;div&gt;// 4.再來是 EventData&lt;/div&gt;&lt;div&gt;#pragma pack(1)&lt;/div&gt;&lt;div&gt;typedef struct {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; UINT32 PCRIndex;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 4 bytes&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; UINT32 EventType;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// 4 bytes&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; UINT32 DigestCount;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// 4 bytes&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 之後是 DigestList 和 EventData&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; UINT8&amp;nbsp; Event[];&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// 可變長度，儲存 Digest 和 EventData (參考前面說明)&lt;/div&gt;&lt;div&gt;} MY_ACPI_TCG2_EVENT;&lt;/div&gt;&lt;div&gt;#pragma pack()&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#define PCR_COUNT 24 // PCR0 到 PCR23，共 24 個 PCR&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// 儲存每個 PCR 的最後一筆 Digest&lt;/div&gt;&lt;div&gt;typedef struct {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; UINT8 Digest[64];&amp;nbsp; // 假設 Digest 最長為 64 字節 (可以根據實際需要調整)&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; UINTN DigestSize;&amp;nbsp; // Digest 大小&lt;/div&gt;&lt;div&gt;} PCRDigest;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;UINTN&lt;/div&gt;&lt;div&gt;GetHashSizeFromAlgo(&lt;/div&gt;&lt;div&gt;&amp;nbsp; IN TPMI_ALG_HASH HashAlgo&lt;/div&gt;&lt;div&gt;&amp;nbsp; )&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp; switch (HashAlgo) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; case TPM_ALG_SHA1:&amp;nbsp; &amp;nbsp;return 20;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; case TPM_ALG_SHA256: return 32;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; case TPM_ALG_SHA384: return 48;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; case TPM_ALG_SHA512: return 64;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; case TPM_ALG_SM3_256:return 32;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; default:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 0;&lt;/div&gt;&lt;div&gt;&amp;nbsp; }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// Hex + ASCII Dump&lt;/div&gt;&lt;div&gt;VOID&lt;/div&gt;&lt;div&gt;PrintHexAndAscii(IN UINT8 *Data, IN UINTN Length)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; for (UINTN i = 0; i &amp;lt; Length; i += 16) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;%08x: &quot;, i);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Print hex&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (UINTN j = 0; j &amp;lt; 16; j++) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((i + j) &amp;lt; Length) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;%02x &quot;, Data[i + j]);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;&amp;nbsp; &amp;nbsp;&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot; &quot;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Print ASCII&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (UINTN j = 0; j &amp;lt; 16; j++) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((i + j) &amp;lt; Length) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CHAR8 c = (CHAR8)Data[i + j];&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (c &amp;gt;= 0x20 &amp;amp;&amp;amp; c &amp;lt;= 0x7E) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;%c&quot;, c);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;.&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print(L&quot;\n&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// Covert to EventType string&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;CONST CHAR16* GetEventTypeString(UINT32 EventType)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; // Standard event types&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; switch (EventType) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_PREBOOT_CERT:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_PREBOOT_CERT(0x00000000)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_POST_CODE:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return L&quot;EV_POST_CODE(0x00000001)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_NO_ACTION:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return L&quot;EV_NO_ACTION(0x00000003)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_SEPARATOR:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return L&quot;EV_SEPARATOR(0x00000004)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_ACTION:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_ACTION(0x00000005)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EVENT_TAG:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return L&quot;EV_EVENT_TAG(0x00000006)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_S_CRTM_CONTENTS:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return L&quot;EV_S_CRTM_CONTENTS(0x00000007)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_S_CRTM_VERSION:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_S_CRTM_VERSION(0x00000008)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_CPU_MICROCODE:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return L&quot;EV_CPU_MICROCODE(0x00000009)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_PLATFORM_CONFIG_FLAGS:&amp;nbsp; &amp;nbsp; return L&quot;EV_PLATFORM_CONFIG_FLAGS(0x0000000A)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_TABLE_OF_DEVICES:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_TABLE_OF_DEVICES(0x0000000B)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_COMPACT_HASH:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_COMPACT_HASH(0x0000000C)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_NONHOST_CODE:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_NONHOST_CODE(0x0000000F)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_NONHOST_CONFIG:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_NONHOST_CONFIG(0x00000010)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_NONHOST_INFO:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_NONHOST_INFO(0x00000011)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_OMIT_BOOT_DEVICE_EVENTS:&amp;nbsp; return L&quot;EV_OMIT_BOOT_DEVICE_EVENTS(0x00000012)&quot;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // EFI specific event types (0x80000000 and above)&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_VARIABLE_DRIVER_CONFIG:&amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_EFI_VARIABLE_DRIVER_CONFIG(0x80000001)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_VARIABLE_BOOT:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return L&quot;EV_EFI_VARIABLE_BOOT(0x80000002)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_BOOT_SERVICES_APPLICATION:&amp;nbsp; return L&quot;EV_EFI_BOOT_SERVICES_APPLICATION(0x80000003)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_BOOT_SERVICES_DRIVER:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_EFI_BOOT_SERVICES_DRIVER(0x80000004)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_RUNTIME_SERVICES_DRIVER:&amp;nbsp; &amp;nbsp; return L&quot;EV_EFI_RUNTIME_SERVICES_DRIVER(0x80000005)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_GPT_EVENT:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return L&quot;EV_EFI_GPT_EVENT(0x80000006)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_ACTION:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_EFI_ACTION(0x80000007)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_PLATFORM_FIRMWARE_BLOB:&amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_EFI_PLATFORM_FIRMWARE_BLOB(0x80000008)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_HANDOFF_TABLES:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_EFI_HANDOFF_TABLES(0x80000009)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_PLATFORM_FIRMWARE_BLOB2:&amp;nbsp; &amp;nbsp; return L&quot;EV_EFI_PLATFORM_FIRMWARE_BLOB2(0x8000000A)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_HANDOFF_TABLES2:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return L&quot;EV_EFI_HANDOFF_TABLES2(0x8000000B)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_HCRTM_EVENT:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return L&quot;EV_EFI_HCRTM_EVENT(0x80000010)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_VARIABLE_AUTHORITY:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_EFI_VARIABLE_AUTHORITY(0x800000E0)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_SPDM_FIRMWARE_BLOB:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_EFI_SPDM_FIRMWARE_BLOB(0x800000E1)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EV_EFI_SPDM_FIRMWARE_CONFIG:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_EFI_SPDM_FIRMWARE_CONFIG(0x800000E2)&quot;;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Add&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //case EV_EFI_SPDM_DEVICE_BLOB:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_EFI_SPDM_DEVICE_BLOB(0x800000E1)&quot;; // 和 EV_EFI_SPDM_FIRMWARE_BLOB 相同&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //case EV_EFI_SPDM_DEVICE_CONFIG:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return L&quot;EV_EFI_SPDM_DEVICE_CONFIG(0x800000E2)&quot;; // 和 EV_EFI_SPDM_FIRMWARE_CONFIG 相同&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return L&quot;UNKNOWN(0x%08x)&quot;; // Unknown event type&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#pragma pack(1)&lt;/div&gt;&lt;div&gt;typedef struct {&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Refer to Tcg2Acpi.c&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; EFI_ACPI_DESCRIPTION_HEADER&amp;nbsp; &amp;nbsp; Header;&amp;nbsp; &amp;nbsp; &amp;nbsp;// &quot;TPM2&quot;&lt;/div&gt;&lt;div&gt;&amp;nbsp; // Flags field is replaced in version 4 and above&lt;/div&gt;&lt;div&gt;&amp;nbsp; //&amp;nbsp; &amp;nbsp; BIT0~15:&amp;nbsp; PlatformClass&amp;nbsp; &amp;nbsp; &amp;nbsp; This field is only valid for version 4 and above&lt;/div&gt;&lt;div&gt;&amp;nbsp; //&amp;nbsp; &amp;nbsp; BIT16~31: Reserved&lt;/div&gt;&lt;div&gt;&amp;nbsp; UINT32&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Flags;&lt;/div&gt;&lt;div&gt;&amp;nbsp; UINT64&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AddressOfControlArea;&lt;/div&gt;&lt;div&gt;&amp;nbsp; UINT32&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;StartMethod;&lt;/div&gt;&lt;div&gt;&amp;nbsp; UINT8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PlatformSpecificParameters[12]; // size up to 12&lt;/div&gt;&lt;div&gt;&amp;nbsp; UINT32&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Laml;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Optional&lt;/div&gt;&lt;div&gt;&amp;nbsp; UINT64&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Lasa;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Optional&lt;/div&gt;&lt;div&gt;} EFI_TPM2_ACPI_TABLE_V4;&lt;/div&gt;&lt;div&gt;#pragma pack()&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// Signature macro&lt;/div&gt;&lt;div&gt;//#define SIGNATURE_32(A,B,C,D)&amp;nbsp; ((UINT32)(A) | ((UINT32)(B)&amp;lt;&amp;lt;8) | ((UINT32)(C)&amp;lt;&amp;lt;16) | ((UINT32)(D)&amp;lt;&amp;lt;24))&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;EFI_STATUS&lt;/div&gt;&lt;div&gt;GetAcpiTableBySignature (&lt;/div&gt;&lt;div&gt;&amp;nbsp; IN&amp;nbsp; UINT32 Signature,&lt;/div&gt;&lt;div&gt;&amp;nbsp; OUT EFI_ACPI_DESCRIPTION_HEADER **OutTable&lt;/div&gt;&lt;div&gt;&amp;nbsp; )&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp; EFI_CONFIGURATION_TABLE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*ConfigTable = gST-&amp;gt;ConfigurationTable;&lt;/div&gt;&lt;div&gt;&amp;nbsp; EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp = NULL;&lt;/div&gt;&lt;div&gt;&amp;nbsp; EFI_ACPI_DESCRIPTION_HEADER&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*Xsdt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; UINT64&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *EntryPtr;&lt;/div&gt;&lt;div&gt;&amp;nbsp; UINTN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EntryCount;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; // Step 1: Find RSDP&lt;/div&gt;&lt;div&gt;&amp;nbsp; for (UINTN i = 0; i &amp;lt; gST-&amp;gt;NumberOfTableEntries; i++) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; if (CompareGuid(&amp;amp;ConfigTable[i].VendorGuid, &amp;amp;gEfiAcpi20TableGuid)) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Rsdp = (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *)ConfigTable[i].VendorTable;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;&amp;nbsp; }&lt;/div&gt;&lt;div&gt;&amp;nbsp; if (Rsdp == NULL) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Print(L&quot;[Error] ACPI 2.0 RSDP not found\n&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; return EFI_NOT_FOUND;&lt;/div&gt;&lt;div&gt;&amp;nbsp; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; // Step 2: Get XSDT&lt;/div&gt;&lt;div&gt;&amp;nbsp; Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)(Rsdp-&amp;gt;XsdtAddress);&lt;/div&gt;&lt;div&gt;&amp;nbsp; if (Xsdt-&amp;gt;Signature != EFI_ACPI_6_3_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Print(L&quot;[Error] XSDT Signature mismatch (found: %08X)\n&quot;, Xsdt-&amp;gt;Signature);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; return EFI_NOT_FOUND;&lt;/div&gt;&lt;div&gt;&amp;nbsp; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; // Step 3: Traverse XSDT entries&lt;/div&gt;&lt;div&gt;&amp;nbsp; EntryCount = (Xsdt-&amp;gt;Length - sizeof(EFI_ACPI_DESCRIPTION_HEADER)) / sizeof(UINT64);&lt;/div&gt;&lt;div&gt;&amp;nbsp; EntryPtr = (UINT64 *)(Xsdt + 1); // entries come right after the header&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; for (UINTN i = 0; i &amp;lt; EntryCount; i++) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; EFI_ACPI_DESCRIPTION_HEADER *Hdr = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)EntryPtr[i];&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; if (Hdr-&amp;gt;Signature == Signature) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; *OutTable = Hdr;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return EFI_SUCCESS;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;&amp;nbsp; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; return EFI_NOT_FOUND;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;EFI_STATUS&lt;/div&gt;&lt;div&gt;EFIAPI&lt;/div&gt;&lt;div&gt;CalculateDigest (&lt;/div&gt;&lt;div&gt;&amp;nbsp; IN UINT8&amp;nbsp; *Data,&lt;/div&gt;&lt;div&gt;&amp;nbsp; IN UINTN&amp;nbsp; DataSize,&lt;/div&gt;&lt;div&gt;&amp;nbsp; OUT UINT8&amp;nbsp; *Digest,&lt;/div&gt;&lt;div&gt;&amp;nbsp; IN UINT16&amp;nbsp; AlgId&lt;/div&gt;&lt;div&gt;&amp;nbsp; )&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; BOOLEAN&amp;nbsp; Status;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; if (AlgId == TPM_ALG_SHA256) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Status = Sha256HashAll (Data, DataSize, Digest);&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; } else {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 支援其他演算法&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return EFI_UNSUPPORTED;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; if (!Status) {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return EFI_DEVICE_ERROR;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; return EFI_SUCCESS;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/5562615426305851393/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/5562615426305851393' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/5562615426305851393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/5562615426305851393'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2025/05/dump-tcg-log.html' title='Dump TCG log'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-4508774175244150577</id><published>2025-01-21T00:43:00.000-08:00</published><updated>2025-01-21T00:43:03.020-08:00</updated><title type='text'></title><content type='html'>&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;祝大家蛇年新年快樂&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Penny 說我很久沒更新了，所以來更新一下~&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/4508774175244150577/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/4508774175244150577' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/4508774175244150577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/4508774175244150577'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2025/01/blog-post.html' title=''/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-9166516525434776465</id><published>2020-02-13T23:27:00.000-08:00</published><updated>2020-02-13T23:27:04.363-08:00</updated><title type='text'>Git Tag </title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
1.搜尋遠端上面的特定字串的Tag:&lt;br /&gt;
&lt;br /&gt;
C:\&amp;gt; git ls-remote --tags origin &quot;00.02.04&quot;&lt;br /&gt;
7dd870355e439cfb8a818b6cd31f3c77f2ce40dc&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refs/tags/BiosRelease/project1/00.02.04&lt;br /&gt;
88138555a49907d6935fe55a8261e226668ba770&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refs/tags/BiosRelease/MockingbirdCmlH/00.02.04&lt;br /&gt;
a98bce225711b983d729fcdb25542c6e8fdebac8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refs/tags/BiosRelease/project2/00.02.04&lt;br /&gt;
3cd9b00479436f67fef2e44955571218e80b6046&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refs/tags/BiosRelease/project3/00.02.04&lt;br /&gt;
c1286cb71e39bf869ae0d70208479c3683dd0989&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refs/tags/BiosRelease/project4/00.02.04&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2.列出遠端上的全部Tag&lt;/div&gt;
&lt;div&gt;
C:\&amp;gt; git ls-remote --tags origin&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span id=&quot;goog_1712280939&quot;&gt;&lt;/span&gt;&lt;a href=&quot;https://www.blogger.com/&quot;&gt;&lt;/a&gt;&lt;span id=&quot;goog_1712280940&quot;&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/9166516525434776465/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/9166516525434776465' title='4 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/9166516525434776465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/9166516525434776465'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2020/02/git-tag.html' title='Git Tag '/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-3957676677018189262</id><published>2019-06-12T08:27:00.000-07:00</published><updated>2019-06-12T08:27:06.020-07:00</updated><title type='text'></title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
GIT 小幫手&lt;/div&gt;
&lt;br /&gt;
1.如何知道某個CommitID是來自於哪個分支&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;git branch -a --contains 68b6100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;會繼續補充&amp;gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/3957676677018189262/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/3957676677018189262' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/3957676677018189262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/3957676677018189262'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2019/06/git-1.html' title=''/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-1267967243513344976</id><published>2019-02-20T00:40:00.001-08:00</published><updated>2019-06-17T22:54:53.441-07:00</updated><title type='text'>紀錄一下好用的Git Alias</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
紀錄一下好用的Git Alias&lt;br /&gt;
C:\Users\&amp;lt;UserName&amp;gt;\.gitconfig&lt;br /&gt;
&lt;br /&gt;
[alias]&lt;br /&gt;
lg1 = log --graph --abbrev-commit --decorate --format=format:&#39;%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)&#39; --all&lt;br /&gt;
&lt;br /&gt;
lg2 = log --graph --abbrev-commit --decorate --format=format:&#39;%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n&#39;&#39; %C(white)%s%C(reset) %C(dim white)- %an%C(reset)&#39; --all&lt;br /&gt;
&lt;br /&gt;
lg = !&quot;git lg1&quot;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
cc=&lt;span style=&quot;color: red;&quot;&gt;!&lt;/span&gt;git clean -ffd &lt;span style=&quot;color: red;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git submodule foreach --recursive git clean -fd &amp;amp;&amp;amp; git reset --hard &amp;amp;&amp;amp; git submodule foreach --recursive git reset --hard &amp;amp;&amp;amp; git submodule update --init --recursive &amp;amp;&amp;amp; git remote prune origin &amp;amp;&amp;amp;&amp;nbsp;git remote update --prune&lt;br /&gt;
&lt;br /&gt;
ccall=!git clean -ffdx &amp;amp;&amp;amp; git submodule foreach --recursive git clean -xfd &amp;amp;&amp;amp; git reset --hard &amp;amp;&amp;amp; git submodule foreach --recursive git reset --hard &amp;amp;&amp;amp; git submodule update --init --recursive &amp;amp;&amp;amp; git remote prune origin &amp;amp;&amp;amp;&amp;nbsp;git remote update --prune&lt;br /&gt;
st=!git status&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
pp=&lt;span style=&quot;color: red;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;git pull&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt; &amp;amp;&amp;amp;&amp;nbsp;&lt;/span&gt;git clean -ffd&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&amp;nbsp;git submodule foreach --recursive git clean -fd &amp;amp;&amp;amp; git reset --hard &amp;amp;&amp;amp; git submodule foreach --recursive git reset --hard &amp;amp;&amp;amp; git submodule update --init --recursive &amp;amp;&amp;amp; git remote prune origin &amp;amp;&amp;amp;&amp;nbsp;git remote update --prune&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[git version &amp;nbsp;2.22.0 and above]&lt;br /&gt;
&lt;br /&gt;
cc=!git clean -ffd &amp;amp;&amp;amp; git submodule foreach --recursive &#39;git clean -fd&#39; &amp;amp;&amp;amp; git reset --hard &amp;amp;&amp;amp; git submodule foreach --recursive &#39;git reset --hard&#39; &amp;amp;&amp;amp; git submodule update --init --recursive &amp;amp;&amp;amp; git remote prune origin &amp;amp;&amp;amp; git remote update --prune&lt;br /&gt;
&lt;br /&gt;
ccall=!git clean -ffdx &amp;amp;&amp;amp; git submodule foreach --recursive &#39;git clean -xfd&#39; &amp;amp;&amp;amp; git reset --hard &amp;amp;&amp;amp; git submodule foreach --recursive &#39;git reset --hard&#39; &amp;amp;&amp;amp; git submodule update --init --recursive &amp;amp;&amp;amp; git remote prune origin &amp;amp;&amp;amp; git remote update --prune&lt;br /&gt;
st=!git status&lt;br /&gt;
&lt;br /&gt;
pp=!git pull &amp;amp;&amp;amp; git clean -ffd &amp;amp;&amp;amp; git submodule foreach --recursive &#39;git clean -fd&#39; &amp;amp;&amp;amp; git reset --hard &amp;amp;&amp;amp; git submodule foreach --recursive &#39;git reset --hard&#39; &amp;amp;&amp;amp; git submodule update --init --recursive &amp;amp;&amp;amp; git remote prune origin &amp;amp;&amp;amp; git remote update --prune&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
-----------------------------------&lt;br /&gt;
Git Pull常遇到的問題 : error: cannot lock ref ‘xxx’: ref xxx is at&lt;br /&gt;
&lt;br /&gt;
git gc --prune=now

&lt;br /&gt;
git update-ref -d refs/remotes/origin/ccc/xxx/yyy&lt;br /&gt;
git remote update --prune&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
---------------------------------&lt;br /&gt;
搜尋Tag&lt;br /&gt;
&lt;br /&gt;
git tag -l &#39;*Loki*&#39;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/1267967243513344976/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/1267967243513344976' title='7 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/1267967243513344976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/1267967243513344976'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2019/02/git-alias.html' title='紀錄一下好用的Git Alias'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-2839159642144717042</id><published>2018-02-05T09:13:00.000-08:00</published><updated>2019-10-14T23:07:50.562-07:00</updated><title type='text'>UEFI Shell Utility - pwrtest.efi</title><content type='html'>The pwrtest.efi is an UEFI Shell tool that help developer to confirm RTC wake function from a system(Support on both Intel and AMD platform).&lt;br /&gt;
&lt;br /&gt;
最近在幫忙ODM看一個RTC Wake 問題，所以就順便寫了一個TOOL來驗證一些東西。原本遇到的問題也解決了，所以就順便把這個小TOOL分享一下給有需要的人使用。&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Usage:&lt;/u&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;pwrtest -s3 -t 10 -w 60&lt;/span&gt;&amp;nbsp; ; 系統會在10 sec delay 後進入S3，然後在60 sec 後喚醒(Wake up)&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; pwrtest [-h|-s3|-s4|-s5|-s|-ss|-sx|-cb|-r]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -h help&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -s3|-s4|-s5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ;選擇系統的Sx State (Intel platform)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -cb&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;;做coldboot ，我是透過 gRT-&amp;gt;ResetSystem()&amp;nbsp; 方式去做的&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -ss&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; 做Shutdown，我是透過 gRT-&amp;gt;ResetSystem()&amp;nbsp; 方式去做的&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -sx value&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; 支援AMD platform去做Sx State，因為填的SLP_TYP值不同.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value = 3/4/5 for AMD platform(S3/S4/S5)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value = 5/6/7 for Intel Platform (S3/S4/S5)&lt;br /&gt;
e.g,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;pwrtest -sx 4 -t 5 -w 30 &lt;/span&gt;; For AMD Platform,&amp;nbsp; Put system to S4 after 5 sec, then wake after 30 sec.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;pwrtest -sx 6 -t 5 -w 30 ;&lt;/span&gt; For INTEL Platform,&amp;nbsp; Put system to S4 after 5 sec, then wake after 30 sec.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;pwrtest -s3 -t 5 -w 30&amp;nbsp; &amp;nbsp;&lt;/span&gt; ; For INTEL Platform,&amp;nbsp; Put system to S3 after 5 sec, then wake after 30 sec.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; pwrtest -r&amp;nbsp; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;; Warm boot&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; pwrtest -cb&amp;nbsp;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ; Cold boot&lt;br /&gt;
&lt;br /&gt;
[註]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; - S3 功能只能喚醒系統，喚醒後會當機，因為我沒有支援Reset Vector(Not support)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; - 有些系統S4/S5 並不支援RTC wake up，所以請跟你們的BIOS/EC確認，因為這個工具只是去填RTC Enable bit &amp;amp; RTC Alarm interrupt而已。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Download (Password: harrison):&lt;br /&gt;
&lt;br /&gt;
version 1.1 :&amp;nbsp;&lt;a href=&quot;https://onedrive.live.com/embed?cid=CA2486E6684D363F&amp;amp;resid=CA2486E6684D363F%21517&amp;amp;authkey=AM4OKvr3SHtPPUo&quot;&gt;pwrtest&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/2839159642144717042/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/2839159642144717042' title='11 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/2839159642144717042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/2839159642144717042'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2018/02/uefi-shell-utility-pwrtestefi.html' title='UEFI Shell Utility - pwrtest.efi'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-205210715797548952</id><published>2018-01-15T22:47:00.000-08:00</published><updated>2018-01-15T22:47:09.882-08:00</updated><title type='text'>紀錄一下WinDbg裡面比較常用到的指令集</title><content type='html'>&lt;span style=&quot;font-size: x-small;&quot;&gt;AMLI裡面比較常用到的指令集&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;AMLI(? for help)-&amp;gt; ?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Help&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- ? [&amp;lt;Cmd&amp;gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Clear Breakpoints&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&lt;span style=&quot;color: blue;&quot;&gt; bc&lt;/span&gt; &amp;lt;bp list&amp;gt; | *&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Disable Breakpoints&amp;nbsp; &amp;nbsp; &amp;nbsp; - &lt;span style=&quot;color: blue;&quot;&gt;bd&lt;/span&gt; &amp;lt;bp list&amp;gt; | *&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Enable Breakpoints&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- be &amp;lt;bp list&amp;gt; | *&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;List Breakpoints&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- &lt;span style=&quot;color: blue;&quot;&gt;bl&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Set Breakpoints&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - &lt;span style=&quot;color: blue;&quot;&gt;bp&lt;/span&gt; &amp;lt;MethodName&amp;gt; | &amp;lt;CodeAddr&amp;gt; ...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Clear Event Log&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - cl&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Dump Event Log&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- &lt;span style=&quot;color: blue;&quot;&gt;dl&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Dump Object Count Table&amp;nbsp; - dc&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Dump Heap&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - dh [&amp;lt;Addr&amp;gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Dump Stack&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- ds [/v] [&amp;lt;Addr&amp;gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Dump Name Space Object&amp;nbsp; &amp;nbsp;- dns [[/s] [&amp;lt;NameStr&amp;gt; | &amp;lt;Addr&amp;gt;]]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Dump Data Object&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- do &amp;lt;Addr&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Find NameSpace Object&amp;nbsp; &amp;nbsp; - find &amp;lt;NameSeg&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Continue Execution&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- g&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Read Byte from Port&amp;nbsp; &amp;nbsp; &amp;nbsp; - i &amp;lt;Port&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Read Word from Port&amp;nbsp; &amp;nbsp; &amp;nbsp; - iw &amp;lt;Port&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Read DWord from Port&amp;nbsp; &amp;nbsp; &amp;nbsp;- id &amp;lt;Port&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;List All Contexts&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&lt;span style=&quot;color: blue;&quot;&gt; lc&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Display Nearest Method&amp;nbsp; &amp;nbsp;- &lt;span style=&quot;color: blue;&quot;&gt;ln&lt;/span&gt; [&amp;lt;MethodName&amp;gt; | &amp;lt;CodeAddr&amp;gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Notify NameSpace Object&amp;nbsp; - &lt;span style=&quot;color: blue;&quot;&gt;notify &lt;/span&gt;&amp;lt;Obj&amp;gt; &amp;lt;Value&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Write Byte to Port&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- o &amp;lt;Port&amp;gt; &amp;lt;Byte&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Write Word to Port&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- ow &amp;lt;Port&amp;gt; &amp;lt;Word&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Write DWord to Port&amp;nbsp; &amp;nbsp; &amp;nbsp; - od &amp;lt;Port&amp;gt; &amp;lt;DWord&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Step Over AML Code&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- p&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Quit to Kernel Debugger&amp;nbsp; - q&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Display Context Info.&amp;nbsp; &amp;nbsp; - &lt;span style=&quot;background-color: blue;&quot;&gt;r&lt;/span&gt; &amp;lt;Context&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Run Method&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- run &amp;lt;MethodName&amp;gt; | &amp;lt;CodeAddr&amp;gt; [&amp;lt;ArgList&amp;gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Set Debugger Options&amp;nbsp; &amp;nbsp; &amp;nbsp;- set [&lt;span style=&quot;color: blue;&quot;&gt;traceon &lt;/span&gt;| traceoff] [&lt;span style=&quot;color: blue;&quot;&gt;nesttraceon &lt;/span&gt;| nesttraceoff] [&lt;span style=&quot;color: blue;&quot;&gt;spewon &lt;/span&gt;| spewoff]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[&lt;span style=&quot;color: blue;&quot;&gt;dbgbrkon&lt;/span&gt; | dbgbrkoff] [lbrkon | lbrkoff] [errbrkon | errbrkoff]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[&lt;span style=&quot;color: blue;&quot;&gt;verboseon &lt;/span&gt;| verboseoff] [logon | logoff] [logmuton | logmutoff]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Trace Into AML Code&amp;nbsp; &amp;nbsp; &amp;nbsp; - t&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Interpreter Trace Mode&amp;nbsp; &amp;nbsp;- trace [trigon] [trigoff] [level=&amp;lt;n&amp;gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[add=&amp;lt;TrigPtStr] [zap=&amp;lt;TrigPtList&amp;gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Unassemble AML code&amp;nbsp; &amp;nbsp; &amp;nbsp; - &lt;span style=&quot;color: blue;&quot;&gt;u&lt;/span&gt; [&amp;lt;MethodName&amp;gt; | &amp;lt;CodeAddr&amp;gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;AMLI(? for help)-&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;ACPI 裡面比較常用到的指令集&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;!acpicache &lt;/span&gt;displays all of the ACPI tables cached by the hardware application layer (HAL)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;!acpiinf&lt;/span&gt; displays information on the configuration of the ACPI&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;!acpiirqarb &lt;/span&gt;displays the contents of the ACPI IRQ arbiter structure&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;!facs&lt;/span&gt; displays a Firmware ACPI Control Structure&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;!fadt &lt;/span&gt;displays a Fixed ACPI Description Table&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;!mapic&lt;/span&gt; displays an ACPI Multiple APIC Table&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;!nsobj &lt;/span&gt;displays an ACPI namespace object&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;!nstree&lt;/span&gt; displays a section of the ACPI namespace tree&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;!rsdt&lt;/span&gt; displays the ACPI Root System Description Table&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;!acpikd.help&lt;/span&gt;&amp;nbsp;&amp;nbsp;For a complete list of ACPI-related extensions.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Reference&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/acpi-debugging&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/205210715797548952/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/205210715797548952' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/205210715797548952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/205210715797548952'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2018/01/windbg.html' title='紀錄一下WinDbg裡面比較常用到的指令集'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-8336074824600576233</id><published>2018-01-10T07:38:00.003-08:00</published><updated>2018-01-10T07:38:52.730-08:00</updated><title type='text'>如何透過DevCon.exe 去開跟關你的Device Manager內的設備</title><content type='html'>&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;如何透過DevCon.exe 去開跟關你的Device Manager內的設備&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; 當你安裝WDK, Visual Studio 或是Windows SDK時，這些安裝檔裡面就會包含DevCon.exe。&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp; 我的DevCon.exe是在底下這個路徑內找到的:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;C:\Program Files (x86)\Windows Kits\10\Tools\x64\DevCon.exe&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;當然，如果你想要自己Build source code的話，你也可以從底下的路徑找到這個source code:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://github.com/Microsoft/Windows-driver-samples/tree/master/setup/devcon&quot;&gt;https://github.com/Microsoft/Windows-driver-samples/tree/master/setup/devcon&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
我自己也用VS2013 成功建構出來這個執行檔，只是有個小地方要注意，就是你build code之前，要用command prompt(Build environment)先執行底下的指令，先把msg.h 建立出來，不然你沒辦法用專案檔案去compiler , 因為會出現會找不到&lt;b&gt;msg.h&lt;/b&gt;的ERROR.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;C:\DevCon &amp;gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;mc msg.mc&lt;/span&gt;&amp;nbsp; &amp;nbsp;會產生&lt;b&gt;msg.h&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
底下就是一些基本的指令操作:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span&gt;1)先找你要開關的Device的HWID(我是存到一個文字檔慢慢找):&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;devcon&amp;nbsp;hwids&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&amp;gt; D:\hwids.txt &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span&gt;2) 使用底下指令去disable , 記得在HW ID前面加@&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;devcon&amp;nbsp;/r&amp;nbsp;disable&lt;/span&gt;&amp;nbsp;&quot;&lt;span style=&quot;color: red;&quot;&gt;@&lt;/span&gt;ACPI\DELL0812\3&amp;amp;31FF937C&amp;amp;0&quot;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
3) 使用底下指令去enable, 記得在HW ID前面加&lt;span style=&quot;color: red;&quot;&gt;@，然後HWID要用&quot; &quot;包起來.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;devcon&amp;nbsp;/r&amp;nbsp;enable&lt;/span&gt; &quot;&lt;span style=&quot;color: red;&quot;&gt;@&lt;/span&gt;ACPI\DELL0812\3&amp;amp;31FF937C&amp;amp;0&quot;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
4) 使用底下指令去重新scan hardware&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;devcon rescan&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
5) 使用底下指令可以做重新開機動作&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;devcon reboot&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
至於其他跟寫driver時會用到的指令功能，大家就看底下微軟的詳細說明囉~&lt;br /&gt;
&lt;br /&gt;
Reference&lt;br /&gt;
&lt;a href=&quot;https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon-examples&quot;&gt;https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon-examples&lt;/a&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/8336074824600576233/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/8336074824600576233' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/8336074824600576233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/8336074824600576233'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2018/01/devconexe-device-manager.html' title='如何透過DevCon.exe 去開跟關你的Device Manager內的設備'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-4079040043670696161</id><published>2016-11-01T13:10:00.007-07:00</published><updated>2016-11-01T13:16:32.325-07:00</updated><title type='text'>ACPICA Programmer Reference Guide</title><content type='html'>&lt;br /&gt;
隨手記錄ㄧ下&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;AE_NOT_FOUND 出現的ㄧ些原因.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;AE_NOT_FOUND :&lt;/b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; The name was not found in the namespace&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;AE_NOT_FOUND :&lt;/b&gt; &lt;span style=&quot;font-size: x-small;&quot;&gt;A valid RSDP could not be located.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;AE_NOT_FOUND :&lt;/b&gt; &lt;span style=&quot;font-size: x-small;&quot;&gt;There is no table with this Signature currently loaded, or the table of the specified Instance is not loaded.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;AE_NOT_FOUND :&lt;/b&gt; &lt;span style=&quot;font-size: x-small;&quot;&gt;The object referenced by the combination of the Object and Pathname was not found within the namespace.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;AE_NOT_FOUND:&lt;/b&gt; &lt;span style=&quot;font-size: x-small;&quot;&gt;The child object parameter is the last object of the given type within the parent — a next child object was not found.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;If Child is NULL, this exception means that the parent object has no children.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;AE_NOT_FOUND:&lt;/b&gt; &lt;span style=&quot;font-size: x-small;&quot;&gt;One or more of the segments of the pathname refers to a non-existent object.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;AE_NOT_FOUND:&lt;/b&gt; &lt;span style=&quot;font-size: x-small;&quot;&gt;A valid ACPI table was not found at the specified Address.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;AE_NOT_FOUND:&lt;/b&gt; &lt;span style=&quot;font-size: x-small;&quot;&gt;An ACPI table with Signature was not found.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;範例:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;ACPI Error: Method parse/execution failed [\_SB.PCI0.LPCB.ECDV.ECIN] (Node 008E3F28), AE_NOT_FOUND (20160930/psparse-632)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;ACPI Error: Method parse/execution failed [\_SB.PCI0.LPCB.ECDV._REG] (Node 008E3F70), AE_NOT_FOUND (20160930/psparse-632)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;ACPI Error: Method parse/execution failed [\_SB.PCI0._INI] (Node 008D5790), AE_NOT_FOUND (20160930/psparse-632)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;ACPI Error: Method parse/execution failed [\ALSD._STA] (Node 008DD4C8), AE_NOT_FOUND (20160930/psparse-632)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/4079040043670696161/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/4079040043670696161' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/4079040043670696161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/4079040043670696161'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2016/11/acpica-programmer-reference-guide.html' title='ACPICA Programmer Reference Guide'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-6842568319168155170</id><published>2016-02-19T22:30:00.001-08:00</published><updated>2016-02-19T22:30:54.336-08:00</updated><title type='text'>不進步就是退步</title><content type='html'>&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;-- 以下並非以偏概全，純屬個人工作體驗 &amp;nbsp;--&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;幾年前加入了一家日商公司，原本抱持著可以跟世界上製作第一台NB的公司裡的業界前輩學習更深入的BIOS知識，但發現事實是殘酷的，經過了多年後的改變，那邊慢慢的研發精神已經沒有那麼積極了，我不會說這家公司很糟，因為還是有很多日本/台灣/大陸/其他Region同事還是努力的在做事情，但是一家公司的文化卻讓肯做事情的人事情越做越多，不肯做事情/事情做不好的人越做越少，乃至於冗員就越來越多，聊八卦破壞團隊精神的人就多(做不好不會被裁員)。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;而開發的方面，日商還是擁有許多比較封閉的開發方式，而「閉門造車」或許有其好處也有相對的壞處，而在一個世界潮流改變很快速的地方，如果不能一直學習成長，那就只能讓人超車。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;因此，幾經嘗試改變周遭同事態度失敗和思考之後，我決定離開那些負面思考/消極態度的同事以及封閉的開發方式的環境，以避免個人養老心態的產生和負面心態的養成。所以在去年所以我選擇加入了另一家外商公司，開始學習不一樣領域的知識，並繼續讓自己保持正向的思考與競爭力。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;然而，在這個新的工作領域中，我的工作內容暫時不需要自己去寫程式，雖然暫時放棄的寫程式的機會，但是我卻多了許多的機會去接觸不同的人事物，並讓自己反省過去到底浪費的多少生命在ㄧ些「不必要的人事物」 上面。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;然而「不進步就是退步」，在最近看到ㄧ些前日商台灣同事連被詢問留下機會都沒有，就被直接裁員，最近才在找工作，心中更是感概萬千。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 雖然很想幫忙，但面對到友情/現實時，我們也只能選擇性幫忙。畢竟社會是現實的，冗員與戰力你只能選擇有戰力的幫忙，否則接納到冗員的公司也只能自求多福了。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;所以，在世界競爭激烈的環境之下，唯有自己持續進步，在遇到這種公司關閉/退出市場或是裁員時，我們才能在裡面繼續生存下去。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2016.02 Harrison&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/6842568319168155170/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/6842568319168155170' title='9 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/6842568319168155170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/6842568319168155170'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2016/02/blog-post.html' title='不進步就是退步'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-1767957814476800659</id><published>2015-02-23T23:00:00.003-08:00</published><updated>2015-02-23T23:00:34.321-08:00</updated><title type='text'>Compiler intrinsics(內建函數)</title><content type='html'>EDK2 中開/關VC++內建函數的方式&lt;br /&gt;
&lt;br /&gt;
平常如果你使用Compiler /Oi 選項時，Compiler自己遇到&lt;b&gt;內建函數&lt;/b&gt;時會自己去產生CODE到你的程式碼之中，如果你想要&lt;b&gt;自己寫這些內建函數&lt;/b&gt;時，就必須要用/Oi- 去關閉他，以免被當成內建函數而出現Compiler error訊息。&lt;br /&gt;
&lt;br /&gt;
例如，我想在我自己的xxx.c 中自己實作一個 ceil() 函數，那你可以透過EDK2 build option override方式在xxx.dsc 中來對你的xxx.inf 設定Compiler option，他只會影響你的xxx.inf。&lt;br /&gt;
&lt;br /&gt;
$(MY_PATH)\xxx.inf {&lt;br /&gt;
&amp;nbsp; &amp;lt;BuildOptions&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; *_*_X64_CC_FLAGS = /Oi-&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/1767957814476800659/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/1767957814476800659' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/1767957814476800659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/1767957814476800659'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2015/02/compiler-intrinsics.html' title='Compiler intrinsics(內建函數)'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-8772240532552341187</id><published>2014-12-25T22:33:00.001-08:00</published><updated>2014-12-25T22:33:46.408-08:00</updated><title type='text'>開啟CMD.EXE並一次執行多個DOS指令的方式(Command Prompt and Batch file)</title><content type='html'>這篇文章是分享如何開啟CMD.EXE時並一次執行多個DOS指令的方式。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;為什麼要分享這個冷知識?&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;因為現在是冬天了，所以很冷。&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
好吧，我承認這是個很無聊的一篇文章，大家就將就點看吧 :)&lt;br /&gt;
&lt;br /&gt;
首先呢，我們都知道Command Prompt 是執行CMD.EXE後就會產生出來的一個畫面，那我們能不能寫個批次檔去執行CMD.EXE又可以執行很多筆指令呢? 答案是可以的，做法就是寫個批次檔，然後透過&lt;span style=&quot;color: red;&quot;&gt;&quot;雙引號&quot;&lt;/span&gt;去把所有指令包起來，&lt;span style=&quot;color: blue;&quot;&gt;指令跟指令中間加入 &amp;amp;&amp;amp;&lt;/span&gt; 就可以了：&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;CMD.EXE &amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;&quot;&lt;/span&gt;指令1 &lt;span style=&quot;color: blue;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; 指令2 &lt;span style=&quot;color: blue;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; 指令3....&lt;span style=&quot;color: blue;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;指令n&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
底下就是兩個批次檔的範例，批次檔內會去執行簡單的DOS指令，執行完畢後會出現一個Command Prompt停在那邊。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt5Cp_LkzRvsKrt-UZRS0kqOs5KPUkU4a4__zkscqld9OTDk1UPzb-yb2aYhSkOJmWeS_fG1iihT61nIKcLzYA1RIn5p136MH4iEMnYcDJsfDqx3menfh-DgE4QqLRcLOCWHD9hw/s1600/Cmd.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt5Cp_LkzRvsKrt-UZRS0kqOs5KPUkU4a4__zkscqld9OTDk1UPzb-yb2aYhSkOJmWeS_fG1iihT61nIKcLzYA1RIn5p136MH4iEMnYcDJsfDqx3menfh-DgE4QqLRcLOCWHD9hw/s1600/Cmd.jpg&quot; height=&quot;216&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyNeGRjuMZdjjh83QFTvOcj29M_RoqJXET8VhXX_lLG45yN359rGZttteTYqP-XYyq1mghMXj5sFFi6OW7vpohXekjKj09zAMV7SD2pqa0iAaoYSeMCiKOsjnwX86S-Jru20UFhQ/s1600/Cmd2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyNeGRjuMZdjjh83QFTvOcj29M_RoqJXET8VhXX_lLG45yN359rGZttteTYqP-XYyq1mghMXj5sFFi6OW7vpohXekjKj09zAMV7SD2pqa0iAaoYSeMCiKOsjnwX86S-Jru20UFhQ/s1600/Cmd2.jpg&quot; height=&quot;273&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
那大家可能會好奇我用在哪裡? 因為我使用SlickEdit 去編寫BIOS CODE，因為懶惰，所以想說我只要開啟 BUILD TIP底下任何一個檔案，然後按個鈕，我就可以進入到工作目錄並且設定好Visual Studio 的環境讓我可以直接Compiler code....就醬~&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqCSkmfuwSClEwHJoiSjCcHEa5My6Mjmt5lozmWf3CVzD1-q3VTKsHxsWywFF7Kyok3gb85rF5L0fjAgXzjG8oC-VFbzwtvYgbeXunfqs3MHe_TU5ffaDVot-orGXyuYfgL1SPig/s1600/CMD3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqCSkmfuwSClEwHJoiSjCcHEa5My6Mjmt5lozmWf3CVzD1-q3VTKsHxsWywFF7Kyok3gb85rF5L0fjAgXzjG8oC-VFbzwtvYgbeXunfqs3MHe_TU5ffaDVot-orGXyuYfgL1SPig/s1600/CMD3.jpg&quot; height=&quot;202&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj92hxMKu9M7abXs_LmRCEdhiiWgd7GBMWK8DYw2MVcIAzIouihjnzgLwEJ4HPgISgh2GHfvhHdRtKFny9L_PwDzsdO8Xj9kYzncsGkwKsj4pyqGonXyMa8iUYPt6_TFmYAxvz-8w/s1600/CMD4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj92hxMKu9M7abXs_LmRCEdhiiWgd7GBMWK8DYw2MVcIAzIouihjnzgLwEJ4HPgISgh2GHfvhHdRtKFny9L_PwDzsdO8Xj9kYzncsGkwKsj4pyqGonXyMa8iUYPt6_TFmYAxvz-8w/s1600/CMD4.jpg&quot; height=&quot;65&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
※ 上圖可以看到我在SlickEdit 內開啟了一個檔案，叫做NT32Pkg.dsc ，然後我設定了兩個快捷鈕，這兩個快捷鈕可以讓我選擇設定VS2012/VS2010的環境，按下去之後他會幫我呼叫設定環境的批次檔，環境設定好之後會直接幫我進入到NT32Pkg.dsc 目錄(E:\UDK2014.SP1\NT32Pkg)，然後我就可以很方便地在Command Prompt內做我要做的事情了。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
底下是我在那兩個快捷鍵內的設定值，有分成CMD.EXE的設定方式跟BATCH的方式，差別就只是在於呼叫CMD.EXE去做事情還是自己寫個批次檔，然後呼叫那個批次檔而已。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
CMD.EXE的方式:&lt;/div&gt;
&lt;div style=&quot;background-color: black; color: white; font-family: Fixedsys; font-size: 10pt;&quot;&gt;
&lt;pre&gt;cmd /E:ON /V:ON /k  &quot;&quot;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat&quot; &amp;amp;&amp;amp; cd/d &quot;%f\..&quot;&quot;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
BATCH FILE的方式(除了描述在快捷鈕之外，要多寫一個批次檔):&lt;/div&gt;
&lt;div style=&quot;background-color: black; color: white; font-family: Fixedsys; font-size: 10pt;&quot;&gt;
&lt;pre&gt;&quot;C:\Apps\TEST.bat&quot; %f&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
TEST.bat的內容:&lt;br /&gt;
&lt;i&gt;@ECHO OFF&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;CALL &quot;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat&quot;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;cd/d &quot;%1\..&quot;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;CMD.EXE&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
上述中的%f 是SlickEdit內的參數，%f = 目前檔案的完整路徑。&lt;br /&gt;
以上面的範例來說:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; %f &amp;nbsp; =&amp;nbsp;e:\UDK2014.SP1\Nt32Pkg\Nt32Pkg&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
最後，我承認科技使用來自於人的惰性，不然也不會有這個冷知識可以分享，哈~&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/8772240532552341187/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/8772240532552341187' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/8772240532552341187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/8772240532552341187'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2014/12/cmdexedoscommand-prompt-and-batch-file.html' title='開啟CMD.EXE並一次執行多個DOS指令的方式(Command Prompt and Batch file)'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt5Cp_LkzRvsKrt-UZRS0kqOs5KPUkU4a4__zkscqld9OTDk1UPzb-yb2aYhSkOJmWeS_fG1iihT61nIKcLzYA1RIn5p136MH4iEMnYcDJsfDqx3menfh-DgE4QqLRcLOCWHD9hw/s72-c/Cmd.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-8773741646437674799</id><published>2014-12-23T22:36:00.003-08:00</published><updated>2014-12-23T22:36:54.303-08:00</updated><title type='text'>Intel® UEFI Development Kit Debugger Tool (Intel UDK Debugger and OVMFPkg)</title><content type='html'>&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;這篇文章是紀錄我自己架設 QEMU + OVMF + Intel UDK&amp;nbsp;+ WinDbg 環境的筆記。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;u&gt;QEMU :&lt;/u&gt;&lt;/b&gt; 他是一個Open Source的處理器仿真器與模擬器。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;a href=&quot;http://wiki.qemu.org/Main_Page&quot;&gt;http://wiki.qemu.org/Main_Page&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;u&gt;OVMF :&lt;/u&gt;&lt;/b&gt; 他是一個UEFI EDK2 codebase裡面的一個專案，用來讓UEFI BIOS可以跑在虛擬機器(Virtual Machine)上面，在這裡的範例就是跑在QEMU裡面。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;a href=&quot;http://tianocore.github.io/ovmf/&quot;&gt;http://tianocore.github.io/ovmf/&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div style=&quot;orphans: 2; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;u&gt;Intel UDK Debugger :&lt;/u&gt;&lt;/b&gt; 這是INTEL開發的一個Source Level Debugger，他需要配合WinDbg(微軟提供的)才能做除錯的動作。&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;a href=&quot;http://uefidk.com/develop/intel-uefi-tools-and-utilities/intel-uefi-development-kit-debugger-tool&quot;&gt;Intel Uefi Development Kit Debugger Tool&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;下面這張圖是我實際的架設環境，我在Windows 8.1裡面安裝了Intel UDK跟WinDbg然後透過&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;虛擬的COM Port&lt;/span&gt;&lt;/b&gt;來與 QEMU裡面的BIOS.BIN(OVMF.FD)溝通。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtJ2e_a-P7GYKAENFo-l9hYpeFj8MoZE3N2z_-YlOKG3i3tydlQAk4aWnrRTZS3VQZMPp6de1WXC_wu2ZNfG9qeNJzVwCxgaD67FJF_WQq_Y2wUPPQPX8_B-8kXueMQDjqlU50AQ/s1600/UDK.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtJ2e_a-P7GYKAENFo-l9hYpeFj8MoZE3N2z_-YlOKG3i3tydlQAk4aWnrRTZS3VQZMPp6de1WXC_wu2ZNfG9qeNJzVwCxgaD67FJF_WQq_Y2wUPPQPX8_B-8kXueMQDjqlU50AQ/s1600/UDK.jpg&quot; height=&quot;287&quot; width=&quot;400&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;安裝與設定(Install and Setup)&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;STEP1 : &lt;/b&gt;Download UDK2014.SP1 ，OvmfPkg and OptionRomPkg&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;我是把它們一起放在&lt;/span&gt;&lt;span style=&quot;orphans: 2; widows: 2;&quot;&gt;E:\UDK2014.SP1; 然後先準備好Compiler環境，並產生OVMF.FD. (環境的部分請參考UDK2014與OVMF的說明)。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;orphans: 2; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;orphans: 2; widows: 2;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;確定Compiler 環境沒問題後，跟隨下面步驟來產生UEFI BIOS ROM。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;1).先產生 OVMF.FD&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp;a.&amp;nbsp;E:\UDK2014.SP1&amp;gt;edksetup.bat&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp;b.&amp;nbsp;E:\UDK2014.SP1&amp;gt;build -DDEBUG_ON_SERIAL_PORT=TRUE -DSOURCE_DEBUG_ENABLE&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;2). 在把OVMF.FD複製一份，並修改檔案名稱為bios.bin (rename)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;(我是放在&amp;nbsp;E:\UDK2014.SP1\Build\Ovmf3264\DEBUG_VS2012x86\FV\bios.bin)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; a.E:\UDK2014.SP1&amp;gt; &lt;span style=&quot;color: red;&quot;&gt;cd E:\UDK2014.SP1\Build\Ovmf3264\DEBUG_VS2012x86\FV&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; b.E:\UDK2014.SP1\Build\Ovmf3264\DEBUG_VS2012x86\FV&amp;gt; &lt;span style=&quot;color: red;&quot;&gt;copy OVMF.FD bios.bin&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;STEP2:&lt;/b&gt; 安裝(Install) WinDbg&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;STEP3: &lt;/b&gt;安裝Virtual Serial Port，你可以選擇Com0Com或是VSPD(Virtual Serial Port Driver)，因為Com0Com 是免費(Free)，另一個要破解(VSPD v7.2)，所以我這邊就只介紹Com0Com 就好，破解版的我就自己知道就好這邊就不介紹了。&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;1) 先執行一個Cmd.exe with Admin (管理者權限)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;i&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;bcdedit -set TESTSIGNING ON&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;2)重新開機 (Reboot)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;3) 安裝Com0Com 2.2.2.0 (For Windows 8.1/Win7 x64 bit)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;a href=&quot;http://sourceforge.net/projects/com0com/files/com0com/2.2.2.0/&quot;&gt;com0com-2.2.2.0-x64-fre-signed.zip&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;4) 執行&amp;nbsp;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&quot;C:\Program Files (x86)\com0com\setupc.exe&quot;，並在畫面中輸入下面指令:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;i&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Command &amp;gt; Install PortName=COM6 PortName=COM7&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;5) 確認設備管理員(Device Manager)內有成功安裝driver，並且No yellow bang.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;STEP4: &lt;/b&gt;安裝(Install) Intel UDK v1.4&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;※如果你是Windows 8.1 ，請設定相容性=Windows 7 (&lt;span style=&quot;color: #505050; font-size: 13px; font-weight: bold; line-height: 20px;&quot;&gt;Compatibility mode=Windows 7&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnTytdBmigGsnIhkm7jD-ZlEbZ8YufR8_8J2VkCrWviUABJ-wCyZ32PhXbCo53oFXDp8Y3Z4AdrGV2LOzTJq91gnH2vBYwGN8FIi-_LSRTTlYRlQvB5AUL5E7IAGL-WEXklVReYQ/s1600/Win7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnTytdBmigGsnIhkm7jD-ZlEbZ8YufR8_8J2VkCrWviUABJ-wCyZ32PhXbCo53oFXDp8Y3Z4AdrGV2LOzTJq91gnH2vBYwGN8FIi-_LSRTTlYRlQvB5AUL5E7IAGL-WEXklVReYQ/s1600/Win7.jpg&quot; height=&quot;201&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;1) 安裝過程中會指定WinDbg安裝目錄跟COM port Number，你也可以安裝完畢後，再去修改他的設定檔案(Config File):&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&lt;i&gt;&quot;C:\Program Files (x86)\Intel\Intel(R) UEFI Development Kit Debugger Tool\SoftDebugger.ini&quot;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;底下是我實作時候的設定:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;COM6 = Intel UDK&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;COM7 = QEMU&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;2) 安裝後，修改SoftDebugger.ini 加入以及修改底下的描述(RED COLOR)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;i style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&quot;C:\Program Files (x86)\Intel\Intel(R) UEFI Development Kit Debugger Tool\SoftDebugger.ini&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: red; font-family: Courier New, Courier, monospace;&quot;&gt;[Debug]&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: red; font-family: Courier New, Courier, monospace;&quot;&gt;Debug=1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;[Debug Port]&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Channel = Serial&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Port = COM6&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: red; font-family: Courier New, Courier, monospace;&quot;&gt;FlowControl = 0 &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;BaudRate = 115200&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Server =&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;STEP5: &lt;/b&gt;&amp;nbsp;執行Intel UDK Debugger，他會叫出WinDbg&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;STEP6: &lt;/b&gt;執行QEMU 並且載入UEFI BIOS (Load BIOS.bin)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&lt;i&gt;E:\UDK2014.SP1\Build\Ovmf3264\DEBUG_VS2012x86\FV&amp;gt;&lt;span style=&quot;color: red;&quot;&gt;&quot;C:\Program Files\qemu\qemu-system-x86_64.exe&quot; -L . -serial COM7&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Microsoft YaHei&#39;; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjplGaLW-LMk-8AftihRCuvtC0W8S06Tr9-2P6VV-rWY0iSqtNwmBcT-XtAs2bGbHfLPp9Sb0ksk4eV-WR0j8SKkT_SNlLh-g9ZbJ28woBCTDylE7WCTMfrkIpbsLmwqgTQtl0jDA/s1600/UDK_OK.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjplGaLW-LMk-8AftihRCuvtC0W8S06Tr9-2P6VV-rWY0iSqtNwmBcT-XtAs2bGbHfLPp9Sb0ksk4eV-WR0j8SKkT_SNlLh-g9ZbJ28woBCTDylE7WCTMfrkIpbsLmwqgTQtl0jDA/s1600/UDK_OK.jpg&quot; height=&quot;262&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Microsoft YaHei&#39;; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Microsoft YaHei&#39;; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Microsoft YaHei&#39;; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
如果有不清楚的部分，可以參考INTEL相關資料。&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Microsoft YaHei&#39;; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Microsoft YaHei&#39;; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Microsoft YaHei&#39;; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Microsoft YaHei&#39;; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Microsoft YaHei&#39;; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/8773741646437674799/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/8773741646437674799' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/8773741646437674799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/8773741646437674799'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2014/12/intel-uefi-development-kit-debugger.html' title='Intel® UEFI Development Kit Debugger Tool (Intel UDK Debugger and OVMFPkg)'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtJ2e_a-P7GYKAENFo-l9hYpeFj8MoZE3N2z_-YlOKG3i3tydlQAk4aWnrRTZS3VQZMPp6de1WXC_wu2ZNfG9qeNJzVwCxgaD67FJF_WQq_Y2wUPPQPX8_B-8kXueMQDjqlU50AQ/s72-c/UDK.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-5499489570258481484</id><published>2014-12-19T00:59:00.003-08:00</published><updated>2014-12-19T00:59:44.299-08:00</updated><title type='text'>VC++ 可轉散發套件(Redistributable Package)</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
這篇文章只是要告訴大家可轉散發套件(&lt;b&gt;VC++&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;background-color: white; font-family: &#39;helvetica neue&#39;, helvetica, arial, &#39;microsoft jhenghei&#39;, &#39;Heiti TC&#39;, sans-serif; line-height: 19.5px;&quot;&gt;&lt;b&gt;Redistributable Package&lt;/b&gt;)&amp;nbsp;&lt;/span&gt;是幹甚麼的?&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
1)首先呢，我先在我的Win7 64 bit OS底下安裝VS2008 ，安裝時順便選擇我要裝&lt;b&gt;x64 compiler&lt;/b&gt;，這樣子我的開發環境就會有VS2008 32 bit/64 bit compiler 功能!&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
2) 接著，我建立一個新的VC++空專案(VC++--&amp;gt;General--&amp;gt;Empty Project)，裡面加入我自己的C 語言Source code (Tmake.c 跟Tmake.h)，然後再專案屬性的地方先設定Win32 (Right click Project --&amp;gt;Properties ，在Platform 的地方選&quot;&lt;b&gt;Win32&lt;/b&gt;&quot;)&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
3) 先產生一次32 bit的應用程式，他會產生再輸出目錄 『&lt;b&gt;Debug&lt;/b&gt;\Tmake.exe』&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
4) 接著，修改專案屬性，改選擇x64 ((Right click Project --&amp;gt;Properties ，在Platform 的地方選&quot;&lt;b&gt;x64&lt;/b&gt;&quot;)，&lt;b&gt;如果你沒看到x64可以選擇，就是在安裝VisualStudio時沒選擇x64 compiler選項&lt;/b&gt;。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
5) 然後再產生一次 64 bit的應用程式，他會產生在輸出目錄『&lt;b&gt;x64\Debug&lt;/b&gt;\Tmake.exe』&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
完成了步驟5之後，我就會有兩個執行檔，分別是32 bit版本跟64 bit版本。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;u&gt;底下是我的開發環境 (產生執行檔，但是拿到別台去執行)&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
OS: Windows 7 64 bit&lt;/div&gt;
&lt;div&gt;
Visual Studio 2008&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; color: #1a1a1a; font-family: &#39;微軟正黑體Microsoft JhengHei&#39;, &#39;微軟正黑體 Microsoft JhengHei&#39;, &#39;Microsoft JhengHei&#39;, 微軟正黑體, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; font-stretch: inherit; line-height: 1.25em; margin: -3px 0px 3px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;font-size: small;&quot;&gt;底下是我的執行環境 (這台機器上面執行我自己寫的程式)&lt;/span&gt;&lt;/u&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
OS : Windows 8.1 64 bit&lt;/div&gt;
&lt;div&gt;
Visual Studio 2012/2013&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWQEyLxCZONo8glnu5LmPz2h8RqXoH0yx_OGJqKU6QXOa8NekT3jNLR8W9JLdxhkZTYI8PaBT4MjdXnr6xg3tSmO2NiBoSz2GPOFugLPPv4SXDuJ9xwUNZ30igmE-GUEHWtnA8tw/s1600/3264.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWQEyLxCZONo8glnu5LmPz2h8RqXoH0yx_OGJqKU6QXOa8NekT3jNLR8W9JLdxhkZTYI8PaBT4MjdXnr6xg3tSmO2NiBoSz2GPOFugLPPv4SXDuJ9xwUNZ30igmE-GUEHWtnA8tw/s1600/3264.jpg&quot; height=&quot;242&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; [圖1] &amp;nbsp;32 bit/64 bit 的主要差別除了暫存器之外就是在於 Calling Convention (呼叫慣例)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
所以大家可以看到，我在Win7開發拿到另一台Win8.1 上面執行，而在Win8.1中我只安裝了Visual Studio 2012/2013這兩個版本，但是我的Win7開發時是Visual Studio 2008開發的。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
所以，當我在Win8.1底下不管是執行32 bit 版本的Tmake.exe 或是 &amp;nbsp;64 bit 版本的Tmake.exe 我都得到了相同的錯誤訊息。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;ERROR MESSAGE: &amp;nbsp;因為應用程式檔設定不正確,所以無法啟動&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYaGYa6n2_BywlRDHNz6N5ehYEx_Rda6R3lCvVBhN2_RLXb2g28NJi1H7NfD_abdrtg20fUUcxLaPCS71u0Ab1bA7_Gqs4qjWHaTS2mKDLK9iYGMIpWdiIpRufurqtigm_JluScQ/s1600/error.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYaGYa6n2_BywlRDHNz6N5ehYEx_Rda6R3lCvVBhN2_RLXb2g28NJi1H7NfD_abdrtg20fUUcxLaPCS71u0Ab1bA7_Gqs4qjWHaTS2mKDLK9iYGMIpWdiIpRufurqtigm_JluScQ/s1600/error.jpg&quot; height=&quot;173&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
[圖 2] 無論32/64 bit 都得到相同的錯誤訊息&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
假如你看到類似這種錯誤訊息時，只要去安裝可轉發套件，把需要的檔案&lt;b&gt;補足&lt;/b&gt;在你的電腦中理論上問題就會消失了，但是 &quot;&lt;span style=&quot;color: red;&quot;&gt;你要找的到正確的版本的可轉發套件&lt;/span&gt;&quot; (後面會講找不到時的解決方式)。&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;底下版本是VS2008 version v9.0.30729&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; color: #1a1a1a; font-family: &#39;微軟正黑體Microsoft JhengHei&#39;, &#39;微軟正黑體 Microsoft JhengHei&#39;, &#39;Microsoft JhengHei&#39;, 微軟正黑體, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; font-stretch: inherit; font-weight: normal; line-height: 1.25em; margin: -3px 0px 3px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;a bi:index=&quot;2&quot; class=&quot;mscom-link&quot; href=&quot;http://www.microsoft.com/zh-tw/download/details.aspx?id=5582&quot; id=&quot;2e31cba0-7b49-4dd7-4f67-94bfeb847e34&quot; style=&quot;-webkit-transition: color 0.1s linear; border: 0px; color: #0044cc; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; transition: color 0.1s linear; vertical-align: baseline;&quot; target=&quot;_self&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b style=&quot;border: 0px; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Microsoft&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;border: 0px; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Visual&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;border: 0px; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;C++&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;border: 0px; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;2008&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;border: 0px; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SP1&lt;/b&gt;&amp;nbsp;可轉散發套件 (x86)&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; color: #1a1a1a; font-family: &#39;微軟正黑體Microsoft JhengHei&#39;, &#39;微軟正黑體 Microsoft JhengHei&#39;, &#39;Microsoft JhengHei&#39;, 微軟正黑體, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; font-stretch: inherit; font-weight: normal; line-height: 1.25em; margin: -3px 0px 3px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;a bi:index=&quot;4&quot; class=&quot;mscom-link&quot; href=&quot;http://www.microsoft.com/zh-tw/download/details.aspx?id=2092&quot; id=&quot;2e31cba0-7b49-4dd7-4f67-94bfeb847e34&quot; style=&quot;-webkit-transition: color 0.1s linear; border: 0px; color: #0044cc; font-family: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; transition: color 0.1s linear; vertical-align: baseline;&quot; target=&quot;_self&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b style=&quot;border: 0px; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Microsoft&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;border: 0px; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Visual&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;border: 0px; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;C++&lt;/b&gt;&amp;nbsp;2008 SP1 可轉散發套件 (x64)&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; color: #1a1a1a; font-family: &#39;微軟正黑體Microsoft JhengHei&#39;, &#39;微軟正黑體 Microsoft JhengHei&#39;, &#39;Microsoft JhengHei&#39;, 微軟正黑體, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; font-stretch: inherit; line-height: 1.25em; margin: -3px 0px 3px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;底下版本是VS2008 v9.0.30729.6161 (比上面的還新一點)&lt;/span&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; color: #1a1a1a; font-family: &#39;微軟正黑體Microsoft JhengHei&#39;, &#39;微軟正黑體 Microsoft JhengHei&#39;, &#39;Microsoft JhengHei&#39;, 微軟正黑體, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; font-stretch: inherit; line-height: 1.25em; margin: -3px 0px 3px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.microsoft.com/en-us/download/details.aspx?id=26368&quot;&gt;Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package MFC Security Update&lt;/a&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; color: #1a1a1a; font-family: &#39;微軟正黑體Microsoft JhengHei&#39;, &#39;微軟正黑體 Microsoft JhengHei&#39;, &#39;Microsoft JhengHei&#39;, 微軟正黑體, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; font-stretch: inherit; line-height: 1.25em; margin: -3px 0px 3px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; color: #1a1a1a; font-family: &#39;微軟正黑體Microsoft JhengHei&#39;, &#39;微軟正黑體 Microsoft JhengHei&#39;, &#39;Microsoft JhengHei&#39;, 微軟正黑體, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; font-stretch: inherit; line-height: 1.25em; margin: -3px 0px 3px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;另外，你可以在安裝完畢後，從System Event Log看到你到底安裝了甚麼版本:&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; color: #1a1a1a; font-family: &#39;微軟正黑體Microsoft JhengHei&#39;, &#39;微軟正黑體 Microsoft JhengHei&#39;, &#39;Microsoft JhengHei&#39;, 微軟正黑體, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; font-stretch: inherit; line-height: 1.25em; margin: -3px 0px 3px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i style=&quot;font-weight: normal;&quot;&gt;Windows Installer 已安裝該產品。產品名稱: Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.6161。產品版本: 9.0.30729.6161。產品語言: 1033。製造商: Microsoft Corporation。安裝成功或錯誤狀態: 0&lt;/i&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style=&quot;background-color: white; border: 0px; color: #1a1a1a; font-family: &#39;微軟正黑體Microsoft JhengHei&#39;, &#39;微軟正黑體 Microsoft JhengHei&#39;, &#39;Microsoft JhengHei&#39;, 微軟正黑體, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; font-stretch: inherit; line-height: 1.25em; margin: -3px 0px 3px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: red; font-size: small;&quot;&gt;如果，你安裝完畢後還不能執行的話，那就是版本不同! &amp;nbsp;&lt;/span&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
如果你從System Event Log 查看，也會看到類似下面的錯誤訊息:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&quot;D:\TmakeJpg\Debug\Tmake.exe&quot; 的&lt;span style=&quot;color: red;&quot;&gt;啟用內容產生失敗。 找不到依存組合 &lt;/span&gt;Microsoft.VC90.DebugCRT,processorArchitecture=&quot;x86&quot;,publicKeyToken=&quot;1fc8b3b9a1e18e3b&quot;,type=&quot;win32&quot;,version=&quot;&lt;span style=&quot;color: red;&quot;&gt;9.0.21022.8&lt;/span&gt;&quot;。&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
意思是說你執行Tmake.exe的電腦內的所能提供的執行環境跟這個應用程式內所要求的版本不同; 從上面的範例可以知道我安裝的都是v9.0.30729.xxxx 但是這個應用程式需要的是9.0.21022.8，這個時候，你有幾個解決方式。&lt;br /&gt;
&lt;br /&gt;
方式1: 從開發的機器上把需要的檔案複製到執行的機器上的&lt;b&gt;Windows\System32&lt;/b&gt; 底下&lt;br /&gt;
需要的檔案需要配合你的應用程式的類型來複製對應的檔案，例如:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: xx-small;&quot;&gt;Release Build 64 bit(x64): &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\&lt;span style=&quot;color: red;&quot;&gt;Amd64&lt;/span&gt;\Microsoft.VC90.CRT&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: xx-small;&quot;&gt;Release Build 32 bit(Win32): &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\&lt;span style=&quot;color: red;&quot;&gt;x86&lt;/span&gt;\Microsoft.VC90.CRT&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;msvcm90.dll&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;msvcp90.dll&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;msvcr90.dll&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;Microsoft.VC90.CRT.manifest&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: red; font-size: xx-small;&quot;&gt;Debug Build 64 bit(x64):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\Debug_NonRedist\&lt;span style=&quot;color: red;&quot;&gt;amd64&lt;/span&gt;\Microsoft.VC90.DebugCRT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: red; font-size: xx-small;&quot;&gt;Debug Build 32 bit(Win32):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\Debug_NonRedist\&lt;span style=&quot;color: red;&quot;&gt;x86&lt;/span&gt;\Microsoft.VC90.DebugCRT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;msvcm90d.dll&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;msvcp90d.dll&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;msvcr90d.dll&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;Microsoft.VC90.DebugCRT.manifest&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
方式2 : 把前面這些需要的檔案打包變成xxx.exe 再一起拿去執行的電腦安裝與執行.&lt;br /&gt;
&lt;br /&gt;
請參考: http://msdn.microsoft.com/en-us/library/ms235291(v=vs.80).aspx&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;http://msdn.microsoft.com/en-us/library/aa260978%28VS.60%29.aspx&lt;br /&gt;
&lt;br /&gt;
方式3: 在專案屬性中選擇使用靜態MFC Library. (Win32/X64都要設定一次) 再重新編譯執行檔就可以了。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMUANpASR3gB13liUKTbpDlMSiSPoe5zItoG-tDA9V8ACbWyLjISj7ViNj201s5OhN9esS39uTymQ11_cXOOiVCk69bDKXOeNTWyHZtNRE9Neoj_ufg_cUuIyVXENCfFA1YbvpzQ/s1600/MFC.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMUANpASR3gB13liUKTbpDlMSiSPoe5zItoG-tDA9V8ACbWyLjISj7ViNj201s5OhN9esS39uTymQ11_cXOOiVCk69bDKXOeNTWyHZtNRE9Neoj_ufg_cUuIyVXENCfFA1YbvpzQ/s1600/MFC.jpg&quot; height=&quot;292&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
結論 :&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;VC++的轉散發套件就是給『跟你開發環境不同』的人去補足需要的Library/DLL之後，才能順利執行你所開發的應用程式。&lt;br /&gt;
&lt;br /&gt;
所以，程式開發者可以選擇『自己打包好所需要的檔案』後再提供給使用者免去使用者無法執行的窘境，或是使用者自己無法執行應用程式時去安裝對應的『轉散發套件』。&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
[註] 我的測試程式後來採用方式3解決問題! 系統就算不安裝VC++的轉散發套件也沒問題。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/5499489570258481484/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/5499489570258481484' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/5499489570258481484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/5499489570258481484'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2014/12/vc-redistributable-package.html' title='VC++ 可轉散發套件(Redistributable Package)'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWQEyLxCZONo8glnu5LmPz2h8RqXoH0yx_OGJqKU6QXOa8NekT3jNLR8W9JLdxhkZTYI8PaBT4MjdXnr6xg3tSmO2NiBoSz2GPOFugLPPv4SXDuJ9xwUNZ30igmE-GUEHWtnA8tw/s72-c/3264.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-8155088661876267715</id><published>2014-10-23T21:20:00.001-07:00</published><updated>2014-10-24T02:34:28.436-07:00</updated><title type='text'>WMI ACPI </title><content type='html'>&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;u&gt;今天要整理的筆記是WMI ACPI&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&amp;nbsp;在BIOS工程師中，對於WMI ACPI應該大家都有玩過，因為許多的OEM都是開發一些OS端的應用程式，然後再透過WMI 這種方式去跟BIOS的ACPI ASL CODE做溝通，以達到可以讀取Thermal 資訊/EC 資訊/ BIOS Setup Utility 資訊....etc.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt; 在網路上或是微軟的相關文件中，你可以看到主要的架構在於wmiacpi.sys 跟acpi.sys 之間的溝通，對於BIOS工程師來說，如果要去提供這種介面就不得不參考微軟的wmi acpi白皮書上面介紹的內容了，底下是微軟文件的說明:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;http://msdn.microsoft.com/en-us/library/windows/hardware/dn614028(v=vs.85).aspx&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;這份文件中主要的概念有幾個:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;1. 他跟你說有一個MOF(Managed Object Format) 是用來給 WMI Core使用的，所以他有個資料庫管理這些MOF檔案；當上層的APP跟WMI Core溝通時，他要去這個資料庫撈對應的MOF資訊，從MOF資訊中取得一些資訊後，才知道怎麼跟你的ACPI溝通!&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;2.溝通的那個ACPI Device有一個特別的PNPID，也就是PNP0C14 ! 所以BIOS工程師要宣告一個ACPI Device然後底下定義_HID , &quot;PNP0C14&quot; 這樣子才能夠溝通~&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;3.Wmi Core 溝通的方式就請自行看這篇文章，像是如何透過GUID找到ACPI _WDG內比對GUID然後找到兩個字元後，再去看Flag屬性是否是Method，然後去執行相關的ACPI Method...之類的資訊，因為這些資訊已經在網路上很多，大家也應該熟悉了，&lt;b&gt;這邊就不多描述&lt;/b&gt;。 底下是對_WDG對應時的C語言格式:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; line-height: 20.0059986114502px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;i&gt;typedef struct
{
     GUID guid;             // GUID that names data block
     union
     {
         CHAR ObjectId[2];  // 2-character ACPI ID  (Data Blocks and Methods)
         struct 
         {
             UCHAR NotificationValue;  // Byte value passed by event handler control method
             UCHAR Reserved[1];
         } NotifyId;
    }
     USHORT InstanceCount;  // Number of separate instances of data block
     USHORT Flags;          // Flags
};&lt;/i&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace !important; font-size: 14px; line-height: 20.0059986114502px; overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;上面的C結構會對應倒ASL的_WDG 內的定義:&lt;/pre&gt;
&lt;pre style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace; font-size: xx-small;&quot;&gt;&lt;span style=&quot;line-height: 20.0059986114502px;&quot;&gt;   Name(_WDG, Buffer() {
        0x6a, 0x0f, 0xBC,....//GUID
        66, 65,              // Object ID (BA) (兩個字元&quot;BA&quot;，可能會組成WQBA或是WMBA，看Flag)
        3,                   // Instance Count (有幾筆Data items)
        0x01,                // Flags (決定他是不是Method...之類的屬性來決定WQXX/WMXX...etc)
        
    }) &lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;那大家可能會問說，你不說運作原理那你要說甚麼?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;一般BIOS工程師在Debug時一般就是利用這些運作原理去追ACPI 來找出問題點，一般大家會比較忽略說，那上層的MOF是怎麼加進去資料庫的? 所以這邊會對這部分做一個簡單的說明。&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;在說明之前，我們先看看下面這張圖:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs6pm78dNznG0nvApv0lwsO1XtH7UuXCRcitZhVnMN4Bhw2zBwFF2jp0NNpmx4Lh3eovefY74osQ7T3y5QHr59y9mPGPKPaziS7dqjP_srbmzhUwdhOa-JWOjVmKGq8W9XdXxhQw/s1600/Wmi_ACPI.jpg&quot; imageanchor=&quot;1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs6pm78dNznG0nvApv0lwsO1XtH7UuXCRcitZhVnMN4Bhw2zBwFF2jp0NNpmx4Lh3eovefY74osQ7T3y5QHr59y9mPGPKPaziS7dqjP_srbmzhUwdhOa-JWOjVmKGq8W9XdXxhQw/s1600/Wmi_ACPI.jpg&quot; height=&quot;320&quot; width=&quot;206&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Vbscript :&lt;/b&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;代表的就是上層APP可以透過像是VBScript/C#....etc之類的去開發你的APP。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Wmi Core :&lt;/b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; 會去撈MOF 資訊跟Acpi.sys溝通(透過WmiAcpi.sys) 。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;ACPI ASL :&lt;/b&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;你要宣告PNP0C14 ，然後有個Name Object 叫做 _WDG (上面圖畫錯了，懶得改了)。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;BIOS Function: &lt;/b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;然後透過ACPI ASL的相關Method來實做一些BIOS CODE，像是發個SMI去取得一些資訊，再透過WMI_ACPI ASL往回傳給上層APP...etc.。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Installation wmi acpi方式有兩種:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;方式1: MOF包在DLL，並註冊到Registry&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;1. 增加上述說的那些ASL CODE到你的BIOS&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;2. 建立一個MOF.DLL (類似OS動態連結檔，不過裡面沒有任何OBJ只有MOF資料)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; a. 建立wmiacpi.rc 跟wmiacpi.def 檔案&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; b. 透過VS2010/2012/2013 的link.exe 將他變成wmiacpi.dll 裡面沒有obj，只有 MOF資料&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;wmiacpi.rc 內容:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;#include &amp;lt;windows.h&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;#include &amp;lt;ntverp.h&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;#define VER_FILETYPE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VFT_DLL&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;#define VER_FILESUBTYPE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VFT_UNKNOWN&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;#define VER_FILEDESCRIPTION_STR &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Resource only DLL containing MOF for ASL code&quot;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;#define VER_INTERNALNAME_STR &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;wmimof&quot;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;#define VER_ORIGINALFILENAME_STR &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;wmimof.DLL&quot;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;#include &quot;common.ver&quot;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;//&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;// WMIACPI.SYS requires that the mof resource be named MofResource&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;MofResource MOFDATA wmiacpi.bmf&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;wmiacpi.def 的內容就只有一行:&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;LIBRARY wmiacpi.dll&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; c. link command :&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;i&gt;rc /fo&quot;%OUTDIR%\wmiacpi.res&quot; wmiacpi.rc&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;i&gt;link /OUT:&quot;%OUTDIR%\wmiacpi.dll&quot; /NOLOGO /DLL &quot;kernel32.lib&quot; &quot;user32.lib&quot; &quot;gdi32.lib&quot; &quot;winspool.lib&quot; &quot;comdlg32.lib&quot; &quot;advapi32.lib&quot; &quot;shell32.lib&quot;&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;i&gt;&quot;ole32.lib&quot; &quot;oleaut32.lib&quot; &quot;uuid.lib&quot; &quot;odbc32.lib&quot; &quot;odbccp32.lib&quot; /DEF:&quot;wmiacpi.def&quot; %OUTDIR%\wmiacpi.res /MANIFEST /ManifestFile:&quot;%OUTDIR%&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;i&gt;\wmiacpi.dll.intermediate.manifest&quot; /MANIFESTUAC:&quot;level=&#39;asInvoker&#39; uiAccess=&#39;false&#39;&quot; /PDB:&quot;%OUTDIR%\wmiacpi.pdb&quot; /TLBID:1 /NOENTRY /DYNAMICBASE&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;i&gt;/NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;3. 複製MOF.DLL檔案到%windir%\system32 (也就是C:\Windows\System32)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4. 在Registry 的HKEY_LOCAL_MACHINE\CurrentControlSet\Services\WmiAcpi底下新增MofImagePath，然後裡面的值指向 &quot;C:\Windows\System32\MOF.DLL&quot;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;5. 重新開機，然後OS偵測到PNP0C14之後就會自動安裝WmiAcpi.sys 然後會去Registry 找到你包在MOF.DLL內的資料，之後用你的APP來透過WMI Core去存取你的ACPI ASL.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;※ 這邊說的MOF.DLL就是你透過link.exe 建立出來的檔案，請自行變更你的名稱&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;方式2: MOF包在ACPI ASL，等發送特定IRP時回給Wmi Core.&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1. 增加上述說的那些ASL CODE到你的BIOS&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2. 建立一個MOF.BMF (MOF的Binary格式，副檔名隨便給因為你可以在Compiler時指定副檔名)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3. 透過&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 26px; orphans: 2; white-space: pre-wrap; widows: 2;&quot;&gt;wmimofck.exe 產生.x 檔案，在把他的內容包到ACPI ASL之中.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWCJ_ov_C0dCbVjOpKBLlt_qjpG08Q_ntRPvi1CJLtzLeHz5_AbVN-UiDVH8ARCkolVRxwSzECNVWGurtKrX2nU43EQlIcJLEHtd8U5cp-qXuTSBkDZmSDrMnwbishlmzqfpIk5w/s1600/wmiacpi1_1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWCJ_ov_C0dCbVjOpKBLlt_qjpG08Q_ntRPvi1CJLtzLeHz5_AbVN-UiDVH8ARCkolVRxwSzECNVWGurtKrX2nU43EQlIcJLEHtd8U5cp-qXuTSBkDZmSDrMnwbishlmzqfpIk5w/s1600/wmiacpi1_1.jpg&quot; height=&quot;42&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;a. 首先先在_WDG內定義一個專屬MOF的GUID(切記不能改變GUID值)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;Name(_WDG, Buffer() {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// This GUID for returning the MOF data&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0x21, 0x12, 0x90, 0x05, 0x66, 0xd5, 0xd1, 0x11, 0xb2, 0xf0, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, //&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;66, 65, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Object ID (BA) &amp;nbsp;這兩個字元可以自己改，但是要對應到WQXX.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Instance Count&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Flags &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;})&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;b.將Wmiacpi.x 內容複製貼上到Name Object &quot;WQBA&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3a3e43; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; Name(WQBA), Buffer(){&quot;MOF Binary data from Wmiacpi.x&quot;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #3a3e43;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;4. 重新開機，然後OS偵測到PNP0C14之後就會自動安裝WmiAcpi.sys 然後會發送特定的IRP，然後ACPI那邊會回給WMI CORE MOF的資訊~&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;在這兩中方式中，都需要把wmiacpi.mof 檔案先經過一個工具叫做mofcomp.exe compiler&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;而這個wmiacpi.mof 檔案的內容就是你在微軟文件那邊看到的，例如:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;class WMIEvent : __ExtrinsicEvent&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;{&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;};&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;[WMI,&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;&amp;nbsp;Locale(&quot;MS\\0x409&quot;),&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;&amp;nbsp;Description(&quot;This class contains the definition of the package used in other classes&quot;),&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;&amp;nbsp;guid(&quot;{ABBC0F60-8EA1-11d1-00A0-C90629100000}&quot;)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;]&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;class Package&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;{&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; [WmiDataId(1),&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;read, write,&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Description(&quot;16 bytes of data&quot;)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; ] uint8 Bytes[16];&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;};&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;...&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;然後經過mofcomp.exe compiler之後，會產生一個MOF binary 檔案，我把他叫做wmiacpi.bmf。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;而這個wmiacpi.bmf 可以經過另一個工具wmimofck.exe&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;來產生c file / c header file ，如果你想自己寫一個Wmi driver時，可以透過這種方式把來幫助你產生一些需要的程式碼，也可以透過&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;wmimofck.exe來產生VBScript 的Sample code(自動產生)，所以當然也可以透過wmimofck.exe來產生一堆HEX 文字檔來方便你把MOF binary資料包進去ACPI ASL之中。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;底下是我的批次檔，用來測試用的，分享給大家參考~&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-SrHee7wjlVkBVCqGWTaVEhWPDyjfYHZuXEsAl18uW-2vcbXfflc3NMOBieb8aXWSRo6rZ0o86kLFg3hK5lcgP9LjjP8P-2j1croEQn29i40pkSY8X8P4pHSUXK6QiDUXKinM3w/s1600/wmiacpi2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-SrHee7wjlVkBVCqGWTaVEhWPDyjfYHZuXEsAl18uW-2vcbXfflc3NMOBieb8aXWSRo6rZ0o86kLFg3hK5lcgP9LjjP8P-2j1croEQn29i40pkSY8X8P4pHSUXK6QiDUXKinM3w/s1600/wmiacpi2.jpg&quot; height=&quot;204&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;※ 這邊使用到的資訊都是來自於微軟的相關文件，有興趣請自行查詢!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;需要用到的工具:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Windows WDK內的wmimofchk.exe (我是安裝WDK for win7 ,目前最新版是WDK 8.1)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Reference&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;http://msdn.microsoft.com/en-us/library/windows/hardware/dn614028(v=vs.85).aspx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;http://msdn.microsoft.com/en-us/library/windows/hardware/ff542012(v=vs.85).aspx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;http://msdn.microsoft.com/en-us/library/windows/hardware/ff554794(v=vs.85).aspx&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/8155088661876267715/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/8155088661876267715' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/8155088661876267715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/8155088661876267715'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2014/10/wmi-acpi.html' title='WMI ACPI '/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs6pm78dNznG0nvApv0lwsO1XtH7UuXCRcitZhVnMN4Bhw2zBwFF2jp0NNpmx4Lh3eovefY74osQ7T3y5QHr59y9mPGPKPaziS7dqjP_srbmzhUwdhOa-JWOjVmKGq8W9XdXxhQw/s72-c/Wmi_ACPI.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-816232151919189621</id><published>2014-09-16T03:01:00.002-07:00</published><updated>2014-09-16T03:01:57.116-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BIOS 開發"/><category scheme="http://www.blogger.com/atom/ns#" term="BIOS相關"/><category scheme="http://www.blogger.com/atom/ns#" term="EDK2"/><category scheme="http://www.blogger.com/atom/ns#" term="EDKII"/><category scheme="http://www.blogger.com/atom/ns#" term="EFI BIOS相關知識"/><title type='text'>EDK2/EDKII Python Build Tool 兩三事 (Build.py)</title><content type='html'>&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;EDK2 Python Build Tool 兩三事&lt;/b&gt;&lt;/h2&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
最近因為工作需要，所以不得已逼自己去把EDK2 Python Build source code看完，看完後順便整理一下一些小重點，以免過陣子自己又忘記了。&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;1)EDK_GLOBAL&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;這種定義的Macro只能給EDK1 driver使用，因為他會去檢查.inf 內的&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;INF_VERSION &amp;nbsp;= 0x00010005 ，如果大於或是等於這個值就是當成EDK2，如果找不到這個值就會當成是EDK1。&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
因為不好用，所以就隨手改了一下CODE，讓他通吃EDK1&amp;nbsp;+ EDK2&amp;nbsp;+ FDF&amp;nbsp;+ DSC + DEC&amp;nbsp;+ INF&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;2) Build Rule and Package rule&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;在EDK2 中，他把EDK1原本的Build Rule &amp;amp; Package Rule 分別描述成:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tools_def.txt&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Build_Rule.txt&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [Rule.$(Arch).$(ModuleType]&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
好不好用看個人，不過如果你要支援原本EDK1 Package Rule時那就對不起啦，你要修改Python source code，不然你做不到。 &amp;nbsp;例如說底下的EDK1 的COMPONENT_TYPE = FILE原本對應到某個Package Rule，但是在EDK2內不支援就是不支援，除非自己改python source code.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
[Defines]&lt;br /&gt;
BASE_NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = xxxxx&lt;br /&gt;
FILE_GUID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 126A4D6A-C404-4200-8779-F327A4A79087&lt;br /&gt;
COMPONENT_TYPE &amp;nbsp;= FILE&lt;br /&gt;
BUILD_TYPE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = MAKEFILE&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;3) Python v.s SQL&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;Python build tool 只是拿SQL當成是存放他收集到的資料的一個地方，然後在另一個地方就可以去撈資料庫內的資訊然後寫對應的CODE去分析要幹嘛，所以rebuild的時候最好把這個資料庫暫存檔案刪除。 EX: Conf\.cache\build.db&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;4) GenSection &amp;amp; GenFFS&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;以前EDK1的這兩個工具也整合進去Python Build tool內了，所以想了解FDF是怎麼產生FV或是FD的人就請自行研究，不過他是另一隻Tool叫做GenFds.py。&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;5) AutoGen.c v.s AutoGen.h&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;偷偷產生的檔案用來存放一些PCD操作/有用到的PCD Value，GUID 定義跟一些偷塞的include... 如果是給PCD database使用的，他還會塞Dynamic PCD給PCD 資料庫當成初始化值。&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; 另外，Library 只會產生AutoGen.h 不會產生AutoGen.c，因為Library通常會跟某個Driver Link，所以等到真正要去產生Module make時，才會去檢查Library 內用到的GUID/PCD ，然後產生在Module&#39;s AutoGen.c內。&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; 6) Hard code&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; 恩，很多東西都寫死在Python build tool內，像是nmake command 要增加修改時就要改一改他，不過也是個好處，就是我可以偷加很多東西在裡面，然後不給你source code...哈!!!&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;7) 產生執行檔&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; .py &amp;nbsp;轉成 .exe 方式我自己再用的有兩種，一種是py2Exe不過版本過舊已經不能支援了，所以我採用EDK2 所建議的cx_Freeze 去轉換，轉換時還要搭配你的Python 版本，目前我看到的codebase內使用的是Python 2.7.3，所以應該以這個為主吧! 底下是EDK2 建議的方式:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Using cx_Freeze 4.2.3 with Python 2.7.2&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Using cx_Freeze 3.0.3 with Python 2.5.4&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; 8) 嗯...有想到再說~&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/816232151919189621/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/816232151919189621' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/816232151919189621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/816232151919189621'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2014/09/edk2edkii-python-build-tool-buildpy.html' title='EDK2/EDKII Python Build Tool 兩三事 (Build.py)'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-7618160645290022573</id><published>2014-02-12T20:13:00.001-08:00</published><updated>2014-02-12T20:13:10.685-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EFI BIOS相關知識"/><title type='text'>Python v.s UEFI EDK2 (EDKII) </title><content type='html'>這篇文章主要是幫自己紀錄一下學習EDK2 build process時的前置準備動作有哪些，後面會陸陸續續把這篇文章補齊，所以先留下個紀錄吧~&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;學習方式&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 對於EDK2來說最大的轉變就是我一直提到的Build process，我常跟我周遭朋友說如果你要學好BIOS或是其他大型軟體專案，中間的『眉角』就是要把大型專案的學習方式分成：&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;BUILD + CODE&lt;br /&gt;
&lt;br /&gt;
當你有辦法分辨以及分開學習時，你才可以精準的掌握住甚麼是BUILD? 甚麼是CODE?&lt;br /&gt;
舉例來說，BUILD的部分就是屬於build rule/compiler rule/package rule ，簡單的說就是透過一些方式來把程式碼產生成binary，依照一些特定的layout來產生成一個BIOS ROM image；至於CODE的部分就屬於程式語言，像是C語言，組合語言的學習! 你唯有了解彼此之間的關係，你才能掌握關鍵處! 這也是我常跟朋友開玩笑說，你真的會&quot;build+code&quot;嗎?!&lt;br /&gt;
&lt;br /&gt;
至於BUILD PROCESS的概念中，我也常常教導朋友去思考為什麼要這樣子做? 他解決了甚麼問題? 有沒有其他方式? 因此我常常由一個批次檔的概念外加一些淺而易懂的範例來讓他們知道說原來BUILD PROCESS原理是如此簡單，不過我沒打算在這邊寫詳細的解說，因為配合著畫圖邊解釋效果比較佳，如果大家有興趣又剛好在業界遇到我時再來跟我討論吧! ^^&lt;br /&gt;
&lt;br /&gt;
所以記得，學習的方式就是BUILD&amp;nbsp;+ CODE分開來學!!!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;前置動作&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;有鑑於EDK2 BUILD PROCESS主要的部分已經改成Python 2.5/2.7開發，美其名是為了跨平台而準備，但是實際上卻沒有達成! &amp;nbsp;畢竟，EDK2在x86中並沒有拿Python 將所有win32 的工具重新寫一次，導致在x86平台中有一部分的python tool跟一部份的win32 tool，所以只能說『某些BUILD TOOLS』跨平台而已! 但是木已成舟，所以現在的x86上就變成了這個怪胎情況了!&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;雖然我不討厭Python，但也不是擁護者，因為跨平台方式有很多種，他也不是最好的一種! 但是因為EDK2都選擇了Python，所以我也要強迫自己來學習他，秉持著工欲善其事，必先利其器的方式，我們先把除錯工具安裝好，以方便我們去分析與研究EDK2&#39;s Build.py&lt;br /&gt;
&lt;br /&gt;
那有哪些東西要先安裝呢? 我個人偏好Visual Studio，因此我選擇了VS2010+PTVS 來當作是Debugger，安裝簡單! 當然你也可以選擇使用Eclipse Classic IDE + PyDev 的除錯方式 (感謝鳥公司John大大傾囊教學)!&lt;br /&gt;
&lt;br /&gt;
所以如果你也想學Python，請跟著我一起安裝:&lt;br /&gt;
&lt;br /&gt;
1. VS2010&lt;br /&gt;
&lt;br /&gt;
2. Python tool for Visual Studio&lt;br /&gt;
https://pytools.codeplex.com/&lt;br /&gt;
&lt;br /&gt;
3. Python 2.7.6 (目前EDK2還沒支援到Python 3.x，建議是安裝2.5.x/2.7.x)&lt;br /&gt;
http://www.python.org/download/releases/2.7.6/&lt;br /&gt;
&lt;br /&gt;
Eclipse Classic IDE+PyDev&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOQGfAsBMMG15RND7T3ioY7PeeJK5zaxOx8Qtr0wyQ6j0cvFTpM8EgjMZmAjSk1mwzD7L77_L08-Nhorf5ZOBaEw5VH7MN83oSbVBS1cP6V31xdeaI453UdFWhSzrwuUQBadUSnw/s1600/1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOQGfAsBMMG15RND7T3ioY7PeeJK5zaxOx8Qtr0wyQ6j0cvFTpM8EgjMZmAjSk1mwzD7L77_L08-Nhorf5ZOBaEw5VH7MN83oSbVBS1cP6V31xdeaI453UdFWhSzrwuUQBadUSnw/s1600/1.jpg&quot; height=&quot;154&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
VS2010+PTVS&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI2aejLBuBMGy_NUVRYFui9YTR8X4LxPeGouePFUOnmSSwgbbg59Cwrerbqjqmhn86OddcHcmp5Ur4vHzhXnR1-VigEgNxL05F_3GvYdPdJea_-IONryDe2rBYOybH81ZKhmOtzA/s1600/2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI2aejLBuBMGy_NUVRYFui9YTR8X4LxPeGouePFUOnmSSwgbbg59Cwrerbqjqmhn86OddcHcmp5Ur4vHzhXnR1-VigEgNxL05F_3GvYdPdJea_-IONryDe2rBYOybH81ZKhmOtzA/s1600/2.jpg&quot; height=&quot;98&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
(未完待續...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/7618160645290022573/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/7618160645290022573' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/7618160645290022573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/7618160645290022573'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2014/02/python-vs-uefi-edk2-edkii.html' title='Python v.s UEFI EDK2 (EDKII) '/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOQGfAsBMMG15RND7T3ioY7PeeJK5zaxOx8Qtr0wyQ6j0cvFTpM8EgjMZmAjSk1mwzD7L77_L08-Nhorf5ZOBaEw5VH7MN83oSbVBS1cP6V31xdeaI453UdFWhSzrwuUQBadUSnw/s72-c/1.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-6323483841918078242</id><published>2014-01-21T23:37:00.000-08:00</published><updated>2014-01-21T23:37:02.167-08:00</updated><title type='text'>文字檔格式真多，那怎麼去區別ASCII/Big5/UTF-16/UTF-8呢?</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0_BVev30T0bK0V_b3aVp_OE_qlGp6Vp1gURncVqNnsExdUMneHWslaBGFInGRztwMF-zb1pUDQhoBgUub4PjHrHNlEtmoR8CT8pHAKaNCSVHeE1XsfhPBzyBJAJ_l6CCxQzB4rA/s1600/Editor.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0_BVev30T0bK0V_b3aVp_OE_qlGp6Vp1gURncVqNnsExdUMneHWslaBGFInGRztwMF-zb1pUDQhoBgUub4PjHrHNlEtmoR8CT8pHAKaNCSVHeE1XsfhPBzyBJAJ_l6CCxQzB4rA/s1600/Editor.jpg&quot; height=&quot;228&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
以前處理一些字幕檔的時候，慢慢的累積了一些區別文字檔編碼的經驗，這邊就分享一下個人經驗，不過經驗歸經驗不一定正確，所以各位就將就點看，把他當成是解決你問題的一個進入點，然後再去搜尋相關知識來解決各位遇到的問題吧!&lt;br /&gt;
&lt;br /&gt;
首先，我們先討論一下文字檔到底是啥? 其實不管是甚麼檔案，儲存的時候都是BINARY資料，差別就在於讀取檔案的人想要如何呈現給你看而已~&lt;br /&gt;
&lt;br /&gt;
例如:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;執行檔=二進制資料 &amp;nbsp; , OS 讀取表頭判定他可以被執行，然後執行他!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;文字檔=二進制資料 &amp;nbsp; , Editor 讀取他然後依照一些編碼原則判定他，然後再去字型檔撈出字型顯示給你看!&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
所以啦，這篇文章要說的就是模擬一下如果我寫了一個Editor，我要怎麼區別不同的編碼格式!&lt;br /&gt;
&lt;br /&gt;
從上面的圖中可以看到，一開始的時候我會先去讀取兩個位元組，這是因為Unicode(UTF-16)檔案會有一個標記來標記他是Unicode存取方式是Big Endian還是Little Endian (低位元組在記憶體低位址, x86常用) ，所以大家可以把UEFI 中的.uni 用16進制編輯器打開來看看，就會看到檔案最開頭有這個標記可以用來判斷~&lt;br /&gt;
&lt;br /&gt;
如果沒有這個標記的檔案，我們就可以判斷為他可能是ASCII/UTF-8/Big-5的編碼方式，因為Big5是兩個位元組組成，他有他一定的規範，所以可以由這些規範來判別字元是不是Big5或只是單純ASCII的一個位元組而已~&lt;br /&gt;
&lt;br /&gt;
除此之外，還有一個UTF-8比較討厭，因為UTF-16是固定兩個位元組儲存一個字元，所以像是英文&quot;A&quot;就會是0x0041 ，高位元組永遠是0x00，所以為了節省空間所以變成了可變位元組的編碼，因此一個字元可能由1~6 bytes組成，看樣子還有機會繼續延伸咧~&lt;br /&gt;
&lt;br /&gt;
因此可以參考Wiki上的UTF-8的對應方式去判讀一個字元由幾個Bytes組成。&lt;br /&gt;
&lt;br /&gt;
例如: 中文字 [這]&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
這=E9 80 99 (UTF-8)&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
第一個位元組的二進制是&lt;span style=&quot;color: red;&quot;&gt;111&lt;/span&gt;0 1001前面的&#39;1&#39;代表全部是3 bytes，而後面的每個位元組的bit7:6就是對應Wiki上說的欄位表示 &amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;10&lt;/span&gt;xx xxxx,&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;10&lt;/span&gt;xx,xxxx&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
所以取出來的xxxx xxxxxx xxxxxx&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|____ &amp;nbsp; 011001 &amp;nbsp; &amp;nbsp;19&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; |____________ &amp;nbsp; 000000 &amp;nbsp; &amp;nbsp;0&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |_________________ &amp;nbsp;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
U+9019 就是unicode的中文字 [這]，所以UTF-8 也算是再重新編碼後的一種unicode表示碼!&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
不知道舉的這些例子看倌們能否了解?!&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
因為這不是我的專長，我是寫BIOS的，以上是經驗談~ Orz&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 16px; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/6323483841918078242/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/6323483841918078242' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/6323483841918078242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/6323483841918078242'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2014/01/asciibig5utf-16utf-8.html' title='文字檔格式真多，那怎麼去區別ASCII/Big5/UTF-16/UTF-8呢?'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0_BVev30T0bK0V_b3aVp_OE_qlGp6Vp1gURncVqNnsExdUMneHWslaBGFInGRztwMF-zb1pUDQhoBgUub4PjHrHNlEtmoR8CT8pHAKaNCSVHeE1XsfhPBzyBJAJ_l6CCxQzB4rA/s72-c/Editor.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-4213486031691359523</id><published>2014-01-07T01:38:00.002-08:00</published><updated>2014-01-09T02:32:18.215-08:00</updated><title type='text'>UEFI Gop driver and PlatformGopPolicy</title><content type='html'>最近在除錯我自己從無到有DIY出來的EDKI codebase的問題，所以在這邊留一下筆記來記錄一下UEFI Gop driver遇到的問題~&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;問題描述:&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
由於我們的系統比較特別，有eDP Panel 跟LVDS Panel(銷庫存)，所以外掛了一顆eDP-LVDS IC，導致點亮VGA的方式變得複雜了點，另外我的CODEBASE目前還很陽春，所以只支援UEFI mode，也就是我要直接上UEFI GopDriver，而執行到UEFI Gop Driver後系統就當機了，為了這個問題所以把這隻Gop driver 反組譯，然後大致追了一下，然後把追CODE的筆記紀錄在下面!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;筆記:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
1) 他是一個EFI driver model driver，所以從DriverBinding Start()追進去看他做了甚麼事情&lt;br /&gt;
2) 底下是我整理的資料，因為沒有他的Source code，完全靠反組譯去猜測出底下的順序與動作，所以僅供參考，並不一定正確!&lt;br /&gt;
3)Root cause: 還不清楚，還在追...哈!&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;DriverBinding-&amp;gt;Start()&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;1..asm{RDTSC};&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;2.ProgramIGD();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a. OpenProtocol(Pciio) //準備用來讀取PCI Regs&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;b. Pciio-&amp;gt;Attributes(Enable BusMatser,MMIO,IOBASE) //啟動IGD設備&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c.&amp;nbsp;OpenProtocol(DevicePath)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; d.LocateProtocol (PlatformGopPolicy) //要求Platform firmware(也就是BIOS)提供VBT/Lid/Dock 的資訊&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.&amp;nbsp;PlatformGopPolicy-&amp;gt;GetVbt(Address,Size);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; f. Config/Read IGD PCI Regs (DeviceId,RevisionId...etc)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.Read &amp;nbsp;Pch DeviceId and RevisionId.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; h.Init MMIO regs &amp;nbsp; // 目前還找不到相關文件說明這些暫存器在幹嘛&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i.Out 0x3c2,0x67&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; j.Config MMIO regs&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; k.&amp;nbsp;PlatformGopPolicy-&amp;gt;PlatformLidStatus()&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; l. &amp;nbsp;PlatformGopPolicy-&amp;gt;PlatformDockStatus() if&amp;nbsp;PlatformGopPolicy&#39;s revision &amp;gt; 0x0001 otherwise, ignore it.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m.Create DDEV LinkedList (Display Device) //應該是參考Vbt去建立出來的資訊 CRT-&amp;gt;eDP-&amp;gt;EFP1-&amp;gt;EFP2-&amp;gt;EFP3&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt; n.Walk DDEV LinkedList to find out predefined DDEV and then try to enable it. (Hangup here.) //我當機在這裡&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; o.Others //還沒追...應該是去產生一些protocol (EDID,brightness...etc) 或是devicepath&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;3.asm{RDTSC};&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;orphans: 2; text-align: -webkit-auto; widows: 2;&quot;&gt;
&lt;div style=&quot;font-family: Calibri;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;4)會被產生出來的Protocol掛自Child Handle上:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;a.DevicePath (&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;09576E91-6D3F-11D2-8E39-00A0C969723B&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small; text-align: -webkit-auto;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;b.Undocument protocol (&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;39487C79-236D-4666-87E5-09547CAAE1BC&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small; text-align: -webkit-auto;&quot;&gt;) : 不知道是幹嘛的...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;c.EdidDiscovered (&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;1C0C34F6-D380-41FA-A049-8AD06C1A66AA):&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small; text-align: -webkit-auto;&quot;&gt;用來表示於顯示設備使用這個EDID.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;d.GraphicOutput(&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;9042A9DE-23DC-4A38-96FB-7ADED080516A):用來顯示影像&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;e.&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;EdidActiveProtocol(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;BD8C1056-9F36-44EC-92A8-A6337F817986)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small; text-align: -webkit-auto;&quot;&gt;&amp;nbsp;: 正在顯示的設備使用這個EDID&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;如果&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;SizeOfEdid !=0 代表EDID資料應該是有效的，應該可以檢查此Handle上面有沒有EDID Protocol來得到顯示設備的EDID，就像是Legacy 時呼叫INT 10h.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/4213486031691359523/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/4213486031691359523' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/4213486031691359523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/4213486031691359523'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2014/01/uefi-gop-driver-and-platformgoppolicy.html' title='UEFI Gop driver and PlatformGopPolicy'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-8242664871926293462</id><published>2013-09-13T00:14:00.003-07:00</published><updated>2013-09-13T00:38:34.893-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EFI BIOS相關知識"/><title type='text'>簡略介紹 EDKI與EDKII (EDK2) 的差別</title><content type='html'>這篇文章主要是簡單闡述一下EDKI 與 EDKII 在BIOS工程師眼中的差別在哪裡? !&lt;br /&gt;
在討論之前，我們先簡單說一下Package是甚麼東西? &lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: red; font-family: Tahoma;&quot;&gt;&lt;b&gt;Package是甚麼?&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: red; font-family: Tahoma;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 在&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;EDKI&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;裡面，我們在寫UEFI driver的時候並不會有所謂的&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;Module&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot; &lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;的概念在裡面。我們開發的時候都是以&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;driver&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;為單位，並不會考慮一些模組化的問題。&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;[註] UEFI 的可執行檔案我們的術語是Image或是Driver，所以當你聽到這個術語時把他當成類似EXE執行檔就可以了。&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 而&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;EDKII裡面，他&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;加上了&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;Package&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;這個概念(模組化)。其實可以把它看成是一個目錄，而這個目錄名稱會是&quot;xxxPkg&quot;，而目錄裡面就是一堆相關的UEFI&lt;/span&gt;&amp;nbsp;driver。&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
所謂的相關的UEFI Driver是說，假如你看到目錄名稱是&quot;NetworkPkg&quot;，那麼這個Package裡面的東西就跟Network有關，&lt;span style=&quot;font-family: 新細明體;&quot;&gt;所以在這個目錄內可以有其他子目錄去存放著&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;PEI/DXE/SMM/APP&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;的&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;Driver&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;或是&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;Library&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;。&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;而組成一個&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;Package&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;的元素(一個PKG目錄內)必定包含一個&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;*.dec&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;和&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;*.dsc&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;Package的好處是甚麼? 就是&quot;獨立&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;在EDKI 的時候，你想單獨產生一個特定的CODE時，你至少&quot;整套CODE&quot;要先產生一次! 而&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;EDKII使用這種&quot;獨立&quot;的概念就不需要整套CODE build完才產生你要的CODE! &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;但也是因為獨立，所以有很多地方都是為了解決獨立出來問題而去改了一堆Build tool動作跟你描述.dsc還有.FDF的動作。&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: red; font-family: 新細明體; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;b&gt;EDKI與EDKII主要的差別?&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: #7600d8; font-family: 新細明體; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #3665ee; font-family: Tahoma;&quot;&gt;&lt;b&gt;- Build process&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #3665ee; font-family: 新細明體;&quot;&gt;&lt;b&gt;的改變&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;EDKI :&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;由&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;ProcessDsc.exe&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;執行將&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;*.inf&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;轉換成&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;makefile&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;的動作&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;EDKII:&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;由&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Tahoma;&quot;&gt;Build.py&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;去處理，同時還會產生&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2d4fc9; font-family: Tahoma;&quot;&gt;AutoGen.c &amp;amp; AutoGen.h&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: #2d4fc9; font-family: Tahoma;&quot;&gt;Parsing *.dec&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #3665ee; font-family: Tahoma;&quot;&gt;&lt;b&gt;- DSC file / FDF file&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;在&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;EDKI&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;裡，決定一個&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;driver&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;要放在那一個&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;firmware volume&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;裡是在&quot;1個&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;.dsc&quot;就可以&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;決定的，通常都會是叫做PlatformDsc.dsc或是 Build.dsc這個檔案! &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;在檔案內你會透過FV=FVREVOVERY的方式把底下的UEFI Driver通通放進去FVREVOVERY.FV，接著透過Flashmap.fdf去規劃ROM的區域，然後決定 FVMAIN.FV放進去哪個區域。&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;但是&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;EDKII&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;為了實現&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;Package&lt;/span&gt;&lt;span style=&quot;font-family: 新細明體;&quot;&gt;這個概念，所以.dsc不再用來描述UEFI driver要放到哪個FV，而只是拿來決定要不要BUILD這目錄下的UEFI driver而已!&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;描述那些UEFI DRIVER放到ROM的哪個位置的動作就變成EDKII新的FDF SPEC所描述的那些動作，所以你必須要新的FDF 格式中描述你那些UEFI driver是要放進去ROM裡面的。&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;b style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: #3665ee; font-family: Tahoma; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;- PCD/DEC&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;因為EDKII還希望做到不用改到Source code就能夠改變CODE的行為，所以延伸出了PCD這種控制方式，不過我是覺得它需要額外寫TOOL去達到他的理念而增加了許多BIOS工程師的麻煩。&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&amp;nbsp; PCD我自己是分成兩部分學習，一部分是屬於如何在RUNTIME管理PCD Database的部分，另一部分就是如何透過DEC FILE去產生PCD的預設值以及有哪些PCD LIB與Header file可以存取他，因為這部分牽扯到實作面(靠的是C語言巨集)，所以需要邊開著CODE邊解釋，所以很難使用文章解釋，希望大家有機會在業界遇到我時在幫大家解釋吧^^.&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&amp;nbsp; 你暫時可以簡單把他想像成是一個變數宣告的方式，變數會有生命週期(整個RUNTIME或是某一個DRIVER而已)與屬性(唯讀/可讀寫)，可以方便你在CODE裡面存取他!&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&amp;nbsp; 以上的部分大致上就是EDKI 與EDKII的差別，對於BIOS工程師來說可能會需要去習慣新的DSC/INF/DEC/FDF寫法，以及BUILD.py這個工具的用法，其他的就是要去習慣各家IBV對於PCD的作法! &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;EDKI與EDKII Reference Code的差別?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;EDKI 與 EDKII Reference code的部分，以目前我接觸到的部分來說最大的差別在於&quot;移植的觀念&quot;。&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;EDKI 身不好移植到不同平台，所以EDKII在這部分是希望能夠好移植，而他的使用的方式是&lt;span style=&quot;color: red;&quot;&gt;約束大家使用同一個&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;EntryPoint&lt;/span&gt;，也就是說在EDKII RC code部分，如果大家的EntryPoint都能指向同一個地方做完一些跟Platform相關的事情之後再跳回去Driver EntryPont，那麼下次如果要移植到不同平台時，我只要把這個共通的EntryPoint改寫就好了。&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;所以在 RC CODE部分，你會看到他先透過共同的_ModuleEntryPoint，然後再從C_FLAG設定的給EDKII Gule Library的EntryPoint 跳回去你設定的Driver EntryPoint，這就是他主要的改變!&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;因為EDKII Glue Library做掉一些事情了，所以以前在UEFI Driver內可能一開始會去呼叫InitDxeLib()來初始化gBS/gRT/gST的動作就不用做了，另外Smm Driver寫法也略有不同，其實都是因為被偷做，所以你可以少做!&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;EDKI與EDKII Code Size的差別?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;由於EDKI 本身在LIBRARY撰寫部分並沒有明確規範，所以連結出來的可執行檔的CODE SIZE會比較大，在EDKII上也針對了這部分重新改寫了原來的LIBRARY以減少連結時的CODE SIZE，因此理論上EDKII 環境下產生出來的可執行檔SIZE應該要寫一些。&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: 新細明體;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
希望簡略的解釋能更幫助大家在學習EDKII 甚至轉換到EDKII的時候不會驚慌失措，也比較知道為什麼要改成這樣子。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/8242664871926293462/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/8242664871926293462' title='5 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/8242664871926293462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/8242664871926293462'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2013/09/edkiedkii-edk2.html' title='簡略介紹 EDKI與EDKII (EDK2) 的差別'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-3360648161980397057</id><published>2013-09-12T04:00:00.001-07:00</published><updated>2013-09-12T04:00:38.401-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows 程式相關"/><title type='text'>DosBox 模擬器 : 如何自己Compiler</title><content type='html'>&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;如果各位是BIOS工程師，但有時候可能有需要在&amp;nbsp;64 bit OS底下去執行Debug32.exe來看看一些組合語言的東西，但是卻發現在64 bit&amp;nbsp;OS底下，Debug32.exe這隻程式是不能被執行的! &lt;br /&gt;
&lt;br /&gt;
為了解決這個問題，我們通常都會去抓DosBox模擬器來使用，而這邊不是教大家去哪抓，而是跟大家說怎麼去自己抓回來Doxbox source code回來，然後使用VisualStudio 2010 自己Compiler 這個好用的工具。&lt;br /&gt;
&lt;br /&gt;
首先，我們需要去抓Doxbox source code跟一些Library，而 DosBox source code 可以透過SVN抓，但是因為這個DosBox在編譯的過程中會去連結一些Library，所以就先就列出來那些會在設定環境時使用到的部分，要大家要自己先去下載:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Dosbox SVN:&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;http://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;(我是抓Revision 3833)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;SDL1.2:&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.libsdl.org/download-1.2.php&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;http://www.libsdl.org/download-1.2.php&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;SDL2.0: &amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.libsdl.org/download-2.0.php&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;http://www.libsdl.org/download-2.0.php&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; (執行DosBox.exe 需要他的SDL2.DLL)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;SDL_Net 20:&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.libsdl.org/projects/SDL_net/&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;http://www.libsdl.org/projects/SDL_net/&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Libpng(libpng.lib):&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.libpng.org/pub/png/libpng.html&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;http://www.libpng.org/pub/png/libpng.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;(我是抓1.6.3)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Zlib(zlib.lib) :&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.zlib.net/&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;http://www.zlib.net/&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; (我是抓Zlib 1.2.8)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;WinCurses(Curses.lib):&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.baldwin.cx/~john/projects/WinCurses.html&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;http://www.baldwin.cx/~john/projects/WinCurses.html&lt;/span&gt;&lt;/a&gt;&amp;nbsp;(Debug用)&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;底下是我抓下來後解壓縮放到E:\DosBox的情況:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGViIxjf9cf17sU9e7opjDwN9t4FOFXBf-Iwl7_wTdDv3IFyetamTWqPfK1Iy9_yniwjSuHE2KoQBFC0sG4fEGs144siBjNcGhsTeZWmuPudodBEaOqq7IeEFEeH8fgR-Z7BFBtw/s1600/1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGViIxjf9cf17sU9e7opjDwN9t4FOFXBf-Iwl7_wTdDv3IFyetamTWqPfK1Iy9_yniwjSuHE2KoQBFC0sG4fEGs144siBjNcGhsTeZWmuPudodBEaOqq7IeEFEeH8fgR-Z7BFBtw/s320/1.jpg&quot; width=&quot;160&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;b&gt;&lt;u&gt;設定DosBox Compiler環境&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
1.我們要先產生zlib.lib給LibPng.lib使用，所以透過VS2010 compiler的方式就是先開啟VS2010 commnd prompt，然後鍵入:&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;E:\DosBox\zlib-1.2.8:\&amp;gt; &amp;nbsp;Nmake /f win32\makefile.msc&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
在編譯結束後，你會看到zlib.lib被會放在Zlib-1.2.8目錄內。&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
2.由於DosBox還需要連結libpng.lib，所以我們透過VS2010方案去產生libpng.lib。&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; 所以在開啟VS2010方案檔案前，要先把預設的ZLIB路徑指向我們前面抓的那一個zlib-1.2.8，所以先去修改zlib.props這個檔案，如下圖:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJNuJKxmhDsEcRWZ7ci96xhzi-9FAyIukRcGUWwb-veKhH8fjzMTyiDRl7bWdgbwpkeEHpmqAGPkFJoW6zWfJZCIhHPAtzlXH6TK38po65iHYLtvYdEgO2EJQjoCeF8p7-DVCnIQ/s1600/2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;81&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJNuJKxmhDsEcRWZ7ci96xhzi-9FAyIukRcGUWwb-veKhH8fjzMTyiDRl7bWdgbwpkeEHpmqAGPkFJoW6zWfJZCIhHPAtzlXH6TK38po65iHYLtvYdEgO2EJQjoCeF8p7-DVCnIQ/s320/2.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
接著開啟方案，然後整個Rebuild Solution.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhglGIEeIyPn-Sga705n4kWxb5Ivat7_YmSh1aZxfQg5D89yGkx3Lg7cfdvnRu99YVu1LjybhnGkCcEtW1dRn0bSzqrM7k8sKHvFoebQGNSX-TXGpruHrCFaAGKBtptcVgFPLlagA/s1600/3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhglGIEeIyPn-Sga705n4kWxb5Ivat7_YmSh1aZxfQg5D89yGkx3Lg7cfdvnRu99YVu1LjybhnGkCcEtW1dRn0bSzqrM7k8sKHvFoebQGNSX-TXGpruHrCFaAGKBtptcVgFPLlagA/s1600/3.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
3.當我們需要的LIB都準備好之後，就可以開啟DOSBOX方案&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; E:\DosBox\visualc_net\dosbox.sln&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
4. 因為我們抓的LIB版本比原本設定的還新，所以要去設定方案內的專案屬性內的C++跟Linker的設定：&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a. Project Properties-&amp;gt;C++-&amp;gt;General-&amp;gt;Additional Include Directories --&amp;gt;Edit&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;../include&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;../src/platform/visualc &amp;nbsp;&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ../SDL-1.2.15/include&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ../SDL2_net-2.0.0/include&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;../lpng163&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ../zlib-1.2.8&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; b.&amp;nbsp;Project Properties-&amp;gt;Linker-&amp;gt;Input-&amp;gt;Additional Dependencies--&amp;gt;Edit&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opengl32.lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; winmm.lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ../zlib-1.2.8/zlib.lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ../lpng163/projects/vstudio/Debug/libpng16.lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ../SDL2_net-2.0.0/lib/x86/SDL2_net.lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ../SDL-1.2.15/lib/x86/sdl.lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ../SDL-1.2.15/lib/x86/sdlmain.lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;../curses/curses.lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; odbc32.lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; odbccp32.lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ws2_32.lib&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
5.
 &lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;如果環境都設定好了，你就可以開始Rebuild，接著等一下子後你就可以看到產生DosBox.exe&lt;/span&gt;

到你的Release&amp;nbsp;目錄內了.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbK0Wl0G-4l15ZxKBhvEL7OctLv1VvpB0_PieFRf1sN3h8-6RJtUO5eUsgYJfv84EqLpkm42YFaTBMDOkFG5AQhmD1OeWg20KTaEms2KrwshxcKrdPtx1L_JB580b5plY243mexQ/s1600/4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;57&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbK0Wl0G-4l15ZxKBhvEL7OctLv1VvpB0_PieFRf1sN3h8-6RJtUO5eUsgYJfv84EqLpkm42YFaTBMDOkFG5AQhmD1OeWg20KTaEms2KrwshxcKrdPtx1L_JB580b5plY243mexQ/s320/4.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
6.
由於產生出來的DosBox.exe 並不能單獨直接執行，還需要一些DLL跟這個執行檔放在同一個目錄內，這些DLL檔案可以從前面抓的那些LIB目錄內找的到，所以我把它集中在同一個目錄內，如下圖所示:

&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHALoHhSSDdbS1P2aHJyvw4NEtIliY84G4928I4SIUyuTdu8_HoX1zGkLHf09RU9ThEkKqYoT-l87a_5ZLAEr-kcAk4SIWuXUwpUhWO7bJEem-oH54xq0BGK3XYUiCHhAeXgg6tA/s1600/5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHALoHhSSDdbS1P2aHJyvw4NEtIliY84G4928I4SIUyuTdu8_HoX1zGkLHf09RU9ThEkKqYoT-l87a_5ZLAEr-kcAk4SIWuXUwpUhWO7bJEem-oH54xq0BGK3XYUiCHhAeXgg6tA/s1600/5.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
7.
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;接著你只要執行dosbox.exe (滑鼠點兩下執行)就可以看到模擬器的畫面跑出來，然後我把我自己的E Driver掛在模擬器的K drive，之後就可以在模擬器內的K:\底下找到我放在E:\Debug32.exe並且執行成功:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKbLOc6x73DOD30J_Z7RbT0OXco8jsux0bqNnKw8Gg3vZrIMU2EYDE_kCnaB1ff_tzRaelBGyNgakExlHev5Xey_52bih7D-Okf_fxL12kf2FHWPppOM-RGRD_69AwyjC2wcTYhw/s1600/6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;211&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKbLOc6x73DOD30J_Z7RbT0OXco8jsux0bqNnKw8Gg3vZrIMU2EYDE_kCnaB1ff_tzRaelBGyNgakExlHev5Xey_52bih7D-Okf_fxL12kf2FHWPppOM-RGRD_69AwyjC2wcTYhw/s320/6.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;我的DosBox Compiler環境是在&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Window8 64 bit OS，然後使用&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Visual Studio 2010的 32bit compiler，所以可以看到我是選Win32 Release build，設定的目錄都是指向x86而不是x64。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;希望這邊文章對於想要自己Compiler DosBox但是又一直不成功的人有幫助 ^^&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; display: inline !important; float: none; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/3360648161980397057/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/3360648161980397057' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/3360648161980397057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/3360648161980397057'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2013/09/dosbox-compiler.html' title='DosBox 模擬器 : 如何自己Compiler'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGViIxjf9cf17sU9e7opjDwN9t4FOFXBf-Iwl7_wTdDv3IFyetamTWqPfK1Iy9_yniwjSuHE2KoQBFC0sG4fEGs144siBjNcGhsTeZWmuPudodBEaOqq7IeEFEeH8fgR-Z7BFBtw/s72-c/1.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-6989406193504803906</id><published>2013-09-11T23:59:00.001-07:00</published><updated>2013-09-12T04:00:49.811-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="組合語言Assembly"/><title type='text'>一個關於INT 3h的知識分享</title><content type='html'>恩，好久沒來發文章了!&amp;nbsp; 慢慢地最近比較有時間，所以會在寫些文章分享一下知識!&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;userContent&quot; data-ft=&quot;{&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}&quot;&gt;&lt;strong&gt;&lt;u&gt;一個關於INT 3h的知識分享&lt;/u&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;userContent&quot; data-ft=&quot;{&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;userContent&quot; data-ft=&quot;{&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}&quot;&gt;一般來說INT xxh的機器碼會看到是CD imm8 ，例如: CD 19 就是呼叫INT 19h.&lt;br /&gt;&lt;br /&gt;而INT3比較特別，他有一個1 byte的OPCODE是0xCC，使用1個BYTE的好處是&quot;&lt;wbr&gt;&lt;/wbr&gt;&lt;span class=&quot;word_break&quot;&gt;&lt;/span&gt;他可以覆蓋在任何指令的第一個BYTE而不會去破壞掉原本的指令&lt;wbr&gt;&lt;/wbr&gt;&lt;span class=&quot;word_break&quot;&gt;&lt;/span&gt;意思&quot;&lt;br /&gt;&lt;br /&gt;而2 bytes的方式就沒這個好處! 如果你了解INTEL 指令，你就會知道一行指令是由Prefix OPCODE.......部分組成的，所以一行指令所代表的機器碼長度&lt;wbr&gt;&lt;/wbr&gt;&lt;span class=&quot;word_break&quot;&gt;&lt;/span&gt;不同，因此一個Byte的INT 3h就可以利用這些特性讓Debugger去插入INT 3h的斷點，然後跳到Debug Engine裡面.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;userContent&quot; data-ft=&quot;{&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;userContent&quot; data-ft=&quot;{&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}&quot;&gt;底下是範例代碼，一個換掉原本位置的方式:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;userContent&quot; data-ft=&quot;{&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;userContent&quot; data-ft=&quot;{&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}&quot;&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 13px/16.79px Verdana, Helvetica, Arial, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lds &amp;nbsp; &amp;nbsp;&amp;nbsp; bx,BreakToAddress&amp;nbsp; ;Insert INT3h OPCODE to this&amp;nbsp;addrees&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-size-adjust: none; font-stretch: normal; font: 13px/16.79px Verdana, Helvetica, Arial, sans-serif; letter-spacing: normal; margin: 0px; padding: 0px; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 13px/16.79px Verdana, Helvetica, Arial, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov &amp;nbsp; &amp;nbsp;al,0CCh&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;INT 03h opcode&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-size-adjust: none; font-stretch: normal; font: 13px/16.79px Verdana, Helvetica, Arial, sans-serif; letter-spacing: normal; margin: 0px; padding: 0px; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 13px/16.79px Verdana, Helvetica, Arial, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;&amp;nbsp; &amp;nbsp; xchg &amp;nbsp; [bx],al&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; ;Set INT 3h OPCODE and also save original opcode into AL&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 13px/16.79px Verdana, Helvetica, Arial, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;userContent&quot; data-ft=&quot;{&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}&quot;&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 13px/16.79px Verdana, Helvetica, Arial, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OriginalOpCode,al&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;;Save&amp;nbsp; original opcode&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-size-adjust: none; font-stretch: normal; font: 13px/16.79px Verdana, Helvetica, Arial, sans-serif; letter-spacing: normal; margin: 0px; padding: 0px; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/6989406193504803906/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/6989406193504803906' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/6989406193504803906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/6989406193504803906'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2013/09/int-3h.html' title='一個關於INT 3h的知識分享'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-3979740612924296252</id><published>2012-09-19T03:01:00.002-07:00</published><updated>2013-09-12T04:01:06.531-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EFI教學"/><title type='text'>EDKII - Build.py </title><content type='html'>&lt;span style=&quot;font-family: Tahoma;&quot;&gt;最近在研究EDKII的 Build process的動作，順便做做筆記!&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;這個Python Build tool是EDKII/EDK2 的一個Build tool，而底下是&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;Build.py 目前支援的Command line options，因為我還沒追完全部的動作，所以先整理一下比較會使用到的部分:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
===============================================================&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-a&quot;, &quot;--arch&quot;, , choices=[&#39;IA32&#39;,&#39;X64&#39;,&#39;IPF&#39;,&#39;EBC&#39;,&#39;ARM&#39;], dest=&quot;TargetArch&quot;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-p&quot;, &quot;--platform&quot;dest=&quot;PlatformFile&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-m&quot;, &quot;--module&quot;,, dest=&quot;ModuleFile&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-b&quot;, &quot;--buildtarget&quot;, &amp;nbsp;dest=&quot;BuildTarget&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-t&quot;, &quot;--tagname&quot;, , dest=&quot;ToolChain&quot;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-x&quot;, &quot;--sku-id&quot;, , dest=&quot;SkuId&quot;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-n&quot;, &amp;nbsp;dest=&quot;ThreadNumber&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-f&quot;, &quot;--fdf&quot;, dest=&quot;FdfFile&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-r&quot;, &quot;--rom-image&quot;, dest=&quot;RomImage&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-i&quot;, &quot;--fv-image&quot;, dest=&quot;FvImage&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-C&quot;, &quot;--capsule-image&quot;, dest=&quot;CapName&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-u&quot;, &quot;--skip-autogen&quot;, dest=&quot;SkipAutoGen&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-e&quot;, &quot;--re-parse&quot;, , dest=&quot;Reparse&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-c&quot;, &quot;--case-insensitive&quot;, dest=&quot;CaseInsensitive&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-w&quot;, &quot;--warning-as-error&quot;, dest=&quot;WarningAsError&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-j&quot;, &quot;--log&quot;, &amp;nbsp;dest=&quot;LogFile&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-s&quot;, &quot;--silent&quot;,, dest=&quot;SilentMode&quot;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-q&quot;, &quot;--quiet&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-v&quot;, &quot;--verbose&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-d&quot;, &quot;--debug&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-D&quot;, &quot;--define&quot;,dest=&quot;Macros&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-y&quot;, &quot;--report-file&quot;dest=&quot;ReportFile&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-Y&quot;, &quot;--report-type&quot; choices=[&#39;PCD&#39;,&#39;LIBRARY&#39;,&#39;FLASH&#39;,&#39;DEPEX&#39;,&#39;BUILD_FLAGS&#39;,&#39;FIXED_ADDRESS&#39;, &#39;EXECUTION_ORDER&#39;], dest=&quot;ReportType&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-F&quot;, &quot;--flag&quot;, dest=&quot;Flag&quot;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&quot;-N&quot;, &quot;--no-cache&quot;, dest=&quot;DisableCache&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;從上面資料中可以看到-a 或是--arch對他來說應該都是同一個選項.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;而底下是一些實際範例的說明，希望對大家有幫助~&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
======================&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
build.exe &amp;nbsp;-p ACTIVE_PLATFORM&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
======================&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
ex: build -p&amp;nbsp;DUETPkg\DuetPkg64.dsc&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
說明: 等同於修改Target.txt內的&amp;nbsp;ACTIVE_PLATFORM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = Nt32Pkg/Nt32Pkg.dsc&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
=====================&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
build -b&amp;nbsp;&lt;span style=&quot;font-family: Verdana;&quot;&gt;TARGET&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
=====================&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
ex: build -b DEBUG&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
說明: 等同於修改Target.txt內的TARGET= DEBUG，以及DSC file: [Defines]&amp;nbsp;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;BUILD_TARGETS&lt;/span&gt;&amp;nbsp;tag&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
[Defines]&lt;br /&gt;
&amp;nbsp; PLATFORM_NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = NT32&lt;br /&gt;
&amp;nbsp; PLATFORM_GUID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = EB216561-961F-47EE-9EF9-CA426EF547C2&lt;br /&gt;
&amp;nbsp; PLATFORM_VERSION&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0.4&lt;br /&gt;
&amp;nbsp; DSC_SPECIFICATION&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00010005&lt;br /&gt;
&amp;nbsp; OUTPUT_DIRECTORY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = Build/NT32&lt;br /&gt;
&amp;nbsp; SUPPORTED_ARCHITECTURES&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = IA32&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;BUILD_TARGETS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = DEBUG|RELEASE&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; SKUID_IDENTIFIER&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = DEFAULT&lt;br /&gt;
&amp;nbsp; FLASH_DEFINITION&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = Nt32Pkg/Nt32Pkg.fdf&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
=====================&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
build -a&amp;nbsp;&lt;span style=&quot;font-family: Verdana;&quot;&gt;TARGET&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
=====================&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
ex: build -d x64&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
說明: 等同於修改Target.txt內的TARGET_ARCH&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = IA32，以及DSC file: [Defines] SUPPORTED_ARCHITECTURES tag (同上範例)&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
=====================&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
build -t&amp;nbsp;&lt;span style=&quot;font-family: Verdana;&quot;&gt;TOOL_CHAIN&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
=====================&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
ex: build -t VS2010x86&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
說明: 等同於修改Target.txt內的TOOL_CHAIN_TAG&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = VS2008x86&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;=====================&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;build --log=Build.log&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;=====================&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;--log 可以產生建置過程的紀錄檔&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/3979740612924296252/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/3979740612924296252' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/3979740612924296252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/3979740612924296252'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2012/09/edkii-buildpy.html' title='EDKII - Build.py '/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-3310943113836995975</id><published>2012-09-09T23:47:00.000-07:00</published><updated>2012-09-09T23:47:23.043-07:00</updated><title type='text'>快快樂樂學EFI(4)-使用VS2010建立EDKII專案</title><content type='html'>&lt;span style=&quot;font-family: Tahoma;&quot;&gt;這一篇文章說的方式可以適用於VS2008與VS2010，使用Visual Studio建立專案的好處其實就只是有Tag功能，也就是方便你去追CODE改CODE的功能，雖然我都是使用SlickEdit 不過還是跟各位說一下怎麼使用吧~&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;在建立Visual Studio專案之前，請確認你已經在DOS Command Prompt下成功進入到NT32的EFI Shell模擬環境，&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;如果還沒成功，請先試試看下面方式:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;1) E:\MyWorkSpace:\&amp;gt; EdkSetup.bat&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;2) 修改&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;E:\MyWorkSpace\Conf\Target.txt 內，搜尋關鍵字MYTOOLS ，並把他改成VS2008x86或是VS2010x86，我是用VS2010，所以要改成VS2010x86&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;3) 先產生 SHELL檔案，透過 E:\MyWorkSpace:\&amp;gt; build -D BUILD_NEW_SHELL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;4) 測試看看能不能看到EFI Shell模擬環境&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;E:\MyWorkSpace:\&amp;gt; build run&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;5) 如果可以看到Shell，則輸入reset 離開模擬環境&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;如果上面步驟都已經成功，則你可以繼續底下的步驟來設定VS2010的EDKII專案&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
Step1: 執行VS2010&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;img src=&quot;file:///C:/Users/z1107tti/AppData/Local/Temp/enhtmlclip/Image(36).png&quot; style=&quot;cursor: default;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;Step2: 選擇File-&amp;gt;New-&amp;gt;Project From Existing Code ...&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;img src=&quot;file:///C:/Users/z1107tti/AppData/Local/Temp/enhtmlclip/Image(37).png&quot; style=&quot;cursor: default;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
Step3: 出現的畫面上選擇&quot;Visual C++&quot; project type&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;img src=&quot;file:///C:/Users/z1107tti/AppData/Local/Temp/enhtmlclip/Image(38).png&quot; style=&quot;cursor: default;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
Step4: Click &quot;Browse&quot; 然後選擇你的工作目錄 (我的是E:\MyWorkSpace)&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
Step5: 並在File type的地方輸入底下這些附檔名，他的用意是去辨識哪些檔案要加入專案&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&amp;nbsp;*.c;*.h;*.asm;*.asm16;*.s;*.inc;*.asl;*.aslc;*.fdf;*.dsc;*.dec;*.inf;*.py&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;img src=&quot;file:///C:/Users/z1107tti/AppData/Local/Temp/enhtmlclip/Image(39).png&quot; style=&quot;cursor: default;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
Step6: 繼續下一步，並選擇 &quot;Use external build system&quot; 然後直接按下 &quot;Finish&quot; (後面的其他設定可以忽略)&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;img src=&quot;file:///C:/Users/z1107tti/AppData/Local/Temp/enhtmlclip/Image(40).png&quot; style=&quot;cursor: default;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
Step7: 在步驟6結束後，你應該可以看到專案檔被開啟成功，然後在專案的地方按滑鼠右鍵，然後選擇&quot;Properties&quot;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDUav6wQ2c-0GYL0hte9qC5k-d9wdkNItYoiRjfqBWp84bTgJDa7MC9zSlYOxHIlDwbajOzFVwxGw9wyq0FVXlAUCxu1J-5kloG9JRBo4IvWT72_O5USmWxqR8o9DyqpTFYMA92g/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;112&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDUav6wQ2c-0GYL0hte9qC5k-d9wdkNItYoiRjfqBWp84bTgJDa7MC9zSlYOxHIlDwbajOzFVwxGw9wyq0FVXlAUCxu1J-5kloG9JRBo4IvWT72_O5USmWxqR8o9DyqpTFYMA92g/s320/%E6%9C%AA%E5%91%BD%E5%90%8D7.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;img src=&quot;file:///C:/Users/z1107tti/AppData/Local/Temp/enhtmlclip/Image(41).png&quot; style=&quot;cursor: default;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
Step8:&amp;nbsp;選擇左邊的 &quot;NMake&quot; 然後設定 Configuration 成 &quot;All Configurations&quot;.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSBofYCoD0vKkSDlS_BbHMmSpv0so83OKRWPYse5XxOguUwNkW-w1fwfngZkdIU5hhSFrv3HVh38G5iaXTD5uv4XwwKG5Drtup4Xmt09LBFcNEROlGky4GOp81Omocu4Fv9LsPfw/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D8.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;109&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSBofYCoD0vKkSDlS_BbHMmSpv0so83OKRWPYse5XxOguUwNkW-w1fwfngZkdIU5hhSFrv3HVh38G5iaXTD5uv4XwwKG5Drtup4Xmt09LBFcNEROlGky4GOp81Omocu4Fv9LsPfw/s320/%E6%9C%AA%E5%91%BD%E5%90%8D8.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;img src=&quot;file:///C:/Users/z1107tti/AppData/Local/Temp/enhtmlclip/Image(42).png&quot; style=&quot;cursor: default;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
Step 9: 然後再編輯右邊的 &quot;Build Command Line&quot;,&quot;Rebuild All Command Line&quot; 和 &quot;&amp;nbsp;Clean Command Line&quot; ，分別輸入下面的設定(請依照自己的工作目錄設定):&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
For Build Command Line:&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
------------------------------&lt;/div&gt;
&lt;span style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;&amp;nbsp; &amp;nbsp;cd /d E:\MyWorkSpace&lt;/span&gt;&lt;br style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot; /&gt;&lt;span style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;&amp;nbsp; &amp;nbsp;set WORKSPACE=E:\MyWorkSpace&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot; /&gt;&lt;span style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;&amp;nbsp; &amp;nbsp;call edksetup.bat --nt32&lt;/span&gt;&lt;br style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot; /&gt;&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
build&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 22px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
For Rebuild All Command Line:&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
------------------------------&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
cd /d E:\MyWorkSpace&lt;br /&gt;
&amp;nbsp; set WORKSPACE=E:\MyWorkSpace&lt;br /&gt;
&amp;nbsp; call edksetup.bat --nt32&lt;br /&gt;
&amp;nbsp; build clean&lt;br /&gt;&lt;div&gt;
build&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 22px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
For Clean Command Line:&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
------------------------------&lt;/div&gt;
&lt;div&gt;
cd /d E:\MyWorkSpace&lt;br /&gt;
&amp;nbsp; set WORKSPACE=E:\MyWorkSpace&lt;br /&gt;
&amp;nbsp; call edksetup.bat --nt32&lt;br /&gt;
&amp;nbsp; build clean&lt;br /&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;Step10: 確定你的工作目錄下的Conf\Target.txt內的TOOL_CHAIN_TAG有設定成VS2010x86，不然你會沒辦法使用VS2010的專案來Compiler，如果你是使用VS2008則設定成VS2008x86即可!&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;Step11: 再選擇一次專案的&quot;Properties&quot;，然後選擇左邊的&quot;Debugging&quot;，接著邊及右邊的這兩個選項:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfGgh6s9oz6Bpjir1cT36FgO-uuc0jQgZ1n3ubq1pehH6jhff2scxOtRmWV6YJZAb0asgoyiTkTNJ5MdPPORDGQhFQON5Bo29u3V9-dtsrqburIDUm3F6bCmeOsOlFeEd1If2ICA/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D9.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;40&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfGgh6s9oz6Bpjir1cT36FgO-uuc0jQgZ1n3ubq1pehH6jhff2scxOtRmWV6YJZAb0asgoyiTkTNJ5MdPPORDGQhFQON5Bo29u3V9-dtsrqburIDUm3F6bCmeOsOlFeEd1If2ICA/s320/%E6%9C%AA%E5%91%BD%E5%90%8D9.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
Command :&amp;nbsp;&lt;a href=&quot;file:///E:/MyWorkSpace/Build/NT32/DEBUG_VS2010x86/IA32/SecMain.exe&quot;&gt;E:\MyWorkSpace\Build\NT32\DEBUG_VS2010x86\IA32\SecMain.exe&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
Working Directory :&amp;nbsp;&lt;a href=&quot;file:///E:/MyWorkSpace/Build/NT32/DEBUG_VS2010x86/IA32&quot;&gt;E:\MyWorkSpace\Build\NT32\DEBUG_VS2010x86\IA32&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;img src=&quot;file:///C:/Users/z1107tti/AppData/Local/Temp/enhtmlclip/Image(43).png&quot; style=&quot;cursor: default;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
Step12: &amp;nbsp;當上述的動作都完成了，你就可以試試看Rebuild和Start Debugging的功能了.&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
成功的話，你會看到EFI Shell的模擬畫面!&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
※ 本篇文章是參考我以前同事部落格所多做的一些說明，如果你需要更仔細的說明，請參考我以前同事&amp;nbsp;&lt;a href=&quot;http://www.blogger.com/profile/13740223047141525668&quot; rel=&quot;nofollow&quot; style=&quot;background-color: whitesmoke; color: purple; font-family: &#39;Trebuchet MS&#39;, verdana, sans-serif; text-align: -webkit-auto; text-decoration: none;&quot;&gt;Tim Lewis&lt;/a&gt;&lt;span style=&quot;background-color: whitesmoke; font-family: &#39;Trebuchet MS&#39;, verdana, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: -webkit-auto;&quot;&gt;的部落格~&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto; text-indent: 10px;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;background-color: whitesmoke; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 22px; text-indent: 10px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/3310943113836995975/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/3310943113836995975' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/3310943113836995975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/3310943113836995975'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2012/09/efi4-vs2010edkii.html' title='快快樂樂學EFI(4)-使用VS2010建立EDKII專案'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDUav6wQ2c-0GYL0hte9qC5k-d9wdkNItYoiRjfqBWp84bTgJDa7MC9zSlYOxHIlDwbajOzFVwxGw9wyq0FVXlAUCxu1J-5kloG9JRBo4IvWT72_O5USmWxqR8o9DyqpTFYMA92g/s72-c/%E6%9C%AA%E5%91%BD%E5%90%8D7.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34652574.post-6517603052850477263</id><published>2012-09-06T01:01:00.002-07:00</published><updated>2012-09-06T01:01:29.501-07:00</updated><title type='text'>快快樂樂學EFI(3)-建立EDKII 環境</title><content type='html'>&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
光陰似箭，歲月如梭! 在EDK推出好幾年後，緊接著BIOS界中的另一個大事情就是又來了一個EDKII。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
其實EDK II 推出的概念是因為EDK 有許多使用者有一堆抱怨，像是不能跨平台使用啦~不能用&quot;微軟&quot;之外的Compiler啦~東西不夠模組化啦~&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
因此針對了使用者的抱怨而做了一些修改? (一些嗎? 改的還蠻大的，不過幾乎都是在Build tool端，本身你寫EFI driver的方式沒啥改變)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
從寫EFI driver的角度來看，你會發現有許多的EntryPoint全部被導入到EDKII的Library內去做初始化，這個好處是當Platform改變時容易移植到其他平台!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
而其他的部分你就要去習慣新的Build tool的語法以及用法了。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
不多說，那要怎麼開始呢? 一樣找Google 大神，找EDKII後點擊第一個連結去抓code吧!&lt;/div&gt;
&lt;div&gt;
&lt;img src=&quot;file:///C:/Users/z1107tti/AppData/Local/Temp/enhtmlclip/Image(34).png&quot; style=&quot;cursor: default;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg-P6VoQDZcEWnMl2spk9GkTYjMtlKiSgAPb3ocJJ4KKlUl8lAz7e6GMuxZWxjq1se5hg33MGVsTjsz2-mJTZCkOh1gMZ7V_J_W5jphhi1gq8XNG5Mu40AH8ZRQBhYRIJgMKPAPw/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg-P6VoQDZcEWnMl2spk9GkTYjMtlKiSgAPb3ocJJ4KKlUl8lAz7e6GMuxZWxjq1se5hg33MGVsTjsz2-mJTZCkOh1gMZ7V_J_W5jphhi1gq8XNG5Mu40AH8ZRQBhYRIJgMKPAPw/s400/%E6%9C%AA%E5%91%BD%E5%90%8D.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
1.&amp;nbsp;先下載 EDKII codebase&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://sourceforge.net/projects/edk2/files/UDK2010%20Releases/UDK2010.SR1.UP1/UDK2010.SR1.UP1.Complete.MyWorkSpace.zip/download&quot; rel=&quot;nofollow&quot; style=&quot;background-color: white; background-image: url(http://sourceforge.net/apps/mediawiki/tianocore/skins/sourceforge/external.png); background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: #3366bb; font-family: verdana; font-size: 13px; line-height: 19.03333282470703px; padding: 0px 13px 0px 0px; text-decoration: none;&quot; title=&quot;http://sourceforge.net/projects/edk2/files/UDK2010%20Releases/UDK2010.SR1.UP1/UDK2010.SR1.UP1.Complete.MyWorkSpace.zip/download&quot;&gt;&lt;b&gt;UDK2010.SR1.UP1 DownLoad&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2.&lt;span style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;解壓縮到隨便一個目錄，我是解壓縮到 E:\&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;UDK2010.SR1.UP1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
3.從說明文件 &quot;UDK2010.SR1.UP1-ReleaseNotes-MyWorkSpace.txt&quot; 內你可以得知下面幾件事情&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; 1)&amp;nbsp;REFERENCE PLATFORMS 有兩種:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a.Desktop - [Nt32Pkg]&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Nt32Pkg\Nt32Pkg.dsc
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b.&amp;nbsp;DUET - UEFI Simulation Environment directly on Hardware (via boot process)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; 2)&amp;nbsp;HOW TO BUILD (WINDOWS SYSTEM) 你要如何在windows系統去建構他&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;&amp;nbsp; a.Setup Build Environment 設定你的建構環境&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-&amp;nbsp;Install Microsoft Visual Studio 2008* SP1 in the build machine and make&amp;nbsp;sure that AMD64&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;complier was selected when installing.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(安裝微軟的VS2008 SP1，在安裝時要確認你有把AMD64 Compiler選項打勾)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-&amp;nbsp;Download &quot;iasl-win-20070508.zip&quot; from &quot;http://www.acpica.org/downloads/Version_20070508.php&quot;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; and extract file &quot;iasl.exe&quot; to&amp;nbsp;&lt;a href=&quot;file:///C:/ASL&quot;&gt;C:\ASL&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(去這個連結抓iasl-win-20070508.zip 這個檔案，並解壓縮後把iasl.exe複製到C:\ASL ，如果&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C:\ASL目錄不存在請自己建立)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt; b . Extract Common Source Code 解壓縮需要的檔案&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- &amp;nbsp;Extract files in [UDK2010.SR1.UP1.MyWorkSpace]&amp;nbsp; to the working space directory (e.g C:).&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Note the&amp;nbsp;Directory &quot;MyWorkSpace&quot; will be created as a result.&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; In this case, it is C:\MyWorkspace. There are two BaseTools package one&amp;nbsp;is for Windows &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; system and another is for UNIX-Like system.&amp;nbsp;
&lt;br /&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Please make&amp;nbsp;sure BaseTools(Windows).zip is used here. Expand the appropriate BaseTools to&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;file:///C:/MyWorkSpace&quot;&gt;C:\MyWorkSpace&lt;/a&gt;&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(把UDK2010.SR1.UP1.MyWorkSpace.zip檔案解壓縮後他會產生一個目錄叫做&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyWorkSpace，在這目錄內有需要的檔案，你可以把這個目錄複製到&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C:\MyWorkSpace然後再把Windows的Build tool &quot;BaseTools(Windows).zip&quot;也解壓縮到&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 這個目錄裡面)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;因為我是放在E:\MyWorkSpace，所以會長得像下面這樣子:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDVElxjaG_cglx2viPfs9IsfS7x9TH4Dld6-hwhBL0p7V7vBP_MYvwgn20ZJplR8J2-GF7BFFcjZAwas8EvYWFym0YVzqeJyThaKqXzghlw0sTK9S5L8DksTUKmYKj4x67D-oWXw/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDVElxjaG_cglx2viPfs9IsfS7x9TH4Dld6-hwhBL0p7V7vBP_MYvwgn20ZJplR8J2-GF7BFFcjZAwas8EvYWFym0YVzqeJyThaKqXzghlw0sTK9S5L8DksTUKmYKj4x67D-oWXw/s400/%E6%9C%AA%E5%91%BD%E5%90%8D1.png&quot; width=&quot;163&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;&amp;nbsp;c.&amp;nbsp;Generate OpenSSL* Crypto Library (產生OpenSSL Crypto 函數庫)&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OpenSSL 的 Crypto 函數庫實作了許多資料編碼方法，像是資料摘要函數(使用&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MD2/MD4/MD5/SHA雜湊演算法)，對稱式加密函數(使用RC2/RC4/RC5/DES/IDEA&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;演算法)以及非對稱式加密函數(DSA/RSA 演算法)。&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - &amp;nbsp;Open file &quot;C:\MyWorkspace\CryptoPkg\Library\OpensslLib\Patch-HOWTO.txt&quot;&amp;nbsp;and&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;follow the instruction to install OpenSSL* for UEFI building.&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (打開這個目錄下的文件&quot;Patch-HOWTO.txt&quot;，然後跟著他的說明去安裝需要的檔案)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ◎&amp;nbsp;Download OpenSSL 0.9.8w from official website:&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;http://www.openssl.org/source/openssl-0.9.8w.tar.gz (先把這個檔案抓下來)　&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;◎&amp;nbsp;Extract TAR into CryptoPkg/Library/OpenSslLib/openssl-0.9.8w&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (把解壓縮出來的目錄openssl-0.9.8w&amp;nbsp;放到CryptoPkg/Library/OpenSslLib底下)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;◎&amp;nbsp;Apply this patch: EDKII_openssl-0.9.8w.patch, and make installation&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(套用以及安裝這個修正)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-----------------------------&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;For Windows Environment:&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-----------------------------&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - Make sure the patch utility has been installed in your machine.&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;(確認你有安裝Patch的工具，如果沒有，請先到下面網站下載及安裝)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Install Cygwin or get the patch utility binary from&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://gnuwin32.sourceforge.net/packages/patch.htm&quot;&gt;http://gnuwin32.sourceforge.net/packages/patch.htm&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;我是下載下面紅色框框的那一個&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg33B1PF4MTwjbL_nlvIsZZ657IodS4n4dvol8HOY_Xo9Iw0DPhSSJPeK-VhivIssS1rsC6eIJMclXdIBHu3TtjRA0vPguYOb9y9-w4ahcet5UdTzJGhLEKPJtTV63JklMU_EsyKw/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;113&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg33B1PF4MTwjbL_nlvIsZZ657IodS4n4dvol8HOY_Xo9Iw0DPhSSJPeK-VhivIssS1rsC6eIJMclXdIBHu3TtjRA0vPguYOb9y9-w4ahcet5UdTzJGhLEKPJtTV63JklMU_EsyKw/s400/%E6%9C%AA%E5%91%BD%E5%90%8D2.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;安裝後會在我的&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;C:\Program Files (x86)\GnuWin32目錄內&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZjiJ3FeUyI7nycyCjKXD4YJiwyQgQpobFCa04XS7ICZxf45mC4s8t1jdqE5k6Mgc9unBrgp_2vJCZQPGhu3no6VPhF_tAdISv8zvk7LeC9Ml0zFcVv2MWLA-KE6wAH2DMVCVWTg/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZjiJ3FeUyI7nycyCjKXD4YJiwyQgQpobFCa04XS7ICZxf45mC4s8t1jdqE5k6Mgc9unBrgp_2vJCZQPGhu3no6VPhF_tAdISv8zvk7LeC9Ml0zFcVv2MWLA-KE6wAH2DMVCVWTg/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - cd $(WORKSPACE)\CryptoPkg\Library\OpensslLib\openssl-0.9.8w&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - &quot;C:\Program Files (x86)\GnuWin32\bin\patch&quot; -p0 -i ..\EDKII_openssl-0.9.8w.patch&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf7anPfYEz8B7KKJiuxTqXan2B7HwjoFrJwfSZj2wBQ87SduEphcr-6ueIoXVduV0WTbVdIECv_m61pcl3hsD4Y7xQVn6FHzE1nu189X-AbIQnRTCShJTGZ-dQpbyWDhz5lRqGpw/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;198&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf7anPfYEz8B7KKJiuxTqXan2B7HwjoFrJwfSZj2wBQ87SduEphcr-6ueIoXVduV0WTbVdIECv_m61pcl3hsD4Y7xQVn6FHzE1nu189X-AbIQnRTCShJTGZ-dQpbyWDhz5lRqGpw/s640/%E6%9C%AA%E5%91%BD%E5%90%8D4.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - cd ..&lt;br /&gt;&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - Install.cmd&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFTtJ7FAp2rkmmJrw3AFwwuXrhZEfIs38D9ZZdqpfuwLV8SWMkz18n8JLdkSXV0lc0weQoYMjHaQxjx7SSFA2vDZnTBC1-GmPGDHIIzpkhxyU6sbDhqePC0xsVj5qu5hnXXpBnKw/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;134&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFTtJ7FAp2rkmmJrw3AFwwuXrhZEfIs38D9ZZdqpfuwLV8SWMkz18n8JLdkSXV0lc0weQoYMjHaQxjx7SSFA2vDZnTBC1-GmPGDHIIzpkhxyU6sbDhqePC0xsVj5qu5hnXXpBnKw/s320/%E6%9C%AA%E5%91%BD%E5%90%8D5.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;&amp;nbsp; d.&amp;nbsp; Build Steps (開始Build code吧~)&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*** NT32 ***&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - Open a command prompt, type command &quot;cd C:\MyWorkspace&quot; to enter the&amp;nbsp;workspace&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; directory, and then type command &quot;edksetup&quot; to initialize the&amp;nbsp;working environment.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - Type below commands to build platforms&amp;nbsp;&amp;nbsp;&quot;build -t VS2008x86&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(進入到你想到的Platform 目錄內，然後輸入build -t VS2008x86 ，然後你就可以&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;看到開始建構你的Code了，做到這一步就算完成了!)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8t-1VHODOznU9k8T368S8j1UKJxYPR5oolHkDGVNAHGmz308p5FrXmXZwx8pe0NLtF5X77Ap_j1XBq8xf70I23VktP-Vd55Ne8tYxkgzA4hbGip9HCz2p77ASvKPWsOtXTfZt8g/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;99&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8t-1VHODOznU9k8T368S8j1UKJxYPR5oolHkDGVNAHGmz308p5FrXmXZwx8pe0NLtF5X77Ap_j1XBq8xf70I23VktP-Vd55Ne8tYxkgzA4hbGip9HCz2p77ASvKPWsOtXTfZt8g/s320/%E6%9C%AA%E5%91%BD%E5%90%8D6.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 底下是其他注意事項:&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; There are two methods to select the tool chain (Use Microsoft Visual Studio 2008*&amp;nbsp;as sample):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - Update TOOL_CHAIN_TAG in file Conf/target.txt: TOOL_CHAIN_TAG = VS2008&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - Add -t build option in command line: &quot;build -t VS2008 ... &quot;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;For 32-bit VS2008 on 64-bit WINDOWS OS, VS2008x86 should be selected instead of VS2008.&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Please refer to tools_def.txt for all supported tool chains and detailed descriptions.&lt;br /&gt;&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (tools_def.txt will be generated at Conf directory after running &quot;edksetup&quot;.)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 最後，希望大家都能夠成功建立自己的建構環境!&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://biosengineer.blogspot.com/feeds/6517603052850477263/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/34652574/6517603052850477263' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/6517603052850477263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34652574/posts/default/6517603052850477263'/><link rel='alternate' type='text/html' href='http://biosengineer.blogspot.com/2012/09/efi3-edkii.html' title='快快樂樂學EFI(3)-建立EDKII 環境'/><author><name>小華的部落格</name><uri>http://www.blogger.com/profile/05736786715794051383</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg-P6VoQDZcEWnMl2spk9GkTYjMtlKiSgAPb3ocJJ4KKlUl8lAz7e6GMuxZWxjq1se5hg33MGVsTjsz2-mJTZCkOh1gMZ7V_J_W5jphhi1gq8XNG5Mu40AH8ZRQBhYRIJgMKPAPw/s72-c/%E6%9C%AA%E5%91%BD%E5%90%8D.png" height="72" width="72"/><thr:total>3</thr:total></entry></feed>