changeset 35:ecbdcda618a4

fix slide
author matac42 <matac@cr.ie.u-ryukyu.ac.jp>
date Sun, 30 Jan 2022 00:10:50 +0900
parents 0fe24a54069b
children 13120531542b
files paper/figs/meta_cg_dg.svg paper/figs/nondestructive_tree_modification.png paper/thesis.pdf slide/slide.html slide/slide.md slide/slide.pdf.html
diffstat 6 files changed, 846 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/paper/figs/meta_cg_dg.svg	Sun Jan 30 00:10:50 2022 +0900
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.1" xmlns:xl="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 662 781" width="662" height="781">
+  <defs>
+    <font-face font-family="Helvetica" font-size="9" units-per-em="1000" underline-position="-75.68359" underline-thickness="49.316406" slope="0" x-height="522.9492" cap-height="717.28516" ascent="770.0195" descent="-229.98047" font-weight="400">
+      <font-face-src>
+        <font-face-name name="Helvetica"/>
+      </font-face-src>
+    </font-face>
+    <font-face font-family="Helvetica Neue" font-size="12" panose-1="2 0 5 3 0 0 0 2 0 4" units-per-em="1000" underline-position="-100" underline-thickness="50" slope="0" x-height="517" cap-height="714" ascent="951.9958" descent="-212.99744" font-weight="400">
+      <font-face-src>
+        <font-face-name name="HelveticaNeue"/>
+      </font-face-src>
+    </font-face>
+    <font-face font-family="Helvetica" font-size="12" units-per-em="1000" underline-position="-75.68359" underline-thickness="49.316406" slope="0" x-height="522.9492" cap-height="717.28516" ascent="770.0195" descent="-229.98047" font-weight="400">
+      <font-face-src>
+        <font-face-name name="Helvetica"/>
+      </font-face-src>
+    </font-face>
+    <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" stroke-linejoin="miter" stroke-miterlimit="10" viewBox="-1 -4 10 8" markerWidth="10" markerHeight="8" color="black">
+      <g>
+        <path d="M 8 0 L 0 -3 L 0 3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+      </g>
+    </marker>
+  </defs>
+  <metadata> Produced by OmniGraffle 7.19.4\n2018-02-12 15:33:34 +0000</metadata>
+  <g id="Canvas_1" stroke-dasharray="none" fill="none" stroke-opacity="1" fill-opacity="1" stroke="none">
+    <title>Canvas 1</title>
+    <rect fill="white" x="0" y="0" width="662" height="781"/>
+    <g id="Canvas_1_Layer_1">
+      <title>Layer 1</title>
+      <g id="Graphic_3">
+        <text transform="translate(507.9492 692.58984)" fill="#945200">
+          <tspan font-family="Helvetica" font-size="9" font-weight="400" fill="#945200" x="0" y="9">  </tspan>
+        </text>
+      </g>
+      <g id="Group_94">
+        <g id="Graphic_96">
+          <rect x="4.8244654" y="90" width="130.17553" height="90" fill="white"/>
+          <path d="M 4.8244654 90 L 135 90 L 135 180 L 4.8244654 180 Z" stroke="#ff9300" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4.0,4.0" stroke-width="1"/>
+        </g>
+        <g id="Graphic_95">
+          <text transform="translate(25.623322 104)" fill="#c25800">
+            <tspan font-family="Helvetica Neue" font-size="12" font-weight="400" fill="#c25800" x=".6286934" y="11">Meta Data Gear</tspan>
+          </text>
+        </g>
+      </g>
+      <g id="Group_91">
+        <g id="Graphic_93">
+          <rect x="459" y="90" width="130.17553" height="90" fill="white"/>
+          <path d="M 459 90 L 589.1755 90 L 589.1755 180 L 459 180 Z" stroke="#ff9300" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4.0,4.0" stroke-width="1"/>
+        </g>
+        <g id="Graphic_92">
+          <text transform="translate(479.79886 104)" fill="#c25800">
+            <tspan font-family="Helvetica Neue" font-size="12" font-weight="400" fill="#c25800" x=".6286934" y="11">Meta Data Gear</tspan>
+          </text>
+        </g>
+      </g>
+      <g id="Graphic_121">
+        <ellipse cx="297" cy="148.5" rx="45.8794865380515" ry="22.5000359527927" fill="white"/>
+        <ellipse cx="297" cy="148.5" rx="45.8794865380515" ry="22.5000359527927" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+        <text transform="translate(265.29647 141.5)" fill="black">
+          <tspan font-family="Helvetica" font-size="12" font-weight="400" fill="black" x="2.353922" y="11">Code Gear</tspan>
+        </text>
+      </g>
+      <g id="Graphic_83">
+        <rect x="32.482347" y="126" width="75.51765" height="45" fill="white"/>
+        <rect x="32.482347" y="126" width="75.51765" height="45" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+        <text transform="translate(37.482347 141.5)" fill="black">
+          <tspan font-family="Helvetica" font-size="12" font-weight="400" fill="black" x="5.07914" y="11">Data Gear</tspan>
+        </text>
+      </g>
+      <g id="Line_118">
+        <line x1="108.5" y1="148.5" x2="241.22056" y2="148.5" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="1"/>
+      </g>
+      <g id="Graphic_120">
+        <rect x="486" y="126" width="75.51765" height="45" fill="white"/>
+        <rect x="486" y="126" width="75.51765" height="45" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+        <text transform="translate(491 141.5)" fill="black">
+          <tspan font-family="Helvetica" font-size="12" font-weight="400" fill="black" x="5.07914" y="11">Data Gear</tspan>
+        </text>
+      </g>
+      <g id="Line_116">
+        <line x1="342.87944" y1="148.5" x2="475.6" y2="148.5" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="1"/>
+      </g>
+      <g id="Graphic_117">
+        <ellipse cx="405.26144" cy="148.5" rx="45.4435686903338" ry="22.5000359527927" fill="white"/>
+        <path d="M 437.3948 132.59012 C 455.1417 141.3769 455.1417 155.6231 437.3948 164.40988 C 419.64804 173.19672 390.87485 173.19672 373.12808 164.40988 C 355.3812 155.6231 355.3812 141.3769 373.12808 132.59012 C 390.87485 123.80328 419.64804 123.80328 437.3948 132.59012" stroke="#ff9300" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4.0,4.0" stroke-width="1"/>
+        <text transform="translate(373.90665 134.5)" fill="#c25800">
+          <tspan font-family="Helvetica" font-size="12" font-weight="400" fill="#c25800" x="18.01593" y="11">Meta </tspan>
+          <tspan font-family="Helvetica" font-size="12" font-weight="400" fill="#c25800" x="2.005188" y="25">Code Gear</tspan>
+        </text>
+      </g>
+      <g id="Graphic_103">
+        <ellipse cx="297" cy="22.5" rx="44.2896033411884" ry="22.5000359527927" fill="white"/>
+        <ellipse cx="297" cy="22.5" rx="44.2896033411884" ry="22.5000359527927" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+        <text transform="translate(266.56837 15.5)" fill="black">
+          <tspan font-family="Helvetica" font-size="12" font-weight="400" fill="black" x="1.082016" y="11">Code Gear</tspan>
+        </text>
+      </g>
+      <g id="Graphic_104">
+        <rect x="32.482347" y="0" width="75.51765" height="45" fill="white"/>
+        <rect x="32.482347" y="0" width="75.51765" height="45" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+        <text transform="translate(37.482347 15.5)" fill="black">
+          <tspan font-family="Helvetica" font-size="12" font-weight="400" fill="black" x="5.07914" y="11">Data Gear</tspan>
+        </text>
+      </g>
+      <g id="Line_105">
+        <line x1="108.5" y1="22.5" x2="242.81045" y2="22.5" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="1"/>
+      </g>
+      <g id="Graphic_106">
+        <rect x="486" y="0" width="75.51765" height="45" fill="white"/>
+        <rect x="486" y="0" width="75.51765" height="45" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+        <text transform="translate(491 15.5)" fill="black">
+          <tspan font-family="Helvetica" font-size="12" font-weight="400" fill="black" x="5.07914" y="11">Data Gear</tspan>
+        </text>
+      </g>
+      <g id="Line_107">
+        <line x1="341.28955" y1="22.5" x2="475.6" y2="22.5" marker-end="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="butt" stroke-linejoin="miter" stroke-width="1"/>
+      </g>
+      <g id="Graphic_122">
+        <ellipse cx="187.21873" cy="148.5" rx="45.4435686903338" ry="22.5000359527927" fill="white"/>
+        <path d="M 219.3521 132.59012 C 237.09897 141.3769 237.09897 155.6231 219.3521 164.40988 C 201.60532 173.19672 172.83214 173.19672 155.08536 164.40988 C 137.3385 155.6231 137.3385 141.3769 155.08536 132.59012 C 172.83214 123.80328 201.60532 123.80328 219.3521 132.59012" stroke="#ff9300" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4.0,4.0" stroke-width="1"/>
+        <text transform="translate(155.86393 134.5)" fill="#c25800">
+          <tspan font-family="Helvetica" font-size="12" font-weight="400" fill="#c25800" x="18.01593" y="11">Meta </tspan>
+          <tspan font-family="Helvetica" font-size="12" font-weight="400" fill="#c25800" x="2.005188" y="25">Code Gear</tspan>
+        </text>
+      </g>
+    </g>
+  </g>
+</svg>
Binary file paper/figs/nondestructive_tree_modification.png has changed
Binary file paper/thesis.pdf has changed
--- a/slide/slide.html	Sat Jan 29 21:43:45 2022 +0900
+++ b/slide/slide.html	Sun Jan 30 00:10:50 2022 +0900
@@ -91,11 +91,117 @@
 <div class='slide'>
   
 <!-- _S9SLIDE_ -->
