{"id":745,"date":"2019-10-12T10:52:40","date_gmt":"2019-10-12T02:52:40","guid":{"rendered":"http:\/\/iqotom.com\/?p=745"},"modified":"2024-09-09T16:15:07","modified_gmt":"2024-09-09T08:15:07","slug":"winring0%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/iqotom.com\/?p=745","title":{"rendered":"WinRing0\u5982\u4f55\u4f7f\u7528"},"content":{"rendered":"\n<p style=\"font-size:30px\"><a href=\"https:\/\/github.com\/huchanghui123\/WinRing0_Test \">\u9879\u76ee\u6e90\u7801\u4e0b\u8f7d\u5730\u5740<\/a><\/p>\n\n\n\n<p>WinRing0 \u662f\u4e00\u4e2a\u5b8c\u5168\u514d\u8d39\u5f00\u6e90\u7684\u7ec4\u4ef6( BSD License ), \u5141\u8bb8windows\u7a0b\u5e8f\u76f4\u63a5\u5bf9I\/O\u7aef\u53e3\u8fdb\u884c\u5b58\u53d6\u64cd\u4f5c\u3002<br> \u901a\u8fc7\u4f7f\u7528\u4e00\u79cd\u5185\u6838\u6a21\u5f0f\u7684\u8bbe\u5907\u9a71\u52a8\u5668\u548c\u5176\u5b83\u51e0\u79cd\u5e95\u5c42\u7f16\u7a0b\u6280\u5de7\uff0c\u5b83\u7ed5\u8fc7\u4e86Windows\u7cfb\u7edf\u7684\u4fdd\u62a4\u673a\u5236\u3002<\/p>\n\n\n\n<p> \u8fd9\u91cc\u5229\u7528WinRing0\u7b80\u5355\u5199\u4e00\u4e2a\u8bfb\u53d6SuperIO\u82af\u7247\u578b\u53f7\u3001CPU\u98ce\u6247\u8f6c\u901f\u7684\u5c0f\u7a0b\u5e8f\u4f5c\u4e3a\u4f8b\u5b50 <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e0b\u8f7dWinRing0\uff0c\u51c6\u5907\u5f00\u53d1\u73af\u5883<\/h3>\n\n\n\n<p><strong>1.\u65b0\u5efa\u9879\u76ee\uff0c\u7701\u7565\u2026<\/strong><\/p>\n\n\n\n<p><strong>2.\u5c06\u4e0b\u8f7d\u597d\u7684WinRing0\u9a71\u52a8\u6587\u4ef6\u653e\u5230\u9879\u76ee\/bin\/Debug\u76ee\u5f55<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"492\" height=\"147\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/WinRing0_path.png\" alt=\"\" class=\"wp-image-746\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/WinRing0_path.png 492w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/WinRing0_path-300x90.png 300w\" sizes=\"(max-width: 492px) 100vw, 492px\" \/><figcaption class=\"wp-element-caption\">WinRing0<\/figcaption><\/figure><\/div>\n\n\n<p><strong>3.\u5c06OpenLibSys.cs\u653e\u5230\u9879\u76ee\u6839\u76ee\u5f55<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5f00\u59cb\u7f16\u5199\u4ee3\u7801\uff0c\u8fd9\u91cc\u53ea\u8d34\u51fa\u6838\u5fc3\u4ee3\u7801<\/h3>\n\n\n\n<p>\u5148\u521b\u5efa\u4e00\u4e2aTestByWinRing0\u7c7b\uff0c\u7528\u6765\u8c03\u7528WinRing0\u7684\u63a5\u53e3<\/p>\n\n\n\n<p><strong>1.  \u521d\u59cb\u5316 WinRing0 <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">public bool Initialize()\n{\n\tMyOls = new OpenLibSys.Ols();\n\treturn MyOls.GetStatus() == (uint)OpenLibSys.Ols.Status.NO_ERROR;\n}<\/code><\/pre>\n\n\n\n<p><strong>2. \u6839\u636eSIO\u82af\u7247\u624b\u518c\u67e5\u627e\u9700\u8981\u7684IO\u7aef\u53e3\u53f7<\/strong><br>\u4e3b\u677f\u578b\u53f7<a href=\"http:\/\/www.qotom.com\/product\/37.html\">QOTOM Q6XXG2-P<\/a>, SuperIO\u82af\u7247\u578b\u53f7\uff1aIT8772I-E<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"528\" height=\"240\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_0.png\" alt=\"\" class=\"wp-image-755\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_0.png 528w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_0-300x136.png 300w\" sizes=\"(max-width: 528px) 100vw, 528px\" \/><figcaption class=\"wp-element-caption\">Enter MB PnP Mode<\/figcaption><\/figure><\/div>\n\n\n<p><strong>sio\u82af\u7247\u5165\u53e3\u5730\u5740\uff0887,01,55,55\uff09<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">public void InitSuperIO()\n{\n\tMyOls.WriteIoPortByte(SuperIO.REG, 0x87);\n\tMyOls.WriteIoPortByte(SuperIO.REG, 0x01);\n\tMyOls.WriteIoPortByte(SuperIO.REG, 0x55);\n\tMyOls.WriteIoPortByte(SuperIO.REG, 0x55);\n}<\/code><\/pre>\n\n\n\n<p><strong>3. \u8bfb\u53d6SIO\u82af\u7247\u578b\u53f7<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"693\" height=\"285\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_1.png\" alt=\"\" class=\"wp-image-756\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_1.png 693w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_1-300x123.png 300w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_1-660x271.png 660w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><figcaption class=\"wp-element-caption\">Chip ID<\/figcaption><\/figure><\/div>\n\n\n<p>\u82af\u7247\u578b\u53f7\u662f16\u4f4d\uff0c\u7531\u4e24\u4e2a\u5b57\u8282\u7ec4\u6210<strong>\u5730\u574020h,21h<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">private static int SuperIo_Inw(byte data)\n{\n\tint val;\n\tMyOls.WriteIoPortByte(0x2e, data++);\n\tval = MyOls.ReadIoPortByte(0x2f) &lt;&lt; 8;\n\tMyOls.WriteIoPortByte(0x2e, data);\n\tval |= MyOls.ReadIoPortByte(0x2f);\n\treturn val;\n}<\/code><\/pre>\n\n\n\n<p><strong>4. \u914d\u7f6e\u98ce\u6247\u63a7\u5236\u5bc4\u5b58\u5668<\/strong><br>\u98ce\u6247\u5c5e\u4e8e\u73af\u5883\u63a7\u5236\u5668,<strong>LDN=04h\uff0c\u63a7\u5236\u5668\u6fc0\u6d3b\u5730\u574030h<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"673\" height=\"180\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_2.png\" alt=\"\" class=\"wp-image-757\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_2.png 673w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_2-300x80.png 300w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_2-660x177.png 660w\" sizes=\"(max-width: 673px) 100vw, 673px\" \/><figcaption class=\"wp-element-caption\">Environment<\/figcaption><\/figure><\/div>\n\n\n<p><strong>EC\u63a7\u5236\u5668\u57fa\u5730\u574016\u4f4d\uff0c\u4e24\u4e2a\u5b57\u8282\uff0c\u7531\u9ad8\u4f4d60h\uff0c\u4f4e\u4f4d61h\u7ec4\u6210<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"677\" height=\"204\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_3.png\" alt=\"\" class=\"wp-image-748\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_3.png 677w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_3-300x90.png 300w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_3-660x199.png 660w\" sizes=\"(max-width: 677px) 100vw, 677px\" \/><\/figure>\n\n\n\n<p><strong>\u914d\u7f6e\u5bc4\u5b58\u5668\u5730\u5740Base+05h\uff0c\u914d\u7f6e\u5bc4\u5b58\u5668\u6570\u636e\u5730\u5740Base+06h<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"251\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_4.png\" alt=\"\" class=\"wp-image-749\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_4.png 692w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_4-300x109.png 300w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_4-660x239.png 660w\" sizes=\"(max-width: 692px) 100vw, 692px\" \/><figcaption class=\"wp-element-caption\">EC Base Address<\/figcaption><\/figure><\/div>\n\n\n<p><strong>\u914d\u7f6e\u98ce\u6247\u8f6c\u901f\u63a7\u5236\u5bc4\u5b58\u5668\uff0c\u5730\u57400C <\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"569\" height=\"70\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_5.png\" alt=\"\" class=\"wp-image-750\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_5.png 569w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_5-300x37.png 300w\" sizes=\"(max-width: 569px) 100vw, 569px\" \/><figcaption class=\"wp-element-caption\">Fan Register<\/figcaption><\/figure><\/div>\n\n\n<pre class=\"wp-block-code\"><code class=\"\">public void InitEc()\n{\n\tMyOls.WriteIoPortByte(0x2e, 0x07);\n\tMyOls.WriteIoPortByte(0x2f, 0x04);\n\tMyOls.WriteIoPortByte(0x2e, 0x30);\n\tMyOls.WriteIoPortByte(0x2f, 0x01);\n\tushort ec_base = (ushort)SuperIo_Inw(0x60);\n\tec_addr_port = (ushort)(ec_base + 0x05);\n\tec_data_port = (ushort)(ec_base + 0x06);\n\tMyOls.WriteIoPortByte(ec_addr_port, 0x0c);\n\tMyOls.WriteIoPortByte(ec_data_port, 0x00);\n}<\/code><\/pre>\n\n\n\n<p><strong>5. \u8bfb\u53d6\u98ce\u6247\u8f6c\u901f<\/strong><br>\u98ce\u6247\u8f6c\u901f\u4fdd\u5b58\u5728\u4e00\u4e2a16\u4f4d\u6570\u636e\u91cc\uff0c\u7531\u4e24\u4e2a8\u4f4d\u6570\u636e\u4fdd\u5b58<br>\u4e0a\u9762\u63d0\u5230\u8f6c\u901f\u63a7\u5236\u5bc4\u5b58\u5668\uff0c\u4f7f\u7528\u7684\u7b2c\u4e00\u7ec4\u98ce\u6247\uff0c\u5730\u57400e<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"91\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_6.png\" alt=\"\" class=\"wp-image-751\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_6.png 675w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_6-300x40.png 300w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_6-660x89.png 660w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><figcaption class=\"wp-element-caption\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"95\" class=\"wp-image-752\" style=\"width: 800px;\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_7.png\" alt=\"\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_7.png 674w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_7-300x36.png 300w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_7-660x78.png 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><br>Fan Read Register<\/figcaption><\/figure><\/div>\n\n\n<p><strong>\u98ce\u6247\u8f6c\u901f\u8ba1\u7b97\u516c\u5f0f<\/strong><br>\u4e0d\u540c\u7684\u82af\u7247\u8ba1\u7b97\u65b9\u5f0f\u5404\u4e0d\u76f8\u540c\uff0c\u9700\u8981\u53c2\u7167\u82af\u7247\u624b\u518c<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"690\" height=\"144\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_8.png\" alt=\"\" class=\"wp-image-753\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_8.png 690w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_8-300x63.png 300w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/sio_enter_8-660x138.png 660w\" sizes=\"(max-width: 690px) 100vw, 690px\" \/><figcaption class=\"wp-element-caption\">fan \u8f6c\u901f\u8ba1\u7b97\u516c\u5f0f<\/figcaption><\/figure><\/div>\n\n\n<pre class=\"wp-block-code\"><code class=\"\">public int GetFanRpm()\n{\n\tint fan_speed = 0;\n\tint fan_rpm = 0;\n\t\/\/2-3 Reading Registers[7:0] (Index=0Eh-0Fh)\n\tMyOls.WriteIoPortByte(ec_addr_port, 0x0e);\n\tbyte lval = MyOls.ReadIoPortByte(ec_data_port);\n\n\t\/\/2-3 Extended Reading Registers [15:8] (Index=19h-1Ah)\n\tMyOls.WriteIoPortByte(ec_addr_port, 0x19);\n\tbyte mval = MyOls.ReadIoPortByte(ec_data_port);\n\n\tfan_speed = (mval &lt;&lt; 8) | lval;\n\tConsole.WriteLine(\"fan_speed:\" + fan_speed);\n\tfan_rpm = (int)(1.35 * Math.Pow(10, 6) \/ (fan_speed * 2));\n\n\treturn fan_rpm;\n}<\/code><\/pre>\n\n\n\n<p><strong>6. \u8fd0\u884c\u754c\u9762<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"386\" height=\"143\" src=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/winring0_test.png\" alt=\"\" class=\"wp-image-754\" srcset=\"http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/winring0_test.png 386w, http:\/\/iqotom.com\/wp-content\/uploads\/2019\/10\/winring0_test-300x111.png 300w\" sizes=\"(max-width: 386px) 100vw, 386px\" \/><figcaption class=\"wp-element-caption\">WinRing0 test<\/figcaption><\/figure><\/div>\n\n\n<p> \u8f6c\u901f\u8ddfaida64\u5bf9\u6bd4\u6709\u4e2a\u51e0\u5341\u8f6c\u7684\u5dee\u8ddd <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9879\u76ee\u6e90\u7801\u4e0b\u8f7d\u5730\u5740 WinRing0 \u662f\u4e00\u4e2a\u5b8c\u5168\u514d\u8d39\u5f00\u6e90\u7684\u7ec4\u4ef6( BSD License ), \u5141\u8bb8window\u2026 <span class=\"read-more\"><a href=\"http:\/\/iqotom.com\/?p=745\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":760,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56,4,81],"tags":[57,53,69],"_links":{"self":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts\/745"}],"collection":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=745"}],"version-history":[{"count":8,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts\/745\/revisions"}],"predecessor-version":[{"id":2047,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts\/745\/revisions\/2047"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/media\/760"}],"wp:attachment":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=745"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}