mirror of
https://github.com/CoderSherlock/CoderSherlock.github.io.git
synced 2026-06-13 08:08:10 -07:00
Update Google Adsense
This commit is contained in:
+37
-44
@@ -4,11 +4,11 @@
|
||||
<title>Stop Talking, Start Doing - 停止空想,开始行动</title>
|
||||
<description>My personal blog, with some boring research staff and some tricks I was fancy to. I'll try my best to make this blog fun and useful. Not just a place I complain about all happens in my Lab.
|
||||
</description>
|
||||
<link>https://codersherlock.github.com//</link>
|
||||
<atom:link href="https://codersherlock.github.com//feed.xml" rel="self" type="application/rss+xml"/>
|
||||
<pubDate>Fri, 28 Jul 2017 15:25:24 -0400</pubDate>
|
||||
<lastBuildDate>Fri, 28 Jul 2017 15:25:24 -0400</lastBuildDate>
|
||||
<generator>Jekyll v3.5.1</generator>
|
||||
<link>http://localhost:4000/</link>
|
||||
<atom:link href="http://localhost:4000/feed.xml" rel="self" type="application/rss+xml"/>
|
||||
<pubDate>Fri, 23 Feb 2018 15:10:22 -0500</pubDate>
|
||||
<lastBuildDate>Fri, 23 Feb 2018 15:10:22 -0500</lastBuildDate>
|
||||
<generator>Jekyll v3.7.2</generator>
|
||||
|
||||
<item>
|
||||
<title>Xv6 introduction</title>
|
||||
@@ -19,27 +19,25 @@
|
||||
<h2 id="xv6-systemcall">Xv6 Systemcall</h2>
|
||||
<p>To invoke a system call, we have to first define a user mode function to be the interface of the kernel instruction in file <em>user.h</em>.</p>
|
||||
|
||||
<div class="language-c highlighter-rouge"><pre class="highlight"><code><span class="kt">void</span> <span class="n">function</span> <span class="p">(</span><span class="kt">void</span><span class="p">);</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">function</span> <span class="p">(</span><span class="kt">void</span><span class="p">);</span>
|
||||
</code></pre></div></div>
|
||||
|
||||
<p>This interface-like function will then pass the function name, in this case function, to <em>usys.S</em>. When using user mode function in programs, <em>usys.S</em> will generate a reference to SYS_function and push system call number of this function into %eax. After that, system can know from <em>syscall.c</em> and determining whether this system call is available. We must define same name system function and add it into <em>syscall.h</em> and <em>syscall.c</em>.</p>
|
||||
|
||||
<div class="language-c highlighter-rouge"><pre class="highlight"><code><span class="cp">#define SYS_function ## // ## is the system call number
|
||||
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp">#define SYS_function ## // ## is the system call number
|
||||
</span>
|
||||
<span class="p">[</span><span class="n">SYS_function</span><span class="p">]</span> <span class="n">sys_function</span> <span class="c1">// real system function name
|
||||
</span>
|
||||
<span class="k">extern</span> <span class="kt">int</span> <span class="n">sys_function</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span> <span class="c1">// real system function declaration
|
||||
</span></code></pre>
|
||||
</div>
|
||||
<span class="p">[</span><span class="n">SYS_function</span><span class="p">]</span> <span class="n">sys_function</span> <span class="c1">// real system function name</span>
|
||||
|
||||
<span class="k">extern</span> <span class="kt">int</span> <span class="n">sys_function</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span> <span class="c1">// real system function declaration</span>
|
||||
</code></pre></div></div>
|
||||
|
||||
<p>After adding these sentences to syscall files, we can implement real function in specific place where you want to make the function works well.</p>
|
||||
|
||||
<p>Sometimes, we need to pass variables among system calls. In this case, variables’ values are not necessary and even can’t be pass directly into system_function. When invoke a system call function, all variables of this system call will be pushed into current process’ stack. In file <em>syscall.c</em>, multiple functions are provided to get these variables from the process. I won’t waste time on explaining how to use these functions especially when elegant and detailed comments were written in source codes. However, I will explain concepts and how process organized and works in xv6 in future articles.</p>
|
||||
</description>
|
||||
<pubDate>Fri, 28 Jul 2017 14:56:55 -0400</pubDate>
|
||||
<link>https://codersherlock.github.com//archivers/intro-xv6</link>
|
||||
<guid isPermaLink="true">https://codersherlock.github.com//archivers/intro-xv6</guid>
|
||||
<link>http://localhost:4000/archivers/intro-xv6</link>
|
||||
<guid isPermaLink="true">http://localhost:4000/archivers/intro-xv6</guid>
|
||||
|
||||
|
||||
<category>xv6</category>
|
||||
@@ -68,8 +66,8 @@
|
||||
|
||||
</description>
|
||||
<pubDate>Wed, 26 Jul 2017 12:42:33 -0400</pubDate>
|
||||
<link>https://codersherlock.github.com//archivers/intro-unikernel</link>
|
||||
<guid isPermaLink="true">https://codersherlock.github.com//archivers/intro-unikernel</guid>
|
||||
<link>http://localhost:4000/archivers/intro-unikernel</link>
|
||||
<guid isPermaLink="true">http://localhost:4000/archivers/intro-unikernel</guid>
|
||||
|
||||
|
||||
<category>unikernel</category>
|
||||
@@ -111,12 +109,11 @@ But we also need some bash script to collect data through different size of rand
|
||||
<li>We need to use this simple awk code and vim operation to extract data.</li>
|
||||
</ul>
|
||||
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="c"># CDC: content defined chucks</span>
|
||||
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># CDC: content defined chucks</span>
|
||||
<span class="c"># HUT: Http upload traffic</span>
|
||||
<span class="c"># ALL: overall time of one commit &amp; upload</span>
|
||||
awk <span class="s1">'/CDC|HUT|ALL/ {print $4,$5}'</span> ~/.ccnet/log/seafile.log &gt; results.stat
|
||||
</code></pre>
|
||||
</div>
|
||||
<span class="nb">awk</span> <span class="s1">'/CDC|HUT|ALL/ {print $4,$5}'</span> ~/.ccnet/log/seafile.log <span class="o">&gt;</span> results.stat
|
||||
</code></pre></div></div>
|
||||
|
||||
<h3 id="install-seafile-on-odroid-xu">Install Seafile on odroid xu</h3>
|
||||
|
||||
@@ -133,13 +130,12 @@ awk <span class="s1">'/CDC|HUT|ALL/ {print $4,$5}'</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="c"># If .img end with xz, use this command to uncompress first</span>
|
||||
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># If .img end with xz, use this command to uncompress first</span>
|
||||
unxz ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img.xz
|
||||
<span class="c"># Burn image into SD-card</span>
|
||||
sudo dd <span class="k">if</span><span class="o">=</span>ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img <span class="nv">of</span><span class="o">=</span>/dev/sdb <span class="nv">bs</span><span class="o">=</span>1M <span class="nv">conv</span><span class="o">=</span>fsync
|
||||
sync
|
||||
</code></pre>
|
||||
</div>
|
||||
<span class="nb">sudo dd </span><span class="k">if</span><span class="o">=</span>ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img <span class="nv">of</span><span class="o">=</span>/dev/sdb <span class="nv">bs</span><span class="o">=</span>1M <span class="nv">conv</span><span class="o">=</span>fsync
|
||||
<span class="nb">sync</span>
|
||||
</code></pre></div></div>
|
||||
|
||||
<h1 id="2016-11">2016-11</h1>
|
||||
|
||||
@@ -168,7 +164,7 @@ sync
|
||||
|
||||
<p>If we want to debug under android, ftrace is a great tool for working. But, ftrace is not available in android if we used default configure file. Android kernel configuration is in <strong>arch/arm64/kernel/configs</strong>. We need to add few lines under that.</p>
|
||||
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="nv">CONFIG_STRICT_MEMORY_RWX</span><span class="o">=</span>y
|
||||
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">CONFIG_STRICT_MEMORY_RWX</span><span class="o">=</span>y
|
||||
<span class="nv">CONFIG_FUNCTION_TRACER</span><span class="o">=</span>y
|
||||
<span class="nv">CONFIG_FUNCTION_GRAPH_TRACER</span><span class="o">=</span>y
|
||||
<span class="nv">CONFIG_DYNAMIC_FTRACE</span><span class="o">=</span>y
|
||||
@@ -177,25 +173,23 @@ sync
|
||||
<span class="nv">CONFIG_PREEMPT_TRACER</span><span class="o">=</span>y
|
||||
<span class="nv">CONFIG_SCHED_TRACER</span><span class="o">=</span>y
|
||||
<span class="nv">CONFIG_STACK_TRACER</span><span class="o">=</span>y
|
||||
</code></pre>
|
||||
</div>
|
||||
</code></pre></div></div>
|
||||
|
||||
<h3 id="how-to-extract-android-images-dump-an-image">How to extract android images: Dump an image</h3>
|
||||
|
||||
<p>If we want to hold a rooted status after flashing boot, we need to extract an image from android devices. We can first use following command to find which blocks belongs to. According to some references, <a href="http://forum.xda-developers.com/showthread.php?t=2450045">this article</a> provide three ways to dump an image, I picked one for easy using.</p>
|
||||
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>adb shell
|
||||
ls -al /dev/block/platform/<span class="nv">$SOME</span><span class="se">\_</span>DEVICE../../by-name <span class="c"># {Partitions} -&gt; {Device Block}</span>
|
||||
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>adb shell
|
||||
<span class="nb">ls</span> <span class="nt">-al</span> /dev/block/platform/<span class="nv">$SOME</span><span class="se">\_</span>DEVICE../../by-name <span class="c"># {Partitions} -&gt; {Device Block}</span>
|
||||
|
||||
<span class="c"># dump file</span>
|
||||
su
|
||||
dd <span class="k">if</span><span class="o">=</span>/dev/block/mmcblk0p37 <span class="nv">of</span><span class="o">=</span>/sdcard/boot.img
|
||||
</code></pre>
|
||||
</div>
|
||||
<span class="nb">dd </span><span class="k">if</span><span class="o">=</span>/dev/block/mmcblk0p37 <span class="nv">of</span><span class="o">=</span>/sdcard/boot.img
|
||||
</code></pre></div></div>
|
||||
</description>
|
||||
<pubDate>Fri, 28 Oct 2016 12:27:33 -0400</pubDate>
|
||||
<link>https://codersherlock.github.com//archivers/some-of-my-previews-exper-work</link>
|
||||
<guid isPermaLink="true">https://codersherlock.github.com//archivers/some-of-my-previews-exper-work</guid>
|
||||
<link>http://localhost:4000/archivers/some-of-my-previews-exper-work</link>
|
||||
<guid isPermaLink="true">http://localhost:4000/archivers/some-of-my-previews-exper-work</guid>
|
||||
|
||||
|
||||
<category>Research</category>
|
||||
@@ -220,10 +214,9 @@ My current solution is using AP to forward all SSL traffic to a proxy, <a hre
|
||||
<li>You have to install charles first. After downloading the charles proxy, you have to unzip it and configure some basic settings.</li>
|
||||
</ul>
|
||||
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="c"># open charles first</span>
|
||||
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># open charles first</span>
|
||||
./bin/charles
|
||||
</code></pre>
|
||||
</div>
|
||||
</code></pre></div></div>
|
||||
<ul>
|
||||
<li>Save charles’ private key and public key</li>
|
||||
</ul>
|
||||
@@ -236,8 +229,8 @@ You also need to save charles Root Certificate, it also contains in the same men
|
||||
</ul>
|
||||
</description>
|
||||
<pubDate>Thu, 27 Oct 2016 22:50:33 -0400</pubDate>
|
||||
<link>https://codersherlock.github.com//archivers/charles-is-not-a-good-tool</link>
|
||||
<guid isPermaLink="true">https://codersherlock.github.com//archivers/charles-is-not-a-good-tool</guid>
|
||||
<link>http://localhost:4000/archivers/charles-is-not-a-good-tool</link>
|
||||
<guid isPermaLink="true">http://localhost:4000/archivers/charles-is-not-a-good-tool</guid>
|
||||
|
||||
|
||||
<category>Network</category>
|
||||
@@ -249,8 +242,8 @@ You also need to save charles Root Certificate, it also contains in the same men
|
||||
<description>
|
||||
</description>
|
||||
<pubDate>Wed, 26 Oct 2016 22:50:33 -0400</pubDate>
|
||||
<link>https://codersherlock.github.com//archivers/hello</link>
|
||||
<guid isPermaLink="true">https://codersherlock.github.com//archivers/hello</guid>
|
||||
<link>http://localhost:4000/archivers/hello</link>
|
||||
<guid isPermaLink="true">http://localhost:4000/archivers/hello</guid>
|
||||
|
||||
|
||||
<category>Nonsense</category>
|
||||
|
||||
Reference in New Issue
Block a user