-<h1 id="テスト">テスト</h1>
+<h2 id="gearsosにおけるfilesystemの設計">GearsOSにおけるFileSystemの設計</h2>
+
+<ul>
+  <li>アプリケーションの信頼性を保証するために,アプリケーションが動作するOSの信頼性を高める必要がある</li>
+  <li>当研究室では,信頼性の保証を目的としたGearsOSを開発している</li>
+  <li>GearsOSで未実装の機能であるファイルシステムの実装を行う</li>
+  <li>Unix likeな実装</li>
+</ul>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="inodeを用いたgearsdirectoryの実装">inodeを用いたgearsDirectoryの実装</h2>
+
+<ul>
+  <li>今回はディレクトリシステムを実装した</li>
+  <li>GearsOSへUnixのFile systemの仕組みを取り入れるアプローチをとる</li>
+  <li>Unixのinodeの仕組みを取り入れる</li>
+  <li>GearsOSのディレクトリシステムであるgearsDirectoryについて説明する</li>
+</ul>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="continuation-based-c">Continuation based C</h2>
+
+<ul>
+  <li>Cの下位言語である</li>
+  <li>function callの代わりにgotoによる継続を用いる</li>
+  <li>プログラムはCodeGearと呼ばれる処理の単位で記述</li>
+  <li>ノーマルレベルとメタレベルの処理を切り分けることが可能である</li>
+</ul>
+
+<div style="text-align: center;">
+  <img src="../paper/figs/dgcgdg.svg" width="1000" />
+</div>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsos">GearsOS</h2>
 
 <ul>
