view slide/slide.html @ 16:e5dbeddc9958

add memory section
author matac42 <matac@cr.ie.u-ryukyu.ac.jp>
date Tue, 24 May 2022 12:01:23 +0900
parents 687e04e14a2c
children 8b69df665d5d
line wrap: on
line source






<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="content-type" content="text/html;charset=utf-8">
   <title>GearsOSにおける<br />inodeを用いたファイルシステムの構築</title>

   <meta name="generator" content="Slide Show (S9) v4.1.0 on Ruby 3.0.3 (2021-11-24) [arm64-darwin21]">
   <meta name="author"    content="Matayoshi Yuto, Shinji Kono" >

<!-- style sheet links -->
<link rel="stylesheet" href="s6/themes/projection.css"   media="screen,projection">
<link rel="stylesheet" href="s6/themes/screen.css"       media="screen">
<link rel="stylesheet" href="s6/themes/print.css"        media="print">
<link rel="stylesheet" href="s6/themes/blank.css"        media="screen,projection">

<!-- JS -->
<script src="s6/js/jquery-1.11.3.min.js"></script>
<script src="s6/js/jquery.slideshow.js"></script>
<script src="s6/js/jquery.slideshow.counter.js"></script>
<script src="s6/js/jquery.slideshow.controls.js"></script>
<script src="s6/js/jquery.slideshow.footer.js"></script>
<script src="s6/js/jquery.slideshow.autoplay.js"></script>

<!-- prettify -->
<link rel="stylesheet" href="scripts/prettify.css">
<script src="scripts/prettify.js"></script>

<script>
  $(document).ready( function() {
    Slideshow.init();

    $('code').each(function(_, el) {
      if (!el.classList.contains('noprettyprint')) {
        el.classList.add('prettyprint');
      }
    });
    prettyPrint();
  } );

</script>

<!-- Better Browser Banner for Microsoft Internet Explorer (IE) -->
<!--[if IE]>
<script src="s6/js/jquery.microsoft.js"></script>
<![endif]-->

    

</head>
<body>

<div class="layout">
  <div id="header"></div>
  <div id="footer">
    <div align="right">
      <img src="s6/images/logo.svg" width="200px">
    </div>
  </div>
</div>

<div class="presentation">

  <div class='slide cover'>
    <table width="90%" height="90%" border="0" align="center">
      <tr>
        <td>
          <div align="center">
              <h1><font color="#808db5">GearsOSにおける<br />inodeを用いたファイルシステムの構築</font></h1>
          </div>
        </td>
      </tr>
      <tr>
        <td>
          <div align="left">
              Matayoshi Yuto, Shinji Kono
              琉球大学
            <hr style="color:#ffcc00;background-color:#ffcc00;text-align:left;border:none;width:100%;height:0.2em;">
          </div>
        </td>
      </tr>
    </table>
  </div>



<div class='slide'>
  
<!-- _S9SLIDE_ -->
<h2 id="inodeを用いたgearsdirectoryの実装">inodeを用いたgearsDirectoryの実装</h2>

<ul>
  <li>アプリケーションの信頼性を保証するために,アプリケーションが動作するOSの信頼性を高める必要がある
    <ul>
      <li>信頼性確保の方法として定理証明やモデル検査がある</li>
    </ul>
  </li>
  <li>当研究室では,信頼性の保証を目的としたGearsOSを開発している</li>
  <li>GearsOSで未実装の機能であるファイルシステムの実装を目指す</li>
  <li><span style="color: red; ">今回はUnix likeにディレクトリシステムを実装した</span></li>
  <li>GearsOSへUnixのファイルシステムの仕組みを取り入れるアプローチをとる</li>
  <li>GearsOSのディレクトリシステムであるgearsDirectoryについて説明する</li>
  <li>未実装であるメモリマネージャーについて考察する</li>
</ul>



</div>

<div class='slide'>
  <!-- _S9SLIDE_ -->
<h2 id="continuation-based-c">Continuation based C</h2>

<ul>
  <li>Cの下位言語である</li>
  <li>プログラムはCodeGearと呼ばれる処理の単位で記述する</li>
  <li>データはDataGearと呼ばれる単位を用いる</li>
  <li>ノーマルレベルとメタレベルの処理を切り分けることが容易に可能である</li>
  <li>function callの継続の代わりにgotoによる継続を用いる
    <ul>
      <li>呼び出し履歴を持たないことから軽量継続と呼ぶ</li>
    </ul>
  </li>
</ul>

<p> </p>

<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>当研究室にて,信頼性と拡張性の両立を目的として開発している</li>
  <li>CbCで記述されている</li>
  <li>Gearという概念があり,実行の単位をCodeGear,データの単位をDataGearと呼ぶ</li>
  <li>ノーマルレベルとメタレベルの処理を切り分けることが容易にできる</li>
</ul>



</div>

<div class='slide'>
  <!-- _S9SLIDE_ -->
<h2 id="gearsos-1">GearsOS</h2>

<h3 id="codegearとmetacodegearの関係">CodeGearとmetaCodeGearの関係</h3>

