annotate slide/CbCXv6.html @ 32:4c24694af0b0

slide html
author tobaru
date Sun, 09 Feb 2020 22:55:38 +0900
parents 98cee2f6c919
children e68c3bd31098
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
1 <!DOCTYPE html>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
2
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
3 <html lang="en">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
4
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
5 <head>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
6 <meta charset="utf-8">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
7 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
8 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
9 <meta name="apple-mobile-web-app-capable" content="yes">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
10 <meta name="apple-mobile-web-app-status-bar-style" content="black">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
11 <meta name="mobile-web-app-capable" content="yes">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
12 <title>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
13 CbCインターフェースによる CbCXv6 の書き換え - HackMD
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
14 </title>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
15 <link rel="icon" type="image/png" href="https://hackmd.io/favicon.png">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
16 <link rel="apple-touch-icon" href="https://hackmd.io/apple-touch-icon.png">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
18 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
19 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
20 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css" integrity="sha256-3iu9jgsy9TpTwXKb7bNQzqWekRX7pPK+2OLj3R922fo=" crossorigin="anonymous" />
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
21 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/3.5.0/octicons.min.css" integrity="sha256-QiWfLIsCT02Sdwkogf6YMiQlj4NE84MKkzEMkZnMGdg=" crossorigin="anonymous" />
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
22 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/themes/prism.min.css" integrity="sha256-vtR0hSWRc3Tb26iuN2oZHt3KRUomwTufNIf5/4oeCyg=" crossorigin="anonymous" />
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
23 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/css/basic/emojify.min.css" integrity="sha256-UOrvMOsSDSrW6szVLe8ZDZezBxh5IoIfgTwdNDgTjiU=" crossorigin="anonymous" />
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
24 <style>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
25 @charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i|Source+Code+Pro:300,400,500|Source+Sans+Pro:300,300i,400,400i,600,600i|Source+Serif+Pro&subset=latin-ext);.hljs{display:block;background:#fff;padding:.5em;color:#333;overflow-x:auto}.hljs-comment,.hljs-meta{color:#969896}.hljs-emphasis,.hljs-quote,.hljs-string,.hljs-strong,.hljs-template-variable,.hljs-variable{color:#df5000}.hljs-keyword,.hljs-selector-tag,.hljs-type{color:#a71d5d}.hljs-attribute,.hljs-bullet,.hljs-literal,.hljs-number,.hljs-symbol{color:#0086b3}.hljs-built_in,.hljs-builtin-name{color:#005cc5}.hljs-name,.hljs-section{color:#63a35c}.hljs-tag{color:#333}.hljs-attr,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-title{color:#795da3}.hljs-addition{color:#55a532;background-color:#eaffea}.hljs-deletion{color:#bd2c00;background-color:#ffecec}.hljs-link{text-decoration:underline}.markdown-body{font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body:after,.markdown-body:before{display:table;content:""}.markdown-body:after{clear:both}.markdown-body>:first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:#c00}.markdown-body .anchor{float:left;padding-right:4px;margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body blockquote,.markdown-body dl,.markdown-body ol,.markdown-body p,.markdown-body pre,.markdown-body table,.markdown-body ul{margin-top:0;margin-bottom:16px}.markdown-body hr{height:.25em;padding:0;margin:24px 0;background-color:#e7e7e7;border:0}.markdown-body blockquote{font-size:16px;padding:0 1em;color:#777;border-left:.25em solid #ddd}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body kbd,.popover kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;color:#555;vertical-align:middle;background-color:#fcfcfc;border:1px solid #ccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}.markdown-body .loweralpha{list-style-type:lower-alpha}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:#000;vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 code,.markdown-body h1 tt,.markdown-body h2 code,.markdown-body h2 tt,.markdown-body h3 code,.markdown-body h3 tt,.markdown-body h4 code,.markdown-body h4 tt,.markdown-body h5 code,.markdown-body h5 tt,.markdown-body h6 code,.markdown-body h6 tt{font-size:inherit}.markdown-body h1{font-size:2em}.markdown-body h1,.markdown-body h2{padding-bottom:.3em;border-bottom:1px solid #eee}.markdown-body h2{font-size:1.5em}.markdown-body h3{font-size:1.25em}.markdown-body h4{font-size:1em}.markdown-body h5{font-size:.875em}.markdown-body h6{font-size:.85em;color:#777}.markdown-body ol,.markdown-body ul{padding-left:2em}.markdown-body ol.no-list,.markdown-body ul.no-list{padding:0;list-style-type:none}.markdown-body ol ol,.markdown-body ol ul,.markdown-body ul ol,.markdown-body ul ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:16px}.markdown-body li+li{padding-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}.markdown-body dl dd{padding:0 16px;margin-bottom:16px}.markdown-body table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}.markdown-body table th{font-weight:700}.markdown-body table td,.markdown-body table th{padding:6px 13px;border:1px solid #ddd}.markdown-body table tr{background-color:#fff;border-top:1px solid #ccc}.markdown-body table tr:nth-child(2n){background-color:#f8f8f8}.markdown-body img{max-width:100%;box-sizing:content-box;background-color:#fff}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{max-width:none;vertical-align:text-top;background-color:transparent}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid #ddd}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:#333}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:0;padding-top:.2em;padding-bottom:.2em;margin:0;font-size:85%;background-color:rgba(0,0,0,.04);border-radius:3px}.markdown-body code:after,.markdown-body code:before,.markdown-body tt:after,.markdown-body tt:before{letter-spacing:-.2em;content:"\00a0"}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body pre{word-wrap:normal}.markdown-body pre>code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:transparent;border:0}.markdown-body .highlight{margin-bottom:16px}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border-radius:3px}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body pre code:after,.markdown-body pre code:before,.markdown-body pre tt:after,.markdown-body pre tt:before{content:normal}.markdown-body .csv-data td,.markdown-body .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}.markdown-body .csv-data .blob-line-num{padding:10px 8px 9px;text-align:right;background:#fff;border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:700;background:#f8f8f8;border-top:0}.news .alert .markdown-body blockquote{padding:0 0 0 40px;border:0 none}.activity-tab .news .alert .commits,.activity-tab .news .markdown-body blockquote{padding-left:0}.task-list-item{list-style-type:none}.task-list-item label{font-weight:400}.task-list-item.enabled label{cursor:pointer}.task-list-item+.task-list-item{margin-top:3px}.task-list-item-checkbox{float:left;margin:.31em 0 .2em -1.3em!important;vertical-align:middle;cursor:default!important}.markdown-body{padding-top:40px;padding-bottom:40px;max-width:758px;overflow:visible!important}.markdown-body .emoji{vertical-align:top}.markdown-body pre{border:inherit!important}.markdown-body code{color:inherit!important}.markdown-body pre code .wrapper{display:-moz-inline-flex;display:-ms-inline-flex;display:-o-inline-flex;display:inline-flex}.markdown-body pre code .gutter{float:left;overflow:hidden;-webkit-user-select:none;user-select:none}.markdown-body pre code .gutter.linenumber{text-align:right;position:relative;display:inline-block;cursor:default;z-index:4;padding:0 8px 0 0;min-width:20px;box-sizing:content-box;color:#afafaf!important;border-right:3px solid #6ce26c!important}.markdown-body pre code .gutter.linenumber>span:before{content:attr(data-linenumber)}.markdown-body pre code .code{float:left;margin:0 0 0 16px}.markdown-body .gist .line-numbers{border-left:none;border-top:none;border-bottom:none}.markdown-body .gist .line-data{border:none}.markdown-body .gist table{border-spacing:0;border-collapse:inherit!important}.markdown-body code[data-gist-id]{background:none;padding:0}.markdown-body code[data-gist-id]:after,.markdown-body code[data-gist-id]:before{content:""}.markdown-body code[data-gist-id] .blob-num{border:unset}.markdown-body code[data-gist-id] table{overflow:unset;margin-bottom:unset}.markdown-body code[data-gist-id] table tr{background:unset}.markdown-body[dir=rtl] pre{direction:ltr}.markdown-body[dir=rtl] code{direction:ltr;unicode-bidi:embed}.markdown-body .alert>p{margin-bottom:0}.markdown-body pre.abc,.markdown-body pre.flow-chart,.markdown-body pre.graphviz,.markdown-body pre.mermaid,.markdown-body pre.sequence-diagram{text-align:center;background-color:inherit;border-radius:0;white-space:inherit}.markdown-body pre.abc>code,.markdown-body pre.flow-chart>code,.markdown-body pre.graphviz>code,.markdown-body pre.mermaid>code,.markdown-body pre.sequence-diagram>code{text-align:left}.markdown-body pre.abc>svg,.markdown-body pre.flow-chart>svg,.markdown-body pre.graphviz>svg,.markdown-body pre.mermaid>svg,.markdown-body pre.sequence-diagram>svg{max-width:100%;height:100%}.markdown-body pre>code.wrap{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.markdown-body .alert>p,.markdown-body .alert>ul{margin-bottom:0}.markdown-body summary{display:list-item}.markdown-body summary:focus{outline:none}.markdown-body details summary{cursor:pointer}.markdown-body details:not([open])>:not(summary){display:none}.markdown-body figure{margin:1em 40px}.markdown-body .mark,.markdown-body mark{background-color:#fff1a7}.vimeo,.youtube{cursor:pointer;display:table;text-align:center;background-position:50%;background-repeat:no-repeat;background-size:contain;background-color:#000;overflow:hidden}.vimeo,.youtube{position:relative;width:100%}.youtube{padding-bottom:56.25%}.vimeo img{width:100%;object-fit:contain;z-index:0}.youtube img{object-fit:cover;z-index:0}.vimeo iframe,.youtube iframe,.youtube img{width:100%;height:100%;position:absolute;top:0;left:0}.vimeo iframe,.youtube iframe{vertical-align:middle;z-index:1}.vimeo .icon,.youtube .icon{position:absolute;height:auto;width:auto;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;opacity:.3;transition:opacity .2s;z-index:0}.vimeo:hover .icon,.youtube:hover .icon{opacity:.6;transition:opacity .2s}.slideshare .inner,.speakerdeck .inner{position:relative;width:100%}.slideshare .inner iframe,.speakerdeck .inner iframe{position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%}.MJX_Assistive_MathML{display:none}.ui-infobar{position:relative;z-index:2;max-width:760px;margin:25px auto -25px;padding:0 15px;color:#777}.toc .invisable-node{list-style-type:none}.ui-toc{position:fixed;bottom:20px;z-index:998}.ui-toc-label{opacity:.3;background-color:#ccc;border:none;transition:opacity .2s}.ui-toc .open .ui-toc-label{opacity:1;color:#fff;transition:opacity .2s}.ui-toc-label:focus{opacity:.3;background-color:#ccc;color:#000}.ui-toc-label:hover{opacity:1;background-color:#ccc;transition:opacity .2s}.ui-toc-dropdown{margin-top:23px;margin-bottom:20px;padding-left:10px;padding-right:10px;max-width:45vw;width:25vw;max-height:70vh;overflow:auto;text-align:inherit}.ui-toc-dropdown>.toc{max-height:calc(70vh - 100px);overflow:auto}.ui-toc-dropdown[dir=rtl] .nav{padding-right:0;letter-spacing:.0029em}.ui-toc-dropdown a{overflow:hidden;text-overflow:ellipsis;white-space:pre}.ui-toc-dropdown .nav>li>a{display:block;padding:4px 20px;font-size:13px;font-weight:500;color:#767676}.ui-toc-dropdown .nav>li:first-child:last-child > ul,.ui-toc-dropdown .toc.expand ul{display:block}.ui-toc-dropdown .nav>li>a:focus,.ui-toc-dropdown .nav>li>a:hover{padding-left:19px;color:#000;text-decoration:none;background-color:transparent;border-left:1px solid #000}.ui-toc-dropdown[dir=rtl] .nav>li>a:focus,.ui-toc-dropdown[dir=rtl] .nav>li>a:hover{padding-right:19px;border-left:none;border-right:1px solid #000}.ui-toc-dropdown .nav>.active:focus>a,.ui-toc-dropdown .nav>.active:hover>a,.ui-toc-dropdown .nav>.active>a{padding-left:18px;font-weight:700;color:#000;background-color:transparent;border-left:2px solid #000}.ui-toc-dropdown[dir=rtl] .nav>.active:focus>a,.ui-toc-dropdown[dir=rtl] .nav>.active:hover>a,.ui-toc-dropdown[dir=rtl] .nav>.active>a{padding-right:18px;border-left:none;border-right:2px solid #000}.ui-toc-dropdown .nav .nav{display:none;padding-bottom:10px}.ui-toc-dropdown .nav>.active>ul{display:block}.ui-toc-dropdown .nav .nav>li>a{padding-top:1px;padding-bottom:1px;padding-left:30px;font-size:12px;font-weight:400}.ui-toc-dropdown[dir=rtl] .nav .nav>li>a{padding-right:30px}.ui-toc-dropdown .nav .nav>li>ul>li>a{padding-top:1px;padding-bottom:1px;padding-left:40px;font-size:12px;font-weight:400}.ui-toc-dropdown[dir=rtl] .nav .nav>li>ul>li>a{padding-right:40px}.ui-toc-dropdown .nav .nav>li>a:focus,.ui-toc-dropdown .nav .nav>li>a:hover{padding-left:29px}.ui-toc-dropdown[dir=rtl] .nav .nav>li>a:focus,.ui-toc-dropdown[dir=rtl] .nav .nav>li>a:hover{padding-right:29px}.ui-toc-dropdown .nav .nav>li>ul>li>a:focus,.ui-toc-dropdown .nav .nav>li>ul>li>a:hover{padding-left:39px}.ui-toc-dropdown[dir=rtl] .nav .nav>li>ul>li>a:focus,.ui-toc-dropdown[dir=rtl] .nav .nav>li>ul>li>a:hover{padding-right:39px}.ui-toc-dropdown .nav .nav>.active:focus>a,.ui-toc-dropdown .nav .nav>.active:hover>a,.ui-toc-dropdown .nav .nav>.active>a{padding-left:28px;font-weight:500}.ui-toc-dropdown[dir=rtl] .nav .nav>.active:focus>a,.ui-toc-dropdown[dir=rtl] .nav .nav>.active:hover>a,.ui-toc-dropdown[dir=rtl] .nav .nav>.active>a{padding-right:28px}.ui-toc-dropdown .nav .nav>.active>.nav>.active:focus>a,.ui-toc-dropdown .nav .nav>.active>.nav>.active:hover>a,.ui-toc-dropdown .nav .nav>.active>.nav>.active>a{padding-left:38px;font-weight:500}.ui-toc-dropdown[dir=rtl] .nav .nav>.active>.nav>.active:focus>a,.ui-toc-dropdown[dir=rtl] .nav .nav>.active>.nav>.active:hover>a,.ui-toc-dropdown[dir=rtl] .nav .nav>.active>.nav>.active>a{padding-right:38px}.markdown-body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica Neue,Helvetica,Roboto,Arial,sans-serif}html[lang^=ja] .markdown-body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica Neue,Helvetica,Roboto,Arial,Hiragino Kaku Gothic Pro,ヒラギノ角ゴ Pro W3,Osaka,Meiryo,メイリオ,MS Gothic,MS\ ゴシック,sans-serif}html[lang=zh-tw] .markdown-body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica Neue,Helvetica,Roboto,Arial,PingFang TC,Microsoft JhengHei,微軟正黑,sans-serif}html[lang=zh-cn] .markdown-body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica Neue,Helvetica,Roboto,Arial,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif}html .markdown-body[lang^=ja]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica Neue,Helvetica,Roboto,Arial,Hiragino Kaku Gothic Pro,ヒラギノ角ゴ Pro W3,Osaka,Meiryo,メイリオ,MS Gothic,MS\ ゴシック,sans-serif}html .markdown-body[lang=zh-tw]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica Neue,Helvetica,Roboto,Arial,PingFang TC,Microsoft JhengHei,微軟正黑,sans-serif}html .markdown-body[lang=zh-cn]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica Neue,Helvetica,Roboto,Arial,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif}html[lang^=ja] .ui-toc-dropdown{font-family:Source Sans Pro,Helvetica,Arial,Meiryo UI,MS PGothic,MS\ Pゴシック,sans-serif}html[lang=zh-tw] .ui-toc-dropdown{font-family:Source Sans Pro,Helvetica,Arial,Microsoft JhengHei UI,微軟正黑UI,sans-serif}html[lang=zh-cn] .ui-toc-dropdown{font-family:Source Sans Pro,Helvetica,Arial,Microsoft YaHei UI,微软雅黑UI,sans-serif}html .ui-toc-dropdown[lang^=ja]{font-family:Source Sans Pro,Helvetica,Arial,Meiryo UI,MS PGothic,MS\ Pゴシック,sans-serif}html .ui-toc-dropdown[lang=zh-tw]{font-family:Source Sans Pro,Helvetica,Arial,Microsoft JhengHei UI,微軟正黑UI,sans-serif}html .ui-toc-dropdown[lang=zh-cn]{font-family:Source Sans Pro,Helvetica,Arial,Microsoft YaHei UI,微软雅黑UI,sans-serif}.ui-affix-toc{position:fixed;top:0;max-width:15vw;max-height:70vh;overflow:auto}.back-to-top,.expand-toggle,.go-to-bottom{display:block;padding:4px 10px;margin-top:10px;margin-left:10px;font-size:12px;font-weight:500;color:#999}.back-to-top:focus,.back-to-top:hover,.expand-toggle:focus,.expand-toggle:hover,.go-to-bottom:focus,.go-to-bottom:hover{color:#563d7c;text-decoration:none}.back-to-top,.go-to-bottom{margin-top:0}.ui-user-icon{width:20px;height:20px;display:block;border-radius:3px;margin-top:2px;margin-bottom:2px;margin-right:5px;background-position:50%;background-repeat:no-repeat;background-size:cover}.ui-user-icon.small{width:18px;height:18px;display:inline-block;vertical-align:middle;margin:0 0 .2em}.ui-infobar>small>span{line-height:22px}.ui-infobar>small .dropdown{display:inline-block}.ui-infobar>small .dropdown a:focus,.ui-infobar>small .dropdown a:hover{text-decoration:none}.ui-published-note{color:#337ab7}.ui-published-note .fa{font-size:20px;vertical-align:top}.unselectable{-webkit-user-select:none;-o-user-select:none;user-select:none}@media print{blockquote,div,img,pre,table{page-break-inside:avoid!important}a[href]:after{font-size:12px!important}}.markdown-body.slides{position:relative;z-index:1;color:#222}.markdown-body.slides:before{content:"";display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;background-color:currentColor;box-shadow:0 0 0 50vw}.markdown-body.slides section[data-markdown]{position:relative;margin-bottom:1.5em;background-color:#fff;text-align:center}.markdown-body.slides section[data-markdown] code{text-align:left}.markdown-body.slides section[data-markdown]:before{content:"";display:block;padding-bottom:56.23%}.markdown-body.slides section[data-markdown]>div:first-child{position:absolute;top:50%;left:1em;right:1em;transform:translateY(-50%);max-height:100%;overflow:hidden}.markdown-body.slides section[data-markdown]>ul{display:inline-block}.markdown-body.slides>section>section+section:after{content:"";position:absolute;top:-1.5em;right:1em;height:1.5em;border:3px solid #777}body{font-smoothing:subpixel-antialiased!important;-webkit-font-smoothing:subpixel-antialiased!important;-moz-osx-font-smoothing:auto!important;text-shadow:0 0 1em transparent,1px 1px 1.2px rgba(0,0,0,.004);-webkit-overflow-scrolling:touch;letter-spacing:.025em}.focus,:focus{outline:none!important}::-moz-focus-inner{border:0!important}body{font-family:Source Sans Pro,Helvetica,Arial,sans-serif}html[lang^=ja] body{font-family:Source Sans Pro,Helvetica,Arial,Hiragino Kaku Gothic Pro,ヒラギノ角ゴ Pro W3,Osaka,Meiryo,メイリオ,MS Gothic,MS\ ゴシック,sans-serif}html[lang=zh-tw] body{font-family:Source Sans Pro,Helvetica,Arial,PingFang TC,Microsoft JhengHei,微軟正黑,sans-serif}html[lang=zh-cn] body{font-family:Source Sans Pro,Helvetica,Arial,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}abbr[data-original-title],abbr[title]{cursor:help}body.modal-open{overflow-y:auto;padding-right:0!important}
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
26 </style>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
27 <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
28 <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
29 <!--[if lt IE 9]>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
30 <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js" integrity="sha256-3Jy/GbSLrg0o9y5Z5n1uw0qxZECH7C6OQpVBgNFYa0g=" crossorigin="anonymous"></script>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
31 <script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js" integrity="sha256-g6iAfvZp+nDQ2TdTR/VVKJf3bGro4ub5fvWSWVRi2NE=" crossorigin="anonymous"></script>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
32 <script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.9/es5-shim.min.js" integrity="sha256-8E4Is26QH0bD52WoQpcB+R/tcWQtpzlCojrybUd7Mxo=" crossorigin="anonymous"></script>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
33 <![endif]-->
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
34 </head>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
35
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
36 <body>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
37 <div id="doc" class="markdown-body container-fluid comment-enabled" data-hard-breaks="true" style="position: relative;"><h1 class="highlight" id="CbCインターフェースによる-CbCXv6-の書き換え" style=""><a class="anchor hidden-xs" href="#CbCインターフェースによる-CbCXv6-の書き換え" title="CbCインターフェースによる-CbCXv6-の書き換え"><span class="octicon octicon-link"></span></a>CbCインターフェースによる CbCXv6 の書き換え</h1><ul>
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
38 <li>並列信頼研</li>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
39 <li>桃原 優</li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
40 </ul><hr><h1 class="highlight" id="概要" style=""><a class="anchor hidden-xs" href="#概要" title="概要"><span class="octicon octicon-link"></span></a>概要</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
41 <li>OS の信頼性を上げたい</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
42 <li>CbCを使って xv6 という OS を書き換える</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
43 <li>Paging の書き換えを行った</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
44 <li>まだ実装中</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
45 <li>将来はコンテナやVMをメタ計算として実装できるはず</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
46 </ul><hr><h1 id="OS-の信頼性を上げたい" style=""><a class="anchor hidden-xs" href="#OS-の信頼性を上げたい" title="OS-の信頼性を上げたい"><span class="octicon octicon-link"></span></a>OS の信頼性を上げたい</h1><ul class="highlight">
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
47 <li>仕様を満たすことを証明する</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
48 <li>証明しやすい形の記述を作る</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
49 <li>CbCの goto で書く
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
50 <ul>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
51 <li>状態遷移系に近い形で記述できる(証明しやすい)</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
52 <li>関数型の記述</li>
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
53 </ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
54 </li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
55 <li>CbCのinterface で書く</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
56 <li>記述のモジュール化</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
57 </ul><hr><h1 id="メタレベルとノーマルレベル" style=""><a class="anchor hidden-xs" href="#メタレベルとノーマルレベル" title="メタレベルとノーマルレベル"><span class="octicon octicon-link"></span></a>メタレベルとノーマルレベル</h1><ul class="highlight">
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
58 <li>ノーマルレベル
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
59 <ul>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
60 <li>CbCで記述される普通のアルゴリズム</li>
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
61 </ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
62 </li>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
63 <li>メタレベル
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
64 <ul>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
65 <li>Paging などのメモリやCPU自体の操作</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
66 <li>プログラムの正しさの証明</li>
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
67 </ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
68 </li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
69 <li>Context
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
70 <ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
71 <li>メタレベルで使用される Meta Data を置く場所</li>
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
72 </ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
73 </li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
74 </ul><hr><h1 id="Continuation-based-C" style=""><a class="anchor hidden-xs" href="#Continuation-based-C" title="Continuation-based-C"><span class="octicon octicon-link"></span></a>Continuation based C</h1><ul class="highlight">
18
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
75 <li>ノーマルレベルとメタレベルの処理を同じ言語で行えるようにした言語(以下CbC)</li>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
76 <li>Code Gear
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
77 <ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
78 <li>基本的な処理の単位</li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
79 <li>goto 文で遷移する</li>
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
80 </ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
81 </li>
18
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
82 <li>Data Gear
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
83 <ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
84 <li>データの単位</li>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
85 </ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
86 </li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
87 <li>Meta Code Gear
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
88 <ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
89 <li>goto meta</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
90 <li>Code Gear の間に挟める計算</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
91 </ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
92 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
93 <li>Meta Data Gear
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
94 <ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
95 <li>Context</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
96 <li>Code Gearの間の接続など</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
97 </ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
98 </li>
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
99 </ul><hr><h1 id="goto-による継続" style=""><a class="anchor hidden-xs" href="#goto-による継続" title="goto-による継続"><span class="octicon octicon-link"></span></a>goto による継続</h1><ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
100 <li>Code Gear の処理の間を goto によって遷移していく</li>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
101 </ul><p><img src="https://i.imgur.com/etfQund.png" alt=""></p><hr><h1 id="Data-Gear-の継続" style=""><a class="anchor hidden-xs" href="#Data-Gear-の継続" title="Data-Gear-の継続"><span class="octicon octicon-link"></span></a>Data Gear の継続</h1><ul>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
102 <li>Code Gear で定義されたデータ</li>
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
103 <li>goto の際に Data Gear も継続される</li>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
104 </ul><p><img src="https://i.imgur.com/3E0DGWA.png" alt=""></p><hr><h1 id="Meta-Code-Gear" style=""><a class="anchor hidden-xs" href="#Meta-Code-Gear" title="Meta-Code-Gear"><span class="octicon octicon-link"></span></a>Meta Code Gear</h1><ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
105 <li>実際にはノーマルレベルの間にメタレベルの処理がある</li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
106 </ul><p><img src="https://i.imgur.com/vy0NxrG.png" alt=""></p><hr><h1 id="Meta-Data-Gear" style=""><a class="anchor hidden-xs" href="#Meta-Data-Gear" title="Meta-Data-Gear"><span class="octicon octicon-link"></span></a>Meta Data Gear</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
107 <li>CbC では接続可能な Code Gear, Data Gear のリスト</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
108 <li>Data Gear を確保するメモリ空間</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
109 <li>ノーマルレベルでの書き換えやアクセスを防ぐために存在</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
110 </ul><hr><h1 id="Xv6" style=""><a class="anchor hidden-xs" href="#Xv6" title="Xv6"><span class="octicon octicon-link"></span></a>Xv6</h1><ul>
18
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
111 <li>MIT の講義用教材として作られたOS
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
112 <ul>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
113 <li>規格化される前のCで書かれたUNIX V6 を書き換えた</li>
18
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
114 <li>1万行程の軽量なOS</li>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
115 <li>Linuxだと数千万行</li>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
116 </ul>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
117 </li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
118 <li>Xv6 をCbCで書き換える</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
119 </ul><hr><h1 id="Xv6の構成" style=""><a class="anchor hidden-xs" href="#Xv6の構成" title="Xv6の構成"><span class="octicon octicon-link"></span></a>Xv6の構成</h1><ul class="highlight">
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
120 <li>systemcall</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
121 <li>Scheduler</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
122 <li>Virtual Memory</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
123 <li>file system</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
124 <li>tty</li>
18
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
125 </ul><hr><h1 id="カーネル空間" style=""><a class="anchor hidden-xs" href="#カーネル空間" title="カーネル空間"><span class="octicon octicon-link"></span></a>カーネル空間</h1><ul>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
126 <li>OS の中核となるプログラムで Meta Level に相当する</li>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
127 <li>Xv6 ではカーネルとユーザープログラムは分離されている</li>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
128 <li>ユーザープログラムはカーネルに直接アクセスできない。
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
129 <ul>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
130 <li>ユーザープログラムによる書き換えやアクセスを防ぐため</li>
18
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
131 <li>呼び出す場合は system call</li>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
132 </ul>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
133 </li>
19
tobaru
parents: 18
diff changeset
134 </ul><hr><h1 id="system-call" style=""><a class="anchor hidden-xs" href="#system-call" title="system-call"><span class="octicon octicon-link"></span></a>system call</h1><ul>
18
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
135 <li>system call 呼び出し</li>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
136 <li>トラップ の発生</li>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
137 <li>ユーザープログラムの中断</li>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
138 <li>処理がカーネルに切り替わる</li>
19
tobaru
parents: 18
diff changeset
139 </ul><hr><h1 id="Paging" style=""><a class="anchor hidden-xs" href="#Paging" title="Paging"><span class="octicon octicon-link"></span></a>Paging</h1><ul>
18
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
140 <li>Page と呼ばれる固定長のブロックに分割して、メモリとスワップ領域で Page を入れ替えて管理</li>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
141 <li>仮想メモリとして扱うことでフラグメンテーションの解消と空き番地を探す必要がなくなる</li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
142 </ul><hr><h1 id="Xv6の書き換え方針" style=""><a class="anchor hidden-xs" href="#Xv6の書き換え方針" title="Xv6の書き換え方針"><span class="octicon octicon-link"></span></a>Xv6の書き換え方針</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
143 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
144 <p>メタレベルとノーマルレベルを記述できるOSを実装したい</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
145 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
146 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
147 <p>段階的に書き換えていきたい</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
148 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
149 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
150 <p>Paging を書き換える理由</p>
18
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
151 <ul>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
152 <li>OS の信頼性を保証する上で重要なメモリ管理部分</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
153 </ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
154 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
155 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
156 <p>__code で書き直していく</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
157 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
158 </ul><hr><h1 id="CbCインターフェース0" style=""><a class="anchor hidden-xs" href="#CbCインターフェース0" title="CbCインターフェース0"><span class="octicon octicon-link"></span></a>CbCインターフェース</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
159 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
160 <p>ノーマルレベルからメタレベルの記述が記述が煩雑になるためインターフェースを導入</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
161 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
162 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
163 <p>インターフェースによる他のメリット</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
164 <ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
165 <li>煩雑な記述の解消</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
166 <li>実装の入れ替え</li>
18
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
167 </ul>
afc36230cf4f slide chapter3,4
tobaru
parents: 17
diff changeset
168 </li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
169 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
170 <p>実装は別で定義し、呼び出す</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
171 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
172 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
173 <p>インターフェースによって実装を置き換えることができる</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
174 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
175 </ul><hr><h1 id="CbCインターフェース" style=""><a class="anchor hidden-xs" href="#CbCインターフェース" title="CbCインターフェース"><span class="octicon octicon-link"></span></a>CbCインターフェース</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
176 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
177 <p>Data Gear と Data Gear に対して操作を行う Code Gear の集合を表現する <strong>Meta Data Gear</strong></p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
178 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
179 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
180 <p>インターフェース実装と定義の図入れる</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
181 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
182 </ul><hr><h1 id="インターフェースの定義0" style=""><a class="anchor hidden-xs" href="#インターフェースの定義0" title="インターフェースの定義0"><span class="octicon octicon-link"></span></a>インターフェースの定義</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
183 <li>Xv6 の Virtual Memory の API 部分のインターフェース</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
184 </ul><pre><code class="c hljs"><span class="token keyword">typedef</span> <span class="token keyword">struct</span> vm<span class="token operator">&lt;</span>Type<span class="token punctuation">,</span>Impl<span class="token operator">&gt;</span> <span class="token punctuation">{</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
185 __code <span class="token function">init_vmm</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
186 __code <span class="token function">kpt_freerange</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm<span class="token punctuation">,</span> uint low<span class="token punctuation">,</span> uint hi<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
187 __code <span class="token function">kpt_alloc</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm <span class="token punctuation">,</span>__code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
188 __code <span class="token function">switchuvm</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm <span class="token punctuation">,</span><span class="token keyword">struct</span> proc<span class="token operator">*</span> p<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
189 __code <span class="token function">init_inituvm</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm<span class="token punctuation">,</span> pde_t<span class="token operator">*</span> pgdir<span class="token punctuation">,</span> <span class="token keyword">char</span><span class="token operator">*</span> init<span class="token punctuation">,</span> uint sz<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
190 __code <span class="token function">loaduvm</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm<span class="token punctuation">,</span>pde_t<span class="token operator">*</span> pgdir<span class="token punctuation">,</span> <span class="token keyword">char</span><span class="token operator">*</span> addr<span class="token punctuation">,</span> <span class="token keyword">struct</span> inode<span class="token operator">*</span> ip<span class="token punctuation">,</span> uint offset<span class="token punctuation">,</span> uint sz<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
191 __code <span class="token function">allocuvm</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm<span class="token punctuation">,</span> pde_t<span class="token operator">*</span> pgdir<span class="token punctuation">,</span> uint oldsz<span class="token punctuation">,</span> uint newsz<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
192
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
193 </code></pre><hr><h1 id="インターフェースの命名" style=""><a class="anchor hidden-xs" href="#インターフェースの命名" title="インターフェースの命名"><span class="octicon octicon-link"></span></a>インターフェースの命名</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
194 <li>typedef struct の直後にインターフェース名(vm)を書く</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
195 <li>Data Gear にマッピングされる</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
196 </ul><pre><code class="c hljs"><span class="token keyword">typedef</span> <span class="token keyword">struct</span> vm<span class="token operator">&lt;</span>Type<span class="token punctuation">,</span>Impl<span class="token operator">&gt;</span> <span class="token punctuation">{</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
197 </code></pre><hr><h1 id="インターフェースの-Code-Gear" style=""><a class="anchor hidden-xs" href="#インターフェースの-Code-Gear" title="インターフェースの-Code-Gear"><span class="octicon octicon-link"></span></a>インターフェースの Code Gear</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
198 <li>Code Gear は __code CodeGear名(引数); で記述する
19
tobaru
parents: 18
diff changeset
199 <ul>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
200 <li>引数が Data Gear に相当する</li>
19
tobaru
parents: 18
diff changeset
201 </ul>
tobaru
parents: 18
diff changeset
202 </li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
203 <li>第1引数の Impl* vm がインターフェースの実装の型になる</li>
19
tobaru
parents: 18
diff changeset
204 </ul><pre><code class="c hljs"><span class="token keyword">typedef</span> <span class="token keyword">struct</span> vm<span class="token operator">&lt;</span>Type<span class="token punctuation">,</span>Impl<span class="token operator">&gt;</span> <span class="token punctuation">{</span>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
205 __code <span class="token function">init_vmm</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
19
tobaru
parents: 18
diff changeset
206 __code <span class="token function">kpt_freerange</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm<span class="token punctuation">,</span> uint low<span class="token punctuation">,</span> uint hi<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
207 __code <span class="token function">kpt_alloc</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm <span class="token punctuation">,</span>__code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
208 __code <span class="token function">switchuvm</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm <span class="token punctuation">,</span><span class="token keyword">struct</span> proc<span class="token operator">*</span> p<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
209 __code <span class="token function">init_inituvm</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm<span class="token punctuation">,</span> pde_t<span class="token operator">*</span> pgdir<span class="token punctuation">,</span> <span class="token keyword">char</span><span class="token operator">*</span> init<span class="token punctuation">,</span> uint sz<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
210 __code <span class="token function">loaduvm</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm<span class="token punctuation">,</span>pde_t<span class="token operator">*</span> pgdir<span class="token punctuation">,</span> <span class="token keyword">char</span><span class="token operator">*</span> addr<span class="token punctuation">,</span> <span class="token keyword">struct</span> inode<span class="token operator">*</span> ip<span class="token punctuation">,</span> uint offset<span class="token punctuation">,</span> uint sz<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
211 __code <span class="token function">allocuvm</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm<span class="token punctuation">,</span> pde_t<span class="token operator">*</span> pgdir<span class="token punctuation">,</span> uint oldsz<span class="token punctuation">,</span> uint newsz<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
212
tobaru
parents: 18
diff changeset
213 </code></pre><hr><h1 id="next…" style=""><a class="anchor hidden-xs" href="#next…" title="next…"><span class="octicon octicon-link"></span></a>next(…)</h1><ul>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
214 <li>__code next(…) は次の Code Gear の継続先</li>
19
tobaru
parents: 18
diff changeset
215 <li>それぞれの Code Gear の引数の1つに設定する</li>
tobaru
parents: 18
diff changeset
216 </ul><pre><code class="c hljs"> __code <span class="token function">kpt_freerange</span><span class="token punctuation">(</span>Impl<span class="token operator">*</span> vm<span class="token punctuation">,</span> uint low<span class="token punctuation">,</span> uint hi<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
217 <span class="token comment">//....</span>
19
tobaru
parents: 18
diff changeset
218 __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
219 <span class="token punctuation">}</span> vm<span class="token punctuation">;</span>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
220 </code></pre><pre><code class="c hljs">__code <span class="token function">exit</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
221 <span class="token comment">//....</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
222 <span class="token punctuation">}</span>
19
tobaru
parents: 18
diff changeset
223
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
224 <span class="token keyword">goto</span> vm<span class="token operator">-&gt;</span><span class="token function">kpt_freerange</span><span class="token punctuation">(</span>vm<span class="token punctuation">,</span> low<span class="token punctuation">,</span> hi<span class="token punctuation">,</span> exit<span class="token punctuation">)</span><span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
225 </code></pre><hr><h1 id="Interface-の実装の型" style=""><a class="anchor hidden-xs" href="#Interface-の実装の型" title="Interface-の実装の型"><span class="octicon octicon-link"></span></a>Interface の実装の型</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
226 <li>実装側のヘッダーファイルも vm_impl と同じように用意する</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
227 </ul><pre><code class="c hljs"><span class="token keyword">typedef</span> <span class="token keyword">struct</span> vm_impl<span class="token operator">&lt;</span>Impl<span class="token punctuation">,</span> Isa<span class="token operator">&gt;</span> impl vm<span class="token punctuation">{</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
228 <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
229 __code <span class="token function">loaduvm_ptesize_check</span><span class="token punctuation">(</span>Type<span class="token operator">*</span> vm_impl<span class="token punctuation">,</span> uint i<span class="token punctuation">,</span> pte_t<span class="token operator">*</span> pte<span class="token punctuation">,</span> uint sz<span class="token punctuation">,</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
230 __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
231 </code></pre><hr><h1 id="インターフェースの実装" style=""><a class="anchor hidden-xs" href="#インターフェースの実装" title="インターフェースの実装"><span class="octicon octicon-link"></span></a>インターフェースの実装</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
232 <li>実装は型と実装をそれぞれ別ファイルで定義する(vm_impl.h と vm_impl.cbc)</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
233 <li>実装するインターフェースは #interface で宣言する</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
234 </ul><pre><code class="c hljs"><span class="token macro property">#interface "vm.h"</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
235 </code></pre><hr><h1 class="highlight" id="vm_impl-のコンストラクタ" style=""><a class="anchor hidden-xs" href="#vm_impl-のコンストラクタ" title="vm_impl-のコンストラクタ"><span class="octicon octicon-link"></span></a>vm_impl のコンストラクタ</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
236 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
237 <p>create_imple の関数内で vm の型を定義し、vm-&gt;CodeGear名 で対応させていく</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
238 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
239 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
240 <p>実装を Code Gear で記述していく。</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
241 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
242 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
243 <p>struct vm* vm = new vm();</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
244 <ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
245 <li>インターフェースのメモリ空間を確保</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
246 </ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
247 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
248 <li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
249 <p>vm-&gt;void_ret = C_vm_void_ret;</p>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
250 <ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
251 <li>Code Gear の enum の設定</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
252 <li>インターフェースのAPIと enum の番号を紐付けている</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
253 </ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
254 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
255 </ul><pre><code class="c hljs">vm<span class="token operator">*</span> <span class="token function">createvm_impl</span><span class="token punctuation">(</span><span class="token keyword">struct</span> Context<span class="token operator">*</span> cbc_context<span class="token punctuation">)</span> <span class="token punctuation">{</span>
19
tobaru
parents: 18
diff changeset
256 <span class="token keyword">struct</span> vm<span class="token operator">*</span> vm <span class="token operator">=</span> new <span class="token function">vm</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
257 <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
tobaru
parents: 18
diff changeset
258 vm<span class="token operator">-&gt;</span>void_ret <span class="token operator">=</span> C_vm_void_ret<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
259 vm<span class="token operator">-&gt;</span>init_vmm <span class="token operator">=</span> C_init_vmmvm_impl<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
260 vm<span class="token operator">-&gt;</span>kpt_freerange <span class="token operator">=</span> C_kpt_freerangevm_impl<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
261 vm<span class="token operator">-&gt;</span>kpt_alloc <span class="token operator">=</span> C_kpt_allocvm_impl<span class="token punctuation">;</span>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
262 </code></pre><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
263 <li>APIの実装の例(init_vmm)
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
264 <ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
265 <li>C_init_vmmvm_impl が メタレベルでinit_vmmvm_impl と対応する</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
266 </ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
267 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
268 </ul><pre><code class="c hljs">__code <span class="token function">init_vmmvm_impl</span><span class="token punctuation">(</span><span class="token keyword">struct</span> vm_impl<span class="token operator">*</span> vm<span class="token punctuation">,</span>__code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
19
tobaru
parents: 18
diff changeset
269 <span class="token function">initlock</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>kpt_mem<span class="token punctuation">.</span>lock<span class="token punctuation">,</span> <span class="token string">"vm"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
270 kpt_mem<span class="token punctuation">.</span>freelist <span class="token operator">=</span> <span class="token constant">NULL</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
271
tobaru
parents: 18
diff changeset
272 <span class="token keyword">goto</span> <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
273 <span class="token punctuation">}</span>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
274 </code></pre><hr><h1 id="インターフェース実装内の-CbC" style=""><a class="anchor hidden-xs" href="#インターフェース実装内の-CbC" title="インターフェース実装内の-CbC"><span class="octicon octicon-link"></span></a>インターフェース実装内の CbC</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
275 <li>for文やif文がある場合はさらに実装を分ける
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
276 <ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
277 <li>状態遷移ベースで記述したい</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
278 </ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
279 </li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
280 <li>インターフェースは外から呼び出されるAPI</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
281 <li>それに対してインターフェースの実装の Code Gearから明示的に呼び出される Code Gearは、Java の private メソッドのように扱われる。</li>
19
tobaru
parents: 18
diff changeset
282 <li>実際に vm.c の loaduvm の実装を分けた記述を説明する</li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
283 </ul><hr><h1 id="実装内の明示的な遷移の処理" style=""><a class="anchor hidden-xs" href="#実装内の明示的な遷移の処理" title="実装内の明示的な遷移の処理"><span class="octicon octicon-link"></span></a>実装内の明示的な遷移の処理</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
284 <li>vm と同じ create_impl 内で vm_impl を定義し、private で実装する Code Gear を定義する</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
285 <li>loaduvmvm_impl で goto によって private に遷移する</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
286 </ul><pre class="highlight"><code class="c hljs">__code <span class="token function">loaduvmvm_impl</span><span class="token punctuation">(</span><span class="token keyword">struct</span> vm_impl<span class="token operator">*</span> vm<span class="token punctuation">,</span> pde_t<span class="token operator">*</span> pgdir<span class="token punctuation">,</span> <span class="token keyword">char</span><span class="token operator">*</span> addr<span class="token punctuation">,</span> <span class="token keyword">struct</span> inode<span class="token operator">*</span> ip<span class="token punctuation">,</span> uint offset<span class="token punctuation">,</span> uint sz<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
287 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>pgdir <span class="token operator">=</span> pgdir<span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
288 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>addr <span class="token operator">=</span> addr<span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
289 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>ip <span class="token operator">=</span> ip<span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
290 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>offset <span class="token operator">=</span> offset<span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
291 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>sz <span class="token operator">=</span> sz<span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
292 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>next <span class="token operator">=</span> next<span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
293
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
294 <span class="token keyword">goto</span> <span class="token function">loaduvm_ptesize_checkvm_impl</span><span class="token punctuation">(</span>vm<span class="token punctuation">,</span> <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
295 <span class="token punctuation">}</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
296 </code></pre><pre class="highlight"><code class="c hljs">vm<span class="token operator">*</span> <span class="token function">createvm_impl</span><span class="token punctuation">(</span><span class="token keyword">struct</span> Context<span class="token operator">*</span> cbc_context<span class="token punctuation">)</span> <span class="token punctuation">{</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
297 <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
298 <span class="token keyword">struct</span> vm_impl<span class="token operator">*</span> vm_impl <span class="token operator">=</span> new <span class="token function">vm_impl</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
299 <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
300 vm_impl<span class="token operator">-&gt;</span>loaduvm_ptesize_check <span class="token operator">=</span> C_loaduvm_ptesize_checkvm_impl<span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
301 <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
302 vm<span class="token operator">-&gt;</span>loaduvm <span class="token operator">=</span> C_loaduvmvm_impl<span class="token punctuation">;</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
303 <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
304 <span class="token punctuation">}</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
305 </code></pre><hr><h1 id="loaduvmの-CbCによる書き換え" style=""><a class="anchor hidden-xs" href="#loaduvmの-CbCによる書き換え" title="loaduvmの-CbCによる書き換え"><span class="octicon octicon-link"></span></a>loaduvmの CbCによる書き換え</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
306 <li>loaduvmは何でなぜ書き換えてるのか</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
307 <li>vm.cのloaduvmの処理をCbC で書き換える</li>
19
tobaru
parents: 18
diff changeset
308 </ul><pre><code class="c hljs"><span class="token keyword">int</span> loaduvm <span class="token punctuation">(</span>pde_t <span class="token operator">*</span>pgdir<span class="token punctuation">,</span> <span class="token keyword">char</span> <span class="token operator">*</span>addr<span class="token punctuation">,</span> <span class="token keyword">struct</span> inode <span class="token operator">*</span>ip<span class="token punctuation">,</span> uint offset<span class="token punctuation">,</span> uint sz<span class="token punctuation">)</span>
tobaru
parents: 18
diff changeset
309 <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
310 uint i<span class="token punctuation">,</span> pa<span class="token punctuation">,</span> n<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
311 pte_t <span class="token operator">*</span>pte<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
312
tobaru
parents: 18
diff changeset
313 <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>uint<span class="token punctuation">)</span> addr <span class="token operator">%</span> PTE_SZ <span class="token operator">!=</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
314 <span class="token function">panic</span><span class="token punctuation">(</span><span class="token string">"loaduvm: addr must be page aligned"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
315 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
316
tobaru
parents: 18
diff changeset
317 <span class="token keyword">for</span> <span class="token punctuation">(</span>i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> sz<span class="token punctuation">;</span> i <span class="token operator">+</span><span class="token operator">=</span> PTE_SZ<span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
318 <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>pte <span class="token operator">=</span> <span class="token function">walkpgdir</span><span class="token punctuation">(</span>pgdir<span class="token punctuation">,</span> addr <span class="token operator">+</span> i<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
319 <span class="token function">panic</span><span class="token punctuation">(</span><span class="token string">"loaduvm: address should exist"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
320 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
321
tobaru
parents: 18
diff changeset
322 pa <span class="token operator">=</span> <span class="token function">PTE_ADDR</span><span class="token punctuation">(</span><span class="token operator">*</span>pte<span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
323
tobaru
parents: 18
diff changeset
324 <span class="token keyword">if</span> <span class="token punctuation">(</span>sz <span class="token operator">-</span> i <span class="token operator">&lt;</span> PTE_SZ<span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
325 n <span class="token operator">=</span> sz <span class="token operator">-</span> i<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
326 <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
327 n <span class="token operator">=</span> PTE_SZ<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
328 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
329
tobaru
parents: 18
diff changeset
330 <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token function">readi</span><span class="token punctuation">(</span>ip<span class="token punctuation">,</span> <span class="token function">p2v</span><span class="token punctuation">(</span>pa<span class="token punctuation">)</span><span class="token punctuation">,</span> offset <span class="token operator">+</span> i<span class="token punctuation">,</span> n<span class="token punctuation">)</span> <span class="token operator">!=</span> n<span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
331 <span class="token keyword">return</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
332 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
333 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
334
tobaru
parents: 18
diff changeset
335 <span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
336 <span class="token punctuation">}</span>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
337 </code></pre><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
338 <li>loaduvm_impl がインターフェースから呼ばれる実装</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
339 </ul><pre><code class="c hljs">__code <span class="token function">loaduvmvm_impl</span><span class="token punctuation">(</span><span class="token keyword">struct</span> vm_impl<span class="token operator">*</span> vm<span class="token punctuation">,</span> pde_t<span class="token operator">*</span> pgdir<span class="token punctuation">,</span> <span class="token keyword">char</span><span class="token operator">*</span> addr<span class="token punctuation">,</span> <span class="token keyword">struct</span> inode<span class="token operator">*</span> ip<span class="token punctuation">,</span> uint offset<span class="token punctuation">,</span> uint sz<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
19
tobaru
parents: 18
diff changeset
340 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>pgdir <span class="token operator">=</span> pgdir<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
341 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>addr <span class="token operator">=</span> addr<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
342 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>ip <span class="token operator">=</span> ip<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
343 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>offset <span class="token operator">=</span> offset<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
344 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>sz <span class="token operator">=</span> sz<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
345 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm_impl<span class="token punctuation">)</span><span class="token operator">-&gt;</span>next <span class="token operator">=</span> next<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
346
tobaru
parents: 18
diff changeset
347 <span class="token keyword">goto</span> <span class="token function">loaduvm_ptesize_checkvm_impl</span><span class="token punctuation">(</span>vm<span class="token punctuation">,</span> <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
348 <span class="token punctuation">}</span>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
349 </code></pre><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
350 <li>loaduvm_impl から private な Code Gear が呼ばれる</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
351 </ul><pre><code class="c hljs"><span class="token macro property">#interface "vm_impl.h"</span>
19
tobaru
parents: 18
diff changeset
352
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
353 __code <span class="token function">loaduvm_ptesize_checkvm_impl</span><span class="token punctuation">(</span><span class="token keyword">struct</span> vm_impl<span class="token operator">*</span> vm_impl<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
19
tobaru
parents: 18
diff changeset
354 <span class="token keyword">char</span><span class="token operator">*</span> addr <span class="token operator">=</span> vm_impl<span class="token operator">-&gt;</span>addr<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
355
tobaru
parents: 18
diff changeset
356 <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>uint<span class="token punctuation">)</span> addr <span class="token operator">%</span>PTE_SZ <span class="token operator">!=</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
357 <span class="token comment">// goto panic</span>
tobaru
parents: 18
diff changeset
358 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
359
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
360 <span class="token keyword">goto</span> <span class="token function">loaduvm_loopvm_impl</span><span class="token punctuation">(</span>vm_impl<span class="token punctuation">,</span> <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
19
tobaru
parents: 18
diff changeset
361 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
362 </code></pre><ul>
tobaru
parents: 18
diff changeset
363 <li>vm.cではここから for だが CbC は if文の中と外にgoto を用意して実装する</li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
364 </ul><p><img src="https://i.imgur.com/ByA7GVJ.png" alt=""></p><pre><code class="c hljs">__code <span class="token function">loaduvm_loopvm_impl</span><span class="token punctuation">(</span><span class="token keyword">struct</span> vm_impl<span class="token operator">*</span> vm_impl<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
19
tobaru
parents: 18
diff changeset
365 uint i <span class="token operator">=</span> vm_impl<span class="token operator">-&gt;</span>i<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
366 uint sz <span class="token operator">=</span> vm_impl<span class="token operator">-&gt;</span>sz<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
367
tobaru
parents: 18
diff changeset
368 <span class="token keyword">if</span> <span class="token punctuation">(</span>i <span class="token operator">&lt;</span> sz<span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
369 <span class="token keyword">goto</span> <span class="token function">loaduvm_check_pgdir</span><span class="token punctuation">(</span>vm_impl<span class="token punctuation">,</span> <span class="token function">next</span><span class="token punctuation">(</span>ret<span class="token punctuation">,</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
370 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
371
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
372 <span class="token keyword">goto</span> <span class="token function">loaduvm_exit</span><span class="token punctuation">(</span>vm_impl<span class="token punctuation">,</span> <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
19
tobaru
parents: 18
diff changeset
373 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
374
tobaru
parents: 18
diff changeset
375
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
376 __code <span class="token function">loaduvm_check_pgdir</span><span class="token punctuation">(</span><span class="token keyword">struct</span> vm_impl<span class="token operator">*</span> vm_impl<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
19
tobaru
parents: 18
diff changeset
377 pte_t<span class="token operator">*</span> pte <span class="token operator">=</span> vm_impl<span class="token operator">-&gt;</span>pte<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
378 pde_t<span class="token operator">*</span> pgdir <span class="token operator">=</span> vm_impl<span class="token operator">-&gt;</span>pgdir<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
379 uint i <span class="token operator">=</span> vm_impl<span class="token operator">-&gt;</span>i<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
380 <span class="token keyword">char</span><span class="token operator">*</span> addr <span class="token operator">=</span> vm_impl<span class="token operator">-&gt;</span>addr<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
381 uint pa <span class="token operator">=</span> vm_impl<span class="token operator">-&gt;</span>pa<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
382
tobaru
parents: 18
diff changeset
383 <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>pte <span class="token operator">=</span> <span class="token function">walkpgdir</span><span class="token punctuation">(</span>pgdir<span class="token punctuation">,</span> addr <span class="token operator">+</span> i<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
384 <span class="token comment">// goto panic</span>
tobaru
parents: 18
diff changeset
385 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
386 pa <span class="token operator">=</span> <span class="token function">PTE_ADDR</span><span class="token punctuation">(</span><span class="token operator">*</span>pte<span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
387
tobaru
parents: 18
diff changeset
388 vm_impl<span class="token operator">-&gt;</span>pte <span class="token operator">=</span> pte<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
389 vm_impl<span class="token operator">-&gt;</span>pgdir <span class="token operator">=</span> pgdir<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
390 vm_impl<span class="token operator">-&gt;</span>addr <span class="token operator">=</span> addr<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
391 vm_impl<span class="token operator">-&gt;</span>pa <span class="token operator">=</span> pa<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
392
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
393 <span class="token keyword">goto</span> <span class="token function">loaduvm_check_PTE_SZ</span><span class="token punctuation">(</span>vm_impl<span class="token punctuation">,</span> <span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
19
tobaru
parents: 18
diff changeset
394 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
395
tobaru
parents: 18
diff changeset
396 __code <span class="token function">loaduvm_check_PTE_SZ</span><span class="token punctuation">(</span><span class="token keyword">struct</span> vm_impl<span class="token operator">*</span> vm_impl<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token keyword">int</span> ret<span class="token punctuation">,</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
397 <span class="token keyword">if</span> <span class="token punctuation">(</span>sz <span class="token operator">-</span> i <span class="token operator">&lt;</span> PTE_SZ<span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
398 n <span class="token operator">=</span> sz <span class="token operator">-</span> i<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
399 <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
400 n <span class="token operator">=</span> PTE_SZ<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
401 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
402
tobaru
parents: 18
diff changeset
403 <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token function">readi</span><span class="token punctuation">(</span>ip<span class="token punctuation">,</span> <span class="token function">p2v</span><span class="token punctuation">(</span>pa<span class="token punctuation">)</span><span class="token punctuation">,</span> offset <span class="token operator">+</span> i<span class="token punctuation">,</span> n<span class="token punctuation">)</span> <span class="token operator">!=</span> n<span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
404 ret <span class="token operator">=</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
405 <span class="token keyword">goto</span> <span class="token function">next</span><span class="token punctuation">(</span>ret<span class="token punctuation">,</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
406 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
407
tobaru
parents: 18
diff changeset
408 vm_impl<span class="token operator">-&gt;</span>n <span class="token operator">=</span> n<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
409
tobaru
parents: 18
diff changeset
410 <span class="token keyword">goto</span> <span class="token function">loaduvm_loopvm_impl</span><span class="token punctuation">(</span>vm_impl<span class="token punctuation">,</span> <span class="token function">next</span><span class="token punctuation">(</span>ret<span class="token punctuation">,</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
411 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
412
tobaru
parents: 18
diff changeset
413 __code <span class="token function">loaduvm_exit</span><span class="token punctuation">(</span><span class="token keyword">struct</span> vm_impl<span class="token operator">*</span> vm_impl<span class="token punctuation">,</span> __code <span class="token function">next</span><span class="token punctuation">(</span><span class="token keyword">int</span> ret<span class="token punctuation">,</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
414 ret <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
415 <span class="token keyword">goto</span> <span class="token function">next</span><span class="token punctuation">(</span>ret<span class="token punctuation">,</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
416 <span class="token punctuation">}</span>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
417 </code></pre><hr><pre><code class="c hljs">
19
tobaru
parents: 18
diff changeset
418 <span class="token keyword">int</span> loaduvm <span class="token punctuation">(</span>pde_t <span class="token operator">*</span>pgdir<span class="token punctuation">,</span> <span class="token keyword">char</span> <span class="token operator">*</span>addr<span class="token punctuation">,</span> <span class="token keyword">struct</span> inode <span class="token operator">*</span>ip<span class="token punctuation">,</span> uint offset<span class="token punctuation">,</span> uint sz<span class="token punctuation">)</span>
tobaru
parents: 18
diff changeset
419 <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
420 uint i<span class="token punctuation">,</span> pa<span class="token punctuation">,</span> n<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
421 pte_t <span class="token operator">*</span>pte<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
422
tobaru
parents: 18
diff changeset
423 <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>uint<span class="token punctuation">)</span> addr <span class="token operator">%</span> PTE_SZ <span class="token operator">!=</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
424 <span class="token function">panic</span><span class="token punctuation">(</span><span class="token string">"loaduvm: addr must be page aligned"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
425 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
426
tobaru
parents: 18
diff changeset
427 <span class="token keyword">for</span> <span class="token punctuation">(</span>i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> sz<span class="token punctuation">;</span> i <span class="token operator">+</span><span class="token operator">=</span> PTE_SZ<span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
428 <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>pte <span class="token operator">=</span> <span class="token function">walkpgdir</span><span class="token punctuation">(</span>pgdir<span class="token punctuation">,</span> addr <span class="token operator">+</span> i<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
429 <span class="token function">panic</span><span class="token punctuation">(</span><span class="token string">"loaduvm: address should exist"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
430 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
431
tobaru
parents: 18
diff changeset
432 pa <span class="token operator">=</span> <span class="token function">PTE_ADDR</span><span class="token punctuation">(</span><span class="token operator">*</span>pte<span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
433
tobaru
parents: 18
diff changeset
434 <span class="token keyword">if</span> <span class="token punctuation">(</span>sz <span class="token operator">-</span> i <span class="token operator">&lt;</span> PTE_SZ<span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
435 n <span class="token operator">=</span> sz <span class="token operator">-</span> i<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
436 <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
437 n <span class="token operator">=</span> PTE_SZ<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
438 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
439
tobaru
parents: 18
diff changeset
440 <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token function">readi</span><span class="token punctuation">(</span>ip<span class="token punctuation">,</span> <span class="token function">p2v</span><span class="token punctuation">(</span>pa<span class="token punctuation">)</span><span class="token punctuation">,</span> offset <span class="token operator">+</span> i<span class="token punctuation">,</span> n<span class="token punctuation">)</span> <span class="token operator">!=</span> n<span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
441 <span class="token keyword">return</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
442 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
443 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
444
tobaru
parents: 18
diff changeset
445 <span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
446 <span class="token punctuation">}</span>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
447 </code></pre><hr><h1 id="stub" style=""><a class="anchor hidden-xs" href="#stub" title="stub"><span class="octicon octicon-link"></span></a>stub</h1><ul>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
448 <li>goto meta はstub を呼び込んでいる</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
449 <li>説明</li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
450 </ul><hr><h1 id="C-を-CbC-に部分的に書き直す手法" style=""><a class="anchor hidden-xs" href="#C-を-CbC-に部分的に書き直す手法" title="C-を-CbC-に部分的に書き直す手法"><span class="octicon octicon-link"></span></a>C を CbC に部分的に書き直す手法</h1><ul>
19
tobaru
parents: 18
diff changeset
451 <li>CbC の場合 goto による 遷移を行うので、関数呼び出しのように goto 以降のコードを実行できない</li>
tobaru
parents: 18
diff changeset
452 <li>例) goto すると戻ってこれないため それ以降が実行されなくなる。</li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
453 </ul><hr><h1 id="CbC-から-C-への遷移" style=""><a class="anchor hidden-xs" href="#CbC-から-C-への遷移" title="CbC-から-C-への遷移"><span class="octicon octicon-link"></span></a>CbC から C への遷移</h1><ul class="highlight">
19
tobaru
parents: 18
diff changeset
454 <li>最初の命令は next で戻ってこれるので、dummy の関数を用意してそこで実行する</li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
455 </ul><pre class="highlight"><code class="c hljs"><span class="token keyword">void</span> <span class="token function">cbc_init_vmm_dummy</span><span class="token punctuation">(</span><span class="token keyword">struct</span> Context<span class="token operator">*</span> cbc_context<span class="token punctuation">,</span> <span class="token keyword">struct</span> proc<span class="token operator">*</span> p<span class="token punctuation">,</span> pde_t<span class="token operator">*</span> pgdir<span class="token punctuation">,</span> <span class="token keyword">char</span><span class="token operator">*</span> init<span class="token punctuation">,</span> uint sz<span class="token punctuation">)</span>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
456 <span class="token punctuation">{</span>
19
tobaru
parents: 18
diff changeset
457 <span class="token comment">// inituvm(p-&gt;pgdir, _binary_initcode_start, (int)_binary_initcode_size);</span>
tobaru
parents: 18
diff changeset
458
tobaru
parents: 18
diff changeset
459 <span class="token keyword">struct</span> vm<span class="token operator">*</span> vm <span class="token operator">=</span> <span class="token function">createvm_impl</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
460 <span class="token comment">// goto vm-&gt;init_vmm(vm, pgdir, init, sz , vm-&gt;void_ret);</span>
tobaru
parents: 18
diff changeset
461 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm<span class="token punctuation">)</span><span class="token operator">-&gt;</span>vm <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token keyword">union</span> Data<span class="token operator">*</span><span class="token punctuation">)</span> vm<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
462 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm<span class="token punctuation">)</span><span class="token operator">-&gt;</span>pgdir <span class="token operator">=</span> pgdir<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
463 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm<span class="token punctuation">)</span><span class="token operator">-&gt;</span>init <span class="token operator">=</span> init<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
464 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm<span class="token punctuation">)</span><span class="token operator">-&gt;</span>sz <span class="token operator">=</span> sz <span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
465 <span class="token function">Gearef</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm<span class="token punctuation">)</span><span class="token operator">-&gt;</span>next <span class="token operator">=</span> C_vm_void_ret <span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
466 <span class="token keyword">goto</span> <span class="token function">meta</span><span class="token punctuation">(</span>cbc_context<span class="token punctuation">,</span> vm<span class="token operator">-&gt;</span>init_inituvm<span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
467 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
468
tobaru
parents: 18
diff changeset
469 <span class="token keyword">void</span> <span class="token function">userinit</span><span class="token punctuation">(</span><span class="token keyword">void</span><span class="token punctuation">)</span>
tobaru
parents: 18
diff changeset
470 <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
471 <span class="token keyword">struct</span> proc<span class="token operator">*</span> p<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
472 <span class="token keyword">extern</span> <span class="token keyword">char</span> _binary_initcode_start<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span> _binary_initcode_size<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
473
tobaru
parents: 18
diff changeset
474 p <span class="token operator">=</span> <span class="token function">allocproc</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
475 <span class="token function">initContext</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>p<span class="token operator">-&gt;</span>cbc_context<span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
476
tobaru
parents: 18
diff changeset
477 initproc <span class="token operator">=</span> p<span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
478
tobaru
parents: 18
diff changeset
479 <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token punctuation">(</span>p<span class="token operator">-&gt;</span>pgdir <span class="token operator">=</span> <span class="token function">kpt_alloc</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token constant">NULL</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
tobaru
parents: 18
diff changeset
480 <span class="token function">panic</span><span class="token punctuation">(</span><span class="token string">"userinit: out of memory?"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
tobaru
parents: 18
diff changeset
481 <span class="token punctuation">}</span>
tobaru
parents: 18
diff changeset
482
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
483 <span class="token function">cbc_init_vmm_dummy</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>p<span class="token operator">-&gt;</span>cbc_context<span class="token punctuation">,</span> p<span class="token punctuation">,</span> p<span class="token operator">-&gt;</span>pgdir<span class="token punctuation">,</span> _binary_initcode_start<span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token keyword">int</span><span class="token punctuation">)</span>_binary_initcode_size<span class="token punctuation">)</span><span class="token punctuation">;</span>
19
tobaru
parents: 18
diff changeset
484
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
485 </code></pre><hr><h1 id="まとめ" style=""><a class="anchor hidden-xs" href="#まとめ" title="まとめ"><span class="octicon octicon-link"></span></a>まとめ</h1></div>
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
486 <div class="ui-toc dropup unselectable hidden-print" style="display:none;">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
487 <div class="pull-right dropdown">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
488 <a id="tocLabel" class="ui-toc-label btn btn-default" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
489 <i class="fa fa-bars"></i>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
490 </a>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
491 <ul id="ui-toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
492 <div class="toc"><ul class="nav">
19
tobaru
parents: 18
diff changeset
493 <li class=""><a href="#CbCインターフェースによる-CbCXv6-の書き換え" title="CbCインターフェースによる CbCXv6 の書き換え">CbCインターフェースによる CbCXv6 の書き換え</a></li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
494 <li class=""><a href="#概要" title="概要">概要</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
495 <li class=""><a href="#OS-の信頼性を上げたい" title="OS の信頼性を上げたい">OS の信頼性を上げたい</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
496 <li class=""><a href="#メタレベルとノーマルレベル" title="メタレベルとノーマルレベル">メタレベルとノーマルレベル</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
497 <li class=""><a href="#Continuation-based-C" title="Continuation based C">Continuation based C</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
498 <li class=""><a href="#goto-による継続" title="goto による継続">goto による継続</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
499 <li class=""><a href="#Data-Gear-の継続" title="Data Gear の継続">Data Gear の継続</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
500 <li class=""><a href="#Meta-Code-Gear" title="Meta Code Gear">Meta Code Gear</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
501 <li class=""><a href="#Meta-Data-Gear" title="Meta Data Gear">Meta Data Gear</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
502 <li class=""><a href="#Xv6" title="Xv6">Xv6</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
503 <li class=""><a href="#Xv6の構成" title="Xv6の構成">Xv6の構成</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
504 <li class=""><a href="#カーネル空間" title="カーネル空間">カーネル空間</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
505 <li class=""><a href="#system-call" title="system call">system call</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
506 <li class=""><a href="#Paging" title="Paging">Paging</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
507 <li class=""><a href="#Xv6の書き換え方針" title="Xv6の書き換え方針">Xv6の書き換え方針</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
508 <li class=""><a href="#CbCインターフェース0" title="CbCインターフェース">CbCインターフェース</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
509 <li class=""><a href="#CbCインターフェース" title="CbCインターフェース">CbCインターフェース</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
510 <li class=""><a href="#インターフェースの定義0" title="インターフェースの定義">インターフェースの定義</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
511 <li><a href="#インターフェースの命名" title="インターフェースの命名">インターフェースの命名</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
512 <li><a href="#インターフェースの-Code-Gear" title="インターフェースの Code Gear">インターフェースの Code Gear</a></li>
19
tobaru
parents: 18
diff changeset
513 <li><a href="#next…" title="next(…)">next(…)</a></li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
514 <li><a href="#Interface-の実装の型" title="Interface の実装の型">Interface の実装の型</a></li>
19
tobaru
parents: 18
diff changeset
515 <li><a href="#インターフェースの実装" title="インターフェースの実装">インターフェースの実装</a></li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
516 <li><a href="#vm_impl-のコンストラクタ" title="vm_impl のコンストラクタ">vm_impl のコンストラクタ</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
517 <li class=""><a href="#インターフェース実装内の-CbC" title="インターフェース実装内の CbC">インターフェース実装内の CbC</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
518 <li><a href="#実装内の明示的な遷移の処理" title="実装内の明示的な遷移の処理">実装内の明示的な遷移の処理</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
519 <li><a href="#loaduvmの-CbCによる書き換え" title="loaduvmの CbCによる書き換え">loaduvmの CbCによる書き換え</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
520 <li><a href="#stub" title="stub">stub</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
521 <li><a href="#C-を-CbC-に部分的に書き直す手法" title="C を CbC に部分的に書き直す手法">C を CbC に部分的に書き直す手法</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
522 <li><a href="#CbC-から-C-への遷移" title="CbC から C への遷移">CbC から C への遷移</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
523 <li><a href="#まとめ" title="まとめ">まとめ</a></li>
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
524 </ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
525 </div><div class="toc-menu"><a class="expand-toggle" href="#">Expand all</a><a class="back-to-top" href="#">Back to top</a><a class="go-to-bottom" href="#">Go to bottom</a></div>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
526 </ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
527 </div>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
528 </div>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
529 <div id="ui-toc-affix" class="ui-affix-toc ui-toc-dropdown unselectable hidden-print" data-spy="affix" style="top:17px;display:none;" null null>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
530 <div class="toc"><ul class="nav">
19
tobaru
parents: 18
diff changeset
531 <li class=""><a href="#CbCインターフェースによる-CbCXv6-の書き換え" title="CbCインターフェースによる CbCXv6 の書き換え">CbCインターフェースによる CbCXv6 の書き換え</a></li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
532 <li class=""><a href="#概要" title="概要">概要</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
533 <li class=""><a href="#OS-の信頼性を上げたい" title="OS の信頼性を上げたい">OS の信頼性を上げたい</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
534 <li class=""><a href="#メタレベルとノーマルレベル" title="メタレベルとノーマルレベル">メタレベルとノーマルレベル</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
535 <li class=""><a href="#Continuation-based-C" title="Continuation based C">Continuation based C</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
536 <li class=""><a href="#goto-による継続" title="goto による継続">goto による継続</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
537 <li class=""><a href="#Data-Gear-の継続" title="Data Gear の継続">Data Gear の継続</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
538 <li class=""><a href="#Meta-Code-Gear" title="Meta Code Gear">Meta Code Gear</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
539 <li class=""><a href="#Meta-Data-Gear" title="Meta Data Gear">Meta Data Gear</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
540 <li class=""><a href="#Xv6" title="Xv6">Xv6</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
541 <li class=""><a href="#Xv6の構成" title="Xv6の構成">Xv6の構成</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
542 <li class=""><a href="#カーネル空間" title="カーネル空間">カーネル空間</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
543 <li class=""><a href="#system-call" title="system call">system call</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
544 <li class=""><a href="#Paging" title="Paging">Paging</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
545 <li class=""><a href="#Xv6の書き換え方針" title="Xv6の書き換え方針">Xv6の書き換え方針</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
546 <li class=""><a href="#CbCインターフェース0" title="CbCインターフェース">CbCインターフェース</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
547 <li class=""><a href="#CbCインターフェース" title="CbCインターフェース">CbCインターフェース</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
548 <li class=""><a href="#インターフェースの定義0" title="インターフェースの定義">インターフェースの定義</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
549 <li><a href="#インターフェースの命名" title="インターフェースの命名">インターフェースの命名</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
550 <li><a href="#インターフェースの-Code-Gear" title="インターフェースの Code Gear">インターフェースの Code Gear</a></li>
19
tobaru
parents: 18
diff changeset
551 <li><a href="#next…" title="next(…)">next(…)</a></li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
552 <li><a href="#Interface-の実装の型" title="Interface の実装の型">Interface の実装の型</a></li>
19
tobaru
parents: 18
diff changeset
553 <li><a href="#インターフェースの実装" title="インターフェースの実装">インターフェースの実装</a></li>
32
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
554 <li><a href="#vm_impl-のコンストラクタ" title="vm_impl のコンストラクタ">vm_impl のコンストラクタ</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
555 <li class=""><a href="#インターフェース実装内の-CbC" title="インターフェース実装内の CbC">インターフェース実装内の CbC</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
556 <li><a href="#実装内の明示的な遷移の処理" title="実装内の明示的な遷移の処理">実装内の明示的な遷移の処理</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
557 <li><a href="#loaduvmの-CbCによる書き換え" title="loaduvmの CbCによる書き換え">loaduvmの CbCによる書き換え</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
558 <li><a href="#stub" title="stub">stub</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
559 <li><a href="#C-を-CbC-に部分的に書き直す手法" title="C を CbC に部分的に書き直す手法">C を CbC に部分的に書き直す手法</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
560 <li><a href="#CbC-から-C-への遷移" title="CbC から C への遷移">CbC から C への遷移</a></li>
4c24694af0b0 slide html
tobaru
parents: 19
diff changeset
561 <li><a href="#まとめ" title="まとめ">まとめ</a></li>
17
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
562 </ul>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
563 </div><div class="toc-menu"><a class="expand-toggle" href="#">Expand all</a><a class="back-to-top" href="#">Back to top</a><a class="go-to-bottom" href="#">Go to bottom</a></div>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
564 </div>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
565 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
566 <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous" defer></script>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
567 <script src="https://cdnjs.cloudflare.com/ajax/libs/gist-embed/2.6.0/gist-embed.min.js" integrity="sha256-KyF2D6xPIJUW5sUDSs93vWyZm+1RzIpKCexxElmxl8g=" crossorigin="anonymous" defer></script>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
568 <script>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
569 var markdown = $(".markdown-body");
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
570 //smooth all hash trigger scrolling
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
571 function smoothHashScroll() {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
572 var hashElements = $("a[href^='#']").toArray();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
573 for (var i = 0; i < hashElements.length; i++) {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
574 var element = hashElements[i];
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
575 var $element = $(element);
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
576 var hash = element.hash;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
577 if (hash) {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
578 $element.on('click', function (e) {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
579 // store hash
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
580 var hash = this.hash;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
581 if ($(hash).length <= 0) return;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
582 // prevent default anchor click behavior
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
583 e.preventDefault();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
584 // animate
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
585 $('body, html').stop(true, true).animate({
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
586 scrollTop: $(hash).offset().top
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
587 }, 100, "linear", function () {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
588 // when done, add hash to url
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
589 // (default click behaviour)
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
590 window.location.hash = hash;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
591 });
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
592 });
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
593 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
594 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
595 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
596
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
597 smoothHashScroll();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
598 var toc = $('.ui-toc');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
599 var tocAffix = $('.ui-affix-toc');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
600 var tocDropdown = $('.ui-toc-dropdown');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
601 //toc
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
602 tocDropdown.click(function (e) {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
603 e.stopPropagation();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
604 });
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
605
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
606 var enoughForAffixToc = true;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
607
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
608 function generateScrollspy() {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
609 $(document.body).scrollspy({
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
610 target: ''
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
611 });
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
612 $(document.body).scrollspy('refresh');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
613 if (enoughForAffixToc) {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
614 toc.hide();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
615 tocAffix.show();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
616 } else {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
617 tocAffix.hide();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
618 toc.show();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
619 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
620 $(document.body).scroll();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
621 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
622
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
623 function windowResize() {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
624 //toc right
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
625 var paddingRight = parseFloat(markdown.css('padding-right'));
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
626 var right = ($(window).width() - (markdown.offset().left + markdown.outerWidth() - paddingRight));
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
627 toc.css('right', right + 'px');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
628 //affix toc left
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
629 var newbool;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
630 var rightMargin = (markdown.parent().outerWidth() - markdown.outerWidth()) / 2;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
631 //for ipad or wider device
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
632 if (rightMargin >= 133) {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
633 newbool = true;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
634 var affixLeftMargin = (tocAffix.outerWidth() - tocAffix.width()) / 2;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
635 var left = markdown.offset().left + markdown.outerWidth() - affixLeftMargin;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
636 tocAffix.css('left', left + 'px');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
637 } else {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
638 newbool = false;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
639 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
640 if (newbool != enoughForAffixToc) {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
641 enoughForAffixToc = newbool;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
642 generateScrollspy();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
643 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
644 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
645 $(window).resize(function () {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
646 windowResize();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
647 });
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
648 $(document).ready(function () {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
649 windowResize();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
650 generateScrollspy();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
651 });
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
652
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
653 //remove hash
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
654 function removeHash() {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
655 window.location.hash = '';
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
656 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
657
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
658 var backtotop = $('.back-to-top');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
659 var gotobottom = $('.go-to-bottom');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
660
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
661 backtotop.click(function (e) {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
662 e.preventDefault();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
663 e.stopPropagation();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
664 if (scrollToTop)
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
665 scrollToTop();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
666 removeHash();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
667 });
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
668 gotobottom.click(function (e) {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
669 e.preventDefault();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
670 e.stopPropagation();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
671 if (scrollToBottom)
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
672 scrollToBottom();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
673 removeHash();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
674 });
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
675
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
676 var toggle = $('.expand-toggle');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
677 var tocExpand = false;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
678
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
679 checkExpandToggle();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
680 toggle.click(function (e) {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
681 e.preventDefault();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
682 e.stopPropagation();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
683 tocExpand = !tocExpand;
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
684 checkExpandToggle();
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
685 })
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
686
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
687 function checkExpandToggle () {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
688 var toc = $('.ui-toc-dropdown .toc');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
689 var toggle = $('.expand-toggle');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
690 if (!tocExpand) {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
691 toc.removeClass('expand');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
692 toggle.text('Expand all');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
693 } else {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
694 toc.addClass('expand');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
695 toggle.text('Collapse all');
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
696 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
697 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
698
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
699 function scrollToTop() {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
700 $('body, html').stop(true, true).animate({
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
701 scrollTop: 0
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
702 }, 100, "linear");
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
703 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
704
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
705 function scrollToBottom() {
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
706 $('body, html').stop(true, true).animate({
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
707 scrollTop: $(document.body)[0].scrollHeight
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
708 }, 100, "linear");
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
709 }
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
710 </script>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
711 </body>
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
712
6afd90dba6db slide chapter1
tobaru
parents:
diff changeset
713 </html>