-  <li>hoge</li>
-  <li>huga</li>
+  <li>信頼性と拡張性の両立を目的として開発されている</li>
+  <li>Gearという概念があり,実行の単位をCodeGear,データの単位をDataGearと呼ぶ</li>
+  <li>軽量継続を基本とし,stackを持たない代わりに全てをContext経由で実行する</li>
+  <li>ノーマルレベルとメタレベルの処理を切り分けることができる</li>
+  <li>同様にGearの概念を持つCbC(Continuation based C)で記述されている.</li>
+  <li>OSとして動作するために今後実装しなければならない機能がいくつか残っている.</li>
+</ul>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsos-1">GearsOS</h2>
+
+<h3 id="codegearとmetacodegearの関係">CodeGearとmetaCodeGearの関係</h3>
+
+<div style="text-align: center;">
+  <img src="../paper/figs/meta_cg_dg.svg" width="1200" />
+</div>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsos-2">GearsOS</h2>
+
+<h3 id="contextを参照する流れ">Contextを参照する流れ</h3>
+
+<div style="text-align: center;">
+  <img src="../paper/figs/context.svg" width="1200" />
+</div>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="unixのfile-system">UnixのFile system</h2>
+
+<h3 id="xv6">xv6</h3>
+
+<ul>
+  <li>MITで教育用の目的で開発されたOS</li>
+  <li>Unixの基本的な構造を持つ</li>
+  <li>当研究室ではxv6のCbCでの書き換え,分析を行なっている</li>
+  <li>File systemではinodeの仕組みが用いられている</li>
+</ul>
+
+<h3 id="inode">inode</h3>
+
+<ul>
+  <li>ファイルの属性情報が書かれたデータである</li>
+  <li>識別番号としてinode numberを持つ</li>
+  <li>inodeはファイルシステム始動時にinode領域をディスク上に確保する</li>
 </ul>
 
 
