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:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2
-2
@@ -11,8 +11,8 @@
|
|||||||
">
|
">
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
<link rel="canonical" href="https://codersherlock.github.com//404.html">
|
<link rel="canonical" href="http://localhost:4000/404.html">
|
||||||
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="https://codersherlock.github.com//feed.xml" />
|
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="http://localhost:4000/feed.xml" />
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
">
|
">
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
<link rel="canonical" href="https://codersherlock.github.com//about/">
|
<link rel="canonical" href="http://localhost:4000/about/">
|
||||||
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="https://codersherlock.github.com//feed.xml" />
|
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="http://localhost:4000/feed.xml" />
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
<meta name="description" content="In this blog, I will generally talk about how to use proper tools to monitor SSL traffics of a mobile devices. Currently, I only can dealing with those SSL t...">
|
<meta name="description" content="In this blog, I will generally talk about how to use proper tools to monitor SSL traffics of a mobile devices. Currently, I only can dealing with those SSL t...">
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
<link rel="canonical" href="https://codersherlock.github.com//archivers/charles-is-not-a-good-tool">
|
<link rel="canonical" href="http://localhost:4000/archivers/charles-is-not-a-good-tool">
|
||||||
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="https://codersherlock.github.com//feed.xml" />
|
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="http://localhost:4000/feed.xml" />
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
@@ -86,10 +86,9 @@ My current solution is using AP to forward all SSL traffic to a proxy, <a href="
|
|||||||
<li>You have to install charles first. After downloading the charles proxy, you have to unzip it and configure some basic settings.</li>
|
<li>You have to install charles first. After downloading the charles proxy, you have to unzip it and configure some basic settings.</li>
|
||||||
</ul>
|
</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
|
./bin/charles
|
||||||
</code></pre>
|
</code></pre></div></div>
|
||||||
</div>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Save charles’ private key and public key</li>
|
<li>Save charles’ private key and public key</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
<link rel="canonical" href="https://codersherlock.github.com//archivers/hello">
|
<link rel="canonical" href="http://localhost:4000/archivers/hello">
|
||||||
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="https://codersherlock.github.com//feed.xml" />
|
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="http://localhost:4000/feed.xml" />
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
<meta name="description" content="What is Unikernel?Unikernels are specialised, single-address-space images contructed by using library operating systems.">
|
<meta name="description" content="What is Unikernel?Unikernels are specialised, single-address-space images contructed by using library operating systems.">
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
<link rel="canonical" href="https://codersherlock.github.com//archivers/intro-unikernel">
|
<link rel="canonical" href="http://localhost:4000/archivers/intro-unikernel">
|
||||||
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="https://codersherlock.github.com//feed.xml" />
|
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="http://localhost:4000/feed.xml" />
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
<meta name="description" content="I hate xv6, a stupid, useless education-oriented system. In this article, I will generally talk about how to implement system call to this operating system.">
|
<meta name="description" content="I hate xv6, a stupid, useless education-oriented system. In this article, I will generally talk about how to implement system call to this operating system.">
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
<link rel="canonical" href="https://codersherlock.github.com//archivers/intro-xv6">
|
<link rel="canonical" href="http://localhost:4000/archivers/intro-xv6">
|
||||||
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="https://codersherlock.github.com//feed.xml" />
|
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="http://localhost:4000/feed.xml" />
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
@@ -77,19 +77,17 @@
|
|||||||
<h2 id="xv6-systemcall">Xv6 Systemcall</h2>
|
<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>
|
<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>
|
<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>
|
</code></pre></div></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>
|
<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>
|
||||||
<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 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>
|
|
||||||
<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 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>
|
||||||
</span></code></pre>
|
</code></pre></div></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>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>
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
<meta name="description" content="This blog contains only some basic record of my works. For some details, I will write a unique blog just for some specific topics.">
|
<meta name="description" content="This blog contains only some basic record of my works. For some details, I will write a unique blog just for some specific topics.">
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
<link rel="canonical" href="https://codersherlock.github.com//archivers/some-of-my-previews-exper-work">
|
<link rel="canonical" href="http://localhost:4000/archivers/some-of-my-previews-exper-work">
|
||||||
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="https://codersherlock.github.com//feed.xml" />
|
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="http://localhost:4000/feed.xml" />
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
@@ -103,12 +103,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>
|
<li>We need to use this simple awk code and vim operation to extract data.</li>
|
||||||
</ul>
|
</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"># HUT: Http upload traffic</span>
|
||||||
<span class="c"># ALL: overall time of one commit & upload</span>
|
<span class="c"># ALL: overall time of one commit & upload</span>
|
||||||
awk <span class="s1">'/CDC|HUT|ALL/ {print $4,$5}'</span> ~/.ccnet/log/seafile.log > results.stat
|
<span class="nb">awk</span> <span class="s1">'/CDC|HUT|ALL/ {print $4,$5}'</span> ~/.ccnet/log/seafile.log <span class="o">></span> results.stat
|
||||||
</code></pre>
|
</code></pre></div></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3 id="install-seafile-on-odroid-xu">Install Seafile on odroid xu</h3>
|
<h3 id="install-seafile-on-odroid-xu">Install Seafile on odroid xu</h3>
|
||||||
|
|
||||||
@@ -125,13 +124,12 @@ awk <span class="s1">'/CDC|HUT|ALL/ {print $4,$5}'</span> ~/.ccnet/log/seafile.l
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</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
|
unxz ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img.xz
|
||||||
<span class="c"># Burn image into SD-card</span>
|
<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
|
<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
|
||||||
sync
|
<span class="nb">sync</span>
|
||||||
</code></pre>
|
</code></pre></div></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<h1 id="2016-11">2016-11</h1>
|
<h1 id="2016-11">2016-11</h1>
|
||||||
|
|
||||||
@@ -160,7 +158,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>
|
<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_TRACER</span><span class="o">=</span>y
|
||||||
<span class="nv">CONFIG_FUNCTION_GRAPH_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
|
<span class="nv">CONFIG_DYNAMIC_FTRACE</span><span class="o">=</span>y
|
||||||
@@ -169,21 +167,19 @@ sync
|
|||||||
<span class="nv">CONFIG_PREEMPT_TRACER</span><span class="o">=</span>y
|
<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_SCHED_TRACER</span><span class="o">=</span>y
|
||||||
<span class="nv">CONFIG_STACK_TRACER</span><span class="o">=</span>y
|
<span class="nv">CONFIG_STACK_TRACER</span><span class="o">=</span>y
|
||||||
</code></pre>
|
</code></pre></div></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3 id="how-to-extract-android-images-dump-an-image">How to extract android images: Dump an image</h3>
|
<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>
|
<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
|
<div class="language-bash highlighter-rouge"><div class="highlight"><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} -> {Device Block}</span>
|
<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} -> {Device Block}</span>
|
||||||
|
|
||||||
<span class="c"># dump file</span>
|
<span class="c"># dump file</span>
|
||||||
su
|
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
|
<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>
|
</code></pre></div></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
">
|
">
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
<link rel="canonical" href="https://codersherlock.github.com//category/">
|
<link rel="canonical" href="http://localhost:4000/category/">
|
||||||
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="https://codersherlock.github.com//feed.xml" />
|
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="http://localhost:4000/feed.xml" />
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
|||||||
+37
-44
@@ -4,11 +4,11 @@
|
|||||||
<title>Stop Talking, Start Doing - 停止空想,开始行动</title>
|
<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>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>
|
</description>
|
||||||
<link>https://codersherlock.github.com//</link>
|
<link>http://localhost:4000/</link>
|
||||||
<atom:link href="https://codersherlock.github.com//feed.xml" rel="self" type="application/rss+xml"/>
|
<atom:link href="http://localhost:4000/feed.xml" rel="self" type="application/rss+xml"/>
|
||||||
<pubDate>Fri, 28 Jul 2017 15:25:24 -0400</pubDate>
|
<pubDate>Fri, 23 Feb 2018 15:10:22 -0500</pubDate>
|
||||||
<lastBuildDate>Fri, 28 Jul 2017 15:25:24 -0400</lastBuildDate>
|
<lastBuildDate>Fri, 23 Feb 2018 15:10:22 -0500</lastBuildDate>
|
||||||
<generator>Jekyll v3.5.1</generator>
|
<generator>Jekyll v3.7.2</generator>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<title>Xv6 introduction</title>
|
<title>Xv6 introduction</title>
|
||||||
@@ -19,27 +19,25 @@
|
|||||||
<h2 id="xv6-systemcall">Xv6 Systemcall</h2>
|
<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>
|
<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>
|
<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>
|
</code></pre></div></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>
|
<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>
|
||||||
<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 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>
|
|
||||||
<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 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>
|
||||||
</span></code></pre>
|
</code></pre></div></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>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>
|
<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>
|
</description>
|
||||||
<pubDate>Fri, 28 Jul 2017 14:56:55 -0400</pubDate>
|
<pubDate>Fri, 28 Jul 2017 14:56:55 -0400</pubDate>
|
||||||
<link>https://codersherlock.github.com//archivers/intro-xv6</link>
|
<link>http://localhost:4000/archivers/intro-xv6</link>
|
||||||
<guid isPermaLink="true">https://codersherlock.github.com//archivers/intro-xv6</guid>
|
<guid isPermaLink="true">http://localhost:4000/archivers/intro-xv6</guid>
|
||||||
|
|
||||||
|
|
||||||
<category>xv6</category>
|
<category>xv6</category>
|
||||||
@@ -68,8 +66,8 @@
|
|||||||
|
|
||||||
</description>
|
</description>
|
||||||
<pubDate>Wed, 26 Jul 2017 12:42:33 -0400</pubDate>
|
<pubDate>Wed, 26 Jul 2017 12:42:33 -0400</pubDate>
|
||||||
<link>https://codersherlock.github.com//archivers/intro-unikernel</link>
|
<link>http://localhost:4000/archivers/intro-unikernel</link>
|
||||||
<guid isPermaLink="true">https://codersherlock.github.com//archivers/intro-unikernel</guid>
|
<guid isPermaLink="true">http://localhost:4000/archivers/intro-unikernel</guid>
|
||||||
|
|
||||||
|
|
||||||
<category>unikernel</category>
|
<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>
|
<li>We need to use this simple awk code and vim operation to extract data.</li>
|
||||||
</ul>
|
</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"># HUT: Http upload traffic</span>
|
||||||
<span class="c"># ALL: overall time of one commit &amp; upload</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
|
<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>
|
</code></pre></div></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3 id="install-seafile-on-odroid-xu">Install Seafile on odroid xu</h3>
|
<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>
|
</li>
|
||||||
</ul>
|
</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
|
unxz ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img.xz
|
||||||
<span class="c"># Burn image into SD-card</span>
|
<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
|
<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
|
||||||
sync
|
<span class="nb">sync</span>
|
||||||
</code></pre>
|
</code></pre></div></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<h1 id="2016-11">2016-11</h1>
|
<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>
|
<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_TRACER</span><span class="o">=</span>y
|
||||||
<span class="nv">CONFIG_FUNCTION_GRAPH_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
|
<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_PREEMPT_TRACER</span><span class="o">=</span>y
|
||||||
<span class="nv">CONFIG_SCHED_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
|
<span class="nv">CONFIG_STACK_TRACER</span><span class="o">=</span>y
|
||||||
</code></pre>
|
</code></pre></div></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3 id="how-to-extract-android-images-dump-an-image">How to extract android images: Dump an image</h3>
|
<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>
|
<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
|
<div class="language-bash highlighter-rouge"><div class="highlight"><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>
|
<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>
|
<span class="c"># dump file</span>
|
||||||
su
|
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
|
<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>
|
</code></pre></div></div>
|
||||||
</div>
|
|
||||||
</description>
|
</description>
|
||||||
<pubDate>Fri, 28 Oct 2016 12:27:33 -0400</pubDate>
|
<pubDate>Fri, 28 Oct 2016 12:27:33 -0400</pubDate>
|
||||||
<link>https://codersherlock.github.com//archivers/some-of-my-previews-exper-work</link>
|
<link>http://localhost:4000/archivers/some-of-my-previews-exper-work</link>
|
||||||
<guid isPermaLink="true">https://codersherlock.github.com//archivers/some-of-my-previews-exper-work</guid>
|
<guid isPermaLink="true">http://localhost:4000/archivers/some-of-my-previews-exper-work</guid>
|
||||||
|
|
||||||
|
|
||||||
<category>Research</category>
|
<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>
|
<li>You have to install charles first. After downloading the charles proxy, you have to unzip it and configure some basic settings.</li>
|
||||||
</ul>
|
</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
|
./bin/charles
|
||||||
</code></pre>
|
</code></pre></div></div>
|
||||||
</div>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Save charles’ private key and public key</li>
|
<li>Save charles’ private key and public key</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -236,8 +229,8 @@ You also need to save charles Root Certificate, it also contains in the same men
|
|||||||
</ul>
|
</ul>
|
||||||
</description>
|
</description>
|
||||||
<pubDate>Thu, 27 Oct 2016 22:50:33 -0400</pubDate>
|
<pubDate>Thu, 27 Oct 2016 22:50:33 -0400</pubDate>
|
||||||
<link>https://codersherlock.github.com//archivers/charles-is-not-a-good-tool</link>
|
<link>http://localhost:4000/archivers/charles-is-not-a-good-tool</link>
|
||||||
<guid isPermaLink="true">https://codersherlock.github.com//archivers/charles-is-not-a-good-tool</guid>
|
<guid isPermaLink="true">http://localhost:4000/archivers/charles-is-not-a-good-tool</guid>
|
||||||
|
|
||||||
|
|
||||||
<category>Network</category>
|
<category>Network</category>
|
||||||
@@ -249,8 +242,8 @@ You also need to save charles Root Certificate, it also contains in the same men
|
|||||||
<description>
|
<description>
|
||||||
</description>
|
</description>
|
||||||
<pubDate>Wed, 26 Oct 2016 22:50:33 -0400</pubDate>
|
<pubDate>Wed, 26 Oct 2016 22:50:33 -0400</pubDate>
|
||||||
<link>https://codersherlock.github.com//archivers/hello</link>
|
<link>http://localhost:4000/archivers/hello</link>
|
||||||
<guid isPermaLink="true">https://codersherlock.github.com//archivers/hello</guid>
|
<guid isPermaLink="true">http://localhost:4000/archivers/hello</guid>
|
||||||
|
|
||||||
|
|
||||||
<category>Nonsense</category>
|
<category>Nonsense</category>
|
||||||
|
|||||||
+2
-2
@@ -11,8 +11,8 @@
|
|||||||
">
|
">
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
<link rel="stylesheet" href="/css/main.css">
|
||||||
<link rel="canonical" href="https://codersherlock.github.com//">
|
<link rel="canonical" href="http://localhost:4000/">
|
||||||
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="https://codersherlock.github.com//feed.xml" />
|
<link rel="alternate" type="application/rss+xml" title="Stop Talking, Start Doing - 停止空想,开始行动" href="http://localhost:4000/feed.xml" />
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
|||||||
Reference in New Issue
Block a user