åå¼·
ã¯ããã« ä¸æã«å§ã¾ã£ãç¥ã ã®æ¯ã(UNIX v6ã¯ã¤ãºåæ¦)ã楽ããã£ãã®ã§togetterã§è¨é²ãã¦ããã¾ããã¿ãªãããUNIX v6ã¯ã¤ãºåæ¦ã«åå ãã¦ç¥èãæ·±ãåãã¾ãããï¼ togetter http://togetter.com/li/342105
ã¯ããã« ä»åã¯superblockã«é¢ããå¦çããalloc( ), ialloc( )ãªã©ãããã¯ããã¤ã¹ã®ãªã½ã¼ã¹ç®¡çãè¦ã¦ããã¾ãã iinit( ) èµ·åæã®main( )ããiinit( )ãå¼ã°ããroot deviceã®åæåãè¡ããã¾ããroot deviceã®ã0ããæ°ãã1çªç®ã®block(=superblocâ¦
ã¯ããã« ä»åã¯ãã¡ã¤ã«ã®ã¯ãã¼ãºå¦çãè¦ã¦è¡ãã¾ãã close( ) ä¸è¨ã®ããã«Cã®ããã°ã©ã ãããªã¼ãã³æ¸ã¿ã®ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãå¼æ°ã«close( )ãå®è¡ããã¨ã close( fp ) ; libcã®close( )ããcloseã·ã¹ãã ã³ã¼ã«(sys close(=6))ãçºè¡ãããclâ¦
ã¯ããã« Lionsæ¬èªæ¸ä¼#16ã«åå ãã¦ãã¾ãããã¡ã¢ãæ®ãã¦ããã¾ããä»åã¯21ç« ã®ãã¤ãã®æ¯ãè¿ããè¡ãã¾ããã togetter é¢é£ãã¤ã¼ããtogetterã§ã¾ã¨ãã¾ããã http://togetter.com/li/291759 çµãã㫠次åã®Lionsæ¬èªæ¸ä¼ã¯5æ27æ¥(æ¥)ã«éå¬ããâ¦
ã¯ããã« ä»åã¯ãã¡ã¤ã«ã®èªã¿æ¸ãå¦çãè¦ã¦ããã¾ããã¯ãã¼ãºå¦çã¯æ¬¡åã«åãã¾ãã read( ), write( ) read( ) http://www.tamacom.com/tour/kernel/unix/S/99.html#L12 write( ) http://www.tamacom.com/tour/kernel/unix/S/99.html#L20 ã¦ã¼ã¶ããã°â¦
ã¯ããã« ä»åãUNIX 7thã®ã³ã¼ããèªã¿è§£ãã¦ããã6thã¨ã®å·®åãæããã«ãã¦ããã¾ããä»åã¯ãã¡ã¤ã«ã®ãªã¼ãã³æã®å¦çãè¦ã¦ããã¾ãã creat( ), open( ) ã¦ã¼ã¶ããã°ã©ã ããsys open(æ¢åã®ãã¡ã¤ã«ã®ãªã¼ãã³), sys creat(æ°è¦ã«ãã¡ã¤ã«ãçæãâ¦
ã¯ããã« ã¨ããã¨ã¤ããªã«ãã¼ã«ã®å¤ã«ããµãã«å§ã¾ã£ãPDP11/40ã®ã¬ã¸ã¹ã¿ã«ã¾ã¤ããè°è«ãã¾ã¨ãã¦ããã¾ããtwitterä¸ã§ããã®ãããªããåããããªããæã®UNIX, PDP11ã«ã¤ãã¦èªã¿è§£ãã¦ãã£ã¦ããã®ãè¦ãããããé¢ç½ãã¨æããã¾ã¨ãã¾ãããæè¿å¤â¦
ã¯ããã« ãitrunc( )ã7thã¨6thã§ã¯ããªãå¤ãã£ã¦ããããã¨ããã³ã¡ã³ããé ãã¾ããã window.twttr = (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], t = window.twttr || {}; if (d.getElementById(id)) return t; js = d.createâ¦
ã¯ããã« ååã®ã¨ã³ããªã§ãUNIX 6thã¨7thã§process switch(context switch)ã®ä»æ§ãéããããããªãã¨ãã話ããã¾ãããä»åã¯ãããæããã«ããããã«ã7thã®save( )ã¨resume( )ã確èªãã¦ããã¾ããnewproc( )ã§çæããããã»ã¹ãswtch( )ã§é¸æããâ¦
ã¯ããã« ä»åã¯èµ·åæã«å®è¡ãããmain( )ãè¦ã¦ããã¾ãããã¾ãç´°ããã¨ããã¯è¿½ã£ã¦ãããªãã¤ããã§ããå¦çãé¢æ°ã«åãåºãã¦ããã¨ããã¨ããcã®ææ³ãå¤ãã£ã¦å¤æ´ããã¦ããã¨ããã¨ãã«ã¯è§¦ãã¾ãããè«ççã»è¨è¨çã«å¤æ´ã®ããç®æã ã注ç®ãã¦â¦
ã¯ããã« Unix 6th Edition readingãä¸æ¯ã¤ããã®ã§ã7th Editionã®readingã«ç§»ãã¾ãã6thã®ã¨ãã¨åãããã«ãããã§ã¡ã¢ãæ¸ãã¦ãããã¨æã£ã¦ãã¾ããä»åã¯ã6thã¨7thã®å·®åããã£ã¨æããã«ãã¦ãã©ãããæ¹éã§ã¡ã¢ãæ¸ãã¦ãããã決ãã¾ãã ã½ã¼â¦
ãã®ã¨ã³ããªã¯http://d.hatena.ne.jp/takahirox/20120131/1328006885ãå訳ãããã®ã§ãã ã¯ããã« æè¿UNIX 6thã®ã½ã¼ã¹ã³ã¼ãã®èªæ¸ã¡ã¢ãæ¸ãçµãã¾ãããã¿ããªãã«ãUNIX 6thã®ã½ã¼ã¹ã³ã¼ããèªããã¨ããªã¹ã¹ã¡ãã¾ãããã®çç±ããã®ã¨ã³ããªã§æ¸ãâ¦
ã¯ããã« Lionsæ¬èªæ¸ä¼#13ã«åå ãã¦ãã¾ãããã¡ã¢ãæ®ãã¦ããã¾ããä»åã¯19ç« ãèªã¿ã¾ããã togetter é¢é£ãã¤ã¼ããtogetterã§ã¾ã¨ãã¾ããã http://togetter.com/li/249512 çµãã㫠次åã®Lionsæ¬èªæ¸ä¼ã¯2æ26æ¥(æ¥)ã«éå¬ãããäºå®ã§ãããOSã®â¦
UNIX v6ã®a.outã«ã¤ãã¦ã¾ã¨ããå 容ãä¸æã®çµµã«ãã¦ã¿ã¾ãããã¦ã¼ã¶ããã¥ã¢ã«5ã®a.outã®é ç®ãçµµã«ããæãã§ããããã¤ãã¯ã¾ã ç解ã§ãã¦ããªãã¦ç©ºç½ã«ãªã£ã¦ãã¾ãããäºæ¿ãã ãã®æ å ±ã¯UNIX v6 ã¤ã³ã¿ããªã¿ã®ä½æã«å¿ è¦ãªãã®ãªã®ã§ããã調ã¹ã¦â¦
ã¯ããã« ååã¯å¯¾è©±å端æ«ã®å¤æ ã確èªãã¾ãããä»åã¯ç«¯æ«ã®èªã¿æ¸ãå¦çãè¦ã¦ããã¾ããã¤ã³ã¿ã¼ãã§ã¤ã¹ã«KLã使ç¨ãã¦ããã¨ããåæã§èªã¿è§£ãã¦ããã¾ããLionsæ¬ã§è¨ãã¨25ç« ã«ãããã¾ããç·´ç¿åé¡ãé¤ããæå¾ã®ç« ã§ãããã®UNIX v6 code readinâ¦
ã¯ããã« ä»åã¯å¯¾è©±å端æ«ã®å¦çæ¹æ³ãè¦ã¦ããã¾ããLionsæ¬ã§è¨ãã¨24ç« ã«ãããã¾ãã 対話å端æ«ã¨ã¯ 対話å端æ«ã¨ã¯ä½ãªã®ããã¾ãã¯èª¿ã¹ã¦ã¿ã¾ããããã¬ã¿ã¤ã端æ«ã¨ããã®ãããã«ãããããã§ããhttp://ja.wikipedia.org/wiki/%E3%83%86%E3%83%ACâ¦
ã¯ããã« ååã®ã¨ã³ããªã§ãã£ã©ã¯ã¿ããã¤ã¹ãã³ãã©ã®å®è£ ã確èªãã¾ãããä»åã¯ãã®ä¸ã§ä½¿ç¨ããã¦ããbuffer pool, putc( ), getc( )ã®è©³ç´°ã確èªãã¦ããã¾ããLionsæ¬ã§è¨ãã¨23ç« ã®å 容ã§ãã buffer pool buffer poolã®å®æ ã¯ã7908è¡ç®ã8140è¡ç®â¦
ã¯ããã« ä»åããLionsæ¬ã®æçµã»ã¯ã·ã§ã³ãè¦ã¦ããã¾ããä»åã¯22ç« ãæ±ãã¾ããæåã«ãã£ã©ã¯ã¿ããã¤ã¹ã¨ã¯ä½ãã解説ãããã®å¾ã©ã¤ã³ããªã³ã¿ã®ããã¤ã¹ãã©ã¤ããè¦ã¦ããã¾ãã ãã£ã©ã¯ã¿ããã¤ã¹ã¨ã¯ UNIXã§ã¯ããã¤ã¹ãäºã¤ã®ç¨®é¡ã«åãã¦æ±ã£â¦
ã¯ããã« ä»åã¯ãã¤ããè¦ã¦ããã¾ããã½ã¼ã¹ã³ã¼ãã®unix/pipe.cãä¸å¿ã«è¿½ã£ã¦ããã¾ãã ãã¤ãã®ä»çµã¿ ãã¤ãã¨ã¯ããã»ã¹éã®éä¿¡ãå®ç¾ããä»çµã¿ã®ãã¨ã§ããåããã»ã¹æ¯ã«åºæã®ã¢ãã¬ã¹ç©ºéãæã£ã¦ãããããé常ã¯ä»ããã»ã¹ãæã£ã¦ãããã¼â¦
ã¯ããã« ä»åã¯unix/sys3.cãè¦ã¦ããã¾ãã fstat( ), stat( ) fstat( )(6014è¡ç®)ã¯fstatã·ã¹ãã ã³ã¼ã«ã®ãã³ãã©ã§ããstat( )(6028è¡ç®)ã¯statã·ã¹ãã ã³ã¼ã«ã®ãã³ãã©ã§ããfstatãstatããã¡ã¤ã«ã®inodeæ å ±ãåå¾ããã·ã¹ãã ã³ã¼ã«ã§ããç°ãªãã®â¦
ã¯ããã« ä»åã¯unix/sys2.cãè¦ã¦ããã¾ãããã¡ã¤ã«ã·ã¹ãã é¢é£ã®ã·ã¹ãã ã³ã¼ã«ãããã£ã¦ãã¾ããåã·ã¹ãã ã³ã¼ã«ã®èª¬æã¯ã¦ã¼ã¶ããã¥ã¢ã«ã«ãè¼ã£ã¦ããã®ã§ãåããã¦ç®ãéããã¨ããå§ããã¾ãã read( ), write( ) read( )(5711è¡ç®)ã¯readã·ã¹â¦
ã¯ããã« ä»åã¯unix/rdwri.cãè¦ã¦ããã¾ãããã¡ã¤ã«ã®èªã¿æ¸ãå¦çãä¸å¿ã§ãã readi( ) readi( )(6221è¡ç®)ã¯ãinodeã«å¯¾å¿ãããã¼ã¿ã®å 容ããã£ã¹ã¯ããèªã¿åºãã¾ããreadi( )ãå¼ã³åºãåã«ãu.u_base, u.u_offset, u.u_count, u.u_segflgãè¨å®ãâ¦
ã¯ããã« ä»åã¯unix/fio.cãè¦ã¦ããã¾ããu.u_ofile[ ]ãfile[ ]ã®å²ãå½ã¦ãã権éãã§ãã¯ãªã©ã®é¢æ°ãæã£ã¦ãã¾ãã getf( ) getf( )(6619è¡ç®)ã¯ããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ããã該å½ã®fileæ§é ä½ãåå¾ãã¦ãããreturnãã¾ãããã¡ã¤ã«ãã£ã¹ã¯ãªãâ¦
ã¯ããã« ä»åã¯unix/subr.cãè¦ã¦ããã¾ããä»®æ³çãªblock Noããç©çããã¤ã¹ã®block Noã«å¤æããbmap( )ãä¸å¿ã«ãsubr(ãµãã«ã¼ãã³)ã®ååã®éããä»ã®é¢æ°ããããå¼ã°ããé¢æ°ãæã£ã¦ãã¾ãã bmap( ) ãã¡ã¤ã«ä¸ã®ã¢ã¯ã»ã¹ããããã¼ã¿ã®ãªãã»ãâ¦
ã¯ããã« ä»åã¯unix/namei.cãè¦ã¦ããã¾ããã·ã¹ãã ã®ä¸ã§ããã¡ã¤ã«ãã©ã®ããã«æ±ããã¦ããããè¦ãã¦ããã¨æãã¾ãã namei( ) 以åã®ã¨ã³ããªã§æ¸ããããã«ããã¡ã¤ã«ã¯ãã£ã¬ã¯ããªã«ãã£ã¦æ¨æ§é ã¨ãã¦ç®¡çããã¦ãã¾ãããã¹ã使ããã¨ã§ãåãâ¦
ã¯ããã« ä»åã¯unix/iget.cãè¦ã¦ããã¾ããiget.cã¯ã³ã¢ä¸ã®inode[ ]ãªã½ã¼ã¹ç®¡çã主ã§ããä»ã«ãæ°ããªinodeã®çæ(ãã¡ã¤ã«ã®çæ)ãããã£ã¬ã¯ããªã¸ã®ã¨ã³ããªè¿½å ã«é¢ããå¦çãªã©ãããã¾ãã ã³ã¢ä¸ã®inode[ ] unix/inode.hã®ä¸ã§inodeæ§é ä½ã®é â¦
ã¯ããã« Lionsæ¬èªæ¸ä¼#12ã«åå ãã¦ãã¾ãããã¡ã¢ãæ®ãã¦ããã¾ããä»åã¯18ç« ãèªã¿ã¾ããã togetter é¢é£ãã¤ã¼ããtogetterã§ã¾ã¨ãã¾ããã http://togetter.com/li/222603 ç§ã®ãã¤ã¼ãã¯è¡¨è¨ã®ããã大ããã®ã§ãåèã«ãããå ´åã¯æ³¨æãã¦å¼ãâ¦
ã¯ããã« unix/alloc.cãè¦ã¦ããã¾ããalloc.cã§ã¯ãããã¯ããã¤ã¹ä¸ã®inodeé åããã¼ã¿é åã®å²ãå½ã¦ã»è§£æ¾ãè¡ã£ã¦ãã¾ãã ãããã¯ããã¤ã¹ã®inodeé åã®å²ãå½ã¦ï¼è§£æ¾ åãããã¯ããã¤ã¹ã«å¯¾å¿ããsuperblock(filsysæ§é ä½(5561è¡ç®))ãã³ã¢ä¸ã«â¦
ã¯ããã« ååããããã¯ããã¤ã¹ããã³ã¢ã¡ã¢ãªã¸ã®inodeå²ãå½ã¦ã解説ãããã¨è¨ã£ãã®ã§ããããã®åã«ãã¦ã³ãã«ã¤ãã¦ã¾ã¨ãã¾ãã ãã¦ã³ãã¨ã¯ï¼ ãã¦ã³ãã¨ã¯ããã¤ã¹ãOSã«èªèãããOSãã使ããããã«ããä»çµã¿ã§ãã mountæ§é ä½ mountæ§é ä½â¦
ã¯ããã« å æ¥ã®10/15-16ã«Lionsæ¬èªæ¸ä¼2011ç§å宿ã«åå ãã¦ãã¾ããããã®ã¨ãã®ææçºè¡¨è³æãå ¬éãã¦ããã¾ããã¾ããå宿é¢é£ã®tweetãtogetterã§ã¾ã¨ãã¾ããã è³æ ææçºè¡¨ã«ä½¿ç¨ããè³æã¯ãã¡ãã§ããUNIX v6 emulator on HTML5 and JavaScriptâ¦