@@ -104,13 +210,68 @@
 
 <div class='slide'>
   <!-- _S9SLIDE_ -->
-<h1 id="gears">Gears</h1>
+<h2 id="gearsfilesystemにおけるdirectoryの構成">GearsFileSystemにおけるdirectoryの構成</h2>
+
+<div style="text-align: center;">
+  <img src="../paper/figs/inode.svg" width="1000" />
+</div>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="unix-like-な-interface">Unix Like な interface</h2>
+
+<h3 id="mkdir">mkdir</h3>
+
+<pre><code class="language-c">__code mkdir(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    struct FTree* newDirectory = createFileSystemTree(context, gearsDirectory-&gt;currentDirectory);
+    Node* inode = new Node();
+    inode-&gt;key = gearsDirectory-&gt;INodeNumber;
+    inode-&gt;value = newDirectory;
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory-&gt;iNodeTree;
+    goto cDirectory-&gt;put(inode, mkdir2);
+}
 
-<ol>
-  <li>Context</li>
-  <li>stub</li>
-  <li>test</li>
-</ol>
+__code mkdir2(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    Node* dir = new Node();
+    dir-&gt;key = name-&gt;value;
+    Integer* iNum = new Integer();
+    iNum-&gt;value = gearsDirectory-&gt;INodeNumber;
+    dir-&gt;value = iNum;
+    gearsDirectory-&gt;INodeNumber = gearsDirectory-&gt;INodeNumber + 1;
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory-&gt;currentDirectory;
+    goto cDirectory-&gt;put(dir, next(...));
+}
+</code></pre>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="unix-like-な-interface-1">Unix Like な interface</h2>
+
+<h3 id="ls">ls</h3>
+
+<pre><code class="language-c">__code ls(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    Node* dir = new Node();
+    dir-&gt;key = name-&gt;value;
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory-&gt;currentDirectory;
+    goto cDirectory-&gt;get(dir, ls2);
+}
+
+__code ls2(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) {
+    printf("%d\n", node-&gt;key);
+    goto next(...);
+}
+</code></pre>
 
 
 
@@ -118,10 +279,106 @@
 
 <div class='slide'>
   <!-- _S9SLIDE_ -->
-<h1 id="コードブロック">コードブロック</h1>
+<h2 id="unix-like-な-interface-2">Unix Like な interface</h2>
+
+<h3 id="cd">cd</h3>
+
+<pre><code class="language-c">__code cd2Child(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory-&gt;currentDirectory;
+    struct Node* node = new Node();
+    node-&gt;key = name-&gt;value;
+    goto cDirectory-&gt;get(node, cd2Child2);
+}
+
+__code cd2Child2(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) {
+    struct FTree* iNodeTree = new FTree();
+    iNodeTree = gearsDirectory-&gt;iNodeTree;
+    goto iNodeTree-&gt;get(node-&gt;value, cd2Child3);
+}
+
+__code cd2Child3(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) {
+    gearsDirectory-&gt;currentDirectory = node-&gt;value;
+    goto next(...);
+}
+</code></pre>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsdirectoryの非破壊的編集によるバックアップ">GearsDirectoryの非破壊的編集によるバックアップ</h2>
+
+<ul>
+  <li>GearsOSにおける永続データは非破壊的な編集を行う木構造を用いて保存する</li>
+  <li>ディレクトリシステム自体にバックアップの機能を搭載することが可能と考える</li>
+</ul>
+
+<div style="text-align: center;">
+  <img src="../paper/figs/nondestructive_tree_modification.png" width="1200" />
+</div>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsfilesystemの今後">GearsFileSystemの今後</h2>
 
