changeset 10:9ccfabe96b5d

fix
author e165723 <e165723@ie.u-ryukyu.ac.jp>
date Mon, 21 Oct 2019 20:39:04 +0900
parents 472b765acb14
children 566ce65437ea
files midterm.pdf midterm.tex pic/goto.graffle src/cbc_example.cbc
diffstat 4 files changed, 22 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
Binary file midterm.pdf has changed
--- a/midterm.tex	Mon Oct 21 16:18:49 2019 +0900
+++ b/midterm.tex	Mon Oct 21 20:39:04 2019 +0900
@@ -70,16 +70,17 @@
 %CbCのinterfaceを使うとモジュール化ができる.また, stackが無い事によってOS内部の明確化も実現できる.
 本研究では, CbCのinterfaceをxv6に搭載する事によりkernelの中の処理を明確にし, OSの信頼性を保証したい.
 また,xv6のinterface実装によりモジュール化が可能となり,拡張性の実現が達成される.
-%\section{GearsOS}
 
 \section{xv6}
 xv6とはMITのオペレーティングコースの教育目的で2006年に開発されたオペレーティングシステムである.
-xv6 はオリジナルである v6 が非常に古いC言語で書かれている為, ANSI-Cに書き換えられ x86 に再実装された. xv6 はプロセス,仮想メモリ,カーネルとユーザーの分離,割り込み,ファイルシステムなどUnixの基本的な構造を持っている.
+xv6 はオリジナルである v6 が非常に古いC言語で書かれている為, ANSI-Cに書き換えられ x86 に再実装された. xv6 はreadやwriteなどのsystemcall,プロセス,仮想メモリ,カーネルとユーザーの分離,割り込み,ファイルシステムなどUnixの基本的な構造を持っている.
 
 \section{Continuation based C}
 xv6 kernel上でinterfaceを実装する際,当研究室で開発されたプログラミング言語 Continuation based C (CbC)を用いる.
 CbC は基本的な処理単位を CodeGearとして定義し,CodeGea間で遷移するようにプログラムを記述するC言語と互換性のあるプログラミング言語である.
-CodeGearは返り値を持たない為,関数内で処理が終了すると呼び出し元の関数に戻ることがなく別のCodeGearへ遷移する%図かコードを入れても良いかも
+CodeGearは返り値を持たない為,関数内で処理が終了すると呼び出し元の関数に戻ることがなく別のCodeGearへ遷移する.
+以下にCode1にCodeGear遷移時のコード例を示す.
+%図かコードを入れても良いかも
 またCbCにおけるCodeGear間の継続にはスタックが使用できず,呼び出し元の環境などを持たない為軽量継続と呼ぶ.
 現在CbCはCコンパイラであるGCC及びLLVMをバックエンドとしたclang上で実装されている.
 \lstinputlisting[label=cbcexample,  caption=CodeGearの継続の例]{src/cbc_example.cbc}
@@ -99,6 +100,7 @@
 従来のスレッドやプロセスに対応する.Context は接続可能な CodeGear, Data Gear のリスト. Data Gear を確保するメモリ空間,実行される Task への Code Gear 等を持っている.
 CodeGearが別のCodeGearに遷移する際,必ずcontextを参照しenumで定義されたCodeGearの番号を指定し遷移する.
 
+%metaGearの話もした方が良い
 %CbCのcontextには引数の置き場所が書いてある.contextの中にDatagearが存在し.enumの番号で管理している。
 %dataの保存先と実行するdategearの保存先
 
--- a/pic/goto.graffle	Mon Oct 21 16:18:49 2019 +0900
+++ b/pic/goto.graffle	Mon Oct 21 20:39:04 2019 +0900
@@ -7,14 +7,14 @@
 	<key>ApplicationVersion</key>
 	<array>
 		<string>com.omnigroup.OmniGraffle6</string>
-		<string>169.23.0.276662</string>
+		<string>163.7.0.243167</string>
 	</array>
 	<key>AutoAdjust</key>
 	<true/>
 	<key>BackgroundGraphic</key>
 	<dict>
 		<key>Bounds</key>
-		<string>{{0, 0}, {558.99997329711914, 783}}</string>
+		<string>{{0, 0}, {559.00000476837158, 783}}</string>
 		<key>Class</key>
 		<string>SolidGraphic</string>
 		<key>ID</key>
@@ -97,7 +97,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{209.49999356269836, 106.55999761819839}, {79, 24}}</string>
+			<string>{{215.99999356269836, 106.55999761819839}, {66, 24}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>FitText</key>
@@ -132,14 +132,14 @@
 			<key>Text</key>
 			<dict>
 				<key>Text</key>
-				<string>{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf830
+				<string>{\rtf1\ansi\ansicpg932\cocoartf1561\cocoasubrtf610
 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;}
 {\colortbl;\red255\green255\blue255;}
 {\*\expandedcolortbl;;}
 \deftab720
 \pard\pardeftab720\qc\partightenfactor0
 
-\f0\fs22 \cf0 goto cg1(a+b)}</string>
+\f0\fs22 \cf0 goto cg1(c)}</string>
 			</dict>
 			<key>Wrap</key>
 			<string>NO</string>
@@ -317,8 +317,6 @@
 			<string>Layer 1</string>
 			<key>Print</key>
 			<string>YES</string>
-			<key>Slices</key>
-			<string>NO</string>
 			<key>View</key>
 			<string>YES</string>
 		</dict>
@@ -347,9 +345,9 @@
 	<key>MasterSheets</key>
 	<array/>
 	<key>ModificationDate</key>
-	<string>2018-01-06 18:15:41 +0000</string>
+	<string>2019-10-21 10:10:42 +0000</string>
 	<key>Modifier</key>
-	<string>Tatsuki IHA</string>
+	<string>坂本昂弘</string>
 	<key>NotesVisible</key>
 	<string>NO</string>
 	<key>Orientation</key>
@@ -378,7 +376,7 @@
 		<key>NSPaperSize</key>
 		<array>
 			<string>size</string>
-			<string>{594.99997329711914, 842}</string>
+			<string>{595.00000476837158, 842}</string>
 		</array>
 		<key>NSPrintReverseOrientation</key>
 		<array>
@@ -423,7 +421,7 @@
 		<key>Expanded_Canvases</key>
 		<array/>
 		<key>Frame</key>
-		<string>{{931, 136}, {989, 938}}</string>
+		<string>{{1827, -192}, {989, 747}}</string>
 		<key>ShowInfo</key>
 		<true/>
 		<key>ShowRuler</key>
@@ -435,7 +433,7 @@
 		<key>TopSlabHeight</key>
 		<real>250</real>
 		<key>VisibleRegion</key>
-		<string>{{47.5, 0}, {475, 780}}</string>
+		<string>{{48, 0}, {460, 574}}</string>
 		<key>Zoom</key>
 		<real>1</real>
 		<key>ZoomValues</key>
--- a/src/cbc_example.cbc	Mon Oct 21 16:18:49 2019 +0900
+++ b/src/cbc_example.cbc	Mon Oct 21 20:39:04 2019 +0900
@@ -1,6 +1,9 @@
-__code cs0(int a, int b){
-  goto cs1(a+b);
+__code cg0(Integer a, Integer b){
+ int a_v = a->value;
+ int b_v = b->value;
+ Integer c = {a_v + b_v};
+  goto cg1(c);
 }
-__code cs1(int c){
-  goto cs2(c);
+__code cg1(Integer c){
+  goto cg2(c);
 }