<ul>
  <li>ノーマルレベルとメタレベルの存在
    <ul>
      <li>CodeGearがDataGearを受け取り,処理後にDataGearを次のCodeGearに渡すという動作をしているように見える</li>
      <li>実際にはデータの整合性の確認や資源管理などのメタレベルの処理が存在し,それらの計算はMetaCodeGearで行われる</li>
    </ul>
  </li>
</ul>

<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>

<ul>
  <li>GearsOS上全てのCodeGear,DataGearの参照を持つ</li>
  <li>OS上の処理の実行単位</li>
  <li>Gearの概念ではMetaDataGearに当たる</li>
  <li>ノーマルレベルから直接参照されず,必ずMetaDataGearとしてMetaCodeGearから参照される</li>
</ul>

<!--
### Contextの種類

- OS全体のContextを管理するKernel Context
- ユーザープログラムごとに存在するUser Context
- CPUやGPUごとに存在するCPU Context

-->



</div>

<div class='slide'>
  <!-- _S9SLIDE_ -->
<h2 id="gearsos-3">GearsOS</h2>

<h3 id="codegear遷移の流れ">CodeGear遷移の流れ</h3>

<div style="text-align: center;">
  <img src="figs/context.svg" width="1200" />
</div>



</div>

<div class='slide'>
  <!-- _S9SLIDE_ -->
<h2 id="unixのファイルシステム">Unixのファイルシステム</h2>

<p>UnixのファイルシステムはBTreeを用いたinodeで構成されており,xv6もその仕組みを用いている</p>

<h3 id="xv6">xv6</h3>

<ul>
  <li>MITで教育用の目的で開発されたOS</li>
  <li>Unixの基本的な構造を持つ</li>
  <li>当研究室ではxv6のCbCでの書き換え,分析を行なっている</li>
  <li>ファイルシステムではinodeの仕組みが用いられている</li>
</ul>

<h3 id="inode">inode</h3>

<ul>
  <li>ファイルの属性情報が書かれたデータである</li>
  <li>識別番号としてinode numberを持つ</li>
  <li>inodeはファイルシステム始動時にinode領域をディスク上に確保する</li>
</ul>



</div>

<div class='slide'>
  <!-- _S9SLIDE_ -->
<h2 id="gearsfilesystemにおけるdirectoryの構成">GearsFileSystemにおけるdirectoryの構成</h2>

<ul>
  <li>2つのRedBlackTreeを用いる
    <ol>
      <li>filenameとinode numberのペアを持つindex tree</li>
      <li>inode numberとinodeのポインタのペアを持つinode tree</li>
    </ol>
  </li>
  <li>カレントディレクトリはgearsDirectory-&gt;currentDirectoryに保存される</li>
</ul>

<div style="text-align: center;">
  <img src="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);
}

__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="mkdir-1">mkdir</h3>

<div style="text-align: center;">
  <img src="figs/mkdir.svg" width="900" />
</div>

<!--
## 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

### ls

<div style="text-align: center;">
  <img src="figs/ls.svg" width="1000">
</div>

## 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(...);
}
```

## Unix Like な interface

### cd

<div style="text-align: center;">
  <img src="figs/cd.svg" width="1200">
</div>

-->



</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="gearsosにおけるメモリマネージメントシステム">GearsOSにおけるメモリマネージメントシステム</h2>

<ul>
  <li>現在,GearsOSがメモリの資源を用いる際にはmallocを用いている</li>
  <li>メモリとディスク上のデータ構造が等しくなる形で実装したい
    <ul>
      <li>単純なコピーでメモリとディスク間のデータやり取りを行うことができる</li>
    </ul>
  </li>
  <li>ガベージコレクションはCopying GCを用いる</li>
</ul>



</div>

<div class='slide'>
  <!-- _S9SLIDE_ -->
<h2 id="gearsdirectoryまとめ">gearsDirectoryまとめ</h2>

<ul>
  <li>gearsDirectoryの実装について説明した</li>
  <li>RedBlackTreeを用いてinodeの仕組みを構築し,ls,cd,mkdirを作成するなどして,Unix Likeに構築することが出来た</li>
  <li>RedBlackTreeのシンプルなinterfaceにより比較的容易に実装を行うことができた</li>
  <li>形式手法とファイルシステムの機能の両面で信頼性の向上が図れると考える</li>
</ul>



</div>

<div class='slide'>
  <!-- _S9SLIDE_ -->
<h2 id="gearsfilesystemの今後">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="gearsdirectory-filename">gearsDirectory filename</h3>

<ul>
  <li>現状はgearsDirectoryのfilenameはIntegerの構造で管理されている</li>
  <li>filenameは一般的に文字列型であるためIntegerから文字列型に変更する必要がある</li>
</ul>

<!--
## GearsFileSystemの今後

### gearsDirectory on disk

- 現状はgearsDirectoryはon memoryで実装されている
- inodeをdisk上に構築する必要がある

### GearsShell

- 現状のGearsOSはユーザーの入力を受け付けることが出来ず,言語フレームワークの様に機能している
- gearsFileSystemなどGearsOSの各機能と接続し,今回作成したcdやlsの様なコマンドを受け付けるGearsShellを作成したい

### ファイルのバックアップ

- レコードのDataをファイルの差分履歴として保持し,日時情報を付け加えることでVersion Control Systemのような機能を持たせることが可能であると考えられる
-->

</div>


</div><!-- presentation -->
</body>
</html>