-<pre><code>goto get(data);
-</code></pre>
+<h3 id="gearsshell">GearsShell</h3>
+
+<ul>
+  <li>現状のGearsOSはユーザーの入力を受け付けることが出来ず,プログラミングインターフェースの様に機能している.</li>
+  <li>gearsFileSystemなどGearsOSの各機能と接続し,今回作成したcdやlsの様なコマンドを受け付けるGearsShellを作成したい.</li>
+</ul>
+
+<h3 id="gearsdirectory-filename">gearsDirectory filename</h3>
+
+<ul>
+  <li>現状はgearsDirectoryのfilenameはIntegerの構造で管理されている</li>
+  <li>filenameは一般的に文字列型であるためIntegerから文字列型に変更する必要がある</li>
+</ul>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsfilesystemの今後-1">GearsFileSystemの今後</h2>
+
+<h3 id="gearsdirectory-path">gearsDirectory path</h3>
+
+<ul>
+  <li>gearsDirectoryにはpathの機能が実装されていない</li>
+  <li>full path指定のlsなどが実装できない状態である</li>
+  <li>FileSystemTreeを拡張し,ノードをたどりpathを生成する様な機能を実装する必要がある</li>
+</ul>
+
+<h3 id="ファイルのバックアップ">ファイルのバックアップ</h3>
+
+<ul>
+  <li>レコードのDataをファイルの差分履歴として保持し,日時情報を付け加えることでVersion Control Systemのような機能を持たせることが可能であると考えられる</li>
+</ul>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="まとめ">まとめ</h2>
+
+<ul>
+  <li>gearsDirectoryの実装について説明した</li>
+  <li>RedBlackTreeのシンプルなinterfaceにより比較的容易に実装を行うことができた</li>
+  <li>形式手法とファイルシステムの機能の両面で信頼性の向上が図れると考える</li>
+  <li>RedBlackTreeを用いてinodeの仕組みを構築し,ls,cd,mkdirを作成するなどして,
+Unix Likeに構築することが出来た.</li>
+</ul>
 
 </div>
 
--- a/slide/slide.md	Sat Jan 29 21:43:45 2022 +0900
+++ b/slide/slide.md	Sun Jan 30 00:10:50 2022 +0900
@@ -2,19 +2,186 @@
 author: 又吉 雄斗
 profile: 並列信頼研
 
-# テスト
+## GearsOSにおけるFileSystemの設計
+
+- アプリケーションの信頼性を保証するために,アプリケーションが動作するOSの信頼性を高める必要がある
+- 当研究室では,信頼性の保証を目的としたGearsOSを開発している
+- GearsOSで未実装の機能であるファイルシステムの実装を行う
+- Unix likeな実装
+
+## inodeを用いたgearsDirectoryの実装
+
+- 今回はディレクトリシステムを実装した
+- GearsOSへUnixのFile systemの仕組みを取り入れるアプローチをとる
+- Unixのinodeの仕組みを取り入れる
+- GearsOSのディレクトリシステムであるgearsDirectoryについて説明する
+
+## Continuation based C
+
+- Cの下位言語である
+- function callの代わりにgotoによる継続を用いる
+- プログラムはCodeGearと呼ばれる処理の単位で記述
+- ノーマルレベルとメタレベルの処理を切り分けることが可能である
+
+<div style="text-align: center;">
+  <img src="../paper/figs/dgcgdg.svg" width="1000">
+</div>
+
+## GearsOS
+
+- 信頼性と拡張性の両立を目的として開発されている
+- Gearという概念があり,実行の単位をCodeGear,データの単位をDataGearと呼ぶ
+- 軽量継続を基本とし,stackを持たない代わりに全てをContext経由で実行する
+- ノーマルレベルとメタレベルの処理を切り分けることができる
+- 同様にGearの概念を持つCbC(Continuation based C)で記述されている.
+- OSとして動作するために今後実装しなければならない機能がいくつか残っている.
+
+## GearsOS
+
+### CodeGearとmetaCodeGearの関係
+
+<div style="text-align: center;">
+  <img src="../paper/figs/meta_cg_dg.svg" width="1200">
+</div>
 
-- hoge
-- huga
+## GearsOS
+
+### Contextを参照する流れ
+
+<div style="text-align: center;">
+  <img src="../paper/figs/context.svg" width="1200">
+</div>
+
+## UnixのFile system
+
+### xv6
+
+- MITで教育用の目的で開発されたOS
+- Unixの基本的な構造を持つ
+- 当研究室ではxv6のCbCでの書き換え,分析を行なっている
+- File systemではinodeの仕組みが用いられている
+
+### inode
 
