<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Tinychenlin</title>
        <link>https://paragraph.com/@cryptometaman</link>
        <description>undefined</description>
        <lastBuildDate>Fri, 03 Apr 2026 22:54:21 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Tinychenlin</title>
            <url>https://storage.googleapis.com/papyrus_images/796361057d0cbfd604814e3a4bb7a5a7f3a4c1fa6f6c32f1c8bc45fe7b302356.jpg</url>
            <link>https://paragraph.com/@cryptometaman</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[WEB3]]></title>
            <link>https://paragraph.com/@cryptometaman/web3</link>
            <guid>1p5VIlEapk4za0I7GQli</guid>
            <pubDate>Thu, 04 Aug 2022 23:46:03 GMT</pubDate>
            <description><![CDATA[I like web3]]></description>
            <content:encoded><![CDATA[<p>I like web3</p>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
        <item>
            <title><![CDATA[兰亭序]]></title>
            <link>https://paragraph.com/@cryptometaman/loJZ2XGTgvQI1CdTVZRT</link>
            <guid>loJZ2XGTgvQI1CdTVZRT</guid>
            <pubDate>Sat, 28 May 2022 14:04:03 GMT</pubDate>
            <description><![CDATA[永和九年，岁在癸丑，暮春之初，会于会稽山阴之兰亭，修禊事也。群贤毕至，少长咸集。此地有崇山峻岭，茂林修竹，又有清流激湍，映带左右。引以为流觞曲水，列坐其次，虽无丝竹管弦之盛，一觞一咏，亦足以畅叙幽情。是日也，天朗气清，惠风和畅。仰观宇宙之大，俯察品类之盛，所以游目骋怀，足以极视听之娱，信可乐也。 夫人之相与，俯仰一世。或取诸怀抱，悟言一室之内；或因寄所托，放浪形骸之外。虽趣舍万殊，静躁不同，当其欣于所遇，暂得于己，快然自足，不知老之将至；及其所之既倦，情随事迁，感慨系之矣。向之所欣，俯仰之间，已为陈迹，犹不能不以之兴怀，况修短随化，终期于尽！古人云，“死生亦大矣。”岂不痛哉！ 每览昔人兴感之由，若合一契，未尝不临文嗟悼，不能喻之于怀。固知一死生为虚诞，齐彭殇为妄作。后之视今，亦犹今之视昔。悲夫！故列叙时人，录其所述。虽世殊事异，所以兴怀，其致一也。后之览者，亦将有感于斯文。兰亭序]]></description>
            <content:encoded><![CDATA[<p>永和九年，岁在癸丑，暮春之初，会于会稽山阴之兰亭，修禊事也。群贤毕至，少长咸集。此地有崇山峻岭，茂林修竹，又有清流激湍，映带左右。引以为流觞曲水，列坐其次，虽无丝竹管弦之盛，一觞一咏，亦足以畅叙幽情。是日也，天朗气清，惠风和畅。仰观宇宙之大，俯察品类之盛，所以游目骋怀，足以极视听之娱，信可乐也。</p><p>夫人之相与，俯仰一世。或取诸怀抱，悟言一室之内；或因寄所托，放浪形骸之外。虽趣舍万殊，静躁不同，当其欣于所遇，暂得于己，快然自足，不知老之将至；及其所之既倦，情随事迁，感慨系之矣。向之所欣，俯仰之间，已为陈迹，犹不能不以之兴怀，况修短随化，终期于尽！古人云，“死生亦大矣。”岂不痛哉！</p><p>每览昔人兴感之由，若合一契，未尝不临文嗟悼，不能喻之于怀。固知一死生为虚诞，齐彭殇为妄作。后之视今，亦犹今之视昔。悲夫！故列叙时人，录其所述。虽世殊事异，所以兴怀，其致一也。后之览者，亦将有感于斯文。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ceb6735be967d767d8b0738f3076e8f5c058580c99ad8ee23bf9f9f90afdf254.png" alt="兰亭序" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">兰亭序</figcaption></figure>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
        <item>
            <title><![CDATA[What is xToken]]></title>
            <link>https://paragraph.com/@cryptometaman/what-is-xtoken</link>
            <guid>oDkHCnOSbYBgnT86trWN</guid>
            <pubDate>Thu, 19 May 2022 10:18:34 GMT</pubDate>
            <description><![CDATA[xtoken terminalxToken is a team of 15 full-time and part-time contributors dedicated to building the comprehensive capital markets platform for Web3. Since launched in July 2020, served thousands of DeFi users and partnered with some of the most dynamic protocols in the space. For most of our history, we were known for building native staking (e.g., xSNX, xBNT, xAAVE) and liquidity (xU3LP) strategies. We processed over $300 million in primary volume across our funds, peaking at $150 million i...]]></description>
            <content:encoded><![CDATA[<figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e749309146c876d5eda317931b6b3b5e065a1bbc164593bc2a85a640ba3f8d87.png" alt="xtoken terminal" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">xtoken terminal</figcaption></figure><p>xToken is a team of 15 full-time and part-time contributors dedicated to building the comprehensive capital markets platform for Web3. Since launched in July 2020, served thousands of DeFi users and partnered with some of the most dynamic protocols in the space. For most of our history, we were known for building native staking (e.g., xSNX, xBNT, xAAVE) and liquidity (xU3LP) strategies. We processed over $300 million in primary volume across our funds, peaking at $150 million in TVL. During the time we spent building an asset management platform, we learned an incredible amount about the DeFi space and the critical needs of the projects operating within it.</p><p>xToken Terminal gives projects seamless access to fundamental DeFi primitives. Our flexible contract architecture and intuitive interface enables projects to be their own CFOs and investment bankers.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://xtokenterminal.io/">https://xtokenterminal.io/</a></p><p>Easy to use APP with the simple UI.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://app.xtokenterminal.io/mining/discover">https://app.xtokenterminal.io/mining/discover</a></p><p>Some of the <strong>key features</strong> available to <em>pool creators</em> on Mining:</p><ul><li><p>Pick any Uniswap V3 pool to incentivize</p></li><li><p>Pick a <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.uniswap.org/protocol/concepts/V3-overview/concentrated-liquidity">custom price range</a> within which to incentivize liquidity (&quot;concentrated liquidity&quot;)</p></li><li><p>Pick any reward token(s) to incentivize liquidity</p></li><li><p>Set rewards amount(s) and program duration(s)</p></li><li><p>Configure a vesting period on rewards (optional)</p></li></ul><p>Some of the <strong>key features</strong> available to <em>liquidity providers</em> on Mining:</p><ul><li><p>Discover active liquidity mining programs</p></li><li><p>Deposit liquidity and immediately begin earning rewards</p></li><li><p>Assurance that pool sponsors have not inserted any malicious code into their staking rewards contracts</p></li></ul><p>xToken Terminal <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://xtokenterminal.io/">xtokenterminal.io</a></p><p>Twitter<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/xtokenterminal"> https://twitter.com/xtokenterminal</a> </p><p>Medium<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://medium.com/xtoken"> https://medium.com/xtoken</a></p><p>Docs<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.xtokenterminal.io/"> https://docs.xtokenterminal.io/</a> </p>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
        <item>
            <title><![CDATA[春江花月夜]]></title>
            <link>https://paragraph.com/@cryptometaman/VNscnJMimJ615RpdJvNl</link>
            <guid>VNscnJMimJ615RpdJvNl</guid>
            <pubDate>Wed, 04 May 2022 08:19:30 GMT</pubDate>
            <description><![CDATA[春江花月夜春江潮水连海平，海上明月共潮生。 滟滟随波千万里，何处春江无月明！ 江流宛转绕芳甸，月照花林皆似霰。 空里流霜不觉飞，汀上白沙看不见。 江天一色无纤尘，皎皎空中孤月轮。 江畔何人初见月？江月何年初照人？ 人生代代无穷已，江月年年望相似。 不知江月待何人，但见长江送流水。 白云一片去悠悠，青枫浦上不胜愁。 谁家今夜扁舟子？何处相思明月楼？ 可怜楼上月裴回，应照离人妆镜台。 玉户帘中卷不去，捣衣砧上拂还来。 此时相望不相闻，愿逐月华流照君。 鸿雁长飞光不度，鱼龙潜跃水成文。 昨夜闲潭梦落花，可怜春半不还家。 江水流春去欲尽，江潭落月复西斜。 斜月沉沉藏海雾，碣石潇湘无限路。 不知乘月几人归，落月摇情满江树。明月]]></description>
            <content:encoded><![CDATA[<figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d1d5905497c4681657453bd5aa820c1973270b4c012cf140f70b6f4e4359692a.jpg" alt="春江花月夜" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">春江花月夜</figcaption></figure><p>春江潮水连海平，海上明月共潮生。 滟滟随波千万里，何处春江无月明！ 江流宛转绕芳甸，月照花林皆似霰。 空里流霜不觉飞，汀上白沙看不见。 江天一色无纤尘，皎皎空中孤月轮。 江畔何人初见月？江月何年初照人？ 人生代代无穷已，江月年年望相似。 不知江月待何人，但见长江送流水。 白云一片去悠悠，青枫浦上不胜愁。 谁家今夜扁舟子？何处相思明月楼？ 可怜楼上月裴回，应照离人妆镜台。 玉户帘中卷不去，捣衣砧上拂还来。 此时相望不相闻，愿逐月华流照君。 鸿雁长飞光不度，鱼龙潜跃水成文。 昨夜闲潭梦落花，可怜春半不还家。 江水流春去欲尽，江潭落月复西斜。 斜月沉沉藏海雾，碣石潇湘无限路。 不知乘月几人归，落月摇情满江树。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a65a1b8dca8427fe77f27e101457477a91a3edb460e1eda18171ee6d0a0d83b9.jpg" alt="明月" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">明月</figcaption></figure>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/6cdf61f9e3d1edb90ad60b848be2ce08a95c58a736fb4a67b7408662fb554d45.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[JTAG 学习笔记之状态机]]></title>
            <link>https://paragraph.com/@cryptometaman/jtag</link>
            <guid>UCsxeiLDc1soqrTkkjbe</guid>
            <pubDate>Tue, 04 Jan 2022 07:45:42 GMT</pubDate>
            <description><![CDATA[JTAG简介JTAG接口的基本工作原理是：在芯片内部定义一个TAP（Test Access Port，测试访问端口），开发人员使用连接到芯片的JTAG外部接口上的JTAG调试器，通过访问芯片内部的TAP端口来扫描芯片内部各个扫描单元以写 入或读取扫描寄存器的状态，从而对芯片进行测试和调试。一个扫描单元对应一个外部管脚，每个外部管脚有一个扫描寄存器BSR单元，所有这些管脚的扫描寄存 器连在一起就形成了扫描链。简单地说，PC通过JTAG调试器对目标板的调试就是通过TAP端口完成对扫描寄存器BSR和指令寄存器IR的读写访问。要了 解关于JTAG 更全面的知识，请参阅 IEEE1149.1标准。基本概念JTAG 是Joint Test Action Group（联合测试行动组）的缩写，是一种国际标准测试协议，它遵守IEEE 1149.1标准。一个含有JTAG接口的处理器，只要时钟正常，就可以通过JTAG接口访问处理器的内部寄存器、挂在处理器总线上的设备以及内置模块的 寄存器。 TAP 是Test Access Port（测试访问端口）的缩写，是芯片内部一个通用的端口，通过TAP可以访问芯...]]></description>
            <content:encoded><![CDATA[<h2 id="h-jtag" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">JTAG简介</h2><p>JTAG接口的基本工作原理是：在芯片内部定义一个TAP（Test Access Port，测试访问端口），开发人员使用连接到芯片的JTAG外部接口上的JTAG调试器，通过访问芯片内部的TAP端口来扫描芯片内部各个扫描单元以写 入或读取扫描寄存器的状态，从而对芯片进行测试和调试。一个扫描单元对应一个外部管脚，每个外部管脚有一个扫描寄存器BSR单元，所有这些管脚的扫描寄存 器连在一起就形成了扫描链。简单地说，PC通过JTAG调试器对目标板的调试就是通过TAP端口完成对扫描寄存器BSR和指令寄存器IR的读写访问。要了 解关于JTAG 更全面的知识，请参阅 IEEE1149.1标准。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">基本概念</h2><p><strong>JTAG</strong></p><p>是Joint Test Action Group（联合测试行动组）的缩写，是一种国际标准测试协议，它遵守IEEE 1149.1标准。一个含有JTAG接口的处理器，只要时钟正常，就可以通过JTAG接口访问处理器的内部寄存器、挂在处理器总线上的设备以及内置模块的 寄存器。</p><p><strong>TAP</strong></p><p>是Test Access Port（测试访问端口）的缩写，是芯片内部一个通用的端口，通过TAP可以访问芯片提供的所有数据寄存器（DR）和指令寄存器（IR），对整个TAP的控制是通过TAP控制器（TAP Controller）完成的。</p><p><strong>边界扫描</strong></p><p>英文叫Boundary Scan，边界扫描的基本思想是在靠近芯片的输入输出管脚（PIN）上设置一个移位寄存器单元，也就是边界扫描寄存器（Boundary-Scan Register）。当芯片处于调试状态时，边界扫描寄存器可以将芯片和外部输入输出管脚隔离开来，通过边界扫描寄存器单元，可以实现对芯片外部输入输出 管脚的观察和控制。对于芯片的输出管脚可以通过与之相连的边界扫描寄存器单元把信号（数据）加载到该引脚中去，对于芯片的输入管脚，也可以通过与之相连的 边界扫描寄存器&quot;捕获&quot;该管脚上的输出信号。在正常的运行状态下，边界扫描寄存器对芯片来说是透明的，所以正常的运行不会受到任何影响，这样，边界扫描寄 存器提供了一种便捷的途径用于观测和控制所需调试的芯片。另外，芯片管脚上的边界扫描（移位）寄存器单元可以相互连接起来，使芯片的周围形成一个边界扫描 链（Boundary-Scan Chain），边界扫描链可以串行地输入和输出，通过相应的时钟信号和控制信号，就可以方便地观察和控制处在调试状态下的芯片。</p><p><strong>JTAG接口信号</strong></p><p>标准的JTAG接口定义了以下一些信号管脚：</p><p>TMS：测试模式选择信号，输入，IEEE 1149.1标准强制要求。</p><p>TCK：测试时钟信号，输入，IEEE 1149.1标准强制要求。</p><p>TDI：测试数据输入信号，输入，IEEE 1149.1标准强制要求。</p><p>TDO：测试数据输出信号，输出，IEEE 1149.1标准强制要求。</p><p>TRST：内部TAP控制器复位信号，输入，IEEE 1149.1标准不强制要求，因为通过TMS也可以对TAP Controller进行复位。</p><p>STCK：时钟返回信号，IEEE 1149.1标准不强制要求。</p><p>DBGRQ：目标板上工作状态的控制信号，IEEE 1149.1标准不强制要求</p><h2 id="h-tap" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">TAP控制器的状态机</h2><p>TAP控制器有16个同步状态，控制器的下一个状态TMS信号决定，TMS信号在TCK的上升沿被采样生效。</p><p>列出了TAP控制器的16个同步状态转换机制。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4fa0318647ecc4a5b70d8eb6e41a06eea2fe8b880b95bb51fe7db61fcd1f64c2.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Test_Logic_Reset测试逻辑复位状态</strong></p><p>处于这种状态下，测试逻辑被禁止以允许芯片正常操作，读IDCODE寄存器将禁止测试逻辑。</p><p>无论TAP控制器处于何种状态，只要将TMS信号在5个连续的TCK信号的上升沿保持高电平，TAP就将进入Test_Logic_Reset状 态，如果TMS信号一直为高电平，那么TAP将保持在Test_Logic_Reset状态，另外TRST信号也可以强迫TAP进入Test_Logic_Reset状态。</p><p>处于Test_Logic_Reset状态的TAP，如果下一个TCK的上升沿时TMS信号处于低电平，那么TAP将被切换到Run_Test_Idle状态。</p><p><strong>Run_Test_Idle运行测试空闲状态</strong></p><p>Run_Test_Idle是TAP控制器扫描操作空闲状态，如果TMS信号一直处于低电平，那么TAP将保持在TRun_Test_Idle状态。当TMS信号在TCK上升沿处于高电平，TAP控制器将进入Select_DR_Scan状态。</p><p><strong>Select_DR_Scan选择数据寄存器扫描状态</strong></p><p>Select_DR_Scan是TAP控制器的一个临时状态，边界扫描寄存器BSR保持它们先前的状态。</p><p>当TMS信号在下一个TCK上升沿处于低电平，TAP控制器进入Capture_DR状态，一个边界扫描寄存器的扫描操作同时被初始化。</p><p>如果TMS信号在下一个TCK上升沿处于高电平，TAP控制器将进入Select_IR_Scan状态。</p><p><strong>Capture_DR捕获数据寄存器状态</strong></p><p>如果TAP控制器处于Capture_DR状态，且当前指令是SAMPLE/PRELOAD指令，那么边界扫描寄存器BSR在TCK信号的上升沿捕 获输入管脚的数据。如果此时不是SAMPLE/PRELOAD指令，那么BSR保持它们先前的值，另外BSR的值被放入连接在TDI和TDO管脚之间的移位寄存器中。</p><p>处于Capture_DR状态时，指令不会被改变。</p><p>如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Exit1_DR状态。如果TMS信号在下一个TCK上升沿处于低电平，则TAP进入Shift_DR状态。</p><p><strong>Shift_DR移位数据寄存器状态</strong></p><p>在Shift_DR状态下，在每个TCK的上升沿，TDI-移位寄存器-TDO串行通道向右移一位，TDI的数据移入移位寄存器，移位寄存器最靠近TDO的位移到TDO管脚上。</p><p>处于Shift_DR状态时，指令不会被改变。</p><p>如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Exit1_DR状态。如果TMS信号处于低电平，则TAP一直进行移位操作。</p><p><strong>Exit1_DR退出数据寄存器状态1</strong></p><p>Exit1_DR是TAP控制器的一个临时状态，如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Update_DR状态；如果TMS信号在下一个TCK上升沿处于低电平，则TAP进入Pause_DR状态。</p><p>处于Exit1_DR状态时，指令不会被改变。</p><p><strong>Pause_DR暂停数据寄存器状态</strong></p><p>Pause_DR状态允许TAP控制器暂时停止TDI-移位寄存器-TDO串行通道的移位操作。</p><p>处于Pause_DR状态时，指令不会被改变。</p><p>如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Exit2_DR状态；如果TMS信号处于低电平，则TAP一直保持暂停状态。</p><p><strong>Exit2_DR退出数据寄存器状态2</strong></p><p>Exit2_DR也是TAP控制器的临时状态，如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Update_DR状态，结束扫描操作；如果TMS信号在下一个TCK上升沿处于低电平，则TAP重新进入Shift_DR状态。</p><p>处于Exit2_D状态时，指令不会被改变。</p><p><strong>Update_DR更新数据寄存器状态</strong></p><p>在正常情况下，边界扫描寄存器BSR的值是被锁存在并行输出管脚中，以免在EXTEST或SAMPLE/PRELOAD命令下执行移位操作时改变 BSR的值。当处于Update_DR状态时选择的是BSR寄存器，那么移位寄存器中的值将在TCK的下降沿被锁存到BSR寄存器的并行输出管脚中去。</p><p>处于Update_DR状态时，指令不会被改变。</p><p>如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Select_DR_Scan状态；如果TMS信号在下一个TCK上升沿处于低电平，则TAP进入Run_Test_Idle状态。</p><p><strong>Select_IR_Scan选择指令寄存器扫描状态</strong></p><p>Select_IR_Scan是TAP控制器的一个临时状态。</p><p>如果TMS信号在下一个TCK上升沿处于低电平，TAP控制器进入Capture_IR状态，一个对指令寄存器的扫描操作同时被初始化。</p><p>如果TMS信号在下一个TCK上升沿处于高电平，TAP控制器将进入Test_Logic_Reset状态。</p><p>处于Select_IR_Scan状态时，指令不会被改变。</p><p><strong>Capture-IR捕获指令寄存器状态</strong></p><p>处于Capture-IR状态时，指令寄存器中的值被固定设置成0b0000001，并将它放入连接在TDI与TDO之间的移位寄存器中。</p><p>处于Capture-DR状态时，指令不会被改变。</p><p>如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Exit1-IR状态；如果TMS信号在下一个TCK上升沿处于低电平，则TAP进入Shift-IR状态。</p><p><strong>Shift_IR移位指令寄存器状态</strong></p><p>在Shift_IR状态下，在每个TCK的上升沿，TDI-移位寄存器-TDO串行通道向右移一位，JTAG指令从TDI管脚上被逐位移入移位寄存器，而移位寄存器中的0b0000001则被逐位从TDO管脚移出。</p><p>处于Shift_IR状态时，指令不会被改变。</p><p>如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Exit1_IR状态；如果TMS信号处于低电平，则TAP一直进行移位操作。</p><p><strong>Exit1_IR退出指令寄存器状态1</strong></p><p>Exit1_IR是TAP控制器的一个临时状态，如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Update_IR状态；如果TMS信号在下一个TCK上升沿处于低电平，则TAP进入Pause_IR状态。</p><p>处于Exit1_IR状态时，指令不会被改变。</p><p><strong>Pause_IR暂停指令寄存器状态</strong></p><p>Pause_IR状态允许TAP控制器暂时停止TDI-移位寄存器-TDO串行通道的移位操作。</p><p>处于Pause_IR状态时，指令不会被改变。</p><p>如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Exit2_IR状态；如果TMS信号处于低电平，则TAP一直处于暂停状态。</p><p><strong>Exit2_IR退出指令寄存器状态2</strong></p><p>Exit2_IR也是TAP控制器的临时状态，如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Update_IR状态，结束扫描操作；如果TMS信号在下一个TCK上升沿处于低电平，则TAP重新进入Shift-IR状态。</p><p>处于Exit2-D状态时，指令不会被改变。</p><p><strong>Update_IR更新指令寄存器状态</strong></p><p>处于Update_IR状态时，移位寄存器中的值将在TCK的下降沿被锁存到指令寄存器中，一旦锁存成功，新的指令将成为当前的指令。</p><p>如果TMS信号在下一个TCK上升沿处于高电平，TAP进入Select_DR_Scan状态；如果TMS信号在下一个TCK上升沿处于电平，则TAP进入Run_Test_Idle状态。</p><h2 id="h-jtag" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">JTAG接口指令集</h2><p>JTAG接口指令集包含以下常用指令：</p><p><strong>EXTEST指令</strong></p><p>外部测试指令，必须全为0，TAP强制定义。该指令初始化外部电路测试，主要用于板级互连以及片外电路测试。</p><p>EXTEST指令在Shift-DR状态时将扫描寄存器BSR寄存器连接到TDI与TDO之间。在Capture-DR状态时，EXTEST指令将 输入管脚的状态在TCK的上升沿装入BSR中。EXTEST指令从不使用移入BSR中的输入锁存器中的数据，而是直接从管脚上捕获数据。在Update- DR状态时，EXTEST指令将锁存在并行输出寄存器单元中的数据在TCK的下降沿驱动到对应的输出管脚上去。</p><p><strong>SAMPLE/PRELOAD指令</strong></p><p>采样/预装载指令，TAP强制定义。在Capture-DR状态下，SAMPLE/PRELOAD指令提供一个从管脚到片上系统逻辑的数据流快照， 快照在TCK的上升沿提取。在Update-DR状态时，SAMPLE/PRELOAD指令将BSR寄存器单元中的数据锁存到并行输出寄存器单元中，然后 由EXTEST指令将锁存在并行输出寄存器单元中的数据在TCK的下降沿驱动到对应的输出管脚上去。</p><p><strong>BYPASS指令</strong></p><p>旁路指令，必须全为1，TAP强制定义。BYPASS指令通过在TDI和TDO之间放置一个1位的旁通寄存器，这样移位操作时只经过1位的旁通寄存 器而不是很多位（与管脚数量相当）的边界扫描寄存器BSR，从而使得对连接在同一JTAG链上主CPU之外的其他芯片进行测试时提高效率。</p><p><strong>IDCODE指令</strong></p><p>读取CPU ID号指令，TAP强制定义。该指令将处理器的ID号寄存器连接到TDI和TDO之间。</p>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
        <item>
            <title><![CDATA[Ubuntu 开机自动挂载硬盘]]></title>
            <link>https://paragraph.com/@cryptometaman/ubuntu</link>
            <guid>5qqM4caV2yQwKEcuYhMo</guid>
            <pubDate>Wed, 22 Dec 2021 05:39:47 GMT</pubDate>
            <description><![CDATA[查看系统分区 $ sudo fdisk -l创建挂载目录 $ mkdir /home/user/data 查询硬盘UUID $ sudo blkid /dev/sda2 /dev/sda2: LABEL="Data" UUID="88069947069936E2" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="7170f9a7-9c9f-43d8-9916-da47aa9101f7" 修改配置文件 $ sudo gvim /etc/fstab 末尾添加： UUID=88069947069936E2 /home/user/data ntfs defaults 0 2 $ sudo reboot 第一个数字：0表示开机不检查磁盘，1表示开机检查磁盘； 第二个数字：0表示交换分区，1代表启动分区（Linux），2表示普通分区 我挂载的分区是在WIn系统下创建的分区，磁盘格式为ntfs]]></description>
            <content:encoded><![CDATA[<p>查看系统分区</p><p>$ sudo fdisk -l</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8ac94116a2f687d0bd49e4206982cb9a2e2546c84e60c54cbad74671b2d955ab.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>创建挂载目录</p><p>$ mkdir /home/user/data</p><p>查询硬盘UUID</p><p>$ sudo blkid /dev/sda2</p><p>/dev/sda2: LABEL=&quot;Data&quot; UUID=&quot;88069947069936E2&quot; TYPE=&quot;ntfs&quot; PARTLABEL=&quot;Basic data partition&quot; PARTUUID=&quot;7170f9a7-9c9f-43d8-9916-da47aa9101f7&quot;</p><p>修改配置文件</p><p>$ sudo gvim /etc/fstab</p><p>末尾添加：</p><p>UUID=88069947069936E2 /home/user/data ntfs defaults 0 2</p><p>$ sudo reboot</p><p>第一个数字：0表示开机不检查磁盘，1表示开机检查磁盘； 第二个数字：0表示交换分区，1代表启动分区（Linux），2表示普通分区 我挂载的分区是在WIn系统下创建的分区，磁盘格式为ntfs</p>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
        <item>
            <title><![CDATA[Windows 设置 power mode API]]></title>
            <link>https://paragraph.com/@cryptometaman/windows-power-mode-api</link>
            <guid>1RYvEBvky48VNd1woPvq</guid>
            <pubDate>Tue, 21 Dec 2021 08:14:36 GMT</pubDate>
            <description><![CDATA[1， 查看当前电源模式， 管理员权限执行CMD， 查看当前电源模式下的GUID C:\WINDOWS\system32 > powercfg / q 电源方案 GUID : 381b4222 - f694 - 41f0 - 9685 - ff5bb260df2e(平衡) GUID 别名 : SCHEME_BALANCED 子组 GUID : 0012ee47 - 9041 - 4b5d - 9b77 - 535fba8b1442(硬盘) GUID 别名 : SUB_DISK 电源设置 GUID : 6738e2c4 - e8a5 - 4a42 - b16a - e040e769756e(在此时间后关闭硬盘) GUID 别名 : DISKIDLE 最小可能的设置 : 0x00000000 最大可能的设置 : 0xffffffff 可能的设置增量 : 0x00000001 可能的设置单位 : 秒 当前交流电源设置索引 : 0x000004b0 当前直流电源设置索引 : 0x00000258 子组 GUID : 02f815b5 - a5cf - 4c84 - bf20 - 649d1...]]></description>
            <content:encoded><![CDATA[<p>1， 查看当前电源模式， 管理员权限执行CMD， 查看当前电源模式下的GUID</p><p>C:\WINDOWS\system32 &gt; powercfg / q 电源方案 GUID : 381b4222 - f694 - 41f0 - 9685 - ff5bb260df2e(平衡) GUID 别名 : SCHEME_BALANCED 子组 GUID : 0012ee47 - 9041 - 4b5d - 9b77 - 535fba8b1442(硬盘) GUID 别名 : SUB_DISK 电源设置 GUID : 6738e2c4 - e8a5 - 4a42 - b16a - e040e769756e(在此时间后关闭硬盘) GUID 别名 : DISKIDLE 最小可能的设置 : 0x00000000 最大可能的设置 : 0xffffffff 可能的设置增量 : 0x00000001 可能的设置单位 : 秒 当前交流电源设置索引 : 0x000004b0 当前直流电源设置索引 : 0x00000258</p><p>子组 GUID : 02f815b5 - a5cf - 4c84 - bf20 - 649d1f75d3d8(Internet Explorer) 电源设置 GUID : 4c793e7d - a264 - 42e1 - 87d3 - 7a0d2f523ccd(JavaScript 计时器频率) 可能的设置索引 : 000 可能的设置友好名称 : 最大电源节省量 可能的设置索引 : 001 可能的设置友好名称 : 最高性能 当前交流电源设置索引 : 0x00000001 当前直流电源设置索引 : 0x00000000</p><p>子组 GUID : 0d7dbae2 - 4294 - 402a - ba8e - 26777e8488cd(桌面背景设置) 电源设置 GUID : 309dce9b - bef4 - 4119 - 9921 - a851fb12f0f4(放映幻灯片) 可能的设置索引 : 000 可能的设置友好名称 : 可用 可能的设置索引 : 001 可能的设置友好名称 : 暂停 当前交流电源设置索引 : 0x00000000 当前直流电源设置索引 : 0x00000001</p><p>子组 GUID : 19cbb8fa - 5279 - 450e-9fac - 8a3d5fedd0c1(无线适配器设置) 电源设置 GUID : 12bbebe6 - 58d6 - 4636 - 95bb - 3217ef867c1a(节能模式) 可能的设置索引 : 000 可能的设置友好名称 : 最高性能 可能的设置索引 : 001 可能的设置友好名称 : 低节能 可能的设置索引 : 002 可能的设置友好名称 : 中等节能 可能的设置索引 : 003 可能的设置友好名称 : 最高节能 当前交流电源设置索引 : 0x00000000 当前直流电源设置索引 : 0x00000002</p><p>子组 GUID : 238c9fa8 - 0aad - 41ed - 83f4 - 97be242c8f20(睡眠) GUID 别名 : SUB_SLEEP 电源设置 GUID : 29f6c1db - 86da - 48c5 - 9fdb - f2b67b1f44da(在此时间后睡眠) GUID 别名 : STANDBYIDLE 最小可能的设置 : 0x00000000 最大可能的设置 : 0xffffffff 可能的设置增量 : 0x00000001 可能的设置单位 : 秒 当前交流电源设置索引 : 0x00000000 当前直流电源设置索引 : 0x00000384</p><p>电源设置 GUID : 94ac6d29 - 73ce - 41a6 - 809f - 6363ba21b47e(允许混合睡眠) GUID 别名 : HYBRIDSLEEP 可能的设置索引 : 000 可能的设置友好名称 : 关闭 可能的设置索引 : 001 可能的设置友好名称 : 启用 当前交流电源设置索引 : 0x00000001 当前直流电源设置索引 : 0x00000001</p><p>电源设置 GUID : 9d7815a6 - 7ee4 - 497e-8888 - 515a05f02364(在此时间后休眠) GUID 别名 : HIBERNATEIDLE 最小可能的设置 : 0x00000000 最大可能的设置 : 0xffffffff 可能的设置增量 : 0x00000001 可能的设置单位 : 秒 当前交流电源设置索引 : 0x00000000 当前直流电源设置索引 : 0x00000000</p><p>电源设置 GUID : bd3b718a - 0680 - 4d9d - 8ab2 - e1d2b4ac806d(允许使用唤醒定时器) GUID 别名 : RTCWAKE 可能的设置索引 : 000 可能的设置友好名称 : 禁用 可能的设置索引 : 001 可能的设置友好名称 : 启用 可能的设置索引 : 002 可能的设置友好名称 : 仅限重要的唤醒计算器 当前交流电源设置索引 : 0x00000001 当前直流电源设置索引 : 0x00000001</p><p>子组 GUID : 2a737441 - 1930 - 4402 - 8d77 - b2bebba308a3(USB 设置) 电源设置 GUID : 48e6b7a6 - 50f5 - 4782 - a5d4 - 53bb8f07e226(USB 选择性暂停设置) 可能的设置索引 : 000 可能的设置友好名称 : 已禁用 可能的设置索引 : 001 可能的设置友好名称 : 已启用 当前交流电源设置索引 : 0x00000001 当前直流电源设置索引 : 0x00000001</p><p>子组 GUID : 44f3beca - a7c0 - 460e-9df2 - bb8b99e0cba6(Intel(R) Graphics Settings) 电源设置 GUID : 3619c3f2 - afb2 - 4afc - b0e9 - e7fef372de36(Intel(R) Graphics Power Plan) 可能的设置索引 : 000 可能的设置友好名称 : Maximum Battery Life 可能的设置索引 : 001 可能的设置友好名称 : Balanced 可能的设置索引 : 002 可能的设置友好名称 : Maximum Performance 当前交流电源设置索引 : 0x00000001 当前直流电源设置索引 : 0x00000001</p><p>子组 GUID : 4f971e89 - eebd - 4455 - a8de - 9e59040e7347(电源按钮和盖子) GUID 别名 : SUB_BUTTONS 电源设置 GUID : a7066653 - 8d6c - 40a8 - 910e - a1f54b84c7e5(「开始」菜单电源按钮) GUID 别名 : UIBUTTON_ACTION 可能的设置索引 : 000 可能的设置友好名称 : 睡眠 可能的设置索引 : 001 可能的设置友好名称 : 休眠 可能的设置索引 : 002 可能的设置友好名称 : 关机 当前交流电源设置索引 : 0x00000000 当前直流电源设置索引 : 0x00000000</p><p>子组 GUID : 501a4d13 - 42af - 4429 - 9fd1 - a8218c268e20(PCI Express) GUID 别名 : SUB_PCIEXPRESS 电源设置 GUID : ee12f906 - d277 - 404b - b6da - e5fa1a576df5(链接状态电源管理) GUID 别名 : ASPM 可能的设置索引 : 000 可能的设置友好名称 : 关闭 可能的设置索引 : 001 可能的设置友好名称 : 中等电源节省量 可能的设置索引 : 002 可能的设置友好名称 : 最大电源节省量 当前交流电源设置索引 : 0x00000001 当前直流电源设置索引 : 0x00000002</p><p>子组 GUID : 54533251 - 82be - 4824 - 96c1 - 47b60b740d00(处理器电源管理) GUID 别名 : SUB_PROCESSOR 电源设置 GUID : 893dee8e - 2bef - 41e0 - 89c6 - b55d0929964c(最小处理器状态) GUID 别名 : PROCTHROTTLEMIN 最小可能的设置 : 0x00000000 最大可能的设置 : 0x00000064 可能的设置增量 : 0x00000001 可能的设置单位 : % 当前交流电源设置索引 : 0x00000005 当前直流电源设置索引 : 0x00000005</p><p>电源设置 GUID : 94d3a615 - a899 - 4ac5 - ae2b - e4d8f634367f(系统散热方式) GUID 别名 : SYSCOOLPOL 可能的设置索引 : 000 可能的设置友好名称 : 被动 可能的设置索引 : 001 可能的设置友好名称 : 主动 当前交流电源设置索引 : 0x00000001 当前直流电源设置索引 : 0x00000000</p><p>电源设置 GUID : a1841308 - 3541 - 4fab - bc81 - f71556f20b4a GUID 别名 : SCHEME_MAX 当前交流电源设置索引 : 未知 当前直流电源设置索引 : 未知</p><p>电源设置 GUID : bc5038f7 - 23e0 - 4960 - 96da - 33abaf5935ec(最大处理器状态) GUID 别名 : PROCTHROTTLEMAX 最小可能的设置 : 0x00000000 最大可能的设置 : 0x00000064 可能的设置增量 : 0x00000001 可能的设置单位 : % 当前交流电源设置索引 : 0x00000064 当前直流电源设置索引 : 0x00000064</p><p>子组 GUID : 7516b95f - f776 - 4464 - 8c53 - 06167f40cc99(显示) GUID 别名 : SUB_VIDEO 电源设置 GUID : 3c0bc021 - c8a8 - 4e07 - a973 - 6b14cbcb2b7e(在此时间后关闭显示) GUID 别名 : VIDEOIDLE 最小可能的设置 : 0x00000000 最大可能的设置 : 0xffffffff 可能的设置增量 : 0x00000001 可能的设置单位 : 秒 当前交流电源设置索引 : 0x00000000 当前直流电源设置索引 : 0x00000000</p><p>电源设置 GUID : aded5e82 - b909 - 4619 - 9949 - f5d71dac0bcb(显示器亮度) 最小可能的设置 : 0x00000000 最大可能的设置 : 0x00000064 可能的设置增量 : 0x00000001 可能的设置单位 : % 当前交流电源设置索引 : 0x00000064 当前直流电源设置索引 : 0x00000028</p><p>电源设置 GUID : f1fbfde2 - a960 - 4165 - 9f88 - 50667911ce96(显示器亮度变暗) 最小可能的设置 : 0x00000000 最大可能的设置 : 0x00000064 可能的设置增量 : 0x00000001 可能的设置单位 : % 当前交流电源设置索引 : 0x00000032 当前直流电源设置索引 : 0x00000032</p><p>电源设置 GUID : fbd9aa66 - 9553 - 4097 - ba44 - ed6e9d65eab8(启用自适应亮度) GUID 别名 : ADAPTBRIGHT 可能的设置索引 : 000 可能的设置友好名称 : 关闭 可能的设置索引 : 001 可能的设置友好名称 : 启用 当前交流电源设置索引 : 0x00000000 当前直流电源设置索引 : 0x00000000</p><p>子组 GUID : 9596fb26 - 9850 - 41fd - ac3e - f7c3c00afd4b(“多媒体”设置) 电源设置 GUID : 03680956 - 93bc - 4294 - bba6 - 4e0f09bb717f(共享媒体时) 可能的设置索引: 000 可能的设置友好名称 : 允许计算机睡眠 可能的设置索引 : 001 可能的设置友好名称 : 阻止计算机在一段时间不活动后进入睡眠状态 可能的设置索引 : 002 可能的设置友好名称 : 允许计算机进入离开模式 当前交流电源设置索引 : 0x00000001 当前直流电源设置索引 : 0x00000000</p><p>电源设置 GUID : 10778347 - 1370 - 4ee0 - 8bbd - 33bdacaade49(视频播放质量补偿) 可能的设置索引 : 000 可能的设置友好名称 : 视频播放节能偏向 可能的设置索引 : 001 可能的设置友好名称 : 视频播放性能补偿 当前交流电源设置索引 : 0x00000001 当前直流电源设置索引 : 0x00000000</p><p>电源设置 GUID : 34c7b99f - 9a6d - 4b3c - 8dc7 - b6693b78cef4(播放视频时) 可能的设置索引 : 000 可能的设置友好名称 : 优化视频质量 可能的设置索引 : 001 可能的设置友好名称 : 平衡 可能的设置索引 : 002 可能的设置友好名称 : 优化节能 当前交流电源设置索引 : 0x00000000 当前直流电源设置索引 : 0x00000001</p><p>子组 GUID : e73a048d - bf27 - 4f12 - 9731 - 8b2076e8891f(电池) GUID 别名 : SUB_BATTERY 电源设置 GUID : 5dbb7c9f - 38e9 - 40d2 - 9749 - 4f8a0e9f640f(低电池电量通知) GUID 别名 : BATFLAGSCRIT 可能的设置索引 : 000 可能的设置友好名称 : 关闭 可能的设置索引 : 001 可能的设置友好名称 : 启用 当前交流电源设置索引 : 0x00000001 当前直流电源设置索引 : 0x00000001</p><p>电源设置 GUID : 637ea02f - bbcb - 4015 - 8e2c - a1c7b9c0b546(关键级别电池操作) GUID 别名 : BATACTIONCRIT 可能的设置索引 : 000 可能的设置友好名称 : 不采取任何操作 可能的设置索引 : 001 可能的设置友好名称 : 睡眠 可能的设置索引 : 002 可能的设置友好名称 : 休眠 可能的设置索引 : 003 可能的设置友好名称 : 关机 当前交流电源设置索引 : 0x00000002 当前直流电源设置索引 : 0x00000002</p><p>电源设置 GUID : 8183ba9a - e910 - 48da - 8769 - 14ae6dc1170a(电池电量水平低) GUID 别名 : BATLEVELLOW 最小可能的设置 : 0x00000000 最大可能的设置 : 0x00000064 可能的设置增量 : 0x00000001 可能的设置单位 : % 当前交流电源设置索引 : 0x0000000a 当前直流电源设置索引 : 0x0000000a</p><p>电源设置 GUID : 9a66d8d7 - 4ff7 - 4ef9 - b5a2 - 5a326ca2a469(关键电池电量水平) GUID 别名 : BATLEVELCRIT 最小可能的设置 : 0x00000000 最大可能的设置 : 0x00000064 可能的设置增量 : 0x00000001 可能的设置单位 : % 当前交流电源设置索引 : 0x00000005 当前直流电源设置索引 : 0x00000005</p><p>电源设置 GUID : bcded951 - 187b - 4d05 - bccc - f7e51960c258(低电量通知) GUID 别名 : BATFLAGSLOW 可能的设置索引 : 000 可能的设置友好名称 : 关闭 可能的设置索引 : 001 可能的设置友好名称 : 启用 当前交流电源设置索引 : 0x00000001 当前直流电源设置索引 : 0x00000001</p><p>电源设置 GUID : d8742dcb - 3e6a - 4b3c - b3fe - 374623cdcf06(低电量操作) GUID 别名 : BATACTIONLOW 可能的设置索引 : 000 可能的设置友好名称 : 不采取任何操作 可能的设置索引 : 001 可能的设置友好名称 : 睡眠 可能的设置索引 : 002 可能的设置友好名称 : 休眠 可能的设置索引 : 003 可能的设置友好名称 : 关机 当前交流电源设置索引 : 0x00000000 当前直流电源设置索引 : 0x00000000</p><p>电源设置 GUID : f3c5027d - cd16 - 4930 - aa6b - 90db844a8f00(保留电池电量) 最小可能的设置 : 0x00000000 最大可能的设置 : 0x00000064 可能的设置增量 : 0x00000001 可能的设置单位 : % 当前交流电源设置索引 : 0x00000007 当前直流电源设置索引 : 0x00000007</p><p>2， 根据以上GUID 编程：</p><p>github:</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Tinycl/win_powermode">https://github.com/Tinycl/win_powermode</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Tinycl/win_powermode">https://github.com/Tinycl/win_powermode</a></p><pre data-type="codeBlock" text="#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;

#include &lt;Windows.h&gt;
#include &lt;powersetting.h&gt;
#include &lt;powrprof.h&gt;
#include &lt;initguid.h&gt;

DEFINE_GUID(BALANCEMODE, 0x381B4222, 0xF694, 0x41F0, 0x96, 0x85, 0xFF, 0x5B, 0xB2, 0x60, 0xDF, 0x2E);
DEFINE_GUID(HIGHPERFORMANCEMODE, 0x8C5E7FDA, 0xE8BF, 0x4A96, 0x9A, 0x85, 0xA6, 0xE2, 0x3A, 0x8C, 0x63, 0x5C);
DEFINE_GUID(POWERSAVEMODE, 0xA1841308, 0x3541, 0x4FAB, 0xBC, 0x81, 0xF7, 0x15, 0x56, 0xF2, 0x0B, 0x4A);

DEFINE_GUID(SUBPROCESSOR, 0x54533251, 0x82be, 0x4824, 0x96, 0xc1, 0x47, 0xb6, 0x0b, 0x74, 0x0d, 0x00);
DEFINE_GUID(PROCTHROTTLEMIN, 0x893dee8e, 0x2bef, 0x41e0, 0x89, 0xc6, 0xb5, 0x5d, 0x09, 0x29, 0x96, 0x4c);
DEFINE_GUID(PROCTHROTTLEMAX, 0xbc5038f7, 0x23e0, 0x4960, 0x96, 0xda, 0x33, 0xab, 0xaf, 0x59, 0x35, 0xec);

DEFINE_GUID(SUBSLEEP, 0x238c9fa8, 0x0aad, 0x41ed, 0x83, 0xf4, 0x97, 0xbe, 0x24, 0x2c, 0x8f, 0x20);
DEFINE_GUID(STANDBYIDLE, 0x29f6c1db, 0x86da, 0x48c5, 0x9f, 0xdb, 0xf2, 0xb6, 0x7b, 0x1f, 0x44, 0xda);

DEFINE_GUID(SUBVIDEO, 0x7516b95f, 0xf776, 0x4464, 0x8c, 0x53, 0x06, 0x16, 0x7f, 0x40, 0xcc, 0x99);
DEFINE_GUID(VIDEOIDLE, 0x3c0bc021, 0xc8a8, 0x4e07, 0xa9, 0x73, 0x6b, 0x14, 0xcb, 0xcb, 0x2b, 0x7e);


#pragma comment(lib, &quot;PowrProf.lib&quot;)
int main(int argc, char** argv)
{
    // set powersave mode
    PowerWriteACValueIndex(NULL, (GUID*)&amp;POWERSAVEMODE, &amp;SUBPROCESSOR, &amp;PROCTHROTTLEMIN, 40);
    PowerWriteDCValueIndex(NULL, (GUID*)&amp;POWERSAVEMODE, &amp;SUBPROCESSOR, &amp;PROCTHROTTLEMIN, 40);

    PowerWriteACValueIndex(NULL, (GUID*)&amp;POWERSAVEMODE, &amp;SUBPROCESSOR, &amp;PROCTHROTTLEMAX, 40);
    PowerWriteDCValueIndex(NULL, (GUID*)&amp;POWERSAVEMODE, &amp;SUBPROCESSOR, &amp;PROCTHROTTLEMAX, 40);

    PowerWriteACValueIndex(NULL, (GUID*)&amp;POWERSAVEMODE, &amp;SUBSLEEP, &amp;STANDBYIDLE, 0);
    PowerWriteDCValueIndex(NULL, (GUID*)&amp;POWERSAVEMODE, &amp;SUBSLEEP, &amp;STANDBYIDLE, 0);

    PowerWriteACValueIndex(NULL, (GUID*)&amp;POWERSAVEMODE, &amp;SUBVIDEO, &amp;VIDEOIDLE, 0);
    PowerWriteDCValueIndex(NULL, (GUID*)&amp;POWERSAVEMODE, &amp;SUBVIDEO, &amp;VIDEOIDLE, 0);
    PowerSetActiveScheme(NULL, (GUID*)&amp;POWERSAVEMODE);

    return 0;
}
"><code>#include <span class="hljs-operator">&#x3C;</span>stdlib.h>
#include <span class="hljs-operator">&#x3C;</span>stdio.h>

#include <span class="hljs-operator">&#x3C;</span>Windows.h>
#include <span class="hljs-operator">&#x3C;</span>powersetting.h>
#include <span class="hljs-operator">&#x3C;</span>powrprof.h>
#include <span class="hljs-operator">&#x3C;</span>initguid.h>

DEFINE_GUID(BALANCEMODE, <span class="hljs-number">0x381B4222</span>, <span class="hljs-number">0xF694</span>, <span class="hljs-number">0x41F0</span>, <span class="hljs-number">0x96</span>, <span class="hljs-number">0x85</span>, <span class="hljs-number">0xFF</span>, <span class="hljs-number">0x5B</span>, <span class="hljs-number">0xB2</span>, <span class="hljs-number">0x60</span>, <span class="hljs-number">0xDF</span>, <span class="hljs-number">0x2E</span>);
DEFINE_GUID(HIGHPERFORMANCEMODE, <span class="hljs-number">0x8C5E7FDA</span>, <span class="hljs-number">0xE8BF</span>, <span class="hljs-number">0x4A96</span>, <span class="hljs-number">0x9A</span>, <span class="hljs-number">0x85</span>, <span class="hljs-number">0xA6</span>, <span class="hljs-number">0xE2</span>, <span class="hljs-number">0x3A</span>, <span class="hljs-number">0x8C</span>, <span class="hljs-number">0x63</span>, <span class="hljs-number">0x5C</span>);
DEFINE_GUID(POWERSAVEMODE, <span class="hljs-number">0xA1841308</span>, <span class="hljs-number">0x3541</span>, <span class="hljs-number">0x4FAB</span>, <span class="hljs-number">0xBC</span>, <span class="hljs-number">0x81</span>, <span class="hljs-number">0xF7</span>, <span class="hljs-number">0x15</span>, <span class="hljs-number">0x56</span>, <span class="hljs-number">0xF2</span>, <span class="hljs-number">0x0B</span>, <span class="hljs-number">0x4A</span>);

DEFINE_GUID(SUBPROCESSOR, <span class="hljs-number">0x54533251</span>, <span class="hljs-number">0x82be</span>, <span class="hljs-number">0x4824</span>, <span class="hljs-number">0x96</span>, <span class="hljs-number">0xc1</span>, <span class="hljs-number">0x47</span>, <span class="hljs-number">0xb6</span>, <span class="hljs-number">0x0b</span>, <span class="hljs-number">0x74</span>, <span class="hljs-number">0x0d</span>, <span class="hljs-number">0x00</span>);
DEFINE_GUID(PROCTHROTTLEMIN, <span class="hljs-number">0x893dee8e</span>, <span class="hljs-number">0x2bef</span>, <span class="hljs-number">0x41e0</span>, <span class="hljs-number">0x89</span>, <span class="hljs-number">0xc6</span>, <span class="hljs-number">0xb5</span>, <span class="hljs-number">0x5d</span>, <span class="hljs-number">0x09</span>, <span class="hljs-number">0x29</span>, <span class="hljs-number">0x96</span>, <span class="hljs-number">0x4c</span>);
DEFINE_GUID(PROCTHROTTLEMAX, <span class="hljs-number">0xbc5038f7</span>, <span class="hljs-number">0x23e0</span>, <span class="hljs-number">0x4960</span>, <span class="hljs-number">0x96</span>, <span class="hljs-number">0xda</span>, <span class="hljs-number">0x33</span>, <span class="hljs-number">0xab</span>, <span class="hljs-number">0xaf</span>, <span class="hljs-number">0x59</span>, <span class="hljs-number">0x35</span>, <span class="hljs-number">0xec</span>);

DEFINE_GUID(SUBSLEEP, <span class="hljs-number">0x238c9fa8</span>, <span class="hljs-number">0x0aad</span>, <span class="hljs-number">0x41ed</span>, <span class="hljs-number">0x83</span>, <span class="hljs-number">0xf4</span>, <span class="hljs-number">0x97</span>, <span class="hljs-number">0xbe</span>, <span class="hljs-number">0x24</span>, <span class="hljs-number">0x2c</span>, <span class="hljs-number">0x8f</span>, <span class="hljs-number">0x20</span>);
DEFINE_GUID(STANDBYIDLE, <span class="hljs-number">0x29f6c1db</span>, <span class="hljs-number">0x86da</span>, <span class="hljs-number">0x48c5</span>, <span class="hljs-number">0x9f</span>, <span class="hljs-number">0xdb</span>, <span class="hljs-number">0xf2</span>, <span class="hljs-number">0xb6</span>, <span class="hljs-number">0x7b</span>, <span class="hljs-number">0x1f</span>, <span class="hljs-number">0x44</span>, <span class="hljs-number">0xda</span>);

DEFINE_GUID(SUBVIDEO, <span class="hljs-number">0x7516b95f</span>, <span class="hljs-number">0xf776</span>, <span class="hljs-number">0x4464</span>, <span class="hljs-number">0x8c</span>, <span class="hljs-number">0x53</span>, <span class="hljs-number">0x06</span>, <span class="hljs-number">0x16</span>, <span class="hljs-number">0x7f</span>, <span class="hljs-number">0x40</span>, <span class="hljs-number">0xcc</span>, <span class="hljs-number">0x99</span>);
DEFINE_GUID(VIDEOIDLE, <span class="hljs-number">0x3c0bc021</span>, <span class="hljs-number">0xc8a8</span>, <span class="hljs-number">0x4e07</span>, <span class="hljs-number">0xa9</span>, <span class="hljs-number">0x73</span>, <span class="hljs-number">0x6b</span>, <span class="hljs-number">0x14</span>, <span class="hljs-number">0xcb</span>, <span class="hljs-number">0xcb</span>, <span class="hljs-number">0x2b</span>, <span class="hljs-number">0x7e</span>);


#<span class="hljs-meta"><span class="hljs-keyword">pragma</span> comment(lib, <span class="hljs-meta-string">"PowrProf.lib"</span>)
int main(int argc, char** argv)
{
    <span class="hljs-comment">// set powersave mode</span>
    PowerWriteACValueIndex(NULL, (GUID*)&#x26;POWERSAVEMODE, &#x26;SUBPROCESSOR, &#x26;PROCTHROTTLEMIN, 40);</span>
    PowerWriteDCValueIndex(NULL, (GUID<span class="hljs-operator">*</span>)<span class="hljs-operator">&#x26;</span>POWERSAVEMODE, <span class="hljs-operator">&#x26;</span>SUBPROCESSOR, <span class="hljs-operator">&#x26;</span>PROCTHROTTLEMIN, <span class="hljs-number">40</span>);

    PowerWriteACValueIndex(NULL, (GUID<span class="hljs-operator">*</span>)<span class="hljs-operator">&#x26;</span>POWERSAVEMODE, <span class="hljs-operator">&#x26;</span>SUBPROCESSOR, <span class="hljs-operator">&#x26;</span>PROCTHROTTLEMAX, <span class="hljs-number">40</span>);
    PowerWriteDCValueIndex(NULL, (GUID<span class="hljs-operator">*</span>)<span class="hljs-operator">&#x26;</span>POWERSAVEMODE, <span class="hljs-operator">&#x26;</span>SUBPROCESSOR, <span class="hljs-operator">&#x26;</span>PROCTHROTTLEMAX, <span class="hljs-number">40</span>);

    PowerWriteACValueIndex(NULL, (GUID<span class="hljs-operator">*</span>)<span class="hljs-operator">&#x26;</span>POWERSAVEMODE, <span class="hljs-operator">&#x26;</span>SUBSLEEP, <span class="hljs-operator">&#x26;</span>STANDBYIDLE, <span class="hljs-number">0</span>);
    PowerWriteDCValueIndex(NULL, (GUID<span class="hljs-operator">*</span>)<span class="hljs-operator">&#x26;</span>POWERSAVEMODE, <span class="hljs-operator">&#x26;</span>SUBSLEEP, <span class="hljs-operator">&#x26;</span>STANDBYIDLE, <span class="hljs-number">0</span>);

    PowerWriteACValueIndex(NULL, (GUID<span class="hljs-operator">*</span>)<span class="hljs-operator">&#x26;</span>POWERSAVEMODE, <span class="hljs-operator">&#x26;</span>SUBVIDEO, <span class="hljs-operator">&#x26;</span>VIDEOIDLE, <span class="hljs-number">0</span>);
    PowerWriteDCValueIndex(NULL, (GUID<span class="hljs-operator">*</span>)<span class="hljs-operator">&#x26;</span>POWERSAVEMODE, <span class="hljs-operator">&#x26;</span>SUBVIDEO, <span class="hljs-operator">&#x26;</span>VIDEOIDLE, <span class="hljs-number">0</span>);
    PowerSetActiveScheme(NULL, (GUID<span class="hljs-operator">*</span>)<span class="hljs-operator">&#x26;</span>POWERSAVEMODE);

    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
}
</code></pre>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
        <item>
            <title><![CDATA[gvim 常见操作]]></title>
            <link>https://paragraph.com/@cryptometaman/gvim</link>
            <guid>SqE133ESctSNxCTRlZRj</guid>
            <pubDate>Thu, 02 Dec 2021 05:34:30 GMT</pubDate>
            <description><![CDATA[1.文件编码操作UTF-8 转 ANSI: set encoding : set encoding=UTF-8 : set fileencoding=cp936 : wq! ANSI 转UTF-8: set encoding : set fileencoding=UTF-8 : wq! 2.显示设置$ gvim ~/.vimrc set nu! set hlsearch syntax enable syntax on colorscheme desert set autoindent set smartindent set tabstop=4 set expandtab set softtabstop=4 set foldmethod=indent syntax on set fileencodings=utf-8,gbk2312,gbk,gb18030,cp936 set encoding=utf-8 set langmenu=zh_CN let $LANG = 'en_US.UTF-8' set nocompatible set nobackup set noswapfile...]]></description>
            <content:encoded><![CDATA[<h2 id="h-1" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">1.文件编码操作</h2><p>UTF-8 转 ANSI</p><pre data-type="codeBlock" text=": set encoding
: set encoding=UTF-8
: set fileencoding=cp936
: wq!
"><code>: set encoding
: set <span class="hljs-attr">encoding</span>=UTF-<span class="hljs-number">8</span>
: set <span class="hljs-attr">fileencoding</span>=cp936
: wq!
</code></pre><p>ANSI 转UTF-8</p><pre data-type="codeBlock" text=": set encoding
: set fileencoding=UTF-8
: wq!
"><code>: set encoding
: set fileencoding=UTF<span class="hljs-number">-8</span>
: wq!
</code></pre><h2 id="h-2" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">2.显示设置</h2><pre data-type="codeBlock" text="$ gvim ~/.vimrc
set nu!
set hlsearch
syntax enable
syntax on
colorscheme desert

set autoindent
set smartindent
set tabstop=4
set expandtab
set softtabstop=4
set foldmethod=indent
syntax on

set fileencodings=utf-8,gbk2312,gbk,gb18030,cp936
set encoding=utf-8
set langmenu=zh_CN
let $LANG = &apos;en_US.UTF-8&apos;

set nocompatible
set nobackup
set noswapfile
set history=1024
set autochdir

"><code>$ gvim ~/.vimrc
set nu!
set hlsearch
syntax enable
syntax on
colorscheme desert

set autoindent
set smartindent
set <span class="hljs-attr">tabstop</span>=<span class="hljs-number">4</span>
set expandtab
set <span class="hljs-attr">softtabstop</span>=<span class="hljs-number">4</span>
set <span class="hljs-attr">foldmethod</span>=indent
syntax on

set <span class="hljs-attr">fileencodings</span>=utf-<span class="hljs-number">8</span>,gbk2312,gbk,gb18030,cp936
set <span class="hljs-attr">encoding</span>=utf-<span class="hljs-number">8</span>
set <span class="hljs-attr">langmenu</span>=zh_CN
let $<span class="hljs-attr">LANG</span> = <span class="hljs-string">'en_US.UTF-8'</span>

set nocompatible
set nobackup
set noswapfile
set <span class="hljs-attr">history</span>=<span class="hljs-number">1024</span>
set autochdir

</code></pre>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
        <item>
            <title><![CDATA[How to use phoronix test suite]]></title>
            <link>https://paragraph.com/@cryptometaman/how-to-use-phoronix-test-suite</link>
            <guid>I0moChBN7LFB1n9QM9DK</guid>
            <pubDate>Thu, 25 Nov 2021 02:27:16 GMT</pubDate>
            <description><![CDATA[phoronix test suite 是很全面的测试工具，支持Linux/Windows/Mac等主流OS。 The Phoronix Test Suite ships with access to more than 450 test profiles and over 100 test suites. These tests range from battery power consumption monitoring for mobile devices to multi-threaded ray-tracing benchmarks and span the CPU, graphics, system memory, disk storage, and motherboard components. If there is a test though not currently covered by the Phoronix Test Suite, new tests can be quickly added via its extensible architectur...]]></description>
            <content:encoded><![CDATA[<p>phoronix test suite 是很全面的测试工具，支持Linux/Windows/Mac等主流OS。</p><p>The Phoronix Test Suite ships with access to more than 450 test profiles and over 100 test suites. These tests range from battery power consumption monitoring for mobile devices to multi-threaded ray-tracing benchmarks and span the CPU, graphics, system memory, disk storage, and motherboard components. If there is a test though not currently covered by the Phoronix Test Suite, new tests can be quickly added via its extensible architecture (see the documentation) with each profile just being comprised of XML files and a few simple scripts. The Phoronix Test Suite also supports Cascading Test Profiles (CTP) whereby a test is able to extend and leverage an already existing profile.</p><p>Regardless of the test profile, if the Phoronix Test Suite detects a test(s) standard deviation between runs is exceeding a predefined threshold, the Phoronix Test Suite can automatically call on that test to be executed additional times to ensure the reported result is accurate. Other statistical and analytical options are also available.</p><p>Through another Phoronix Test Suite module it is possible to log in real-time various system sensors like the CPU temperature, the battery power consumption, disk read/write speeds, and numerous other sensors. This can be done while any test profile is running and the recorded results are then provided within the results viewer. It is as simple as running a command such as MONITOR=all phoronix-test-suite benchmark x264.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bee14e2cd2f4efeda613ed57b49243ee905c0415db015cddcc66c0c811e5751d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>官方网站：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.phoronix-test-suite.com/">https://www.phoronix-test-suite.com/</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.phoronix.com/">https://www.phoronix.com/</a></p><p>github:</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/phoronix-test-suite/phoronix-test-suite/">https://github.com/phoronix-test-suite/phoronix-test-suite/</a></p>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
        <item>
            <title><![CDATA[Ubuntu 20.04 安装EDK2]]></title>
            <link>https://paragraph.com/@cryptometaman/ubuntu-20-04-edk2</link>
            <guid>oySpndj9IVTViwPtDSmH</guid>
            <pubDate>Tue, 23 Nov 2021 11:26:12 GMT</pubDate>
            <description><![CDATA[(1) Ubuntu 20.04 添加源$sudo vim /etc/apt/sources.list deb http://mirrors.aliyun.com/ubuntu/ xenial main deb-src http://mirrors.aliyun.com/ubuntu/ xenial main deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main deb http://mirrors.aliyun.com/ubuntu/ xenial universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb-src http://mirrors.aliyun.com/ubuntu/ xenia...]]></description>
            <content:encoded><![CDATA[<p>(1) Ubuntu 20.04 添加源</p><pre data-type="codeBlock" text="$sudo vim  /etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main

deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main

deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

$sudo apt update
"><code><span class="hljs-variable">$sudo</span> vim  /etc/apt/sources.list

deb <span class="hljs-symbol">http:</span>/<span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial main
deb-src http:/</span><span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial main

deb http:/</span><span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial-updates main
deb-src http:/</span><span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial-updates main

deb http:/</span><span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial universe
deb-src http:/</span><span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial universe
deb http:/</span><span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial-updates universe
deb-src http:/</span><span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial-updates universe

deb http:/</span><span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial-security main
deb-src http:/</span><span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial-security main
deb http:/</span><span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial-security universe
deb-src http:/</span><span class="hljs-regexp">/mirrors.aliyun.com/ubuntu</span><span class="hljs-regexp">/ xenial-security universe

$sudo apt update
</span></code></pre><p>(2)安装依赖包</p><pre data-type="codeBlock" text="$sudo apt install git python3 python3-distutils uuid-dev nasm bison flex
$sudo apt install gcc g++ build-essential qemu qemu-system
$sudo apt install libx11-dev x11proto-xext-dev libxext-dev 
"><code>$sudo apt install git python3 python3<span class="hljs-operator">-</span>distutils uuid<span class="hljs-operator">-</span>dev nasm bison flex
$sudo apt install gcc g<span class="hljs-operator">+</span><span class="hljs-operator">+</span> build<span class="hljs-operator">-</span>essential qemu qemu<span class="hljs-operator">-</span>system
$sudo apt install libx11<span class="hljs-operator">-</span>dev x11proto<span class="hljs-operator">-</span>xext<span class="hljs-operator">-</span>dev libxext<span class="hljs-operator">-</span>dev 
</code></pre><p>(3)安装gcc-5 并配置多版本gcc</p><pre data-type="codeBlock" text="$apt install gcc-5 g++-5
$sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 40
$sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 40
$sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 50
$sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 50
$sudo update-alternatives --config gcc
$sudo update-alternatives --config g++
"><code>$apt install gcc<span class="hljs-number">-5</span> g<span class="hljs-operator">+</span><span class="hljs-operator">+</span><span class="hljs-number">-5</span>
$sudo update<span class="hljs-operator">-</span>alternatives <span class="hljs-operator">-</span><span class="hljs-operator">-</span>install <span class="hljs-operator">/</span>usr<span class="hljs-operator">/</span>bin<span class="hljs-operator">/</span>gcc gcc <span class="hljs-operator">/</span>usr<span class="hljs-operator">/</span>bin<span class="hljs-operator">/</span>gcc<span class="hljs-number">-5</span> <span class="hljs-number">40</span>
$sudo update<span class="hljs-operator">-</span>alternatives <span class="hljs-operator">-</span><span class="hljs-operator">-</span>install <span class="hljs-operator">/</span>usr<span class="hljs-operator">/</span>bin<span class="hljs-operator">/</span>g<span class="hljs-operator">+</span><span class="hljs-operator">+</span> g<span class="hljs-operator">+</span><span class="hljs-operator">+</span> <span class="hljs-operator">/</span>usr<span class="hljs-operator">/</span>bin<span class="hljs-operator">/</span>g<span class="hljs-operator">+</span><span class="hljs-operator">+</span><span class="hljs-number">-5</span> <span class="hljs-number">40</span>
$sudo update<span class="hljs-operator">-</span>alternatives <span class="hljs-operator">-</span><span class="hljs-operator">-</span>install <span class="hljs-operator">/</span>usr<span class="hljs-operator">/</span>bin<span class="hljs-operator">/</span>gcc gcc <span class="hljs-operator">/</span>usr<span class="hljs-operator">/</span>bin<span class="hljs-operator">/</span>gcc<span class="hljs-number">-9</span> <span class="hljs-number">50</span>
$sudo update<span class="hljs-operator">-</span>alternatives <span class="hljs-operator">-</span><span class="hljs-operator">-</span>install <span class="hljs-operator">/</span>usr<span class="hljs-operator">/</span>bin<span class="hljs-operator">/</span>g<span class="hljs-operator">+</span><span class="hljs-operator">+</span> g<span class="hljs-operator">+</span><span class="hljs-operator">+</span> <span class="hljs-operator">/</span>usr<span class="hljs-operator">/</span>bin<span class="hljs-operator">/</span>g<span class="hljs-operator">+</span><span class="hljs-operator">+</span><span class="hljs-number">-9</span> <span class="hljs-number">50</span>
$sudo update<span class="hljs-operator">-</span>alternatives <span class="hljs-operator">-</span><span class="hljs-operator">-</span>config gcc
$sudo update<span class="hljs-operator">-</span>alternatives <span class="hljs-operator">-</span><span class="hljs-operator">-</span>config g<span class="hljs-operator">+</span><span class="hljs-operator">+</span>
</code></pre><p>(4)获取源代码和编译</p><pre data-type="codeBlock" text="$git config --global url.&quot;https://hub.fastgit.org&quot;.insteadOf https://github.com
$git clone https://github.com/tianocore/edk2.git
$git clone https://github.com/tianocore/edk2-libc.git
$git clone https://github.com/acpica/acpica.git
$cd edk2
$git submodule update --init
$cd ..
$make -C edk2/BaseTools
$make -C acpica/
$gvim mybuild.sh
#!/bin/bash
export WORKSPACE=$PWD
export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-libc
export IASL_PREFIX=$PWD/acpica/generate/unix/bin/
export PYTHON_COMMAND=/usr/bin/python3
$sudo chmod a+x mybuild.sh
$source ./mybuild.sh
$source source edk2/edk2setup.sh
$build -p  edk2/EmulatorPkg/EmulatorPkg.dsc -a X64 -t GCC5 
"><code>$git config <span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-keyword">global</span> url."https:<span class="hljs-comment">//hub.fastgit.org".insteadOf https://github.com</span>
$git clone https:<span class="hljs-comment">//github.com/tianocore/edk2.git</span>
$git clone https:<span class="hljs-comment">//github.com/tianocore/edk2-libc.git</span>
$git clone https:<span class="hljs-comment">//github.com/acpica/acpica.git</span>
$cd edk2
$git submodule update <span class="hljs-operator">-</span><span class="hljs-operator">-</span>init
$cd ..
$make <span class="hljs-operator">-</span>C edk2<span class="hljs-operator">/</span>BaseTools
$make <span class="hljs-operator">-</span>C acpica<span class="hljs-operator">/</span>
$gvim mybuild.sh
#<span class="hljs-operator">!</span><span class="hljs-operator">/</span>bin<span class="hljs-operator">/</span>bash
export WORKSPACE<span class="hljs-operator">=</span>$PWD
export PACKAGES_PATH<span class="hljs-operator">=</span>$PWD<span class="hljs-operator">/</span>edk2:$PWD<span class="hljs-operator">/</span>edk2<span class="hljs-operator">-</span>libc
export IASL_PREFIX<span class="hljs-operator">=</span>$PWD<span class="hljs-operator">/</span>acpica<span class="hljs-operator">/</span>generate<span class="hljs-operator">/</span>unix<span class="hljs-operator">/</span>bin<span class="hljs-operator">/</span>
export PYTHON_COMMAND<span class="hljs-operator">=</span><span class="hljs-operator">/</span>usr<span class="hljs-operator">/</span>bin<span class="hljs-operator">/</span>python3
$sudo chmod a<span class="hljs-operator">+</span>x mybuild.sh
$source ./mybuild.sh
$source source edk2<span class="hljs-operator">/</span>edk2setup.sh
$build <span class="hljs-operator">-</span>p  edk2<span class="hljs-operator">/</span>EmulatorPkg<span class="hljs-operator">/</span>EmulatorPkg.dsc <span class="hljs-operator">-</span>a X64 <span class="hljs-operator">-</span>t GCC5 
</code></pre><p>(5)坑</p><p>（a) 强制将Os 变成O0， 即不优化</p><p>(b)报 [RegisterFilterLib] is not found， 将自己的dsc文件中添加</p><p>!include MdePkg/MdeLibs.dsc.inc</p>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
        <item>
            <title><![CDATA[AMD noncanical address access        attack poc ]]></title>
            <link>https://paragraph.com/@cryptometaman/amd-noncanical-address-access-attack-poc</link>
            <guid>TrSEcknSURIeB6pn3jMK</guid>
            <pubDate>Sat, 20 Nov 2021 02:40:50 GMT</pubDate>
            <description><![CDATA[amd ryzen 架构处理器硬件设计的漏洞：非法的地址通过一套算法和合法的地址映射到通过一个TLB 条目里。 攻击原理基于如此， 利用对非法地址的推测访问，获取对应合法地址的数据。详细的论文和PoC 在 Github: https://github.com/Tinycl/amd_nocanonical_access 其中合法地址和非法地址之间的映射关系如下：]]></description>
            <content:encoded><![CDATA[<p>amd ryzen 架构处理器硬件设计的漏洞：非法的地址通过一套算法和合法的地址映射到通过一个TLB 条目里。 攻击原理基于如此， 利用对非法地址的推测访问，获取对应合法地址的数据。详细的论文和PoC 在 Github:</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Tinycl/amd_nocanonical_access">https://github.com/Tinycl/amd_nocanonical_access</a></p><p>其中合法地址和非法地址之间的映射关系如下：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/398c0c2b7918efab633e2b1a4d9da0dc673cd86dbbbc82baff757d47dd307d16.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
        <item>
            <title><![CDATA[怎样简单使用winring0驱动]]></title>
            <link>https://paragraph.com/@cryptometaman/winring0</link>
            <guid>gBfMuDVeJ1glFNWPthW1</guid>
            <pubDate>Thu, 18 Nov 2021 02:00:52 GMT</pubDate>
            <description><![CDATA[Winring0 驱动内部集成了读写MSR、读写物理地址、读写PCI配置空间、读写IO地址空间等常见的操作。目前签名版的不具备读写物理地址的能力，想要读写物理地址需要重新编译驱动，并将Windows设置成测试模式。本文介绍，如何使用VS2019编译Winring0驱动及如何使用， 测试代码 github ： https://github.com/Tinycl/easy_winring0 （1）下载并安装VS2019 https://visualstudio.microsoft.com/zh-hans/vs/ （2）下载并安装相同版本的SDK和WDK， 比如SDK 10.0.18362 WDK 10.0.18362 https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk （3）编译驱动 （4)编写测试案例 （4.1）加载驱动 （4.2）使用驱动的API Good Luck!]]></description>
            <content:encoded><![CDATA[<p>Winring0 驱动内部集成了读写MSR、读写物理地址、读写PCI配置空间、读写IO地址空间等常见的操作。目前签名版的不具备读写物理地址的能力，想要读写物理地址需要重新编译驱动，并将Windows设置成测试模式。本文介绍，如何使用VS2019编译Winring0驱动及如何使用， 测试代码 github ：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Tinycl/easy_winring0">https://github.com/Tinycl/easy_winring0</a></p><p>（1）下载并安装VS2019</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://visualstudio.microsoft.com/zh-hans/vs/">https://visualstudio.microsoft.com/zh-hans/vs/</a></p><p>（2）下载并安装相同版本的SDK和WDK， 比如SDK 10.0.18362 WDK 10.0.18362</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk">https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk</a></p><p>（3）编译驱动</p><p>（4)编写测试案例</p><p>（4.1）加载驱动</p><p>（4.2）使用驱动的API</p><p>Good Luck!</p>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
        <item>
            <title><![CDATA[Mirror I'm coming]]></title>
            <link>https://paragraph.com/@cryptometaman/mirror-i-m-coming</link>
            <guid>UNfkxXzvcZIi3V6D7A0T</guid>
            <pubDate>Thu, 18 Nov 2021 01:48:19 GMT</pubDate>
            <description><![CDATA[This is my first Mirror blog, so interesting! Mirror 的数据是存储在去中心化分布式存储网路Arweave上， AR 应该比FILE coin 更靠谱。 牛逼！]]></description>
            <content:encoded><![CDATA[<p>This is my first Mirror blog, so interesting!</p><p>Mirror 的数据是存储在去中心化分布式存储网路Arweave上， AR 应该比FILE coin 更靠谱。 牛逼！</p>]]></content:encoded>
            <author>cryptometaman@newsletter.paragraph.com (Tinychenlin)</author>
        </item>
    </channel>
</rss>