-# Gears
+- ファイルの属性情報が書かれたデータである
+- 識別番号としてinode numberを持つ
+- inodeはファイルシステム始動時にinode領域をディスク上に確保する
+
+## GearsFileSystemにおけるdirectoryの構成
+
+<div style="text-align: center;">
+  <img src="../paper/figs/inode.svg" width="1000">
+</div>
+
+## Unix Like な interface
+
+### mkdir
+
+```c
+__code mkdir(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    struct FTree* newDirectory = createFileSystemTree(context, gearsDirectory->currentDirectory);
+    Node* inode = new Node();
+    inode->key = gearsDirectory->INodeNumber;
+    inode->value = newDirectory;
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory->iNodeTree;
+    goto cDirectory->put(inode, mkdir2);
+}
 
-1. Context
-1. stub
-1. test
+__code mkdir2(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    Node* dir = new Node();
+    dir->key = name->value;
+    Integer* iNum = new Integer();
+    iNum->value = gearsDirectory->INodeNumber;
+    dir->value = iNum;
+    gearsDirectory->INodeNumber = gearsDirectory->INodeNumber + 1;
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory->currentDirectory;
+    goto cDirectory->put(dir, next(...));
+}
+```
+
+## Unix Like な interface
+
+### ls
+
+```c
+__code ls(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    Node* dir = new Node();
+    dir->key = name->value;
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory->currentDirectory;
+    goto cDirectory->get(dir, ls2);
+}
+
+__code ls2(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) {
+    printf("%d\n", node->key);
+    goto next(...);
+}
+```
+
+## Unix Like な interface
+
+### cd
+
+```c
+__code cd2Child(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory->currentDirectory;
+    struct Node* node = new Node();
+    node->key = name->value;
+    goto cDirectory->get(node, cd2Child2);
+}
 
-# コードブロック
+__code cd2Child2(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) {
+    struct FTree* iNodeTree = new FTree();
+    iNodeTree = gearsDirectory->iNodeTree;
+    goto iNodeTree->get(node->value, cd2Child3);
+}
 
+__code cd2Child3(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) {
+    gearsDirectory->currentDirectory = node->value;
+    goto next(...);
+}
 ```
-goto get(data);
-```
+
+## GearsDirectoryの非破壊的編集によるバックアップ
+
+- GearsOSにおける永続データは非破壊的な編集を行う木構造を用いて保存する
+- ディレクトリシステム自体にバックアップの機能を搭載することが可能と考える
+
+<div style="text-align: center;">
+  <img src="../paper/figs/nondestructive_tree_modification.png" width="1200">
+</div>
+
+## GearsFileSystemの今後
+
+### GearsShell
+
+- 現状のGearsOSはユーザーの入力を受け付けることが出来ず,プログラミングインターフェースの様に機能している.
+- gearsFileSystemなどGearsOSの各機能と接続し,今回作成したcdやlsの様なコマンドを受け付けるGearsShellを作成したい.
+
+### gearsDirectory filename
+
+- 現状はgearsDirectoryのfilenameはIntegerの構造で管理されている
+- filenameは一般的に文字列型であるためIntegerから文字列型に変更する必要がある
+
+## GearsFileSystemの今後
+
+### gearsDirectory path
+
+- gearsDirectoryにはpathの機能が実装されていない
+- full path指定のlsなどが実装できない状態である
+- FileSystemTreeを拡張し,ノードをたどりpathを生成する様な機能を実装する必要がある
+
+### ファイルのバックアップ
+
+- レコードのDataをファイルの差分履歴として保持し,日時情報を付け加えることでVersion Control Systemのような機能を持たせることが可能であると考えられる
+
+## まとめ
+
+- gearsDirectoryの実装について説明した
+- RedBlackTreeのシンプルなinterfaceにより比較的容易に実装を行うことができた
+- 形式手法とファイルシステムの機能の両面で信頼性の向上が図れると考える
+- RedBlackTreeを用いてinodeの仕組みを構築し,ls,cd,mkdirを作成するなどして,
+Unix Likeに構築することが出来た.
--- a/slide/slide.pdf.html	Sat Jan 29 21:43:45 2022 +0900
+++ b/slide/slide.pdf.html	Sun Jan 30 00:10:50 2022 +0900
@@ -75,11 +75,117 @@
 <div class='slide'>
   
 <!-- _S9SLIDE_ -->
-<h1 id="テスト">テスト</h1>
+<h2 id="gearsosにおけるfilesystemの設計">GearsOSにおけるFileSystemの設計</h2>
+
+<ul>
+  <li>アプリケーションの信頼性を保証するために,アプリケーションが動作するOSの信頼性を高める必要がある</li>
+  <li>当研究室では,信頼性の保証を目的としたGearsOSを開発している</li>
+  <li>GearsOSで未実装の機能であるファイルシステムの実装を行う</li>
+  <li>Unix likeな実装</li>
+</ul>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="inodeを用いたgearsdirectoryの実装">inodeを用いたgearsDirectoryの実装</h2>
+
+<ul>
+  <li>今回はディレクトリシステムを実装した</li>
+  <li>GearsOSへUnixのFile systemの仕組みを取り入れるアプローチをとる</li>
+  <li>Unixのinodeの仕組みを取り入れる</li>
+  <li>GearsOSのディレクトリシステムであるgearsDirectoryについて説明する</li>
+</ul>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="continuation-based-c">Continuation based C</h2>
+
+<ul>
+  <li>Cの下位言語である</li>
+  <li>function callの代わりにgotoによる継続を用いる</li>
+  <li>プログラムはCodeGearと呼ばれる処理の単位で記述</li>
+  <li>ノーマルレベルとメタレベルの処理を切り分けることが可能である</li>
+</ul>
+
+<div style="text-align: center;">
+  <img src="../paper/figs/dgcgdg.svg" width="1000" />
+</div>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsos">GearsOS</h2>
 
 <ul>
-  <li>hoge</li>
-  <li>huga</li>
+  <li>信頼性と拡張性の両立を目的として開発されている</li>
+  <li>Gearという概念があり,実行の単位をCodeGear,データの単位をDataGearと呼ぶ</li>
+  <li>軽量継続を基本とし,stackを持たない代わりに全てをContext経由で実行する</li>
+  <li>ノーマルレベルとメタレベルの処理を切り分けることができる</li>
+  <li>同様にGearの概念を持つCbC(Continuation based C)で記述されている.</li>
+  <li>OSとして動作するために今後実装しなければならない機能がいくつか残っている.</li>
+</ul>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsos-1">GearsOS</h2>
+
+<h3 id="codegearとmetacodegearの関係">CodeGearとmetaCodeGearの関係</h3>
+
+<div style="text-align: center;">
+  <img src="../paper/figs/meta_cg_dg.svg" width="1200" />
+</div>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsos-2">GearsOS</h2>
+
+<h3 id="contextを参照する流れ">Contextを参照する流れ</h3>
+
+<div style="text-align: center;">
+  <img src="../paper/figs/context.svg" width="1200" />
+</div>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="unixのfile-system">UnixのFile system</h2>
+
+<h3 id="xv6">xv6</h3>
+
+<ul>
+  <li>MITで教育用の目的で開発されたOS</li>
+  <li>Unixの基本的な構造を持つ</li>
+  <li>当研究室ではxv6のCbCでの書き換え,分析を行なっている</li>
+  <li>File systemではinodeの仕組みが用いられている</li>
+</ul>
+
+<h3 id="inode">inode</h3>
+
+<ul>
+  <li>ファイルの属性情報が書かれたデータである</li>
+  <li>識別番号としてinode numberを持つ</li>
+  <li>inodeはファイルシステム始動時にinode領域をディスク上に確保する</li>
 </ul>
 
 
@@ -88,13 +194,68 @@
 
 <div class='slide'>
   <!-- _S9SLIDE_ -->
-<h1 id="gears">Gears</h1>
+<h2 id="gearsfilesystemにおけるdirectoryの構成">GearsFileSystemにおけるdirectoryの構成</h2>
+
+<div style="text-align: center;">
+  <img src="../paper/figs/inode.svg" width="1000" />
+</div>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="unix-like-な-interface">Unix Like な interface</h2>
+
+<h3 id="mkdir">mkdir</h3>
+
+<pre><code class="language-c">__code mkdir(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    struct FTree* newDirectory = createFileSystemTree(context, gearsDirectory-&gt;currentDirectory);
+    Node* inode = new Node();
+    inode-&gt;key = gearsDirectory-&gt;INodeNumber;
+    inode-&gt;value = newDirectory;
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory-&gt;iNodeTree;
+    goto cDirectory-&gt;put(inode, mkdir2);
+}
 
-<ol>
-  <li>Context</li>
-  <li>stub</li>
-  <li>test</li>
-</ol>
+__code mkdir2(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    Node* dir = new Node();
+    dir-&gt;key = name-&gt;value;
+    Integer* iNum = new Integer();
+    iNum-&gt;value = gearsDirectory-&gt;INodeNumber;
+    dir-&gt;value = iNum;
+    gearsDirectory-&gt;INodeNumber = gearsDirectory-&gt;INodeNumber + 1;
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory-&gt;currentDirectory;
+    goto cDirectory-&gt;put(dir, next(...));
+}
+</code></pre>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="unix-like-な-interface-1">Unix Like な interface</h2>
+
+<h3 id="ls">ls</h3>
+
+<pre><code class="language-c">__code ls(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    Node* dir = new Node();
+    dir-&gt;key = name-&gt;value;
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory-&gt;currentDirectory;
+    goto cDirectory-&gt;get(dir, ls2);
+}
+
+__code ls2(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) {
+    printf("%d\n", node-&gt;key);
+    goto next(...);
+}
+</code></pre>
 
 
 
@@ -102,10 +263,106 @@
 
 <div class='slide'>
   <!-- _S9SLIDE_ -->
-<h1 id="コードブロック">コードブロック</h1>
+<h2 id="unix-like-な-interface-2">Unix Like な interface</h2>
+
+<h3 id="cd">cd</h3>
+
+<pre><code class="language-c">__code cd2Child(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) {
+    struct FTree* cDirectory = new FTree();
+    cDirectory = gearsDirectory-&gt;currentDirectory;
+    struct Node* node = new Node();
+    node-&gt;key = name-&gt;value;
+    goto cDirectory-&gt;get(node, cd2Child2);
+}
+
+__code cd2Child2(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) {
+    struct FTree* iNodeTree = new FTree();
+    iNodeTree = gearsDirectory-&gt;iNodeTree;
+    goto iNodeTree-&gt;get(node-&gt;value, cd2Child3);
+}
+
+__code cd2Child3(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) {
+    gearsDirectory-&gt;currentDirectory = node-&gt;value;
+    goto next(...);
+}
+</code></pre>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsdirectoryの非破壊的編集によるバックアップ">GearsDirectoryの非破壊的編集によるバックアップ</h2>
+
+<ul>
+  <li>GearsOSにおける永続データは非破壊的な編集を行う木構造を用いて保存する</li>
+  <li>ディレクトリシステム自体にバックアップの機能を搭載することが可能と考える</li>
+</ul>
+
+<div style="text-align: center;">
+  <img src="../paper/figs/nondestructive_tree_modification.png" width="1200" />
+</div>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsfilesystemの今後">GearsFileSystemの今後</h2>
 
-<pre><code>goto get(data);
-</code></pre>
+<h3 id="gearsshell">GearsShell</h3>
+
+<ul>
+  <li>現状のGearsOSはユーザーの入力を受け付けることが出来ず,プログラミングインターフェースの様に機能している.</li>
+  <li>gearsFileSystemなどGearsOSの各機能と接続し,今回作成したcdやlsの様なコマンドを受け付けるGearsShellを作成したい.</li>
+</ul>
+
+<h3 id="gearsdirectory-filename">gearsDirectory filename</h3>
+
+<ul>
+  <li>現状はgearsDirectoryのfilenameはIntegerの構造で管理されている</li>
+  <li>filenameは一般的に文字列型であるためIntegerから文字列型に変更する必要がある</li>
+</ul>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="gearsfilesystemの今後-1">GearsFileSystemの今後</h2>
+
+<h3 id="gearsdirectory-path">gearsDirectory path</h3>
+
+<ul>
+  <li>gearsDirectoryにはpathの機能が実装されていない</li>
+  <li>full path指定のlsなどが実装できない状態である</li>
+  <li>FileSystemTreeを拡張し,ノードをたどりpathを生成する様な機能を実装する必要がある</li>
+</ul>
+
+<h3 id="ファイルのバックアップ">ファイルのバックアップ</h3>
+
+<ul>
+  <li>レコードのDataをファイルの差分履歴として保持し,日時情報を付け加えることでVersion Control Systemのような機能を持たせることが可能であると考えられる</li>
+</ul>
+
+
+
+</div>
+
+<div class='slide'>
+  <!-- _S9SLIDE_ -->
+<h2 id="まとめ">まとめ</h2>
+
+<ul>
+  <li>gearsDirectoryの実装について説明した</li>
+  <li>RedBlackTreeのシンプルなinterfaceにより比較的容易に実装を行うことができた</li>
+  <li>形式手法とファイルシステムの機能の両面で信頼性の向上が図れると考える</li>
+  <li>RedBlackTreeを用いてinodeの仕組みを構築し,ls,cd,mkdirを作成するなどして,
+Unix Likeに構築することが出来た.</li>
+</ul>
 
 </div>