Proceedings of 3rd International Workshop on Plan 9 October 30-31, 2008

Computer and Communication Engineering Department University of Thessaly Volos, Greece

Organization

Organizing Committee

Spyros Lalis, University of Thessaly Manos Koutsoumpelias, University of Thessaly Francisco Ballesteros, Universidad Rey Juan Carlos de Madrid Sape Mullender, , Alcatel-

Program Committee

Richard Miller (chair), Miller Research Ltd. Peter Bosch, Bell Labs, Alcatel-Lucent Geoff Collyer, Bell Labs, Alcatel-Lucent Latchesar Ionkov, Los Alamos National Laboratory Paul Lalonde, Intel Corp. Eric Nichols, Nara Institute of Science and Technology Brantley Coile, Coraid Inc. Charles Forsyth, Vita Nuova Ltd.

Table of Contents

Glendix: A Plan9/ Distribution Anant Narayanan, Shantanu Choudhary, Vinay Pamarthi and Manoj Gaur...... 1

Upperware: Pushing the Applications Back Into the System Gorka Guardiola, Francisco J. Ballesteros and Enrique Soriano...... 9

Scaling Upas Erik Quanstrom...... 19

Vidi: A To Go Latchesar Ionkov...... 25

Inferno DS : Inferno port to the Nintendo DS Salva Peiro...... 31

9P For Embedded Devices and Tiger Ellis...... 39

Mrph: A Morphological Analyzer Noah Evans...... 43

Semaphores in Plan 9 Sape Mullender and Russ Cox...... 53 v9fb: A Remote Framebuffer Infrastructure for Linux Abhishek Kulkarni and Latchesar Ionkov...... 63

Glendix: A Plan9/Linux Distribution

Anant Narayanan Shantanu Choudhary Vinay K. Pamarthi Manoj S. Gaur !=#=LEO=(=JE*+=#1+IJEJKJA*6A?D+*#*CO56=EFKH51+@E=

)*564)+6

9A @AI?HE>A *KH =FFH*=?D *B >HE+CE+ JDA 2#=+ ' KIAHIF=?A J* JDA CE+KN EAH+A# E+ *H@AH J* IFHA=@ JDA KIA *B 2#=+ ' J**#I =F*+CIJ JDA CE+KN@ALA#G *FAH?*FFK+EJOH

1. Introduction /(7KCE+KN EI = F*FK#=H BHAA *FAH=JE+C IOIJAF E+ KIA J*@=OH /(7KCE+KN IJHELAI J* >A IJHE?J#O ?*FF#E=+J MEJD 2M51: IJ=+@=H@I5 =+@ EI JDKI JEA@ @*M+ MEJD IALAH=# HAGKEHAG FA+JI =+@ JDAHA>O ?A=IAI J* >A E++*L=JELA =I B=H =I *FAH=JE+C IOIJAF @AIEC+ EI ?*+G ?AH+A@H 2#=+ ' P R5 *+ JDA *JDAH D=+@5 M=I @AIEC+A@ J* >A = BH*FSI?H=J?D IK??AII*H J* 7(1:H 6DA 2#=+ ' *FAH=JE+C IOIJAF *BBAHI IALAH=# +AM BA=JKHAI JD=J =HA LAHO ?*FFA##E+C J*=@ALA#*FAHE+J*@=OߣIAH=*B*BFAHI*+=#?*FFKJE+CH 6DA 2#=+ ' EAH+A#5 D*MALAH5 IKFF*HJI *+#O = >=HA FE+EFKF *B D=H@M=HAH 6D=J EI *+A *B JDA FHEF=HO HA=I*+I *B EJI K+F*FK#=HEJO B*H @=OSJ*S@=O KIAH 6DA CE+KN EAH+A#5 *+ JDA *JDAH D=+@5 D=I D=@ OA=HI *B @ALA#*FFA+J >ADE+@ EJ5 =+@ A+T*OI JDA IKFF*HJ *B IALAH=# D=H@M=HA?*FF*+A+JI=+@@ALA#*FAHI=#EEAH 9A FH*F*IA /#A+@EN5 = CA+AH=# FKHF*IA *FAH=JE+C IOIJAF JD=J =EFI J* ?*F>E+A JDA 2#=+ ' KIAHIF=?A MEJD JDA CE+KN EAH+A#5 J* *BBAH J*@=OߣI @ALA#*FAH =+ AN?EJE+C A+LEH*+G FA+JB*H=FF#E?=JE*+@ALA#*FFA+J*+FAHI*+=#?*FFKJAHI=+@AF>A@@A@IOIJAFI=#EEAH 6DA FHEF=HO F*JEL=JE+C B=?J*H DAHA EI J* FH*F*JA JDA 2#=+ ' IJO#A *B =FF#E?=JE*+ @ALA#*FG FA+J J* JDA #=HCA >=IA *B @ALA#*FAHI JD=J CE+KN =#HA=@O D=IH ) IA?*+@=HO B=?J*H EI J* A#EFE+=JA JDA +AA@ B*H GNU P R >=IA@ KIAHIF=?A I*BJM=HA5 >O HAF#=?E+C JDAF MEJD JDAEH #ECDJMAECDJ 2#=+ ' ?*K+JAHF=HJI5 MDE?D =HA TKIJ =I BK+?JE*+=# =+@ F*HJ=>#AH 6DA HAIK#JE+C @EIJHE>KJE*+M*K#@>A=#ECDJMAECDJCE+KN>=IA@*FAH=JE+CIOIJAFH 1+ JDEI F=FAH5 MA @AI?HE>A JDA =FFH*=?D J=EA+ >O KI J* ?HA=JA /#A+@ENH 9A >ACE+ MEJD = HALEAM *B JDA @EBBAHA+J =FFH*=?DAI F*IIE>#A5 =+@ JDA+ @AI?HE>A JDA ?D*IA+ FAJD*@*#*CO5 =#*+C MEJD IEC+EBE?=+J ?D=##A+CAI =+@ D*M MA *LAH?=FA JDAFH 9A ?*+G ?#K@AMEJD=IKFF=HO*BMD=JD=I>AA+@*+AI*B=H=+@=BAM+*JAI*+BKJKHAM*HEH

2. Review .H*F = >H*=@ FAHIFA?JELA5 JDAHA =HA JM* EE+@I *B ?*FF=JE>E#EJO MA ?=+ ?HA=JA >AJMAA+ FH*CH=FI *+ 2#=+ ' =+@ CE+KNH 1+ JDEI IA?JE*+5 MA @EI?KII I*KH?A =+@ >E+=HO ?*FF=JE>E#G EJO5=+@MD=JJDAOFA=+E+JDA?*+JANJ*B/#A+@ENH

______{[email protected],[email protected],[email protected],[email protected]}

1 2.1. Source compatibility 2#=+'BH*F7IAH5F=?A=#I*E+*M+=I plan9port) P!REI=+ANEIJE+CI*BJM=HAF=?EG =CA B*H 2M51: ?*FF#E=+J *FAH=JE+C IOIJAFI JD=J ?*+IEIJI *B F*HJI *B IALAH=# 2#=+ ' =FF#EG ?=JE*+IH 9DE#A F*IJ *B 2#=+ 'ߣI #E>H=HEAI D=LA =#I* >AA+ F*HJA@5 JDA I*#KJE*+ EI +*J ?*FG F#AJA#O FAHBA?JH .*H AN=FF#A5 J=EE+C JDA I*KH?A B*H = 2#=+ ' FH*CH=F =+@ HA?*FFE#E+C EJ KIE+C plan9port F=O+*JHAIK#JE+?*HHA?J#OM*HEE+C>E+=HEAI=##JDAJEFAH M+A *B JDA =FFH*=?DAI MA HALEAMA@ A=H#O *+ @KHE+C JDA FH*TA?J M=I LAHO IEFE#=H J* plan9port. 6DA F*IJ IEC+EBE?=+J =@L=+J=CA B*H JDEI =FFH*=?D EI JD=J 2#=+ ' =FF#E?=JE*+I ?=+>AHK+*+=L=HEAJO*B7(1:?#*+AI+*JTKIJCE+KN=BJAH=HA?*FFE#AH 0*MALAH5 JDEI M*K#@ HAGKEHA KI J* MHEJA 2M51: AGKEL=#A+JI *B =## JDA 2#=+ ' #E>H=HEAI5 MDE?D IAAFA@ #EEA = IJAF >=?EM=H@H 6DA =@@EJE*+=# ?*+IJH=E+J *B D=LE+C J* HA?*FFE#A JDA FH*CH=F B*H A=?D J=HCAJ A+LEH*+FA+J M=I +*J LAHO =FFA=#E+C MD=J EB JDA I*KH?AI MAHA +*J=L=E#=>#A\5=+@JDKIMA?D*IAJ*HATA?JJDEI=FFH*=?DH

2.2. Binary compatibility ) F*HA =FFA=#E+C I*#KJE*+ M=I J* =?DEALA >E+=HOS#ALA# ?*FF=JE>E#EJO *B =## 2#=+ ' =FF#E?=JE*+IH 6DA F=+JH= DAHA M=I compile−once−execute−everywhere. 9A M=+JA@ J* A+IKHA JD=J EJ M*K#@+ߣJ F=JJAH MDAHA JDA FH*CH=F M=I ?*FFE#A@5 EJ ID*K#@ HK+ =I ANFA?JA@*+>*JD2#=+'=+@CE+KNH 9DE#AJDEI =FFH*=?D IAAFI E@A=#5 JDA CE+KN EAH+A# FH*LE@AI JDA ?=F=>E#EJO J* IKFF*HJ +AM >E+=HO B*HF=JI5 IK?D =I 2#=+ 'ߣI a.out. 1+ *H@AH B*H JDEI =FFH*=?D J* M*HE5 MA D=LA J* F=EA CE+KN >AD=LA AN=?J#O =I = 2#=+ ' EAH+A# M*K#@5 =I B=H =I =FF#E?=JE*+I =HA ?*+G ?AH+A@H 6DAHA =HA JM* FHEF=HO ?D=++A#I B*H =+ =FF#E?=JE*+ J* =??AII BK+?JE*+=#EJO FH*G LE@A@ >O JDA 2#=+ ' EAH+A#] IOIJAF ?=##I =+@ BE#A IAHLAHIH 1B MA MAHA J* FH*LE@A IKEJ=>#A EFF#AFA+J=JE*+I *B >*JD E+ JDA CE+KN EAH+A#5 KIAHIF=?A =FF#E?=JE*+I ID*K#@ >A *>#ELE*KI J* JDA B=?J JD=J JDA K+@AH#OE+C EAH+A# EI CE+KN =+@ +*J 2#=+ '5 MDE?D EI AN=?J#O MD=J MA M=+JH 9A @A?E@A@ J* =@*FJ JDEI =FFH*=?D >A?=KIA EJ M=I E+JAHAIJE+C =+@ IAAFA@ J* =?DEALA*KHIJ=JA@C*=#IE+=?#A=+F=++AHH

3. Methodology 1+ JDEI IA?JE*+ MA @EI?KII JDA EFF#AFA+J=JE*+ @AJ=E#I *B =+ a.out >E+=HO #*=@AH B*H CE+KN=+@2#=+'IJO#AIOIJAF?=##D=+@#E+CH

3.1. Loader 9A ME## +*J @AI?HE>A JDA IJHK?JKHA *B = 2#=+ ' ANA?KJ=>#A5 MDE?D EI =#HA=@O @*?KG FA+JA@ P"R E+ a.out#H CE+KN =#HA=@O IKFF*HJI = L=HEAJO *B ANA?KJ=>#AI S H=+CE+C BH*F -C.JDA+=JELACE+KNANA?KJ=>#AB*HF=JJ*+M..H 0A+?A5JDAB*K+@=JE*+B*H=@@E+CIKFG F*HJ B*H = +AM ANA?KJ=>#A B*HF=J D=@ =#HA=@O >AA+ #=E@5 MA IEFF#O D=@ J* KIA JDA J**#I JD=JJDAEAH+A#*BBAHA@KIH M+A *B JDA H*#AI JD=J EAH+A# F*@K#AI ?=+ =??*FF#EID EI =@@E+C +AM >E+=HO B*HF=JI J* = HK++E+C IOIJAF5 I* MA ?D*IA J* MHEJA = EAH+A# F*@K#A B*H JDA 2#=+ ' ANA?KJ=>#A B*HF=JH 6DA IE+C#A >ECCAIJ =@L=+J=CA *B MHEJE+C = EAH+A# F*@K#A B*H JDEI FKHF*IA EI JD=J MA @E@+ߣJ D=LA J* HA?*FFE#A JDA EAH+A# =+@ HA>**J ALAHO JEFA MA F=@A = ?D=+CA J* JDA #*=@AHSJD=+EIJ*CE+KNߣI@O+=FE?F*@K#A#*=@E+CKK+#*=@E+CB=?E#EJEAIH CAJߣI J=EA = #**E =J D*M JDA exec IOIJAF ?=## EI EFF#AFA+JA@ E+ CE+KN5 >A?=KIA JD=J EI ?A+JH=# J* *KH *>TA?JELAH 6DA A+JHO F*E+J *B exec #ELAI E+ JDA =H?DEJA?JKHAS@AFA+@A+J JHAA*BJDAI*KH?ABE#AI5>KJ=##JDAE+JAHAIJE+C?*@AEIF=HJ*B fs/exec.c. 6DAJ*F#ALA# BK+?JE*+5 do_execve(), FAHB*HFI I*FA >=IE? AHH*H ?DA?EE+C5 BE##I JDA >E+=HO F=H=FG AJAH IJHK?JKHA linux_binprm =+@ #**EI B*H = IKEJ=>#A >E+=HO D=+@#AHH 6DA #=IJ IJAF EI FAHB*HFA@ >O = IAFAH=JA BK+?JE*+ search_binary_handler(), 6DA BK+?JE*+ BE+@I

2 JDA =FFH*FHE=JA >E+=HO D=+@#AH >O I?=++E+C = #EIJ *B HACEIJAHA@ >E+=HO B*HF=JI5 =+@ F=IIG E+C JDA binprm IJHK?JKHA J* =## *B JDAF K+JE# *+A IK??AA@IH 1B +* D=+@#AH EI =>#A J* @A=#MEJDJDAANA?KJ=>#ABE#A5JDAIOIJAF?=##HAJKH+IJDA ENOEXEC AHH*H?*@AH CE+KN EI =#I* ?*FF=JE>#A MEJD JDA IJ=+@=H@ 7+EN >AD=LE*H *B IKFF*HJE+C ANA?JK=>#A JANJ BE#AI JD=J >ACE+ MEJD #!. 5K?D BE#AI =HA ANA?KJA@ MEJD JDA DA#F *B =+ E+JAFHAJAH MDE?D EI IFA?EBEA@ EFFA@E=JA#O =BJAH JDA #! IOF>*#H .*H JDEI FKHF*IA5 = >E+=HO B*HF=J IFA?E=#EaA@ E+ HK++E+C E+JAHFHAJAH BE#AI (fs/binfmt_script.c) 5 EI E+?#K@A@H 6DA BK+?JE*+ EI @AIEC+A@ J* >A HAA+JH=+J5 =+@ binfmt_script ?DA?EI =C=E+IJ @*K>#A E+L*?=JE*+H 6DA =>E#EJO J* E+L*EA =+ E+JAFHAJAH E+ = >E+=HO B*HF=J D=+@#AH DA#FI KI CHA=J#O5 =I MA ID=## IAA#=JAHH

3.2. Binary format handling )I FA+JE*+A@ >AB*HA5 CE+KN *BBAHI JDA =>E#EJO J* HACEIJAH +AM >E+=HO B*HF=JI =J HK+G JEFAH 6DA EFF#AFA+J=JE*+ EI GKEJA IJH=ECDJB*HM=H@5 =#JD*KCD EJ E+L*#LAI M*HEE+C MEJD H=JDAH A#=>*H=JA @=J= IJHK?JKHAI S AEJDAH JDA ?*@A *H JDA @=J= IJHK?JKHAI FKIJ =??*FF*G @=JA JDA K+@AH#OE+C ?*FF#ANEJEAIb A#=>*H=JA @=J= IJHK?JKHAI *BBAH F*HA B#ANE>E#EJO JD=+ A#=>*H=JA?*@AH 6DA ?*HA *B = >E+=HO B*HF=J EI HAFHAIA+JA@ E+ JDA EAH+A# >O = IJHK?JKHA ?=##A@ linux_binfmt, MDE?DEI@A?#=HA@E+JDA linux/binfmts.h BE#A] struct linux_binfmt { struct linux_binfmt *next; long *use_count; int (*load_binary)(struct linux_binprm *, struct pt_regs *); int (*load_shlib)(int fd); int (*core_dump)(long signr, struct pt_regs *); };

6DA JDHAA FAJD*@I @A?#=HA@ >O JDA >E+=HO B*HF=J =HA KIA@ J* ANA?KJA = FH*CH=F BE#A5 J* #*=@ = ID=HA@ #E>H=HO =+@ CA+AH=JA = ?*HA @KFF5 HAIFA?JELA#OH 6DA next F*E+JAH EI KIA@ >O search_binary_handler(), MDE#A JDA use_count F*E+JAH EAAFI JH=?E *B JDA KI=CA ?*K+J *B F*@K#AIH 9DA+ALAH = FH*?AII p EI ANA?KJE+C E+ JDA HA=#F *B = F*@K#=HEaA@ >E+=HO B*HF=J5 JDA EAH+A# EAAFI JH=?E *B use_count J* FHALA+J K+ANG FA?JA@HAF*L=#*BJDAF*@K#AH MB JDA JDHAA FAJD*@I5 MA *+#O +AA@ J* EFF#AFA+J load_binary. load_shlib EI +*J HAGKEHA@ =I =## 2#=+ ' >E+=HEAI =I IJ=JE?=##O #E+EA@5 =+@ core_dump EI F=E+#O KIA@ J*CA+AH=JA?*HA@KFFIHA=@=>#A>OJDA/(7@A>KCCAHMDE?DMA@*+*JM=+JJ*KIAH 6DA >E+=HO B*HF=J D=+@#AH HA?AELAI JM* EFF*HJ=+J F=H=FAJAHI >O JDA EAH+A#H 6DA BEHIJ ?*+J=E+I = @AI?HEFJE*+ *B JDA >E+=HO BE#A =+@ JDAIA?*+@EI=F*E+JAHJ*JDAFH*?AII*H HACEIJAHIH 6DA BEHIJ =HCKFA+J5 = linux_binprm IJHK?JKHA5 ?*+J=E+I5 E+ =@@EJE*+ J* *JDAH BEA#@I5 JDA BEHIJ & >OJAI *B JDA >E+=HO BE#A MDE?D A+=>#A KI J* GKE?E#O ?DA?E JDA magic +KF>AH5 =+@ @A?E@A EB MA M=+J J* ANA?KJA JDEI >E+=HO *H +*JH 9A =#I* CAJ =@@HAIIAI *B JDA @=J= F=CAI KIA@ J* ?=HHO =H*K+@ JDA A+LEH*+FA+J =+@ =HCKFA+J #EIJ B*H JDA+AMFH*CH=FH

3.3. Memory layout and padding M+?A MAߣLA ?*+BEHFA@ JD=J JDA CELA+ ANA?KJ=>#A EI E+@AA@ =+ a.out BE#A5 MA >ACE+ J* #*=@ EJI ?*+JA+JI E+J* FAF*HOH 6DA #=O*KJ E+ FAF*HO EI @AI?HE>A@ E+ @AJ=E# E+ a.out# >KJ J=EA +*JA *B JDA B=?J JD=J JDA E+SFAF*HO HAFHAIA+J=JE*+ *B = >E+=HO @*AI not F=J?D MEJD JD=J *B JDA ?*+JA+JI *B JDA BE#AH 6DAHA EI = C=F >AJMAA+ JDA TEXT =+@ DATA IA?G JE*+I E+ FAF*HO5 >A?=KIA *B F=CAS=#EC+FA+JH 1+ JDA ANA?KJ=>#A BE#A5 D*MALAH5 =## IA?G JE*+I =HA *+A =BJAH JDA *JDAH5 I* MDE#A ?*FOE+C JDA ?*+JA+JI E+J* FAF*HO MA +AA@ J* ?HAG =JAJDEIANJH=F=@@E+CH 6DEI M=I *KH BEHIJ F=T*H ?D=##A+CAH 9A +*JE?A@ JD=J =## *B JDA >E+=HO B*HF=JI CE+KN

3 IKFF*HJI5 =?JK=##O @* ?*+J=E+ JDA F=@@E+C E+ JDA BE#A EJIA#B5 =+@ JDAHAB*HA5 =## JDAEH D=+G @#AHI KIA JDA E+B=F*KI mmap() ?=## J* @EHA?J#O F=F JDA BE#A J* FAF*HOH 9A ?=++*J KIA JD=J =FFH*=?D >A?=KIA mmap() @*AI +*J M*HE *+ +*+ F=CAS=#EC+A@ *BBIAJI5 =+@ JDA DATA IA?JE*+EI>*K+@J*>A=JIK?D=+=@@HAIIE+JDABE#AH )I = M*HE=H*K+@5 MA KIA CE+KNߣI E+JAHFHAJAH ?=F=>E#EJEAI @EI?KIIA@ A=H#EAH J* E+L*EA = KIAHIF=?A FH*CH=F MDA+ALAH =+ =KJDA+JE? =H*KJ ANA?KJ=>#A EI B*K+@H 6DEI KIAHG IF=?A FH*CH=F ?HA=JAI JDEI ANJH= F=@@E+C E+ JDA BE#A EJIA#B5 MDE?D F=O JDA+ >A FAF*HOS F=FFA@H 6DEI F=@@E+C FH*CH=F =#I* JKH+A@ *KJ J* >A ANJHAFA#O KIABK# E+ #=JAH IJ=CAI *B JDAFH*TA?J5=IME##>A@EI?KIIA@E+JDA+ANJIA?JE*+H

3.4. Top of Stack 6DA IJ=JAFA+J JD=J IOIJAF ?=##I =HA JDA *+#O M=O B*H 2#=+ ' KIAHIF=?A =FF#E?=JE*+I J* E+JAH=?J MEJD JDA EAH+A# EI +*J A+JEHA#O JHKAH 6DA 2#=+ ' EAH+A# E+EJE=#EaAI =+@ F=E+J=E+I = IFA?E=# IJHK?JKHA ?=##A@ Tos, MDE?D EI =#I* KIA@ J* AN?D=+CA @=J= >AJMAA+ JDA EAH+A# =+@KIAHIF=?A] struct Tos { struct /* Per profiling */ { Plink *pp; /* known to be 0(ptr) */ Plink *next; /* known to be 4(ptr) */ Plink *last; Plink *first; ulong pid; ulong what; } prof; uvlong cyclefreq; vlong kcycles; vlong pcycles; ulong pid; ulong clock; /* top of stack is here */ };

)I O*K ?=+ IAA5 JDAHA =HA IALAH=# BEA#@I EFF*HJ=+J B*H FH*?AII FH*BE#E+C5 MDE?D +AA@ J* F=@A =L=E#=>#A MDA+ = >E+=HO E+ ANA?KJA@H 6DA 2#=+ ' EAH+A# E+EJE=#EaAI JDEI =HA= =>*LA JDA KIAHIF=?A IJ=?E =+@ IJ*HAI JDA =@@HAII E+ JDA =??KFK#=J*H5 BH*F MDE?D KIAHG IF=?A =FF#E?=JE*+I HAJHEALA =+@ IJ*HA EJ E+ = C#*>=# L=HE=>#A _tos. 6DEI EI @*+A >O =## FH*CH=FI #E+EA@ MEJD libc. CE+KN5 D*MALAH5 HAIAJI JDA =??KFK#=J*H EFFA@E=JA#O =BJAH JDA #*=@AH BE+EIDAI J* IEC+=#JDAHAJKH+L=#KA*B exec 5I*MA?=+ߣJKIAJD=JHACEIJAHJ*+*JEBO KIAHIF=?A=FF#E?=JE*+I*BJDA Tos =@@HAIIH )I = M*HE=H*K+@5 MA KIA@ JDA F=@@E+C FH*CH=F @AI?HE>A@ E+ JDA FHALE*KI IA?JE*+5 J* F=+C#A JDA E+IJHK?JE*+ JD=J BAJ?DA@ JDA =@@HAII BH*F EAX =+@ ?D=+CA@ EJ J* BAJ?D JDA =@@HAII BH*F EBX E+IJA=@ CE+KN @*AI +*J F*@EBO EBX E+ =+O M=O >AJMAA+ JDA #*=@AHߣI A+@ =+@ JDA FH*CH=FߣI >ACE++E+CH 6DA *F?*@A B*H JDA MOV E+IJHK?JE*+ EI 0x89. 6DA BEHIJE+IJHK?JE*+E+=JOFE?=#2#=+'KIAHIF=?A=FF#E?=JE*+5JDAHAB*HA5M*K#@KIK=##O>A] 89 05 xx xx xx xx MDAHA ߣNN NN NN NNߣ @A+*JAI = ! S>EJ =@@HAII ?*HHAIF*+@E+C J* JDA C#*>=# L=HE=>#A _tos E+JDA DATA IA?JE*+H 9A?D=+CAJDEIE+IJHK?JE*+J*] 89 1D xx xx xx xx E+=??*H@=+?AMEJDN&$*F?*@AJ=>#AP$RB*H MOV:

4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!H! KH ! -): ! -+: ! -,: ! -*: ! -52 ! -*2 ! -51 ! -,1 ! ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)@@HAII ! !*@ ! 4K! 8=#KA*B!*@4K!*OJAI1+0AN ! ! ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!P-):R  ! ! &! ! & ! ! & ! !! !& ! ! ! ! ! ! ! ! ! ! !P-+:R ! !  !  ' ' ' ! !' ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! ! ! ! ! ! P-,:R ! !    ! ) ! ! ) ! ! ) ! ! ! !) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! !P-*:R  ! ! ! * ! ! ! * ! ! ! * ! !! ! !* ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! ! ! ! ! ! ! ! ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!PSRPSR ! " ! + ! " ! + ! " ! + ! !" ! !+ ! ! ! ! ! ! ! ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!@EIF! ! !  ! # , # , # , !# !, ! ! ! ! ! ! ! ! ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!P-51R ! !  $ ! - ! $ ! - ! $ ! - ! !$ ! !- ! ! ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!P-,1R ! ! ! % ! . ! % ! . ! % ! . ! !% ! !. !

3.5. handler M+?A JDA #*=@AH D=@ >AA+ MHEJJA+5 JDA +ANJ F=T*H J=IE M=I J* >A =>#A J* E+JAH?AFJ IOIJAF ?=##IH 1+ CE+KN5 IOIJAF ?=##I =HA E+L*EA@ KIE+C JDA 0x80 E+JAHHKFJ5 MDE?D H=EIAI JDA FH*CH=FFA@ AN?AFJE*+ MEJD JD=J LA?J*HH 6DA ?=##E+C FH*?AII F=IIAI JDA IOIJAF ?=## +KF>AH J* E@A+JEBO JDA HAGKEHA@ IOIJAF ?=## E+ JDA EAX HACEIJAHH 6DA EAH+A# I=LAI JDA ?*+JA+JI *B F*IJ HACEIJAHI E+ JDA EAH+A# F*@A IJ=?E5 DA+?A *JDAH F=H=FAJAHI J* JDA IOIG JAF ?=## EB HAGKEHA@ =HA F#=?A@ *+ IK>IAGKA+J HACEIJAHIH 6DA D=+@#AH EI ANEJA@ MDA+ JDA IOIJAF ?=## BE+EIDAI5 =+@ JDA HACEIJAHI =HA HAIJ*HA@H 6DA HAJKH+ L=#KA *B JDA IOIJAF ?=## EI F#=?A@ E+ JDA =??KFK#=J*H5 MDAHA EJ EI FE?EA@ KF >O JDA ?=##E+C FH*?AIIH )+ AN=FG F#A*B=ߣ0A##*9*H#@ߣ FH*CH=FE+FKHA=IIAF>#OB*HCE+KNEIFH*LE@A@B*H?#=HEJO] section .data hello: db ’Hello World!’, 10 helloLen: equ $−hello section .text global _start _start: mov eax, 4 mov ebx, 1 mov ecx, hello mov edx, helloLen int 80h mov eax, 1 mov ebx, 0 int 80h

6D=+EBK##O5JDAFAJD*@*BIOIJAF?=##E+L*?=JE*+E+ 2#=+ ' EI +*J LAHO @EBBAHA+J BH*F MD=J EI @AI?HE>A@ =>*LAH 6DA *+#O JM* >EC ?D=+CAI =HA] = 2#=+ ' KIAI FH*CH=FFA@ AN?AFJE*+ LA?J*H 0x40 J* +*JEBO JDA EAH+A#5 =+@5 > 2#=+ ' =FF#E?=JE*+I IJ*HA =HCKFA+JI B*H JDA IOIJAF ?=## *+ JDA KIAHIF=?A IJ=?E5 TKIJ #EEA B*H =+O *JDAH BK+?JE*+ ?=##H )+ AN=FG F#AFH*CH=FB*H2#=+'ME##F=EAJDA@EBBAHA+?AI?#A=H]

5 DATA string<>+0(SB)/8, $−"Hello GLOBL string<>+0(SB), $8 TEXT _main+0(SB), 1, $0 MOVL $1, 4(SP) MOVL $string<>+0(SB), 8(SP) MOVL $7, 12(SP) MOVL $−1, 16(SP) MOVL $−1, 20(SP) MOVL $51, AX INT $64 MOVL $string<>+0(SB), 4(SP) MOVL $8, AX INT $64 7+B*HJK+=JA#O5 JDA CE+KN EAH+A# M=I +*J >KE#J J* IKFF*HJ JDA E+JAH?AFJE*+ *B @EBBAHA+J E+JAHHKFJ LA?J*HI E+ = EAH+A# F*@K#AH 6DA E+EJE=#Ea=JE*+ EI @*+A =J >**J JEFA5 DA+?A5 B*H JDEI F=HJ *B JDA FH*TA?J5 MA D=@ J* @EHA?J#O A@EJ JDA EAH+A# I*KH?A =I *FF*IA@ J* = F*@G K#A=I@*+AB*HJDA>E+=HOB*HF=J#*=@AHH arch//kernel/traps_32.c EI MDAHA FH*CH=FFA@ AN?AFJE*+ C=JAI =HA ?HAG =JA@H 6DA H*KJE+A set_system_gate() EI FH*LE@A@ >O JDA EAH+A# J* IAJ =+ E+JAHHKFJ IAHLE?AH*KJE+A154B*H=F=HJE?K#=HAN?AFJE*+LA?J*HH 9A KIA@ JD=J BK+?JE*+ J* IAJ = C=JA B*H E+JAHHKFJ LA?J*H N"H )I B*H JDA 1545 MA ?*FEA@ JDA I=FA H*KJE+A =I B*H E+JAHHKFJ LA?J*H N&5 MEJD JDA AN?AFJE*+ *B ?=##E+C = ?KIJ*F IOIJAF ?=## EFF#AFA+J=JE*+ E+ JDA A+@] sys_plan9(), EHHAIFA?JELA *B JDA IOIJAF ?=## +KF>AH E+ JDA =??KFK#=J*HH 6DA 154 ?*FEAI JDA HACEIJAH L=#KAI J* JDA EAH+A# IJ=?E =I KIK=#5 =+@ JHECCAHI sys_plan() MEJD =FFH*FHE=JA =HCKFA+JIH 9A KIA JDA L=#KA *B JDA EBP HACEIJAH J* *>J=E+ JDA IJ=?E F*E+JAH E+ KIAHIF=?A =+@ ANJH=?J IOIJAF ?=## =HCKFA+JI KIE+C JDA __get_user() H*KG JE+A FH*LE@A@ >O CE+KNH 6DAIA =HCKFA+JI =HA E+ JKH+ F=IIA@ J* =+ E+JAH+=# IOIJAF ?=## EFF#AFA+J=JE*+H 5*FAJEFAI JDEI FA=+I ?=##E+C =+ ANEIJE+C CE+KN IOIJAF ?=##5 >KJ E+ F=+O ?=IAI5 MA D=@ J* MHEJA *+A BH*F I?H=J?D AC] sys_fd2path). ) I+EFFAJ *B JDA sys_plan9 BK+?JE*+EI=IB*##*MI] asmlinkage long sys_plan9(struct pt_regs regs) { . /* retrieving arguments from userspace stack */ unsigned long *addr = (unsigned long *)regs.esp; /* check syscall number and invoke */ switch (regs.eax) { . case 51: /* pwrite */ arg1 = *(++addr); arg2 = *(++addr); arg3 = *(++addr); addr = addr + 2;

offset = (loff_t) *(addr); if (offset == 0xffffffff) retval = sys_write(arg1, (const char __user*)arg2, arg3); else retval = sys_pwrite64(arg1, (const char __user*)arg2, arg3, offset);

break; } }

6 4. Conclusion *O EFF#AFA+JE+C # *B JDA !' IOIJAF ?=##I5 MA C*J = IKHFHEIE+C +KF>AH *B =FF#E?=G JE*+I J* HK+H -N=FF#AI E+?#K@A 8c, , , , , , cb, =+@ , =F*+C *JDG AHIH 9A >A#EALA JD=J *+ ?*FF#AJE+C =## JDA IOIJAF ?=##I5 /#A+@EN ME## FH*LE@A =+ AN?A##A+J >=IA B*H @ALA#*FAHI J* IJ=HJ MHEJE+C =FF#E?=JE*+I *+ CE+KN E+ JDA 2#=+ ' M=OH 6DA =>E#EJO J* HK+ K+F*@EBEA@ >E+=HEAI E+ >*JD *FAH=JE+C IOIJAFI EI +*J FH*LE@A@ >O =+O *JDAH ANEIJG E+C =#JAH+=JELA5 MEJD JDA AN?AFJE*+ *B 'LN MDE?D EI @EI?KIIA@ E+ JDA =FFA+@ENH 6DA FAHG B*HF=+?A*BJDAIA>E+=HEAIME##>AJDAI=FA=I*JDAH+=JELA#E+KN>E+=HEAI>A?=KIA=##JDA IKFF*HJE+CE+BH=IJHK?JKHAEI>KE#J@EHA?J#OE+J*JDAEAH+A#H /#A+@EN5 =J JDEI IJ=CA5 IAHLAI =I FH**B *B ?*+?AFJ JD=J E@A=I BH*F JDA 2#=+ ' IOIJAF ?=+ >A E+JACH=JA@ E+J* JDA CE+KN EAH+A#H 0*MALAH5 E+ *H@AH J* =?DEALA JDA C*=# *B FH*LE@G E+C = ?*FF#AJA ߢߢ2#=+ ' ANFAHEA+?Aߣߣ J* =FF#E?=JE*+ @ALA#*FAHI5 JDAHA EI = #*J F*HA J* >A @*+A5MDE?DEI@EI?KIIA@E+JDAB*##*ME+CIA?JE*+H

5. Future Work 9DE#A F*IJ *B JDA IOIJAF ?=##I BH*F 2#=+ ' F=F F*HA *H #AII @EHA?J#O J* JDAEH CE+KN ?*K+JAHF=HJI5 I*FA BA=JKHAI =HA K+EGKA 2#=+ 'H 2H*?AII =+@ =@@HAII IF=?A F=+=CAFA+J =#*+C MEJD FAHSFH*?AII +=FAIF=?AI =HA JDA JM* F*IJ EFF*HJ=+J =IFA?JI JD=J =BBA?J JDA EFF#AFA+J=JE*+*BIOIJAF?=##IH 4A?A+J#O5 JDA CE+KN EAH+A# =@@A@ IKFF*HJ B*H FAHSFH*?AII +=FAIF=?AI LE= JDA CLONE_NEWNS B#=C B*H EJI clone IOIJAF?=##H0A+?A5CE+KN=#HA=@O?*+J=E+IFHEFEJELAI B*H +=FAIF=?A F=+EFK#=JE*+5 ALA+ EB JDAO =HA +*J ANF*IA@ J* KIAHIF=?A =FF#E?=JE*+I @EHA?J#OH 9A >A#EALA JD=J IOIJAF ?=##I IK?D =I =+@ bind ?=+ >A EFF#AFA+JA@ KIE+C FHEFEJELAI =#HA=@O FH*LE@A@ >O JDA CE+KN EAH+A#5 =+@ E+@AA@5 MA =HA =#HA=@O M*HEG E+C *+ JDAFH rfork, *+ JDA *JDAH D=+@5 EI = #EJJ#A JHE?EEAH5 AIFA?E=##O >A?=KIA *B JDA IFA?EBE??*F>E+=JE*+*B JDA RFMEM =+@ RFPROC B#=CIb MDE?D HAIK#JI E+ JDA ?HA=JE*+ *B = +AM FH*?AII ID=HE+C ALAHOJDE+C MEJD EJI F=HA+J5 AN?AFJ B*H JDA IJ=?EH .*H JDEI F=HJE?K#=H FAHFKJ=JE*+5 EJ ME## >A +A??AII=HO J* @EC @AAFAH E+J* JDA FAF*HO F=+=CAFA+J FHEFEG JELAI FH*LE@A@ >O JDA CE+KN EAH+A#5 >KJ EI A+JEHA#O F*IIE>#AH 1+ B=?J5 IE+?A MA =HA @A=#E+C MEJD EAH+A# ?*@A DAHA5 =+OJDE+C EI JA?D+E?=##O F*IIE>#A5 JDA *+#O L=HE=JE*+ =F*+CIJ JDA @EBBAHA+JIOIJAF?=##IEIJDA=F*K+J*B?*@AJ*>A?D=+CA@=+@K*HMHEJJA+H 6DA *JDAH F=T*H BA=JKHA J* >A AFK#=JA@ EI JD=J *B JDA IO+JDAJE? BE#A IOIJAFI FH*G LE@A@ >O JDA 2#=+ ' EAH+A#H 5E+?A CE+KN =#HA=@O IKFF*HJI IK?D BE#A IOIJAFI =J#A=IJ F=HG JE=##O S AN=FF#AI =HA /proc =+@ /sys), MA JDE+E EJ ME## +*J >A D=H@ J* ANJA+@ JDEI J* JHKA 2#=+ ' BE#AIOIJAFI IK?D =I /net. /dev/draw ?=+ >A >KE#J *+ J*F JDA +=JELA CE+KNBH=FA>KBBAH@ALE?AH M+?A MA EFF#AFA+J =## JDA IOIJAF ?=##I =+@ IO+JDAJE? BE#A IOIJAFI ?*HHA?J#O5 JDAHA ID*K#@ >A +* FAH?AEL=>#A @EBBAHA+?A >AJMAA+ JDA /#A+@EN EAH+A# =+@ = 2#=+ ' EAH+A# =I B=H =I =+ =FF#E?=JE*+ EI ?*+?AH+A@H 5*KH?A ?*@A =+@ *JDAH @AJ=E#I FAHJ=E+E+C J* JDA FH*G TA?J =HA =L=E#=>#A *+ http://glendix.org/. ,ALA#*FAHI =HA A+?*KH=CA@ J* F=HJE?EG F=JA

Acknowledgements 6DEI FH*TA?J M=I >*H+ BH*F A=H#EAH *FA+ I*KH?A FH*TA?JI5 I* MA M*K#@ #EEA J* >ACE+ >O JD=+EE+C JDA 2#=+ ' =+@ CE+KN ?*FFK+EJEAI B*H CELE+C KI IK?D CHA=J I*BJM=HA =+@ IKFF*HJ J* M*HE MEJDH 5FA?EBE?=##O5 MA M*K#@ #EEA J* JD=+E +D=H#AI .*HIOJD5 4KII +*N5 4A+A 0AHF=+ =+@ )# 8EH*5 MD* ?*+JHE>KJA@ IEC+EBE?=+J#O J* JDA FH*TA?J >O *BBAHE+C JDAEH E+IECDJBK#?*FFA+JI5IKCCAIJE*+I=+@DA#FH !=T*H F*HJE*+I *B /#A+@EN MAHA ANA?KJA@ =I = BE+=# JAHF FH*TA?J =J JDA !=#=LEO= (=JE*+=# 1+IJEJKJA *B 6A?D+*#*COH 9A M*K#@ #EEA J* JD=+E ,HH 8ET=O#=NFE B*H DAH JEFA#O BAA@>=?E =+@IKCCAIJE*+IH

7 References P R 4*> 2EEA5 ,=LA 2HAI*JJ*5 5A=+ ,*HM=H@5 **> .#=+@HA+=5 jA+ 6D*FFI*+5 0*M=H@ 6HE?EAO5 =+@ 2DE# 9E+JAH>*JJ*F5 ߢߢ2#=+ ' BH*F *A## C=>Iߣߣ5 +*FFKJE+C 5OIJAFI5 85 !5 5KFG FAH ''#5FFH S #" P Rߢߢ/(7ߣI(*J7+ENߣߣ5DJJF]KKMMMHC+KH*HCK P!R4KII+*N5ߢߢ2#=+'BH*F7IAH5F=?Aߣߣ5DJJF]KKIMJ?DH?*FKF#=+'F*HJK P"Rߢߢ2#=+'2H*CH=FFAHߣI!=+K=#ߣߣ5DJJF]KKF#=+'H>A##S#=>IH?*FKIOIKF=+K P#R)#AII=+@H*4K>E+E5ߢߢ2#=OE+CMEJD>E+=HOB*HF=JIߣߣ5 DJJF]KKMMMH#E+KNHEJKkHK>E+EK@*?IK>E+BFJK>E+BFJHDJF# P$Rߢߢ1+JA#$"=+@1)S! )H?DEJA?JKHAI5*BJM=HA,ALA#*FAHߣI!=+K=#ߣߣ5L*#KFA ) P%R *HO=+ .*H@5 4KII +*N5 ߢߢ8N! ] CECDJMAECDJ 7IAHS#ALA# 5=+@>*NE+C *+ JDA N&$ߣߣ5 75-(1:)++K=#6A?D+E?=#+*+BAHA+?A55KFFAH &H

Appendix: Comparison to 9vx 8N! P%R EI = KIAHSF*@A #E>H=HO JD=J M=I HA?A+J#O @ALA#*FA@ =J +5)1C5 !16H 6DA FHEG F=HO FKHF*IA *B JDA #E>H=HO EI J* FH*LE@A = I=BA =+@ F*HJ=>#A ANA?KJE*+ A+LEH*+FA+J B*H K+JHKIJA@ N&$ ?*@AH M+A *B JDA E+JAHAIJE+C =FF#E?=JE*+I *B JDEI EI JDA =>E#EJO J* HK+ 2#=+ ' ANA?KJ=>#AI *+ =## F#=JB*HFI JD=J 8N! IKFF*HJI ?KHHA+J#O .HAA*5,5 CE+KN =+@ !=? M5 :H'LNEIJDAFH*TA?JJD=JKIAI8N! J*HK+=+E+IJ=+?A*BJDA2#=+'IOIJAFH M+ JDA IKHB=?A5 EJ F=O IAAF #EEA JDA *KJ?*FAI *B 'LN *+ CE+KN =+@ /#A+@EN =HA IEFE#=H5 >KJ JDAHA =HA F=+O EFF*HJ=+J @EBBAHA+?AIH 8N! ?=+ >A ?*FF=HA@ E+ = LAHO H*KCD IA+IA J* = LEHJK=# F=?DE+A5 =+@ JDKI JDAHA EI = @EIT*E+J >AJMAA+ JDA >E+=HEAI HK++E+C E+IE@A EJ5 =+@ JDA *FAH=JE+C IOIJAF EJ HK+I *+H /#A+@EN5 D*MALAH5 =EFI J* FH*LE@A = F*HA ?#*IA ?*KF#E+C >AJMAA+ 2#=+ ' =FF#E?=JE*+I =+@ JDA CE+KN EAH+A#5 MDAJDAH O*K JHKIJ JDA ANAG ?KJ=>#AI *H +*JH 5A?*+@#O5 8N! EI HAIJHE?JA@ J* N&$ >E+=HEAI *+#OH 9DE#A JDEI F=FAH @EIG ?KIIAI *+#O JDA N&$ EFF#AFA+J=JE*+ *B /#A+@EN5 MA ?=+ A=IE#O ANJA+@ EJ J* ?*LAH *JDAH =H?DEJA?JKHAI=IMA##5CELA+JDA?H*IISF#=JB*HF+=JKHA*B>*JD2#=+'>E+=HEAI=+@CE+KNH

8 Upperware: Pushing the Applications Back Into the System

Gorka Guardiola, Francisco J. Ballesteros, Enrique Soriano 4AOJK=n+=HloI7nELAHIEJO, 5F=En {nAmo,F=KHA=,AIoHE=no}(lIK>.oHC

ABSTRACT

1J EIGKEJA @EBBE?KlJ =n@JA@EoKIJoID=HA @ALE?AI =monC @EBBAHAnJ oFAH=JEnC IOIJAmI. 1B MA =lIo M=nJ Jo ID=HA oJDAH HAIoKH?AI, lEkA JDA IJ=JA oB = MA> >HoMIAHoH=nA@EJoH,EJ >A?omAInANJ JoEmFoIIE>lA.

5EmEl=H FHo>lAmI =HA IolLA@ EnIE@A 2l=n ' [ "] =n@ 1nBAHno ["] >O KIEnC JDA '2 FHoJo?ol [']. 6DA noHm=l =FFHo=?D, JDoKCD, EI Jo MHEJA =n =FFlE?=­ JEon oH = @ALE?A @HELAH FHoLE@EnC = BElAIOIJAm EnJAHB=?A. OKH FHo>lAm EI IomAMD=J @EBBAHAnJ. 9A =lHA=@OD=LA n=JELA =FFlE?=JEonIlEkA 9oH@oH.EHA­ BoN. 0oM ?=n MA KIA JDAIA =FFlE?=JEonI, n=JELA Jo IALAH=l oFAH=JEnC IOI­ JAmI, =n@ =J JDA I=mA JEmA D=LA JDA A=IA oB ?ommKnE?=JEonI FHoLE@A@ >O '2?.

1n JDEI F=FAH MA FHoFoIA = IEmFlA M=O Jo @o EJ: 9H=F JDA =FFlE?=JEonI =n@ @HELAHI MEJD = ?onJHollEnC BElAIOIJAm HKnnEnC on 1nBAHno, DoIJA@ on JDA HAlAL=nJ m=?DEnAI. 6DAn, ANFoHJ =n@ ID=HA JDA BElAIOIJAmI, ANFoHJEnC JDAm ALAn Jo JDA lo?=l DoIJ IOIJAm JDHoKCD IomA FHoJo?ol EJ Kn@AH­ IJ=n@I. 9EJDoKJ mK?D ?onBECKH=JEon, JDA KIAH ?=n FHEnJ =n@ HA=@ @o?K­ mAnJI IEmFlO >O KIEnC @H=C =n@ @HoF =J =nO oB JDA EnLolLA@ m=?DEnAI. 9A FHoFoIA JDA n=mA upperware BoH JDEI =FFHo=?D, MDE?D JHEAI Jo =>IJH=?J =FFlE?=JEonIEnIJA=@oB JDA Kn@AHlOEnCIOIJAm.

1. Introduction 6DA E@A= oB O?JoFKI [!] EI Jo ?AnJH=lEzA JDA IJ=JA oB JDA =FFlE?=JEonI En = ?omFKJAH JD=J MA ?=ll JDA 2+. 6DAn JDA KIAH ?=n HKn JDA JAHmEn=l IoBJM=HA MDE?D ANFoHJI lo?=l HAIoKH?AI =I BElAIOIJAmI Jo =FFlE?=JEonI HKnnEnC on JDA 2+. Lo?=l HAIoKH?AI m=O >A =FFlE?=JEonI =n@ @ALE?AI HKnnEnC =J JDA JAHmEn=l. 1n oH@AH Jo EnJACH=JA JDAIA =FFlE?=­ JEonI MEJD JDA HAIJ oB JDA IOIJAm MA D=@ Jo MH=F JDAm MEJD BElAIOIJAmI, =CCHAC=JEnC IomA =JJHE>KJAI Jo JDAm Io JDAO ?oKl@ >A IAlA?JA@ =KJom=JE?=llO. 9A D=LA BoKn@ JD=J JDEI =FFHo=?D EI LAHO IEmFlA OAJ FoMAHBKl =n@ lAJI KIAHI ID=HA HAIoKH?AI A=IElO MEJDoKJ mK?D ?onBECKH=JEon. 9A ?=ll EJ upperware. *O FHo?AA@EnC BKHJDAH =n@ ANFoHJEnC JDA HAIKlJEnC n=mA IF=?A >=?k Jo JDA Kn@AHlOEnC DoIJ O5, MA HA=?D = FoHJ=>lA M=O Jo EnJA­ CH=JA JDA DAJAHoCAnAoKI JAHmEn=l, En = JH=nIF=HAnJ M=O. *O ?=HABKllO JDEnkEnC JDA BElAIOI­ JAm EnJAHB=?AI, Io JD=J JDAO ?=n >A KIA@ >O ?oFOEnC BElAI, MA ?=n ?onLAHJ JDEI =FFHo=?D EnJo = CAnAH=l IolKJEon ALAn BoH non FHoCH=mmAH KIAHI, MDE?D ?=n @o moIJ JDEnCI >O @H=C-=n@-@HoF. ______6DEI MoHk IKFFoHJA@ En F=HJ >O 5F=nEID 61N- %-$%!#!-+ - =n@ +)M 5- ##/61+/ &#.

9 9A D=LA =FFlEA@JDA upperware FHEn?EFlA >O MHEJEnC ’device@HELAHIߣ BoH DECD lALAl =FFlE?=­ JEonI =n@ IAHLE?AI =L=El=>lA on L=HEoKI IOIJAmI MA KIA. 6DEI En?lK@AI FHEnJEnC, @o?K­ mAnJ LEAMAHI, LoE?A IOnJDAIEI, KIAH =?JELEJO monEJoHEnC, =n@ = MA> >HoMIAH IAHLE?A IJEll Kn@AHM=O. 1n JDEI =HJE?lA MA @AI?HE>A IK?D ߣ@ALE?A @HELAHIߣ, JDAEH EnJAHB=?A =n@ MD=J ?=n >A C=EnA@ >O KIEnC KFFAHM=HA: IA=mlAII ?ommKnE?=JEon =n@ A=IO oB KIA =?HoII DAJAHo­ CAnAoKI Fl=JBoHmI. 9A BAAl JD=J KFFAHM=HA ?=n >A KIABKl En CAnAH=l Jo EnJACH=JA @EBBAH­ AnJ Fl=JBoHmI,J=kEnCJDA Fl=?A oB JOFE?=l o>jA?J-oHEAnJA@mE@@lAM=HA OOM=FFHo=?D. NoJA JD=J KnlEkA En mE@@lAM=HA IOIJAmI, MA MH=F JDA n=mAIF=?A =n@ m=kA EJ =L=El=>lA Jo JDA Kn@AHlOEnC IOIJAm =J A=?D JAHmEn=l En = JH=nIF=HAnJ M=O. .oH JDA DoIJ JDA n=mA IF=?A EI jKIJ =noJDAH BElA LolKmA. 0oMALAH, EJ FHoLE@AI =ll IoHJ oB IAHLE?AI BoH JDA KIAH. *AEnC n=JELAlO =L=El=>lA, n=JELA =FFlE?=JEonI =HA =>lA Jo KIA IK?D n=mA IF=?A =I JDA KIAH IAAIBEJ.

2. Organization -NFAHEAn?A MEJD 2l=n ', 1nBAHno =n@ 2l=n * [ ] J=KCDJ KI JD=J ANFoHJEnC @ALE?AI =n@ =FFlE?=JEonI =I IOnJDAJE? BElAIOIJAmI m=kAI EJ A=IO Jo EnJACH=JA JDAm EnJo = @EIJHE>KJA@ oFAH=JEnC IOIJAm. )FFlE?=JEonI lEkA (1) [&] =n@ (1) >AnABEJ CHA=JlO BHom FHoCH=m=>ElEJO>OANFoIEnC= IOnJDAJE?BElAIOIJAm. *KJ oKH FHo>lAm =n@ =FFHo=?D EI noJ GKEJA JDA I=mA, ALAn EB MA IJEll M=nJ Jo ANFoIA IoBJM=HA HAIoKH?AI BHom JDA Kn@AHlOEnC oFAH=JEnC IOIJAm =n@ EnJACH=JA JDAm EnJo = n=mA IF=?A. 1nBAHno @oAI JDEI Jo IomA ANJAnJ MEJD EJI @ALE?AI MDElA HKnnEnC DoIJA@. 6DA m=En @EBBAHAn?A EI JD=J 1nBAHno Fl=?AI EJIAlB side by side Jo JDA DoIJ oFAH=JEnC IOIJAm, JD=J EI, EJ FHoLE@AI EJI oMn @EIJEn?J LEHJK=l Fl=JBoHm. 1nIJA=@, MA JHO Jo Fl=?A oKHIAlLAI =>oLA =ll JDA IoBJM=HA HKnnEnC n=JELAlO, mA=nEnC JD=J MA JHO Jo J=kA =@L=nJ=CA oB JDA Kn@AHlOEnC oFAH=JEnC IOIJAm =I mK?D =I FoIIE>lA, En?lK@EnC =lIo IomA oB JDA =FFlE?=­ JEonI. 9D=J MA =HA JHOEnC Jo =??omFlEID EI IEmEl=H En =FFHo=?D Jo MD=J 1nBAHno @oAI MEJD JDA Kn@AHlOEnC BElAIOIJAm oB JDA DoIJ =n@ Jo MD=J 'LN @oAI MEJD JDA 6+2/12 IJ=?k. 9A =HA JHOEnC Jo MH=F IoBJM=HA HAIoKH?AI MEJD = BElAIOIJAm >KJ KIEnC =ll JDA mA?D=nEImI FHo­ LE@A@>OJDA DoIJ JoA=IA FHoCH=m=>ElEJO=n@JoEnJAH=?J MEJDJDA KIAHMDAnnA?AII=HO. 9DAn JHOEnC Jo MH=F Kn@AHlOEnC =FFlE?=JEonI, MA D=LA Jo >A ?=HABKl Jo @EIJEnCKEID >AJMAAn JMo JOFAI oB EnJAHB=?AI mA=nEnC JDA IAm=nJE?I MA =IIECn Jo JDA BElAIOIJAm: passive =n@ active: .2=IIELA EnJAHB=?AI MH=F @ALE?AI JD=J =HA IEmEl=H Jo loM lALAl @ALE?AI. 6DAO @o noJ HAGKEHA EnJAH=?JEon MEJD JDA KIAH LE= JDA Kn@AHlOEnC IOIJAm. 1n = IAnIA JDAO =HA @=J= IEnkI =n@ IoKH?AI. -N=mFlAI oB JDEI =HA JDA O?JoFKI LoE?A IOnJDAIEI =n@ FHEnJAH @ALE?AI. 6DA B=?J JD=J JDAO @o noJ HAGKEHA EnJAH=?JEon MEJD JDA KIAH EI LAHO EmFoHJ=nJ, >A?=KIA EJ Fl=?AI HAIJHE?JEonI on JDA M=O JDAO IDoKl@ >AD=LA. .oH AN=mFlA, EB JDA KIAH EmFoHJI = FHEnJAH BHom = nA=H>O ?omFKJAH =n@ IAn@I IomAJDEnC Jo FHEnJ, IDA @oAI noJ M=nJ JDA HAmoJA DoIJ O5 Jo =Ik DAH MD=J F=FAH IEzA Jo KIA En JDA HAmoJA ?omFKJAH. 1nIJA=@, EJ EI moHA ?onLAnEAnJ EB JDA BElA IOIJAm EnJAHB=?AI FHoLE@AI =n =CHAA@-KFon IJ=n@=H@?onBECKH=JEon=n@IomA mA=nIJo?D=nCA EJ. .)?JELA EnJAHB=?AI MH=F =FFlE?=JEonI MDE?D @o HAGKEHA EnJAH=?JEon MEJD JDA KIAH. 6DAO =HA noHm=llO ?on@KEJI oB @=J= oH, =J lA=IJ, ?onJHol JDA @=J= BloM. -N=mFlAI oB JDEI kEn@ oB EnJAHB=?A =HA A@EJoHI=n@MA>>HoMIAHI.)nA@EJoHJ=kAIIomA BElA,?D=nCAIEJ =n@FKJI

10 EJ IomAMDAHA AlIA =I @E?J=JA@ >O JDA EnJAH=?JEon MEJD JDA KIAH. 6DEI EnJAH=?JEon D=FFAnI EnJDA Kn@AHl=OEnCDoIJ IOIJAmoB JDA ?omFKJAHFHoLE@EnCJDA IAHLE?A. OHJDoCon=l Jo JDEI ?l=IIEBE?=JEon, >KJ =lIo EmFoHJ=nJ, EI JD=J BoH IomA oB JDAIA @ALE?AI EJ m=O >A @AIEH=>lA Jo kAAF JDAEH IJ=JA =?HoII ?omFKJAHI =n@/oH IAIIEonI, MDE?D =BBA?JI JDA EmFlAmAnJ=JEonI oB JDA IAHLAHI Jo >A FHoLE@A@ A.C., A@EJoHI MoKl@ ?oFO JDA BElAI, Jo HAm=En=KJonomoKI.

Figure 1: Upperware organization.

6DA BElAIOIJAmIMA ID=HA En JDEI B=IDEon nAA@ IomA =JJHE>KJAI Jo lAJ JDA KIAH IAlA?J JDAm =FFHoFHE=JAlO >O JDAEH lo?=JEon, oFAH=JEnC IOIJAm, AJ?. *O ?onLAnJEon, MA =@@ = BElA n=mA@ ndb Jo JDA HooJ oB A=?D BElAIOIJAm. 6DEI BElA ?onJ=EnI = lEIJ oB =JJHE>KJA/L=lKA F=EHI @AI?HE>EnC JDA IOIJAm ANFoHJA@. 5K?D EnBoHm=JEon EI =lIo kAFJ =J = ?AnJH=l HACEIJHO, BoH JDA KIAH Jo look. 1n JDEI M=O, JDA BElAIOIJAm ?=HHEAI MEJDEn EJIAlB EJI oMn @AI?HEFJEon, IDoKl@JDA KIAHnAA@JoknoM.

3. Spooling OnA JDEnC MA D=LA BoKn@ MDElA JHOEnC Jo @ALEIA M=OI Jo ANFoIA =n@ EnJAH=?J MEJD JDA IOnJDAJE? BElAIOIJAmI, EI JD=J spooling EI= FoMAHBKl IJH=JACO. *O spooling MA @onoJ HABAH jKIJ JoJDA ?l=IIE?=l IFoolEnCEnJAHB=?A,>A?=KIA BoHKIJDA @EHA?JoHO@oEnC JDA IFoolEnC EI IOnJDAJE? =n@ IomA m=CE? m=O o??KH En EJ. NALAHJDAlAII, JDA m=En E@A= HAm=EnI JDA I=mA: .ElAI =HA ?oFEA@ Jo = @EHA?JoHO =n@ JDEnCI D=FFAn Jo JDAm MDAn JDAEH JKHn ?omAI. 6DA HAIKlJEnC mA?D=nEIm EI IEmEl=H Jo )FFlA @HoFlAJI [ ], =IB=H=IJDA KIAHEI?on?AHnA@. +oFOEnC= BElA Jo= @EHA?JoHOJHECCAHI=n=?JEon. 5FoolEnC =lIo FHoLE@AI = M=O Jo EnJAH=?J MEJD JDA BElAIOIJAm JDHoKCD JDA DoIJ O5. 5Fool­ EnC @EHA?JoHEAI =HA ANFoHJA@ >=?k Jo JDA DoIJ IOIJAm KIEnC, BoH AN=mFlA, 9A>,)8. ) IEmFlA @H=C =n@ @HoF m=O >A KIA@ Jo FHEnJ = BElA oH Jo A@EJ EJ, DE@EnC Jo JDA An@ KIAH JDA @AJ=ElIoB JDA DoIJA@IOIJAmFHoLE@EnCJDA mA?D=nEIm.

11 *AIE@AI, IFoolEnC FHoLE@AI = M=O Jo IJHK?JKHA JDA IoBJM=HA. ) MDolA BElAIOIJAm @oAI noJ nAA@ Jo >A EmFlAmAnJA@ BoH A=?D @EBBAHAnJ IAHLE?A @ALE?A oH =FFlE?=JEon; jKIJ IomA BKn?JEonIEmFlAmAnJEnCJDA =?JEonFAHBoHmA@JoJDA BElAIEnIE@A JDA IFoolAH. 1n JDA ?KHHAnJ EmFlAmAnJ=JEon JDAHA EI = FoHJ=>lA mo@KlA EmFlAmAnJEnC JDA IFoolEnC BElAIOIJAm. .oH A=?D @EBBAHAnJ spooler, =n =H?DEJA?JKHA @AFAn@=nJ EmFlAmAnJ=JEon oB = IFoolAHmo@KlA FHoLE@AI=nEnJAHB=?A JoJDA =?JK=l IAHLE?A. 6DEI EnJAHB=?A D=I JDHAA oFAH­ =JEonI, start stop =n@ status. 9DAn = BElA D=I >AAn ?oFEA@ @AJA?JA@ >O JDA clunk on = BE@ oFAn BoH MHEJEnC start EI ?=llA@. 1n IomA ?EH?KmIJ=n?AI, HA=@EnC = BElA =lIo JHECCAHI = ?=ll Jo start. 6DEI m=kAI JDA oFAH=JEon Jo >A FAHBoHmA@ =KJom=JE?=llO MDAn = BElA EI ?oFEA@ Jo JDA @EHA?JoHO. 6DA stop oFAH=JEon CAJI ?=llA@ MDAn = BElA EI HAmoLA@ BHom JDA @EHA?JoHO. 1J FHoLE@AI = mA=n BoH JDA KIAH Jo =>oHJ oH ?=n?Al = IFoolEnC on FHo­ CHAII. 7IEnCJDEIIEmFlA I?DAmA,MA D=LA = FoHJ=>lA EnJAHB=?A MDE?D ?=n >A KIA@ HECDJ BHom JDA BElA >HoMIAHI FHoLE@A@ >O moIJ =ll? DoIJ oFAH=JEnC IOIJAmI =I MAll =I = IEmFlA M=O Jo EmFlAmAnJ nAM IAHLAHI =n@ = IJH=ECDJBoHM=H@ KIAH EnJAHB=?A, MAll knoMn >O =nO KIAH no m=JJAHJDA IOIJAmAmFloOA@. 6MoAN=mFlA oB IFoolEnCIAHLAHI,@EI?KIIA@nANJ,=HA JDA view =n@ print @ALE?AI.

3.1. View View EI =n EmFlAmAnJ=JEon oB JDA IFoolAH EnJAHB=?A, E.A., FHoLE@AI = IFoolEnC @ALE?A BoH LEAMEnC BElAI =n@ @o?KmAnJI. 1J HAlEAI on JDA CAnAHE? open ?omm=n@ oB JDA DoIJ O5 Jo oFAn JDA HAlAL=nJ BElA MDAn EJI start BKn?JEon EI ?=llA@. .oH AN=mFlA, JDA @ALE?A KIAI gnome−open EnLEnKN, open EnM=?O5,=n@JDA FlKm>AHon2l=n'. 6DA @ALE?A EI EnJAn@A@ BoH HA=@EnC @o?KmAnJI, lEkA 2,. oH IEmEl=H BoHm=JI, En = F=IIELA M=O, =lJDoKCD EJ EI = lEJJlA moHA CAnAH=l JD=n JD=J. .oH AN=mFlA, ?oFOEnC =n M2! BElA MoKl@ HAFHo@K?A EJ on JDA @AB=KlJ Fl=OAH =n@, En = IEmEl=H M=O, ?=n >A KIA@ Jo @EIFl=O Em=CAI, Fl=O LE@Ao BElAI, oFAn @o?KmAnJI =n@ MA> F=CAI, AJ?. *KJ noJA JD=J A@EJEon oB JDA >HoMIA@BElAIEInoJ IKFFoHJA@>OJDA @ALE?A.

3.2. Print Print EI JDA EnJAHB=?A Jo JDA FHEnJAH IOIJAm oB JDA DoIJ O5. 1J EI =lIo = IFoolAH mo@KlA. ) BElA@ ?oFEA@ onJo EJ EI FHEnJA@ lEkA En =n ol@ B=IDEon FHEnJEnC IFoolAH IOIJAm. )J JDA momAnJ EJ KIAI JDA +725 lFH ?omm=n@I En M=? O5 =n@ LEnKN, =n@ lF En 2l=n '. 1J FHEnJI jKIJ Jo JDA @AB=KlJ FHEnJAH MEJD JDA @AB=KlJ oFJEonI, MEJDoKJ =nO FoIIE>ElEJO oB ?on­ BECKH=JEon. 6DAHA D=I=lIo>AAn=n=@-Do?FHEnJAHmo@KlA BoH9En@oMI. -LAn JDoKCD JDEI mo@KlA EI GKEJA n=ïLA, EJ D=I FHoLA@ Jo >A DECDlO KIABKl. 7IEnC EJ, EJ >A?omAI JHELE=l Jo @o JDEnCI lEkA FHEnJ Jo JDA ?loIAIJ FHEnJAH IAlA?JA@ =KJom=JE?=llO LE= JDA n@>BHom@EBBAHAnJ lo?=JEonI=n@@EBBAHAnJ oFAH=JEnCIOIJAmI.

4. Voice 6DEI EI = IEmFlA @ALE?A, noJ >=IA@ on JDA IFoolAH. Voice ANFoHJI moIJlO = BElA =F=HJ BHom JDA ndb MDE?D ?=n >A MHEJJAn Jo. )nO JANJ MHEJJAn EnJo EJ EI IOnJDAIEzA@ =I LoE?A. 6DEI EI KIA@ moIJlO BoH mAII=CAI oB JDA IOIJAm, >KJ EJ ?=n =lIo >A KIA@ BoH mAII=CAI =monCKIAHI,lEkA on2l=n*. 7IA@ MEJD ?=HA oB noJ =nnoOEnC JDA KIAH >O BHAGKAnJ mAII=CAI, EJ EI = KIABKl ?omFlA­ mAnJ BoH oJDAH EnJAHB=?AI Jo JDA IOIJAm. .oH AN=mFlA, lonC JAHmA@ ?omm=n@I, mA=nEnC JDoIA JD=J @o noJ ?omFlAJA =BJAH IALAH=l IA?on@I, CAnAH=JA = ?omFlAJA LoE?A mAII=CA Jo

12 HA=IIKHA JDA KIAHJD=J JDA ?omm=n@D=IBEnEIDA@. 1n M=? O5 MA KIA = @On=mE?=llO CAnAH=JA@ )FFlA5?HEFJ I?HEFJ. .oH LEnKN MA KIA esspeak. On 2l=n ' MA HAlO on JDA 2l=n * @ALE?A BoH LoE?A IOnJDAIEI, MDE?D EI =?JK=llO HAl=OEnC JDA MoHk Jo=nOnA=H->OLEnKNm=?DEnA AGKEFFA@MEJD.AIJEL=l.

5. Idle 1n oH@AH Jo @o JDEnCI =KJom=JE?=llO, oKH IOIJAm nAA@I Jo knoM EB JDA KIAH EI E@lA, mA=n­ EnC EB DA EI KIEnC JDA JAHmEn=l oH noJ. OB ?oKHIA, MA =lIo nAA@ Jo knoM which JAHmEn=l D=I >AAn KIA@ l=IJ, Jo lo?=JA JDA KIAH. 6DEI EI @onA >O AmFloOEnC IomA DAKHEIJE?I on @=J= ?ollA?JA@ BHom IALAH=l EnJAH=?JELA =FFlE?=JEonI =n@ BHom JDA IOIJAm 1/O IJ=JEIJE?I. 6DA Idle @ALE?A EI HAIFonIE>lA BoH ?ollA?JEnC IK?D @=J= =n@ KF@=JEnC =CHAA@-KFon BElAI @AI?HE>EnC JDA =?JELEJO oB JDA KIAH on =ll DAH JAHmEn=lI. 6DA HAIJ oB JDA IOIJAm HAlEAI onlO on JDA FoHJ=>lA BElAI =n@ ALAnJI =n@ @oAI noJ nAA@ Jo >A ?on?AHnA@ =>oKJ Fl=JBoHm- IFA?EBE?@AJ=ElI.

6. Web 9A =HA ?KHHAnJlO @ALAloFEnC = @ALE?A BoH JDA MA> >HoMIAH, browserfs. 6DA BEHIJ FHoJo­ JOFA oBBAHI JDHAA IOnJDAJE? BElAI Jo FKll @=J= BHom JDA MA> >HoMIAH  open, history, =n@ bookmarks =n@ = ctl BElA Jo FKID @=J= =n@ FAHBoHm >=IE? oFAH=JEonI on JDA >HoMIAH. )ll FKll BElAI=HA HA=@-onlO=n@AN?lKIELA-oFAn. 6DA JDHAA FKll BElAI FHoLE@A JDAEH @=J= En = ?=nonE?=l BoHm=J. ,EBBAHAnJ >HoMIAHI KIA @EB­ BAHAnJ BoHm=JI Jo IJoHA @=J= m=EnlO :ML, >KJ JDEI EI DE@@An >O JDA FHoLE@A@ EnJAHB=?A. *HoMIAHBI oBBAHI JDA EnBoHm=JEon KIEnC Fl=En JANJ BElAI, En oH@AH Jo m=kA EJ A=IO BoH DKm=nIJoHA=@EJ =n@ BoHFHoCH=mIJoJH=nIBoHmEJ. 9DAn = FKll BElA EI oFAnA@, JDA @ALE?A HAJHEALAI JDA ?oHHAIFon@EnC @=J= BHom JDA DoIJߣI >HoMIAH>OANA?KJEnC?AHJ=Enn=JELA FHoCH=mIonJDA DoIJ. 6DA open BElA oBBAHI JDA lEIJ oB 74LI JD=J =HA ?KHHAnJlO oFAnA@ En >HoMIAHߣI MEn@oMI =n@ J=>I,onA FAHlEnA.1J ?oHHAIFon@IJoJDA F=CAI>AEnCLEAMA@FHAIAnJlO. History FHoLE@AI JDA l=IJ  AnJHEAI En JDA >HoMIAHߣI DEIJoHO HA?oH@. -=?D lEnA EI BoHmA@ >O JDA @=JA oB JDA AnJHO IA?on@I IEn?A AFo?D, JDA 74L BoH JDA AnJHO, =n@ JDA JEJlA oB JDA 06MLF=CA,IAF=H=JA@>O>l=nkI.6DEIBoHm=J EIA=IElOJokAnEz=>lA,>A?=KIA JDA @=JA =n@ JDA 74L?=nnoJ En?lK@A >l=nkI. 6DA bookmarks BElA FHoLE@AI JDA lEIJ oB >ookm=HkA@ F=CAI, =I ?onJ=EnA@ En = F=HJE?Kl=H Bol@AH En JDA >HoMIAH EnJAHB=?A. 6DA KIAH EI En ?D=HCA oB ?HA=JEnC =nO nAM >ookm=HkI En JDEI Bol@AH Jo m=kA JDAm =L=El=>lA BHom =ll DEI o?JoFKI JAHmEn=lI. 6DEI M=O, JDA KIAH EI =>lA Jo IAlA?J MDE?D >ookm=HkI =HA ID=HA@ =monC JAHmEn=lI =n@ MDE?D onAI =HA noJ. )I EJ ?oKl@ >A ANFA?JA@, JDA BoHm=J oB JDA bookmarks BElA EI IEmFlO onA >ookm=Hk FAH lEnA, BoHmA@>OJDA 74L=n@EJI@AI?HEFJEon. 6DA ctl BElA EI KIA@ Jo FKID @=J= =n@ Jo FAHBoHm ?onJHol oFAH=JEonI on JDA JAHmEn=lߣI >HoMIAH. 5o B=H, EJ EmFlAmAnJI onlO JMo ?omm=n@I: open =n@ close. 6DA open ?omm=n@ ANA?KJAI JDA >HoMIAH EB EJ EI noJ OAJ ANA?KJEnC, m=kAI = nAM MEn@oM, =n@ oFAnI JDA CELAn74LIEnJ=>I. .oHAN=mFlA: echo open http://google.com http://lsub.org > /term/browser/ctl

6DA close ?omm=n@BoH?AIJDA >HoMIAHJo?loIA EJIMEn@oMI=n@GKEJ. 6oCAJDAH MEJD browserfs MA FHoLE@A IALAH=l I?HEFJI Jo ?=FJKHA =n@ HA?HA=JA JDA IJ=JA oB JDA >HoMIAH.

13 6DA I?HEFJ bookmarks.sh HA=@I JDA >ookm=HkI BHom JDA KIAHߣI JAHmEn=lI E.A. /pc/terms/*/browser/bookmarks  =n@ mAHCAI JDAm on = IEnClA BElA, JD=J EI =KJom=JE­ ?=llO oFAnA@ >O JDA >HoMIAH oB JDA JAHmEn=l En MDE?D EJ EI ANA?KJA@. 6DA I=mA EI @onA >O history.sh BoHDEIJoHOAnJHEAI,oBBAHEnC= 06MLBElA MEJDAnJHEAIoH@AHA@>O@=JA. )lJDoKCD JDEI IEmFlA =FFHo=?D MoHkI BoH FHoLE@EnC JDA MA> >HoMIEnC IJ=JA Jo JDA KIAH, EJ EI noJ AnoKCD Jo ?HA=JA = BKll EllKIEon oB KIEnC JDA I=mA >HoMIAH =J =ll JDA JAHmEn=lI. 5ALAH=l ANJH= ?onJHol oFAH=JEonI Jo KF@=JA JDA >HoMIAHߣI E@A= oB >ookm=HkI =n@ DEIJoHO MoKl@>A nAA@A@noJ JoJ=lk =>oKJ ?ookEAI. 1n=nO?=IA,JDA ?KHHAnJ LAHIEon=I@AI?HE>A@FHoLE@AI= FoHJ=>lA EmFlAmAnJ=JEon.

7. Mobile devices .oH IomA @ALE?AI EJ m=O >A @AIEH=>lA BoH JDAEH IJ=JA Jo BolloM JDA KIAH. .oH AN=mFlA, MA mECDJ M=nJ JokAAFJDA IAJ oB MA>F=CAI>AEnCLEAMA@JDA I=mA,nom=JJAHJDA JAHmEn=l. .oH oJDAH @ALE?AI oH JAHmEn=lI MA m=O noJ M=nJ JDEI Jo D=FFAn. OnlO JDA KIAH knoMI JDA =FFHoFE=JA JDEnCJo@o. 9A JHO Jo FHoLE@A JDEI B=?ElEJO En = IEmFlA M=O, lA=LEnC EJ KF Jo JDA KIAH JDA ?DoE?A oB MDAn =n@ BoH MDE?D IAHLE?AI EJ EI Jo >A AmFloOA@. 6DA oLAH=ll I?DAmA EI @AI?HE>A@ nANJ, >KJ MA EJ EI Jo >A noJA@ JD=J JDEI B=?ElEJO EI IJEll En JDA A=HlO IJ=CAI =n@ EI noJ OAJ =L=El­ =>lA. 9A MEll JHO Jo kAAF JDEI @AI?HEFJEon ?on?HAJA Jo JDA AN=mFlA oB JDA >HoMIAH, JDoKCD JDA E@A=I =HA A=IElO CAnAH=lEz=>lA. 9A =HA ?KHHAnJlO MoHkEnC on JDEI EmFlAmAnJ=JEon oB JDA >HoMIAH. *ABoHA JDA KIAH JKHnI oBB = JAHmEn=l, = IDAll I?HEFJ, dump.sh, EI ANA?KJA@. 6DEI I?HEFJ IJoHAI JDA @=J= oB JDA JAHmEn=lߣI >HoMIAH En HA=l BElAI, En = MAll-knoMn @EHA?JoHO oB JDA 2+. 9DAn JDA KIAHI JKHn on = JAHmEn=l, =noJDAH I?HEFJ, restore.sh, EI ANA?KJA@. 6DEI I?HEFJ HA=@I JDA BElAI En JDA MAll-knoMn @EHA?JoHO =n@ HA?HA=JAI JDA IJ=JA En JDA JAHmEn=lߣI MA> >HoMIAH. )noJDAH I?HEFJ, followme.sh, ?=n =KJom=JE?=llO @KmF =n@ HAIJoHA @=J= MDAn JDA KIAH lo?=JEon ?D=nCAI E.A. DA moLAI BHom onA oBBE?A Jo =noJDAH. 9A MEll ANFAHEmAnJ MEJD browserfs En oH@AH Jo ?HA=JA ?ommon FolE?EAI BoH oJDAH =FFlE?=­ JEonMH=FFAHI.

8. Implementation 6DA EmFlAmAnJ=JEon oB JDA m=?DEnA @AFAn@=nJ mo@KlAI EI = mENJKHA oB IDAll I?HEFJI, =FFlAI?HEFJI,+ =n@MD=JALAHJDA DoIJ IOIJAmmECDJ FHoLE@A Jo@oJDA jo>=J D=n@. 5omA oB JDA oFAH=JEonI JD=J D=LA Jo >A @onA En JDA Kn@AHlOEnC IOIJAm =HA JHELE=l Jo EmFlAmAnJ, MDElA oJDAH =HA =nnoOEnC. 1J =ll @AFAn@I on JDA EnJAHB=?A oBBAHA@ >O JDA =FFlE?=JEon?onIE@AHA@=n@JDA IAJ oB JoolI=L=El=>lA. .oH AN=mFlA, )FFlAI?HEFJ on M=? O5 : FHoLE@AI = HA=Ion=>lA EnJAHB=?A Jo ?onJHol moIJ =FFlE?=JEonI. .oH EnIJ=n?A, JDA 5=B=HE )21 FHoLE@AI oFAH=JEonI Jo @A=l MEJD J=>I, 74LI, =n@ ANA?KJA J=L= 5?HEFJ oLAH = @o?KmAnJ, Io IomA oFAH=JEonI =HA A=IO Jo EmFlAmAnJ. On JDA oJDAH D=n@, 5=B=HE @oAI noJ ?onJAmFl=JA >ookm=Hk =n@ DEIJoHO m=nEFKl=JEon >O JDEH@F=HJEAI,IoMA D=LA Jo@A=l MEJDM=?O5FHoFAHJOlEIJ :MLBElAI>OD=n@. 9A JHO Jo kAAF JDA nKm>AH oB BA=JKHAI Jo = mEnEmKm Io JD=J JDA EmFlAmAnJ=JEon EI A=IO Jo MHEJA BoH =ll JDA oFAH=JEnC IOIJAmI EnLolLA@ =I DoIJI BoH JDA O?JoFKI. 1n JDA ?=IAI En MDE?D MA ?=n =LoE@ moIJ oB JDA EnJAH=?JEon MEJD JDA n=JELA =FFlE?=JEonI >O HAlOEnC on BElAIEnIJA=@,MA @oIo. 6DEI M=O, EJ EI A=IEAH Jo kAAF KF MEJD JDA E@EoIOn?H=IEAI oB JDA @EBBAHAnJ IOIJAmI, LAH­ IEonI =n@ =FFlE?=JEonI EnLolLA@. 9A =lIo JHO Jo KIA JDA @AB=KlJ oH moIJ FoFKl=H

14 =FFlE?=JEonI oB JDA IOIJAm EB JDAHA EI moHA JD=n onA. .oH AN=mFlA, En LEnKN MA =HA IJE?k­ EnCMDAnALAHFoIIE>lA Jo=FFlE?=JEonIMDE?D?omA >O@AB=KlJ MEJD7>KnJK=n@/nomA. 6o CELA = J=IJA oB DoM IEmFlA EJ EI Jo MHEJA KFFAHM=HA BoH =FFlE?=JEonI En M=? O5 MA MEll CELA JDA 5LO+ BoH JDA HAlAL=nJ F=HJI En JDA O?JoFKI. MoIJ oB JDA ?o@A EI LEm>o, MEJD IomA I?HEFJI=n@=FFlAI?HEFJICAnAH=JA@=J HKnJEmA BoHJDA M=?O5@AFAn@=nJ F=HJ. 6=>lAI =n@ IDoM JDA lEnAI oB ?o@A nAA@A@ Jo EmFlAmAnJ JDA MH=FFAHI JDAmIAlLAI, En?lK@EnC JDA IFoolAH FoHJ=>lA =n@ M=? O5 mo@KlAI, HAIFA?JELAlO. 6=>lA ! IDoMI JDA lEnAI oB ?o@A nAA@A@ Jo EmFlAmAnJ JDA M=? O5 I?HEFJI oB JDA ?KHHAnJ LAHIEon oB browserfs. 6=>lA " IDoMI JDA lEnAI nAA@A@JoEmFlAmAnJ JDA EnBH=IJHK?JKHA Jo>A =>lA Jo HAANFoHJ JDA BElAIAHLAHIJoJDA lo?=l DoIJ =n@JoIAlA?J JDA =FFHoFE=JA JHAA =KJom=CE?=llO. ____________lines module     ______&&  browserfs.b  ______%%  spool.b  ______  view.b 

Table 1: Lines of code, portable modules.

____________lines module     ______'"  idle.b  ______#'  mbrowser.b  ______&  print.b 

Table 2: Lines of code, Mac OS modules.

____________lines program     ______$'  browserfs.scpt (applescript) 

Table 3: Lines of code, host commands.

____________lines program     ______$$  webdav  ______%%  watcher  ______%#  mux 

Table 4: Lines of code, infrastructure to reexport the fileservers to the local host.

9. Related work ME@@lAM=HA ?ommonlO IEJI >AJMAAn JDA =FFlE?=JEon =n@ JDA oFAH=JEnC IOIJAm =n@ JHEAI Jo =>IJH=?J JDA oFAH=JEnC IOIJAm. 9A =HA JHOEnC Jo @o JDA oFFoIEJA, =n@ =>IJH=?J JDA =FFlE?=JEonJom=kA EJ =L=El=>lA JoJDA IOIJAmE.A.,JooJDAHIOIJAmI. 9A =HA >O no mA=nI JDA BEHIJ onAI Jo MH=F lo?=l @ALE?AI oB JDA DoIJ O5 =n@ Jo ANFoHJ

15 JDAm KIEnC = loMAH lALAl )21. NFBI[$]=n@'LN[#]MH=FJDA lo?=l 6+2/12 IJ=?k,BoHAN=m­ FlA MEJD = BElAIOIJAm. 1nBAHno, drawterm, =n@ m=nO LEHJK=l m=?DEnAI lEkA 8M9=HA [ ] [ !] =HA =>lA Jo ANFoHJ JDA lo?=l BElAIOIJAm =n@ IomA @ALE?AI >O KIEnC JDA DoIJ oI. 6DEI EI = ?ommon JA?DnEGKA KIA@ En F=H=LEHJK=lEz=JEon. 6DA m=En @EBBAHAn?A EI JD=J MA =HA JHOEnCJoMH=FDECDlALAl @ALE?AI=n@=FFlE?=JEonI. .ElAIOIJAm lEkA ?lEAnJI lEkA (4) oH sshfs(4) JHO Jo MH=F IAHLAHI KIEnC BElAIOI­ JAmI =I ?lEAnJI. 6DA E@A= EI IEmEl=H Jo MD=J MA =HA JHOEnC Jo =?DEALA, >KJ JDAO =HA HAmoJA IAHLAHI. 0AHA JDA =FFlE?=JEon MoKl@ >A JDA ?lEAnJ =n@ EJ EI >KElJ EnJo JDA BElAIOIJAm. 9A =HA MH=FFEnC lo?=l =FFlE?=JEonI EnIJA=@, =lIo MEJD = BElAIOIJAm, En oH@AH Jo ANFoHJ JDAm. 1n= IAnIA,EJ EIJDA HALAHIA IJH=JACO. 5omA A=HlO HK@EmAnJ=HO =JJAmFJI D=LA >AAn m=@A >ABoHA Jo ANFoHJ =FFlE?=JEonI lEkA = >HoMIAH KIEnC FlKm>AH =n@ IID IAA [%]. )I B=H =I MA knoM no onA D=I JHEA@ MH=FFEnC JDAmMEJD= BKll BlA@CA@BElAIOIJAm,MDE?DEImK?DmoHA HE?DEnEJI EnJAHB=?A =n@ FoIIE>El­ EJEAI. 4AC=H@EnC MA> >HoMIEnC, JDAHA =HA KJElEJEAI Jo m=n=CA =n@ ID=HA >ookm=HkI, IK?D =I ,Al.E?Eo.KI [ ]. 6DAHA =HA =lIo FHoCH=mI Jo mAHCA =n@ JH=nIl=JA >ookm=Hk BElAI BHom @EBBAHAnJ >HoMIAHI [ ]. NonA oB JDAIA IOIJAmI FHoLE@A mA?D=nEImI Jo =KJom=JE?=llO HA?HA=JA JDA IJ=JA oB JDA >HoMIAH En @EBBAHAnJ m=?DEnAI MDE?D EI BEn=llO oKH Co=l. )lIo, JDAO =HA mA=nJ jKIJ BoH = IEnClA F=HJE?Kl=H IAHLE?A MA> >HoMIEnC =n@ noJ BoH =ll oJDAH JoolInAA@A@>O= ?omFKJAHKIAH.

10. Conclusions OKH ANFAHEAn?A MEJD JDA O?JoFKI D=I m=@A KI HA=lEzA DoM A=IO ?=n EJ >A Jo KIA =FFlE?=­ JEonI on?A JDAO =HA MH=FFA@ KF =n@ EnJACH=JA@ >=?k EnJo JDA IOIJAm EnJAHB=?A. 5omA­ JDEnC=IIEmFlA =IJDA FHEnJ @ALE?A MDE?D=??oKnJIBoHlAIIJD=n # lEnAI oB ?o@A En?lK@­ EnC JDA IFoolAH BElAIOIJAm An=>lAI JDA KIAH Jo FHEnJ BHom LEnKN Jo M=? O5 =n@ LE?ALAHI= IomAJDEnC JD=J, FAHD=FI IKHFHEIEnClO, MA ?oKl@ noJ @o @KA Jo En?omF=JE>ElEJEAI >AJMAAn @EBBAHAnJ n=JELA IOIJAmI EnLolLA@. 1J EI =m=zEnC JD=J IEmEl=H EIIKAI =HA IJEll FHo>lAmI En FH=?JE?A @KA Jo @EBBAHAnJ ?onBECKH=JEonI, IA?KHEJO, =n@ LAHIEon EIIKAI. 9EJD KFFAHM=HA JDEI ?=n >A =??omFlEIDA@ ImooJDlO kAAFEnC JDA KIAH o>lELEoKI Jo JDA m=CE? ClKA DE@EnC >ADEn@JDA I?AnA.6DA I=mA CoAIBoHmoIJ oJDAH@ALE?AI=n@IAHLE?AI.

11. Future work. MoHA =FFlE?=JEonI =HA Jo >A MH=FFA@ Jo D=LA = ?omFlAJA IAJ. 6DA MA> >HoMIAH FHoJo­ JOFA D=I >AAn MHEJJAn BoH 5=B=HE, >KJ JDAHA EI noJ OAJ IKFFoHJA@ BoH JDA oJDAH m=En- IJHA=m oFAH=JEnC IOIJAmI. )n A@EJoH =n@ = mKIE? Fl=OAH BElAIOIJAm nAA@ Jo >A MHEJJAn =IMAll. )IoB Jo@=O,JDA IFoolAH@oAInoJ lEIJAnJomAII=CAIBHomJDA =FFlE?=JEonJo@AJA?J MDAn JDA KIAH EI @onA MEJD = BElA A.C., MDAn = LEAM MEn@oM D=I >AAn ?loIA@. 5omA EnBH=I­ JHK?JKHA EI =lHA=@O =L=El=>lA BoH JDEI, >KJ EJ EI noJ >AEnC KIA@. 6DA FHo>lAm EI JD=J JDEI MoKl@ IKFFoIA = moHA EnJEm=JA HAl=JEonIDEF MEJD JDA n=JELA =FFlE?=JEon, m=kEnC EJ D=H@AHJoMHEJA/FoHJ JDA m=?DEnA @AFAn@AnJ F=HJ oB JDA IAHLE?A. 5KFFoHJ BoH 9En@oMI EI =lIo nAA@A@, >KJ nonA oB JDA O?JoFKI @ALAloFAHI KIA 9En@oMI @=ElO =n@, =lJDoKCD>=IE?IAHLE?AI=HA =L=El=>lA JD=nkIJoJDA FoHJ=>ElEJOoB 1nBAHno,mK?D HAm=EnIJo>A @onA.

16 References . )FFlA, 5DEnO ,HoFlAJI, DJJF://MMM.=FFlA.?om/@oMnlo=@I/m=?oIN/FHo@K?JELEJO_JoolI/[email protected], &. . .. J. *=llAIJAHoI, /. /K=H@Eol=, K. L. )lC=H=, -. 5oHE=no, 2. 0. 3KEHóI, -. M. +=IJHo, ). LAon=H@o =n@ 5. )HéL=lo, 2l=n *: *oNAI BoH nAJMoHk HAIoKH?AI, Journal of the Brasil• ian Society. Special issue on Adaptable Computing Systems. To appear. Also in http://lsub.org/ls/export/box.html, ". !. .. J. *=llAIJAHoI, 2. 0AH=I, -. 5oHE=no =n@ 5. L=lEI, 6DA O?JoFKI: 6oM=H@I >KEl@EnC @EIJHE>KJA@Im=HJ IF=?AI>O?AnJH=lEzEnCALAHOJDEnC., UCAMI, %. ". 5. ,oHM=H@, 4. 2EkA, ,. L. 2HAIoJJo, ,. M. 4EJ?DEA, 0. 6HE?kAO =n@ 2. 9EnJAH>oJJom, 6DA 1nBAHnoOFAH=JEnC5OIJAm, Bell Labs Technical Journal 2,  ''%,. #. *. .oH@ =n@ 4. +oN, 8N! : LECDJMAECDJ, 7IAH-lALAl 5=n@>oNEnC on JDA N&$, USENIX, &. $. NFBI,NFBIFHojA?J,DJJF://IoKH?ABoHCA.nAJ/FHojA?JI/nFBI, %. %. 4. FEkA, MAII=CA >O Ho> FEkA En 'B=nI: MO MA> >HoMIEnC JA?DnEGKA, DJJF://'B=nI.nAJ/=H?DELA/  / /# ', !. &. 4. 2EkA, )?mA: ) 7IAH 1nJAHB=?A BoH 2HoCH=mmAHI, Proceedings for the Winter USENIX Conference, ''", !- !". 5=n.H=n?EI?o,+).. '. ,. 2HAIoJJo =n@ 2. 9EnJAH>oJJom, 6DA OHC=nEz=JEon oB NAJMoHkI En 2l=n ', Plan 9 User’s Manual 2. . J.5?D=?DJAH,,Al.E?Eo.KI,DJJF://@Al.E?Eo.KI, !. . -.5oBJM=HA,*ookEJ,DJJF://ALAHO@=OIoBJM=HA.nAJ/>ookEJ, !. . J. 5KCAHm=n, /. 8AnkEJ=?D=l=m =n@ *. 0. LEm, 8EHJK=lEzEnC 1/O ,ALE?AI on 8MM=HA 9oHkIJ=JEonߣI 0oIJA@ 8EHJK=l M=?DEnA MonEJoH, USENIX Annual Technical Confer• ence,  , - ". !. 8M9=HA,8M9=HA, http://www.vmware.com,  . ". 2l=n * 7IAHߣI M=nK=l. 5A?on@ A@EJEon., Laboratorio de Systemas, URJC. GSYC−Tech. Rep.−2004−04., ".

17

18 Scaling Upas

Erik Quanstrom [email protected]

ABSTRACT

6DA 2l=n ' Am=El IOIJAm, 7F=I, KIAI JH=@EJEon=l mAJDo@I oB @AlELAHO Jo 7N1:® m=El >oNAI MDElA KIEnC = KIAH-lALAl BElA IOIJAm, 7F=I/BI, Jo JH=nI­ l=JA m=El >oNAI oB L=HEoKI BoHm=JI EnJo = IEnClA, ?onLAnEAnJ BoHm=J BoH =??AII. 7nBoHJKn=JAlO, EJ @oAI noJ @o Io ABBE?EAnJlO. 7F=I/BI HA=@I AnJEHA Bol@AHI EnJo ?oHA. 9DAn @AlAJEnC Am=El BHom m=El >oNAI, JDA AnJEHA m=El >oN EI HAMHEJJAn. 1 @AI?HE>A DoM 7F=I/BI D=I >AAn =@=FJA@ Jo KIA ?=?D­ EnC, En@ANEnC =n@ = nAM m=El >oN BoHm=J m@EH Jo lEmEJ 1/O, HA@K?A ?oHA IEzA =n@AlEmEn=JA JDA nAA@JoHAMHEJA m=El >oNAI.

1. Introduction

+D=EnA@=J DEIHooJ JMoI?Eon@AmonI@MAll ߝ -H=ImKI,=HMEn,6DA *oJ=nE?/=H@An

)J +oH=E@, Am=El EI JDA l=HCAIJ HAIoKH?A KIAH En JDA IOIJAm >O oH@AHI oB m=CnEJK@A. )I oB JKlO, %, HAMHEJEnC m=El >oNAI M=I KIEnC !M*/@=O on JDA 9O4M =n@ IALAH=l KIAHI HAGKEHA@ moHA JD=n "M* oB ?oHA. )I oB JKlO, &, HAMHEJEnC m=El >oNAI M=I KIEnC &M*/@=O on JDA 9O4M =n@ IALAH=l KIAHI HAGKEHA@ moHA JD=n . /* oB ?oHA Jo HA=@ Am=El. +lA=HlO JDAIA =HA @EBBE?KlJ Jo IKIJ=En lALAlI oB CHoMJD, ALAn MEJDoKJ CHoMJD oB JDA ?omF=nO. 9A nAA@A@ Jo lEmEJ JDA =moKnJ oB @EIk IF=?A KIA@ =n@, moHA KHCAnJlO, HA@K?A 7F=I/BIߣ ?oHA IEzA. 6DA JA?DnEGKAI AmFloOA@ =HA IEmFlA. M=El EI noM IJoHA@ En = @EHA?JoHO MEJD onA mAI­ I=CA FAH BElA. 6DEI AlEmEn=JAI JDA nAA@ Jo HAMHEJA m=El >oNAI. 7F=I/BI noM m=EnJ=EnI=n En@AN MDE?D =lloMI EJ Jo FHAIAnJ ?omFlAJA mAII=CA IKmm=HEAI MEJDoKJ HA=@EnC En@ANA@ mAII=CAI. +om>EnEnC JDA JMo JA?DnEGKAI =lloMI 7F=I/BI Jo HA=@ onlO nAM oH HABAH­ An?A@ mAII=CAI. .En=llO, ?=?DEnC lEmEJI >oJD JDA JoJ=l nKm>AH oB En-?oHA mAII=CAI =n@ JDAEHJoJ=l IEzA.

2. Mdir Format 1n =@@EJEon Jo mAAJEnC oKH KHCAnJ oFAH=JEon=l HAGKEHAmAnJI oB HA@K?EnC mAmoHO =n@ @EIk BooJFHEnJ, Jo mAAJ JDA ANFA?J=JEonI oB oKH KIAHI MA HAGKEHA = IolKJEonJD=J EI=>lA Jo D=n@lA Bol@AHI KF Jo JAn JDoKI=n@ mAII=CAI, oFAn Bol@AHI GKE?klO, lEIJ JDA ?onJAnJI oB Bol@AHIGKE?klO=n@IKFFoHJ JDA ?KHHAnJ IAJ oB m=El HA=@AHI. 6DAHA =HA IALAH=l FoJAnJE=l IJOlAI oB m=El >oNAI. 6DA m=El@EH[ ] BoHm=J D=I IomA =JJH=?­ JELA FHoFAHJEAI. M=El ?=n >A @AlELAHA@ Jo oH @AlAJA@ BHom = m=El >oN MEJDoKJ lo?kEnC. NAM m=El oH @AlAJA@ m=El m=O >A @AJA?JA@ MEJD = @EHA?JoHO I?=n. 9DAn KIA@ MEJD 9O4M IJoH=CA, JDA =moKnJ oB IJoH=CA HAGKEHA@ EI no moHA JD=n JDA IEzA oB nAM m=El HA?AELA@.

19 M>oN BoHm=J ?=n HAGKEHA JD=J = nAM ?oFO oB JDA En>oN >A IJoHA@ ALAHO @=O. -LAn MEJD IJoH=CA JD=J ?o=lAI?AI @KFlE?=JA >lo?kI IK?D =I 8AnJE, @AlAJEnC = mAII=CA MEll CAnAH=llO HAGKEHA nAM IJoH=CA IEn?A mAII=CAI=HA noJ @EIk->lo?k =lECnA@. M=El@EH@oAInoJ HA@K?A JDA ?oIJ oB JDA ?ommon J=Ik oB = IKmm=HO lEIJEnC oB m=El IK?D =I CAnAH=JA@ >O =?mA M=El. 6DA m=ElI[ ] BoHm=J FHoFoIAI = @EHA?JoHO FAH m=El. ) ?oFO oB JDA m=El =I @AlELAHA@ EI IJoHA@ =n@ A=?D mEmA F=HJ EI @A?o@A@ En IK?D = M=O JD=J = m=El HA=@AH ?oKl@ @EIFl=O JDA BElA @EHA?JlO. +omm=n@ lEnA JoolI En JDA IJOlA oB M0[!] =HA KIA@ Jo @EIFl=O =n@ FHo?AII m=El. 7F=I/BI EI noJ nA?AII=HO BoH HA=@EnC lo?=l m=El. M=ElI D=I JDA FoJAnJE=l Jo HA@K?A mAmoHO BooJFHEnJ >AloM JD=J oBBAHA@ >O m@EHI BoH n=JELA Am=El HA=@EnC. 0oMALAH =ll oB JDA l=HCAIJ m=El >oNAI =J oKH IEJA =HA IAHLA@ AN?lKIELAlO JDHoKCD 1M)2. 6DA FHABoHm=J­ JEnC>Om=ElIMoKl@>A KnnA?AII=HOBoHIK?D=??oKnJI. OJDAH m=El IAHLAHI IK?D =I LoJKI NoJAI["] IJoHA Am=El En = ?KIJom @=J=>=IA BoHm=J MDE?D =lloMI BoH BEAl@A@ =n@ BKll-JANJ IA=H?DEnC oB m=El Bol@AHI. 5K?D = BoHm=J FHoLE@AI LAHO GKE?k m=El lEIJEnCI =n@ Coo@ IA=H?D ?=F=>ElEJEAI. 5K?D = IolKJEon MoKl@ noJ lAn@ EJIAlB MAll Jo= Jool->=IA@AnLEHonmAnJ, noHMoKl@EJ >A IEmFlA. M=El@EH BoHm=J IAAmA@ JDA >AIJ >=IE? BoHm=J >KJ EJI F=HJE?Kl=HI =HA JEA@ Jo JDA 7N1: AnLE­ HonmAnJ; m@EH EI = @AI?An@=nJ. ) m@EH Bol@AH EI = @EHA?JoHO MEJD JDA n=mA oB JDA Bol@AH. MAII=CAI En JDA m@EH Bol@AH =HA IJoHA@ En = BElA n=mA@ utime.. Utime EI @ABEnA@ =I JDA @A?Em=l 7N1: IA?on@I MDAn JDA mAII=CA M=I =@@A@ Jo JDA Bol@AH. .oH JDA En>oN, JDEI JEmA MEll ?oHHAIFon@ Jo JDA 7N1: .Hom  lEnA. Seq EI = JMo-@ECEJ IAGKAn?A nKm>AH IJ=HJEnC MEJD 00. 6DA loMAIJ =L=El=>lA IAGKAn?A nKm>AH EI KIA@ Jo IJoHA JDA mAII=CA. 6DKI, JDA BEHIJ Am=El FoIIE>lA MoKl@ >A n=mA@ 0.00. 6o FHALAnJ =??E@AnJI, mAII=CA BElAI =HA IJoHA@ MEJD JDA =FFAn@-onlO =n@ AN?lKIELA-=??AII >EJI JKHnA@ on. 6DA mAI­ I=CA EI IJoHA@ En JDA I=mA BoHm=J EJ MoKl@ >A En m>oN BoHm=J; A=?D mAII=CA EI = L=lE@ m>oNBol@AHMEJD= IEnClA mAII=CA.

3. Indexing 9DAn KF=I/BI BEn@I =n KnEn@ANA@ mAII=CA, EJ EI =@@A@ Jo JDA En@AN. 6DA En@AN EI = BElA n=mA@ foldername.E@N =n@ ?onIEIJI = IECn=JKHA =n@ onA lEnA FAH M1M- F=HJ. -=?D lEnA ?onJ=EnI JDA 50) ?DA?kIKm oB JDA mAII=CA oH = Fl=?A Dol@AH BoH IK>F=HJI, onA BEAl@ FAH AnJHO En JDA messageid/info BElA, Bl=CI =n@ JDA nKm>AH oB IK>F=HJI. 6DA Bl=CI =HA ?KHHAnJlO= IKFAHIAJ oB JDA IJ=n@=H@1M)2 Bl=CI. 6DAOFHoLE@A JDA IEmEl=H BKn?JEon=lEJO Jo m=El@EHߣI mo@EBEA@ BElA n=mAI. 6DKI JDA ߢ5ߣ =nIMAHA@ Bl=C HAm=EnI IAJ >AJMAAn EnLo?=­ JEonI oB m=El HA=@AHI. OJDAH mKJ=>lA EnBoHm=JEon =>oKJ = mAII=CA m=O >A IJoHA@ En = IEmEl=HM=O. 5En?A JDA info BElA EIHA=@>O=ll JDA m=El HA=@AHIJoFHo@K?A m=El lEIJEnCI, m=El >oNAI m=O >A lEIJA@ MEJDoKJ oFAnEnC =nO m=El BElAI MDAn no nAM m=El D=I =HHELA@. 5EmEl=HlO, oFAn­ EnC = nAM m=El >oN HAGKEHAI HA=@EnC JDA En@AN =n@ ?DA?kEnC nAM m=El. 1n@AN BElAI =HA JOFE?=llO >AJMAAn .# =n@ # JDA IEzA oB JDA BKll m=El >oN. -=?D JEmA JDA En@AN EI CAn­ AH=JA@,EJ EIBKllOHAMHEJJAn.

4. Caching 7F=I/BI IJoHAI A=?D mAII=CA En = Message IJHK?JKHA. 6o An=>lA ?=?DEnC, JDEI IJHK?­ JKHA M=I IFlEJ EnJo BoKH F=HJI: 6DA Idx oH En@AN, mAII=CA IK>F=HJI, EnBoHm=JEon on JDA ?=?DA IJ=JA oB JDA mAII=CA =n@ = IAJ oB FoEnJAHI EnJo JDA FHo?AIIA@ DA=@AH =n@ >o@O. OnlO JDA FoEnJAHI Jo JDA FHo?AIIA@ DA=@AH =n@ >o@O =HA IK>jA?J Jo ?=?DEnC. 6DA =L=El­ =>lA ?=?DA IJ=JAI=HA Cidx, Cheader =n@ Cbody.

20 9DAn JDA DA=@AH =n@ >o@O =HA noJ FHAIAnJ, JDA =LAH=CA mAII=CA MEJD IK>F=HJI J=kAI HoKCDlO !K* oB mAmoHO. 6DKI = , mAII=CA m=El >oN MoKl@ HAGKEHA HoKCDlO !M* oB ?oHA En =@@EJEon Jo =nO ?=?DA@ mAII=CAI. 4A=@I oB JDA info oH subject BElAI ?=n >A I=JEIBEA@BHomJDA EnBoHm=JEonEnJDA Idx IJHK?JKHA. 5En?A JDAHA =HA = B=EH nKm>AH oB LAHO l=HCA mAII=CAI, HAGKAIJI JD=J ?=n >A I=JEIBEA@ >O HA=@EnC JDA mAII=CA DA=@AHI @o noJ HAIKlJ En JDA BKll mAII=CA >AEnC HA=@. 4A=@I oB JDA header oH rawheader BElAI oB JoF-lALAl mAII=CAI =HA I=JEIBEA@ En JDEI M=O. 4A=@EnC JDA I=mA BElAI BoH IK>F=HJI, DoMALAH, HAIKlJI En JDA AnJEHA mAII=CA >AEnC HA=@. +=?DEnC JDA DA=@AHHAIKlJIEnJDA Cheader ?=?DA IJ=JA. 5EmEl=HlO, HA=@EnC JDA body HAGKEHAI JDA >o@O Jo >A HA=@, FHo?AIIA@ =n@ HAIKlJI En JDA Cbody ?=?DA IJ=JA. 4A=@EnC BHom M1M- IK>F=HJI =lIo HAIKlJI En JDA Cbody ?=?DA IJ=JA. 6DA ?=?DA D=I = IEmFlA L47 HAFl=?AmAnJ FolE?O. -=?D JEmA = ?=?DA@ mAm>AH oB = mAI­ I=CA EI =??AIIA@, EJ EI moLA@ Jo JDA DA=@ oB JDA lEIJ. 6DA ?=?DA ?onJ=EnI = m=NEmKm nKm>AH oB mAII=CAI =n@ = m=NEmKm IEzA. 9DElA JDA m=NEmKm nKm>AH oB mAII=CAI m=O noJ >A AN?AA@A@, JDA m=NEmKm ?=?DA IEzA m=O >A AN?AA@A@ EB JDA IKm oB =ll JDA ?KHHAnJlO HABAHAn?A@ mAII=CAI EI CHA=JAH JD=n JDA IEzA oB JDA ?=?DA. 1n JDEI ?=IA =ll KnHABAHAn?A@ mAII=CAI MEll >A BHAA@. 9DAn HAmoLEnC = mAII=CA BHom JDA ?=?DA =ll oB JDA ?=?DA=>lA EnBoHm=JEonEIBHAA@.

5. Collateral damage

-=?DnAM KIAHoB = nAM IOIJAmKn?oLAHI= nAM ?l=IIoB >KCI. ߞ *HE=nKAHnECD=n

1n =@@EJEon Jo KF=I/BI, FHoCH=mI JD=J D=LA =IIKmFJEonI =>oKJ DoM m=El >oNAI =HA IJHK?­ JKHA@ nAA@A@ Jo >A mo@EBEA@. 2HoCH=mI MDE?D @AlELAH m=El Jo m=El >oNAI @AlELAH, m=H­ ID=l, ml, ImJF =n@ =FFAn@ mAII=CAI Jo Bol@AHI MAHA CELAn = ?ommon nA@m=El BKn?­ JEon Jo ?=ll. 5En?A JDEI M=I @onA >O mo@EBOEnC BKn?JEonI En JDA 7F=I ?ommon lE>H=HO, JDEI FHAIAnJA@ = FHo>lAm BoH FHoCH=mI noJ JH=@EJEon=llO F=HJ oB 7F=I IK?D =I =?mA M=El =n@ Em=F"@. 4=JDAH JD=n Bol@ JDAIA FHoCH=mI EnJo 7F=I, = nAM FHoCH=m, m>=FFAn@, M=I=@@A@Jo7F=I. 1m=F"@ =lIo HAGKEHAI JDA =>ElEJO Jo HAn=mA =n@ HAmoLA Bol@AHI. 9DElA =n ANJAHn=l FHo­ CH=m MoKl@ MoHk BoHJDEI=IMAll,JD=J =FFHo=?DD=IIomA @H=M>=?kI. MoIJ EmFoHJ=nJlO, 1M)2 Bol@AHI ?=nߣJ >A moLA@ oH HAn=mA@ En JDA I=mA M=O MEJDoKJ HAEmFlAmAnJEnC BKn?­ JEon=lEJO JD=J EI =lHA=@O En KF=I/BI. 1J =lIo AmFD=IEIAI JDA =IOmmAJHO >AJMAAn HA=@EnC =n@ @AlAJEnC Am=El =n@ oJDAH Bol@AH =?JEonI. .ol@AH HAn=mEnC =n@ HAmoL=l MAHA =@@A@ Jo KF=I/BI. 1J EI EnJAn@A@ JD=J m>=FFAn@ MEll >A HAmoLA@ Ioon =n@ HAFl=?A@ MEJD AGKEL­ =lAnJ KF=I/BIBKn?JEon=lEJOߞ =J lA=IJ BoHnon-@AlELAHOFHoCH=mI. M@EHI =lIo ANFoIA =n o@@EJO =>oKJ BElA FAHmEIIEonI. )n =FFAn@-onlO BElA JD=J EI mo@A 0622 m=O >A =FFAn@A@ Jo >O =nOonA, >KJ EI HA=@=>lA onlO >O JDA oMnAH. 9EJD = @EHA?­ JoHO, IK?D = IAJKF EI noJ @EHA?JlO FoIIE>lA =I MHEJA FAHmEIIEon Jo = @EHA?JoHO EmFlEAI FAH­ mEIIEon Jo HAmoLA. 6DAHA =HA = nKm>AH oB IolKJEonI Jo JDEI FHo>lAm. ,AlELAHO ?oKl@ >A m=@A =IOmmAJHE?=lߞEn?omEnC BElAI ?oKl@ >A MHEJJAn Jo = m>oN. OH, BolloMEnC JDA AN=m­ FlA oB JDA oKJ>oKn@ m=El GKAKA, A=?D KIAH ?oKl@ @AlELAH Jo = @EHA?JoHO oMnA@ >O JD=J KIAH. 1n m=nO *5,-@AHELA@ 7N1: IOIJAmI, JDA IJE?kO >EJ on @EHA?JoHEAI EI KIA@ Jo mo@­ EBO JDA mA=nEnC oB JDA w >EJ BoH KIAHI m=J?DEnC onlO JDA oJDAH >EJI. .oH JDAm, JDA w >EJ CELAIFAHmEIIEonJo?HA=JA >KJ noJ JoHAmoLA. 9DElA JDEI EI IomAMD=J oB = onA-oBB IEJK=JEon, 1 ?DoIA Jo EmFlAmAnJ = LAHIEon oB JDA

21 IJE?kO >EJ KIEnC JDA ANEIJEnC =FFAn@-onlO >EJ on oKH BElA IAHLAH. 6DEI M=I EmFlAmAnJA@ =I =n ANJH= FAHmEIIEon ?DA?k MDAn HAmoLEnC BElAI. .AMAH JD=n  lEnAI oB ?o@A MAHA HAGKEHA@.

6. Performance ) HAFHAIAnJ=JELA lo?=l m=El >oN M=I KIA@ Jo CAnAH=JA IomA HoKCD FAHBoHm=n?A nKm­ >AHI. 6DA m=El >oN EI M* =n@ ?onJ=EnI &$& mAII=CAI. 6DAIA BECKHAI =HA IDoMn En J=>lA . 1n JDA MoHIA ?=IAߞ=n KnEn@ANA@ m=El >oNߞJDA nAM KF=I/BI KIAI & oB JDA mAmoHO oB JDA oHECEn=l MDElA KIEnC ! moHA ?FK. 1n JDA >AIJ ?=IA, EJ KIAI onlO # oB JDA mAmoHO MDElA KIEnC onlO ! oB JDA ?FK. +lA=HlO, = l=HCAH m=El >oN MEll m=kA JDAIA H=JEoI moHA =JJH=?JELA. 1n JDA JMo monJDI IEn?A JDA In=FIDoJ M=I J=kAn, JD=J I=mA m=El >oND=ICHoMnJo M* =n@?onJ=EnI & "mAII=CAI. ____________6=>lA ߝ 2AHBoHm=n?A         =?JEon KIAH IOIJAm HA=l ?oHA IEzA  ______ I I I M*       ______ol@BIHA=@ .$' .&" $.% !#  ______EnEJE=l HA=@ .$# .' $.' #        ______En@ANA@HA=@ .$" .! .%% $.# 

7. Future Work 9DElA 7F=Iߣ mAmoHO KI=CA D=I >AAn @H=IJE?=llO HA@K?A@, EJ EI IJEll = MoHk-En-FHoCHAII. +=?DEnC =n@ En@ANEnC =HA =@AGK=JA >KJ FHEmEJELA. 7F=I/BI EI IJEll En?onIEIJAnJlO >OF=IIA@ BoH =FFAn@EnC mAII=CAI Jo m=El >oNAI. 6DAHA =HA =lIo IomA BA=JKHAI MDE?D HAm=En En?omFlAJA. .En=llO, JDA Im=ll En?HA=IA En I?=lA >HEnCI IomA nAM GKAIJEonI =>oKJ JDA oHC=nEz=JEon oB Am=El. 1J m=O >A KIABKl BoH m=El >oNAI MEJD LAHO l=HCA nKm>AHI oB mAII=CAI Jo @ELE@A JDA En@AN EnJo BENA@-IEzA ?DKnkI. 6DAn mAII=CAI ?oKl@ >A HA=@ EnJo = BENA@-IEzA@ Fool oB IJHK?­ JKHAI =I nAA@A@. 0oMALAH EJ EI ?KHHAnJlO D=H@ Jo IAA DoM ?lEAnJI ?oKl@ A=IElO EnJAHB=?A = m=El >oN l=HCA AnoKCD BoH JDEI JA?DnEGKA Jo >A KIABKl. +KHHAnJlO, =ll ?lEAnJI =IIKmA JD=J EJ EI HA=Ion=>lA Jo =llo?=JA =n En-?oHA @=J= IJHK?JKHA BoH A=?D mAII=CA En = m=El >oN. 6o J=kA =@L=nJ=CA oB = ?DKnkA@ En@AN, ?lEAnJI oH JDA IAHLAH MoKl@ nAA@ = M=O oB lEmEJEnC JDA nKm>AH oB mAII=CAI ?onIE@AHA@ =J = JEmA. )lIo, BoH IK?D l=HCA m=El >oNAI, EJ MoKl@ >A EmFoHJ=nJ Jo IAF=H=JA JDA En?omEnC mAII=CAI BHom ol@AH mAII=CAI Jo lEmEJ JDA MoHk HAGKEHA@JoI?=nBoHnAM mAII=CAI. +=?DEnC EI F=HJE?Kl=HlO KnI=JEIB=?JoHO. .ElAI IDoKl@ >A HA=@ En BENA@-IEzA@ >KBBAHI Io m=NEmKm mAmoHO KI=CA @oAI noJ @AFAn@ on JDA IEzA oB JDA l=HCAIJ BElA EnJDA m=El >oN. 7nBoHJKn=JAlO, ?KHHAnJ @=J= IJHK?JKHAI @o noJ HA=@ElO IKFFoHJ JDEI. 1n FH=?JE?A, JDEI lEmE­ J=JEonD=InoJ OAJ >AAnnoJE?A=>lA. 6DAHA =HA =lIo = BAM BA=JKHAI JD=J nAA@ Jo >A ?omFlAJA@. 6H=?kEnC oB HABAHAn?AI D=I >AAn =@@A@ Jo m=HID=l =n@ KF=I/BI. 1n =@@EJEon, JDA En@AN FHoLE@AI = Fl=?A Jo IJoHA mKJ=>lA EnBoHm=JEon =>oKJ = mAII=CA. 6DAIA ?=F=>ElEJEAI IDoKl@ >A >KElJ KFon Jo FHo­ LE@A CAnAH=l JDHA=@EnC=n@J=CCEnC?=F=>ElEJEAI.

22 8. Speculation .HAA@ BHom JDA lEmEJ=JEon JD=J =ll mAII=CAI En = m=El >oN mKIJ >A HA=@ =n@ IJoHA@ En mAmoHO >ABoHA = IEnClA mAII=CA m=O>A =??AIIA@,EJ EIEnJAHAIJEnCJoIFA?Kl=JA on= BAM BKHJDAHFoIIE>ElEJAI. .oH AN=mFlA, EJ m=O >A KIABKl Jo HAFl=?A IAF=H=JA m=El >oNAI MEJD = IEnClA ?ollA?JEon oB mAII=CAI =IIECnA@ Jo onA oH moHA LEHJK=l m=El >oNAI. 6DA =IIo?E=JEon >AJMAAn = mAI­ I=CA =n@ = m=El >oN MoKl@ >A = J=C. ) mAII=CA ?oKl@ >A =@@A@ Jo oH HAmoLA@ BHom onA oH moHA m=El >oNAI MEJDoKJ mo@EBOEnC JDA m@EH BElA. 1B JDHA=@I MAHA EmFlAmAnJA@ >O J=CCEnC A=?D mAII=CA MEJD EJI HABAHAn?AI, EJ MoKl@ >A FoIIE>lA Jo BolloM JDHA=@I =?HoII m=El >oNAI, ALAn Jo mAII=CAI HAmoLA@ BHom =ll m=El >oNAI, FHoLE@A@ JDA Kn@AH­ lOEnC BElA MAHA noJ =lIo HAmoLA@. 1B = B=?ElEJO BoH =@@EnC =H>EJH=HO, =KJom=JE? J=CI MAHA An=>lA@, EJ MoKl@ >A FoIIE>lA Jo J=C mAII=CAI MEJD JDA Am=El =@@HAII En JDA 5M62 .Hom lEnA.

9. References [ ],.*AHnIJAEn,7IEnCm=El@EHBoHm=J,FK>lEIDA@onlEnA =J DJJF://?H.OF.Jo/FHoJo/[email protected] [ ]..*=llAIJAHoIFK>lEIDA@onlEnA =J DJJF://lIK>.oHC/m=CE?/m=n DJml/ /m=ElI [!]M09EkEFA@E= AnJHO,DJJF://An.MEkEFA@E=.oHC/MEkE/M0_MAII=CA_0=n@lEnC_5OIJAm ["]LoJKINoJAI9EkEFA@E= AnJHO,DJJF://An.MEkEFA@E=.oHC/MEkE/LoJKI_NoJAI [#],. 2HAIoJJo, 7F=Iߞ= 5EmFlAH )FFHo=?D Jo NAJMoHk M=El, 2Ho?AA@EnCI oB JDA JD 7IAnEN?onBAHAn?A, '&#.

23

24 Vidi: AVenti To Go

Latchesar Ionkov Los Alamos National Laboratory∗ [email protected]

ABSTRACT Vidi is a Venti proxy that allows certain clients to work when there is no connection to the Venti server. Vidi can be used on , such as laptops, to create archives of the file system even when disconnected, and later to transfer the archives to the Venti server. This paper describes an archival configuration used by the author as well as the design and implementation of a proxy that allows it to work in a disconnected state.

1. Introduction Venti [7] archival server and the utilities for using it, Vac and Vacfs, allow simple and convenient way of keeping history of computer’s files forever. Venti’s interface doesn’t allow data to be deleted or modified once it is stored. The fact that block’s address depends on its content allows Venti to coalesce all blocks with the same content and keep a single copy in its storage. The archival utilities that use Venti don’t need to implement complex algorithms to detect which files on the filesystem are modified. Archiving multiple filesystems with similar files leads to even better utilization of disk’s space.Initially Venti was designed to replace Plan9’s WORM [6] filesystem, but with Plan9 from User Space [2] the server and clients are also available for POSIX compatible operating systems. A common Venti setup consists of a server with many disks, possibly in RAID configuration, and multiple clients in the same network archiving their filesystems daily on the server. This setup doesn’t work well when the clients are mobile and can be used disconnected for long periods of time. If the clients cannot connect to Venti, gaps are introduced in history of the filesystem, data might be lost, and some of the important advantages of using Venti no longer exist. One of the solutions for mobile computers is to run Venti locally, eventually copying the local Venti content to the central Venti server later. A major drawback for this approach is that Venti requires at least 105 percent as much disk space as the data stored. The disk space of the mobile computers is not as abundant as for the servers and desktops and the restriction is very often unacceptable. Vidi introduces an alternative solution for disconnected archival that only uses 0.5 to 2 percent of the space required by running a local Venti server.Instead of keeping locally the content of all the blocks when making an archive, it keeps only the addresses of the blocks that were already sent to Venti, and the content of the blocks that were written while the Venti server was unavailable. Once the mobile computer is connected to its home network, Vidi copies the blocks to the central Venti server and deletes them from the local disk. A notable disadvantage of using Vidi is that it doesn’t allow access to previous snapshots when disconnected. 2. Plan9 dump for Linux 2.1. Venti Venti is a network storage system that uses a hash value of a block’s content as an address for the block. Once data is stored into the Venti storage, it cannot be deleted. Venti provides simple interface for storing and retrieving data. When a client sends a data block for storage,

∗ LANL publication: LA-UR-08-05603

25 the Venti server responds with the SHA-1 [1] hash of the block contents called score.If the client needs to retrieve the data, it sends the score to the server and Venti sends back the block’s content. The maximum size of a block Venti can store is 56 Kilobytes. Using the SHA-1 hash of a block as an address allows the Venti server to detect blocks with the same content and ensure that they are stored only once on the disk. This property simplifies considerably the archival clients because they no longer need to figure out which files on the file system were changed. If the files are not modified, their subsequent archival is not going to use any more space in the archival system. At a higher level, Venti supports storing and retrieving larger files by splitting them into blocks. The scores of the data blocks are combined into indirect blocks, their scores are combined further until a single score is produced that can later be used to retrieve the whole file. Venti files don’t have names or any metadata information typically present for any modern files. Venti also supports “directory” files that contain description (scores and some additional information) of Venti files. Each block in Venti has assigned a type value that indicates whether it is a data block, an indirect block (and the level of indirection), or a directory block. Venti ships with utilities to store, copy or retrieve Venti files and directories. 2.2. Vac Vac is a utility for storing files and directories in Venti. Venti converts the specified list of files into a list of Venti files and directories, saving the score of the top directory in a special root block. The score of the root block is returned to the user and can be used to retrieve the file hierarchy. Vac stores the regular files as a single Venti file. Because the Venti directories don’t store files’ metadata, each directory is represented with two Venti files – a Venti data file containing the metadata of the files from the directory, and a Venti directory. Vacfs is a [4] file server that given a score for a Vac root block can serve all the files stored with Vac. Vacfs can be used natively in Plan9, or using the v9fs [3] filesystem in Linux. 2.3. Using vac for archival The Plan9 [5] dump filesystem provides a convenient view of its previous states. Each night a snapshot of the filesystem is taken and its content is available forever. The content of the file system on January 1st, 2001 can be reviewed by going to /n/dump/2001/0101 directory. It is possible to achieve similar results on Linux by using Vac and Vacfs. Each night Vac is run to store the Linux filesystem in Venti, and the resulting score is saved in separate directory /YYYY/MMDD. Then Vac is run again with -m option to expand and merge all vac scores in a single tree. The resulting score can be mounted using v9fs to provide the convenient Plan9 dump interface. 3. Vidi: archive when disconnected Vidi is a server that speaks the Venti protocol. When the Venti server is available, Vidi acts as a proxy, redirecting client’s requests to Venti, and Venti’s responses back to the client.In addition to the redirection, Vidi builds a locally stored cache of scores for blocks that were sent to Venti. The cache is used in the disconnected state to detect blocks that Venti has and not store them for later transmission. Blocks whose scores are not present in the Vidi’s score cache are saved in a block log. Both the score cache and the block log are stored on a local disk. Figure 1 shows Vidi’s operation when it is connected to Venti. Reading a block is always sent to the Venti server. The read operations don’t affect Vidi’s score cache. Writing a block first checks if its score is present in Vidi’s score cache, and if it is present, a “success” response is sent back to the client without contacting the Venti server. Otherwise, the block is sent to the Venti server and on success, the score of the block is saved in Vidi’s score cache. When Vidi is not connected to Venti (Figure 2), read operations check if the score is present in the score cache, and if so whether the block is available from the local block log.In the unlikely case when the block is available locally, its content is sent back to the client, otherwise Vidi responds with an error. On write, if the score of the block is found in the score cache, a “success” response is sent to the client. Otherwise, Vidi appends the block content to its block log and adds the score to the score cache.

26 !"#$%&'(") *+#$,-#-) !!!!"#!$%&'&!(!)*+'",-./012*'$30/4*55 !!!!30/4*!(!36&:$%&'&5 !!!!!!!!0&06*,78'30/4*$30/4*5 !!!!#/8+%!(!0&06*,78'30/4*$30/4*5 !!!!!!!!4*37/+%$%&'&5 !!!!"#!$#/8+%5 !!!!*.3* !!!!!!!!4*37/+%$30/4*5 !!!!!!!!4*37/+%*44/4$9+/'!#/8+%95 !!!!!!!!4*'84+ !!!!!!!! !!!!"#!$)*+'",-./0178'$%&'&55 !!!!!!!!4*37/+%$30/4*5 !!!!*.3* !!!!!!!!4*37/+%*44/4$,,,5!!!!!!!!

Figure 1: Operation when Vidi is connected to the Venti server

!"#$%&'(") *+#$,-#-) !!!!"#$%&!'!()(*"+,"$-(.%"/-(.%"0 !!!!-(.%"!'!-*)

Figure 2: Operation when Vidi is disconnected from the Venti server

Vidi keeps two pointers into the block log – of the first block that wasn’t sent to Venti yet, and the position where the next block should be written to. When Vidi is reconnected to the Venti server, it starts sending the blocks from the block log to Venti. When all blocks are sent, i.e. the two pointers have the same value, the block log size is reset to the initial size. When a block is appended to the block log, its address doesn’t directly reflect the offset where it is written in the log file. The block addresses always grow, even when the block log is shrunk after all blocks are submitted to Venti. This prevents updating the score cache addresses once the blocks are not in the block log anymore. When the block file is shrunk, Vidi updates a third pointer it keeps which keeps the logical address of the first block in the file. To check if a block for a score stored in the score cache is still available in the block log, Vidi checks if the “start” pointer is greater than the address of the block. Unlike Venti’s index, Vidi’s score cache can drop scores of existing blocks. That can cause blocks that are already present in Venti (and even in the block log itself) to be added to Vidi’s block log. The duplicates don’t cause incorrect operation for Venti or Vidi. The only issue is the increased size of the local block log file. Our results show that with a reasonable size of the score cache, the number of duplicate blocks is not outrageous. In addition to saving the score cache on a local disk, Vidi keeps some of the scores in RAM to improve the performance. The prototype Vidi server is implemented for Unix operating system in 4000 lines of C code. It doesn’t use the standard libventi libraries that are distributed with Plan9 from User Space. 3.1. Score cache disk layout The disk layout (Figure 3) of Vidi’s score cache is similar to Venti’s index layout. The available disk space is divided into buckets (64K by default) and each bucket contains a map for a slice of the score space. The entries in the bucket are sorted by score. Unlike Venti, which depends on its index not overflowing, Vidi is designed to handle overflows and keep the most recently used scores in a bucket. Vidi doesn’t keep a global LRU list.Instead it keeps per bucket LRU list.If a score needs to be added to a bucket, the least recently used entry in the bucket is

27 removed.In order to keep a LRU list, in addition to the block score, and its position in the local block log, the entry has pointers to the previous and next entry in the list.

"#$%&'()#*& ()#*&'2&)3&%

*#+,%'-%./%, 3"#$%&'278% )

!"#$%&') 5"63%,'+4'3"#$%&2 9

!"#$%&'( !,2&'3"#$%&'+442%& : !!! !"!#$% (;

!"#$%&'01( !!!

!"#$%&'0 !"!#$% 3"#$%&1278%

+,#-&.'2&)3&% +,#-&. /0.%1

3"#$%&'278% ) !"#$%&'-%./%, 2#+,% )

5"63%,'+4'%5&,7%2 9 >5&,?') &?A% ;)

5"63%,'+4'<7&2 : >5&,?'( 5"63%,'+4'<7&2 ;; 6,"'75/%= (; !!! A,%B7+"2'7/= ;C

>5&,?'@1( 5%=&'7/= D)

>5&,?'@ 3E+#$'.//,%22 D9

Figure 3: Score cache disk layout

3.2. Block log disk layout Unlike Venti, Vidi’s block log (Figure 4) is stored in a local file that is allowed to grow and shrink. The block log is not divided into arenas. The block log file consists of a header, list of data blocks and a trailer. The header contains a magic number and the “start” pointer. Each block contains a magic number, block’s type, size and content. The log’s trailer contains the “read” and “write” pointers. Vidi doesn’t compress the block contents. 3.3. Using Vidi with Vac When Vac is not used in an incremental mode, it converts the file system into a stream of “write” operations. Because Vac doesn’t try to retrieve data from Venti, it would work well when connecting to Vidi even when disconnected. As Vidi doesn’t always contact the Venti server even when connected, Vac’s performance is improved even in non-incremental mode. 4. Performance results The performance of the prototype is evaluated with different score cache and RAM cache sizes. The Venti server is running on a Linux server with 16 CPUs, 32GB RAM and 2.7TB arena space. The Vidi server is running on another Linux server with 2 CPUs and 2GB of RAM. Both servers are connected to the network with a Gigabit Ethernet card, but not to the same Ethernet switch and are 3 hops apart. The tests were performed using the vac program from Plan9 from User Space on a directory containing 117347 files with total size 11.38 GBytes. Before the tests were run, the directory was stored to the Venti server.

28 "#$%&'($) "#$%&'*+,-+. "#$%&

!"#$%&)*+,*- 2"#$%&3*+,*-&4+56$ ( 2"#$%&4+56$ (

!"#$%&( 01+-1&+,,-*00 7 19:* 7

!"#$%&' 068* ; "#$%&'/.,0#+. !!! ,+1+ '<

!"#$%&./' 2"#$%&1-+6"*-&4+56$ (

!"#$%&. -*+,&+,,-*00 7

!"#$%&=-+6"*- >-61*&+,,-*00 '<

Figure 4: Block log disk layout

Figure 5 shows results running Vac with 64 Kilobyte buckets. Keeping information for the score recency leads to changes in the score cache even when the score is already present in the cache. This leads to higher number of operations to the local disk compared with the standard Venti which doesn’t keep recency information per score. Having too small score cache leads to increased number of missed scores and even though the completion time is lower, Vidi stores an unacceptably high number of blocks (50 percent) even though they already are present in the central Venti server. Using too large score cache increases the I/O operations to the score cache too much decreasing the performance. The best results are achieved when the score

7000 7000 Score cache in RAM Score cache in RAM 10MB 10MB 25MB 25MB 100MB 100MB 6000 direct 6000 direct direct incremental direct incremental

5000 5000

4000 4000 Time (s) Time (s)

3000 3000

2000 2000

1000 1000

50 100 150 200 50 100 150 200 Score Cache on Disk (MB) Score Cache on Disk (MB) (a) Time to archive with empty score cache (b) Time to archive with populated score cache

7000 Score cache in RAM 10MB 25MB 100MB 6000 direct direct incremental

5000

4000 Time (s)

3000 Score Cache Cache Utilization Block log Size (MB) (percent) size (MB)

2000 25 100 6339 50 100 876

1000 75 73 12.37 100 53 12.37 50 100 150 200 Score Cache on Disk (MB) 200 26 12.37 (c) Time to archive when disconnected (d) Score cache utilization and block log size Figure 5: Results using Vidi with 64 Kilobyte buckets.

29 cache is about 75 percent full.In that case, Vidi uses 0.74 percent of the storage a local Venti would use to archive the file system with performance comparable with the one achieved when using Vac in incremental archive mode. Tests performed with smaller bucket size show improved performance at the expense of using more space used by the block log. Using smaller buckets reduces the I/O bandwidth, but the smaller number of scores in a LRU list increases the chance of score miss. 5. Conclusion and Future Work Vidi allows standard Venti tools to be used for archiving when the central Venti server is not available.It caches locally the scores of the most recently written blocks. Vidi provides reasonable performance using a fraction of the disk space that other alternatives would use. An interesting future work would be to extend Vidi to cache not only scores, but also the content of the blocks, allowing partial access to the archived file system. Experimentation with caching techniques other than LRU (ARC, MQ, etc.) could improve the hit ratio on both score and block cache further improving the performance and the user experience as a whole. The implementation could be further improved by compressing the blocks in the local block log, and improving the I/O operations to the score cache. References [1] Secure Hash Standard. National Institute of Standards and Technology, Washington, 2002. Federal Information Processing Standard 180-2. [2] Russ Cox. Plan9 from user space. http://swtch.com/plan9port/. [3] Eric Van Hensbergen and Latchesar Ionkov. The v9fs project. http://v9fs.sourceforge.net. [4] AT&T Bell Laboratories.Introduction to the 9p protocol. Plan 9 Programmer’s Manual, 3, 2000. [5] , Dave Presotto, Sean Dorward, Bob Flandrena, , Howard Trickey, and Phil Winterbottom. . Computing Systems, 8(3):221–254, Summer 1995. [6] Sean Quinlan. A cached WORM file system. Software — Practice and Experience, 21(12):1289–1299, 1991. [7] Sean Quinlan and Sean Dorward. Venti: A new approach to archival data storage.In FAST ‘02: Proceedings of the 1st USENIX Conference on and Storage Technologies, page 7, Berkeley, CA, USA, 2002. USENIXAssociation.

30 Inferno DS: Inferno port to the Nintendo DS

Salva Peiró Valencia, Spain [email protected]

October 12, 2008

Abstract

The Inferno DS port began in 2007 as a one-man Google Summer of Code project, to Inferno available on a standard, cheap, networked device with graphics and audio. The GSoC project attracted a small group of developers that is completing the port, to make the device fully usable for application development. This paper describes the current status of the port. It reviews the background and the motivation for the work, provides a DS hardware overview, and discusses the kernel development process, focusing on the setup and development of Dis applications running on the DS. There is plenty of scope for futher work. We hope to encourage others to contribute to the project.

1. Background The DS [1] native port of Inferno [2] was started by Noah Evans for GSoC 2007 [3]. At the the end of GSoC the port was starting to be usable under the no$gba [4] emulator, enough that it was possible to interact with Inferno's window manager wm(1) 1 using the emulated screen. Inferno also booted and ran on a real DS, but the touch screen did not work. In spite of its limitations the port provided enough basic functionality to encourage further development. The GSoC project sparked the interest of a small group of enthusiasts to nish the port and begin work on new applications suitable for the platform. It is an Open Source project, hosted on Google Code, and supported by discussions in Google Groups and on IRC. 1.1. Motivation The current project shares the motivation stated by Noah Evans on his GSoC 2007 application [3]: by using cheap and easily accessible hardware, native Inferno on the DS would show a wide range of users the power and possibilities of the Inferno and Plan 9 approach to building distributed systems. On other platforms, instead of a native port, we might consider hosting Inferno under an existing system, but we found that emu(1) on DSLinux [5] was not viable as when running with graphics the program crashed due to out of memory errors. There was thus increased curiosity about the advantages of a native port for DS software development. For instance, a proper operating system would overcome limitations of some homebrew programs for the DS, such as no multi-tasking, and it would give the benets of having a coherent system with a standard set of tools. Furthermore, it would provide a real testbed for Limbo applications, including those developed in the inferno-lab [6]. The DS is particularly interesting as an Inferno target because it provides WiFi networking, allowing us to have fun with multi-user games and applications, including Voice-over-IP and jukebox programs using its audio input and output. 2. DS Overview The native port had to address unusual aspects of the Nintendo DS hardware, so some knowl- edge of that is helpful. What follows is a small overview of the DS hardware organized in three subsections: the system processors, its inter-communication mechanisms, and last the built-in devices (and expansions). 31 1 the notation page(section), refers to Inferno manual pages [14] 2.1. Processors The DS has two 32-bit ARM [7] processors: an ARM946E-S running at 66MHz that is in charge of the video and performs the main computations; and an ARM7TDMI at 33MHz that acts as a slave to deal with the remaining devices, including wireless, audio, touch screen, and power management. The system is shipped with the following internal memory:

• 4096KB Main ARM9 RAM • 96KB Main ARM7 WRAM (64Kb + 32K mappable to NDS7 or NDS9) • 60KB TCM/Cache (TCM: 16K Data, 32K Code) (Cache: 4K Data, 8K Code) • 656KB Video RAM (usable as BG/OBJ/2D/3D/Palette/Texture/WRAM memory) • 256KB Firmware FLASH (512KB in iQue variant) • 36KB BIOS ROM (4K NDS9, 16K NDS7, 16K GBA)

For more details see [8][GBATEK, NDS Overview]. 2.2. Communication The two processors in the DS can communicate using combinations of the following methods:

• Shared memory: The 4Mb of ARM9 RAM starting at 0x02000000 can be shared by both processors. It can be congured so that one cpu can be given priority over the other when they access the memory concurrently.

• Hardware FIFOs: The DS FIFO controller allows the processors to exchange 32 bit values. It allows full-duplex communication, where each cpu has a destination queue that stores the values sent by the other cpu, and interrupts notify the appropriate cpu about queue activity. This mechanism is crucial as it allows sending messages to request actions. This is used for example to read and write the real-time clock, obtain the touch coordinates, perform WiFi tasks, and request audio samples to be played or recorded to the ARM7 cpu.

• Sync interrupt: The Sync IRQ is a simple mechanism that allows one cpu (`local') to generate an IRQ to the other (`remote') cpu. We can use that to emulate WiFi receiver interrupts: when the ARM7 detects when a packet has been received it informs the ARM9 using Sync.

Given that accessing shared memory generates wait states to the cpu with less priority, it must be used with care. It works well in combination with FIFOs, by passing FIFO messages with pointers to shared memory. This is analogous to passing parameters by value or by reference. See [8][GBATEK, DS Inter Process Communication (IPC)] for a more detailed description. 2.3. Devices The Nintendo DS has the following built-in devices:

• Video: There are two 3-inch backlit LCD screens, each 256x192 pixels, with 18bit color depth. Each screen has a dedicated 2D video engine, and there is one 3D video engine that can be assigned to either screen.

• Sound: There are 16 sound channels (16x PCM8/PCM16/IMA-ADPCM, 6x PSG-Wave, 2x PSG-Noise). Output can be directed either to built-in stereo speakers, or to a head- phone socket. Input can come either from a built-in microphone, or a microphone socket. 32 • Controls: A user interacts with the DS through a gamepad and a touch screen. The gamepad provides 4 direction keys plus 8 buttons, and the touch screen on the lower LCD screen can be used as a pointing device.

• Networking: WiFi IEEE802.11b wireless networking is provided by the RF2958 (aka RF9008) chip from RFMD. The main drawback is that there is no documentation from the manufacturer about its interfacing and programming. All that is known was reverse engineered by other projects. That information is gathered in [8][GBATEK, DS Wireless Communications] and also in the dswi project and DSLinux [5]

• Specials: Additional devices include: a built-in real time clock, power managment de- vice, hardware divide and square root functions and the ARM CP15 System Control Coprocessor (controlling cache, tcm, pu, bist, etc.)

• External Memory: There are two available slots: NDS slot (slot-1) and GBA slot (slot-2), which are the preferred way to plug in expansion cards and other devices. The slots are commonly used to provide storage on SD/TF cards. There are, however, other devices such as Dserial, CPLDStarter or Xport [9], which provide UART, MIDI, USB and standard digital I/O interfaces together with CPLDs or FPGAs. see [8][GBATEK, NDS Hardware Programming]. 3. DS Port This section describes the idiosyncrasies of the DS port, in particular those related to the setup, kernel and application development. 3.1. Environment The development environment is the default shipped with Inferno. The compiler used is 5{a,c,l}, which forms part of the Inferno and Plan 9 compiler suite [11]. It is used to build the ARM [12] binaries for both the ARM7 and ARM9 cpus, together with the companion tools: mk, acid, , , size, etc. which are used for building, debugging and examining the resulting binaries. The only special tool required is ndstool [10] which generates a bootable image to be launched by the NDS loader running on the DS. The image contains everything required to describe how to boot the code, which includes the ARM7 and ARM9 binaries and their corresponding load addresses and entrypoints. 3.2. DS kernels The Inferno DS port follows the usual pattern for a port of native Inferno to a new platform for an already-supported processor. Much of the code of the Inferno native kernel is platform- independent, including the IP stack. The Dis interpreter and built-in Limbo modules are also platform-independent. That platform-independent code only needs to be compiled, which is done automatically by a mkfile. A relatively small amount of platform-specic code must be written. The DS port shares much of the ARM-specic code with the other ARM ports of Inferno, including the `on the y' compiler (JIT) for Dis for the ARM processor. There are existing ports of Inferno to the ARM, which have been used both as a source of ideas and code. Inferno's earlier port to the iPAQ is the closest existing platform to the DS: both have touch screens, storage, audio and wireless networking, The underlying hardware is completely dierent, however, and the DS often looks like a small brother of the iPAQ: a slower 66 Mhz CPU clock, only 4 Mb of available RAM, small LCD displays and reduced wireless capabilities. One of the rst things to address in the port was how to use the two processors. The ARM9 cpu has 4 Mb of RAM, which permits it to run an Inferno kernel, but the slower ARM7 has only access to 64 Kb or EWRAM (exclusive RAM). Given this memory limitation the ARM7 cannot sensibly run an Inferno kernel. Instead it runs specialised code that manages the hardware devices assigned to the ARM7. The ARM7 kernel is interrupt driven. During its initialisation phase, it sets device interrupts, and congures the buttons, touch screen, FIFOs, and the devices on the SPI. It then switches to a low-power mode, where it endlessly waits for interrupts to wake it. The kernel currently has 2,630 lines of C code, over half of that in its WiFi interface, 33 and 70 lines of assembly code. The ARM9 runs the full Inferno kernel, and provides devices like pointer(3), ether(3), rtc(3), audio(3), etc. About 6,500 lines of C code and 310 lines of assembly code is specic to either the ARM processor or the DS platform. Most of that code is in device drivers. The implementation of the device drivers is unusual: because of the division of work between the processors, the drivers must access and control many of the physical devices via the ARM7, and we discuss that next. 3.3. Communication: FIFOs IPC To avoid conicts that would arise if sharing the hardware devices between cpus, each device is assigned exclusively to one cpu or the other. For example, the Serial Peripheral Interface (SPI) is owned by the ARM7. Many of the peripherals are accessed through SPI, including touch screen, WiFi, rtc, rmware, power management and audio. The LCD hardware by contrast is owned by the ARM9. Consequently, the ARM9 cannot directly drive the audio device, nor can the ARM7 directly display on the screen for debugging. To overcome this, we use the interprocessor communication mechanisms listed above  FIFOs and shared memory  to implement a simple messaging protocol that allows one cpu to access devices owned by the other. It is a Remote Procedure Call protocol: each message is associated at the receiving cpu with a function that performs the work requested by the message. For simplicity the function and its arguments are encoded into a 32 bit message as follows:

msg[32] := type[2] | subtype[4] | data[26], where field[n] refers to a field of n bits of length type[2] := 00: System, 01: Wifi, 10: Audio, 11: reserved. subtype[4] := 2^4 = 16 type specific sub-messages. data[26] := data/parameters field of the message.

The encoding was chosen to have a notation that was easy to read in the calling code, yet accommodate all the data to be exchanged between the cpus:

type[2] is used to have messages organised in 4 bit types: System, Wi, Audio and a Reserved type. subtype[4] is used to further qualify the message type. For example, given message type[2] = Wifi actions to be performed include initialising the WiFi controller, setting the WiFi authentication parameters, and preparing to send or receive a packet. Those and the other operations required can all be encoded using the 16 available message subtypes. data[26] the data eld is just big enough to allow passing of pointers into the 4Mbyte shared memory. (This will have to be revised when using memory expansions @ 0x08000000, 16 Mb)

The protocol has a simple implementation. For instance, here is the low-level non-blocking FIFO put function:

int nbfifoput(ulong cmd, ulong data) { if(FIFOREG->ctl & FifoTfull) return 0; FIFOREG->send = (data<

Here is an example of its use, extracted from devrtc.c, executed by the ARM9 side to read the 34 ARM7 RTC: ulong secs; ... nbfifoput(F9TSystem|F9Sysrrtc, (ulong)&secs); Because the hardware interface to the FIFO is the same for each processor, similar code can be used by the the ARM7 in the other direction, for instance to send a string to the ARM9 to print on the LCD. (The code is not identical because the ARM9 kernel environment includes scheduling.) The interrupt-driven part of the FIFO driver is also straightforward. An extract is shown below to give the avour: static void fifotxintr(Ureg*, void*) { if(FIFOREG->ctl & FifoTfull) return; wakeup(&putr); intrclear(FSENDbit, 0); } static void fiforxintr(Ureg*, void*) { ulong v; while(!(FIFOREG->ctl & FifoRempty)) { v = FIFOREG->recv; fiforecv(v); } intrclear(FRECVbit, 0); } static void fifoinit(void) { FIFOREG->ctl = (FifoTirq|FifoRirq|Fifoenable|FifoTflush); intrenable(0, FSENDbit, fifotxintr, nil, "txintr"); intrenable(0, FRECVbit, fiforxintr, nil, "rxintr"); } Here fiforxintr is executed when an message receive IRQ is triggered, then the FIFO is examined to read the message, which is passed to fiforecv which knows the encoding of the messages, and invokes the corresponding function associated with each message. 3.4. Graphics The DS has two LCD screens, but the draw(3) device currently provides access only to the lower screen, because it is the only touch screen in the DS, and mapping touch screen coordinates to screen coordinates (pixels) makes obvious sense to a user: touching the screen refers to that point on the screen. The DS port could also draw on the upper screen, but it will take some experimentation to determine how to best use both screens so the result still makes sense to both user and programmer. For example, although Limbo's draw(2) does not require that everything drawn be accessible through /dev/pointer, existing interactive applications eectively assume that. One interesting alternative is to use the touch screen coordinates as relative instead of absolute: this would provide access to both screens, and visual feedback can be provided by a software cursor. 3.5. Memory Having 4 Mb of RAM limits the programs that can be run. To overcome this memory limitation, 35 it is possible to use slot-2 memory expansions; the expansions can add between 8 Mb and 32 Mb of RAM, Unfortunately, owing to the slot-2 bus width it can only perform 32-bit and 16-bit writes; when an 8-bit write is performed it results in garbage written to memory. This problem is circumvented in DSLinux [5] by modifying the compiler to replace strb in- structions with swpb, with appropriate changes to surrounding code. We might be able to do the same in the Inferno loader 5l (since that generates the nal ARM code), but failing that, make a similar change to the compiler 5c. 3.6. DLDI The Dynamically Linked Disc Interface (DLDI)[16], is a widespread way of accessing storage SD/TF cards. It provides the IO functions required to access storage independently of which boot card is being used. When a file.nds le is booted, the boot loader auto-patches the DLDI header contained inside the file.file with the specic IO functions for this card. This has been partially implemented in the DS port, where the devdldi.c le provides a suitable DLDIhdr, which is properly recognised and patched by the boot loader. The problem with this approach is that the DLDI patched code (arm-elf ) contains instructions which modify a critical register without restoring it afterwards, which would panic the kernel. For that reason, at this moment the DLDIhdr is only used to detect the card type and then select one of a set of compiled-in drivers, one for each type of card. 3.7. Application As usual for Inferno ports, the existing Dis les for applications run unchanged (subject to available resources). At the application level the DS has some features that make it interesting. User input comes from various buttons, and the touch screen. Graphical output is on two small LCD displays. As noted above, having two displays but only one with a touch screen presents a dierent graphical interface from the one that applications (and users) expect. This is currently the object of experimentation in the inferno-lab [6]. Whichever approach is chosen, being able to run Limbo applications in the full Inferno environ- ment on the DS already opens the eld for interesting applications, which combine graphics, touch, networking and audio. This can include games, VoIP, music, MIDI synths, and other more common uses, such as connecting to remote systems with cpu(1), and managing them from the DS, or accessing remote resources using the styx(5) protocol. 3.8. Setting up the development environment It is easy to set up Inferno to run on the Nintendo DS. An Inferno kernel that can be distributed as an .nds image is available for download from the Inferno DS project site [1]. A standard Inferno distribution is placed on an SD/TF card, and the .nds kernel image can be copied to an SD/TF card, to be booted by the NDS loader. This kernel provides access to the underlying hardware through Inferno's normal device inter- face, namely through a le system interface that is used by applications to access most kernel services. The kernel includes the normal Inferno interfaces for draw(3), pointer(3), ether(3) and audio(3), and a DS-specic devdldi that provides storage access to SD/TF cards. With all this, the development of applications consists of the following steps:

1. setup Inferno emu on a development host: where the applications can be coded, compiled and tested, see [13] for more details. 2. applications on a DS emulator (optional): like no$gba [4] or desmume. 3. transfer applications (.dis les) to SD/TF card: to be launched after booting the Inferno DS kernel.

4. Conclusions The main conclusion extracted during the development of the port has been how the careful design and implementation of the whole Inferno system have made the task of developing this port easier. Most of the kernel code is portable, including the whole of the Dis virtual machine, 36 and just needs to be compiled. The platform-specic kernel code for any native port is fairly small (on the order of a few thousand lines). There was already existing support for the ARM processor, and a few sample ports to ARM platforms to act as models. The interface is simple and modular. This has had also an eect on the tasks of locating and xing errors, and introducing new functionality like input, storage, networking and audio which have become easier. Emulators are still of great help to save test time. The benets of the Inferno design [2] will be also noticed when developing Limbo applications for the DS, as this area has been less used and tested during the development of the port. 5. Future work This project is work in progress, and signicant things remain to do. There are undoubtedly places where a simple-minded implementation just to get things going needs to be redone. For example, the graphics implementation is being extended to allow Inferno to take advantage of both LCD screens, and the audio driver is being reworked to improve playing and recording quality. One big task is to nish and test the wireless networking code. The DS will be much more interesting once it can communicate with other devices, because Inferno comes into its own in a networked environment. That will allow it to access le systems and devices provided by an emu(1) instance running hosted elsewhere. We can also speed development by booting remote kernels. The wireless provides only WEP and open modes at 2.0 Mbps. Once the WiFi code is fully working, it will be interesting to see how the relatively low data rate (in current terms) aects the use of the styx(5) protocol to access remote lesystems. As low-level device support is completed, eort will shift from the kernel side to the applications side. Indeed, that is already happening with the inferno-lab [6] experiments with the Mux interface and with the QUONG/HexInput [15] keyboard to ease interaction with the system through the touch screen. Please in! [1] References [1] Noah Evans, Salva Peiró, Mechiel Lukkien Inferno DS: Native Inferno Kernel for the Nintendo DS. http://code.google.com/p/inferno-ds/. [2] Sean Dorward, Rob Pike, David Leo Presotto, Dennis M. Ritchie, Howard Trickey, Phil Win- terbottom The Inferno Operating System. Computing Science Research Center, Lucent Technologies, Bell Labs, Murray Hill, New Jersey USA http://www.vitanuova.com/inferno. http://code.google.com/p/inferno-os/. [3] Noah Evans, mentored by Charles Forsyth, Inferno Port to the Nintendo DS. Google Summer of Code 2007, http://code.google.com/soc/2007/p9/about.html. [4] Martin Korth, no$gba emulator debugger version. http://nocash.emubase.de/gba- dev.htm. [5] Pepsiman, Amadeus and others, DSLinux: port of uCLinux to the Nintendo DS. http://www.dslinux.org. [6] Caerwyn Jones & co, Inferno Programmers Notebook. http://caerwyn.com/ipn, http://code.google.com/p/inferno-lab [7] ARM (Advanced Risc Machines), ARM7TDMI (rev r4p3) Technical Reference Manual. ARM Limited, http://www.arm.com/documentation/ARMProcessorCores. [8] Martin Korth, GBATEK: Gameboy Advance / Nintendo DS Technical Info. http://nocash.emubase.de/gbatek.txt. http://nocash.emubase.de/gbatek.htm. [9] Charmed Labs, Xport. http://www.drunkencoders.org/reviews.php. [10] DarkFader, natrium42, WinterMute, ndstool Devkitpro: toolchains for homebrew game development. http://www.devkitpro.org/ [11] Ken Thompson, Plan 9 C Compilers. Bell Laboratories, Murray Hill, New Jersey 07974, 37 USA. http://plan9.bell-labs.com/sys/doc/compiler.html. [12] David Seal, The ARM Architecture Reference Manual, 2nd edition. Addison-Wesley Longman Publishing Co. http://www.arm.com/documentation/books.html. [13] Phillip Stanley-Marbell, Inferno Programming with Limbo. John Wiley & Sons 2003, http://www.gemusehaken.org/ipwl/. [14] The Inferno Manual. http://www.vitanuova.com/inferno/man/. [15] http://www.strout.net/info/ideas/hexinput.html. [16] Michael "Chishm" Chisholm, Dynamically Linked Disc Interface. http://dldi.drunkencoders.com/index.php.

38 9P For Embedded Devices

Bruce Ellis Tiger Ellis +lK>*EHHEC= *AllALKA0Ell,N59,)KIJH=lE= [email protected]

ABSTRACT

9P D=I FHoLA@ oLAH JDA OA=HI Jo >A = L=lK=>lA =n@ m=llA=>lA BElA IOIJAm FHoJo?ol. .KHJDAHmoHA, =I EI EJ Am>H=?A@ >O 2l=n', EJ EI moHA JD=n = ?on­ LAnEAnJ FHoJo?ol BoH EnJAH=?JEon >AJMAAn @EIF=H=JA @ALE?AI. 1n@AA@ 2l=n' HAlEAIonEJ. 6DA FHoJo?ol ?=n >A KIA@ Jo An?=FIKl=JA ?onJHol oB =n Am>A@@A@ @ALE?A, MDE?D IEmFlO IAHLAI = 9P BElA IOIJAm. 0oMALAH, ALAn JDoKCD 9P EI LAHO lECDJMAECDJ, EJ ?=n >A =@=FJA@ Jo >A moHA BHKC=l on @ALE?A HAIoKH?AI. 6DEI EI EmFoHJ=nJ on LAHO Im=ll @ALE?AI .2/)I MDAHA = BKll 9P EmFlA­ mAnJ=JEon?=n?onIKmAmoIJoBJDA=L=El=>lAC=JAI. 9A =@@HAII JDEI EIIKA =I = BElAIOIJAm embedfs on JDA Am>A@@A@ m=?DEnAߣI C=JAM=O 2l=n' m=?DEnA. 9A FHoLE@A EmFlAmAnJ=JEon =n@ ?on­ BECKH=JEon@AJ=ElIJ=HCAJA@=JJDA Casella ,ECEJ=l)K@Eo@ALE?A.

1. Introduction 9P BElAIOIJAmI=HAKIA@BoH@ELAHIA=n@oBJAnKnANFA?JA@FKHFoIAI. ;oKnAA@onlOlook =J upas [HAB], [HAB], =n@ ftpfs(1). MoIJ =HA IAHLA@ >O KIAH-lALAl FHo?AIIAI, JDA kAHnAl FHoLE@EnC JDA nA?AII=HO mKlJEFlANEnC =n@ FHAIAnJEnC FDOIE?=l @ALE?AI =I 9p IAHLAHI. 4AmoJA @ALE?AI =HA =??AIIA@ IA=mlAIIlO LE= MD=JALAH ?onnA?JEon FHoJo?ol EI =FFHoFHE=JA Jo JDA J=HCAJ. 6OFE?=llO JDEI = ?ommon IAHLE?A, lEkA 9fs, KIEnC = 6+2 ?on­ nA?JEon. 1J ?=n A=IElO >A = IFA?E=lEzA@ IAHLAH on =n Am>A@@A@ @ALE?A ?onnA?JEnC LE= 75*,IAHE=l,H=MAJDAH,AJ?. ) Im=ll Am>A@@A@ @ALE?A m=O noJ D=LA AnoKCD HAIoKH?AI Jo FHoLE@A = BKll 9P IAHLE?A. 6DA HAIoKH?AI JD=J m=O >A l=?kEnC En?lK@A >KBBAH IF=?A, oKJIJ=n@EnC HAGKAIJ GKAKA IF=?A; =n@ oB m=joH ?on?AHn IKBBE?EAnJ IElE?on BoH D=n@lEnC JDA BKll FHoJo?ol. OKH EnJAn­ JEon EI Jo FHoLE@A = = BElA IOIJAm MDE?D =?JI =I =n EnJAHB=?A Jo = @ALE?A EmFlAmAnJEnC = ?onBECKH=>lAIK>IAJoB 9P,IA=mlAIIlO-HAIFA?JEnCJDAEnJACHEJOoBJDAmo@Al. )HCK=>lO = BElAIOIJAm J=EloHA@ Jo = IFA?EBE? @ALE?A MEJD = ?KIJom FHoJo?ol EI = moHA ABBE­ ?EAnJ KIA oB ?O?lAI. 9A EnIJA=@ Am>H=?A = HAKIA=>lA, HAIFA?J=>lA, ?onBECKH=>lA mo@Al =n@ANEIJEnC?o@A-=moHAABBE?EAnJKIAoB>H=En?O?lAI.

2. An Embedded Interface 6DA EnJAHB=?A EI EmFlAmAnJA@ KIEnC lib9p [HAB], MDE?D FHoLE@AI IomA ?lA=H oFJEmEz=­ JEonI. .=mElE=HEJO MEJD JDA 9P FHoJo?ol EI =IIKmA@ En JDEI F=FAH BoH >HALEJO. 1J EI MAll IJHK?JKHA@=n@m=llA=>lA. /ELAnJDA@EI?l=EmAHMA MEll IJ=JA = HAIKlJ BoH = Im=ll Am>A@@A@ @ALE?A, MDE?D D=I = LAHO BENA@IJHK?JKHA=n@lEmEJA@HAIoKH?AI. 6DEI?oKl@A=IElO>AJDA?on?lKIEon-AN?AFJJDAHA

39 EImoHAJoJAll. 6DEIEIMD=J Casella lookIlEkA: ______   % /n/casella; -l   --rw-rw-rw- M 324 casella casella 0 Aug 26 22:02 audioctl   ---w--w--w- M 324 casella casella 0 Aug 26 22:02 audioin   --r--r--r-- M 324 casella casella 0 Aug 26 22:02 audioout     --rw-rw-rw- M 324 casella casella 0 Aug 26 22:02 ctl   --rw-rw-rw- M 324 casella casella 0 Aug 26 22:02 irom   --rw-rw-rw- M 324 casella casella 0 Aug 26 22:02 midictl   ---w--w--w- M 324 casella casella 0 Aug 26 22:02 midiin   --r--r--r-- M 324 casella casella 0 Aug 26 22:02 midiout  ______

6DA@EHA?JoHOIAHLA@EIBl=JMEJD=?onIJ=nJm=F>AJMAAnn=mA =n@ stat EnBo En?lK@EnC QidI. 6DEIEnBoHm=JEonEIlo=@A@>O embedfs BHom=?onBECKH=JEonBElA.

-nKmAH=JEnCJDA 9P TmesgIIAHLA@>O embedfs: Tversion lib9p D=n@lAIJDEImAII=CA. Tauth lib9p KIAH auth() BKn?JEon D=n@lAI JDEI. 7IK=llO no =KJDAnJE?=JEon EI HAGKEHA@, =??AII EI m=n=CA@ >O FAHmEIIEonI on JDA srv BElA. 1J IAAmI KnnA?AII=HO Jo HAFlE­ ?=JAJDAn=JKH=l plan9 =??AII mA?D=nEIm. Tflush 2=IIA@onJoJDA@ALE?A,DAl@>OJDAIAHLAH,oHALAn@EI?=H@A@. Tattach 4AJKHnIJDAHooJ Qid. Twalk 4AJKHnIJDA=FFHoFHE=JA Qid. Topen 4AJKHnI JDA =FFHoFHE=JA Qid, =n@ = IKEJ=>lA iounit. 1nBoHmI JDA @ALE?A EB =FFHo­ FHE=JA. Tcreate Eperm. Tread, Twrite 2=IIA@onJoJDA@ALE?A. Tclunk lib9p D=n@lAI JDEI mAII=CA. 7IAH BKn?JEon destroyfid() EnBoHmI JDA @ALE?A EB=FFHoFHE=JA. Tremove Eperm. Tstat lib9p KIAH stat() BKn?JEonD=n@lAIJDEI>=IA@on?onBECKH=JEon@=J=. Twstat Eperm. NoJA JD=J JDA ?ommKnE?=JEon MEJD JDA @ALE?A ?=n =n@ @oAI KIA = IK>IAJ oB 9p IFA?EBE­ ?=llO: open, clunk, read, =n@ write. 1n B=?J JDA @ALE?A nAA@ onlO IKFFoHJ read =n@ write.

40 3. A Closer Look 6DA HAIKlJ FHAIAnJA@ =>oLA EI HA=@ElO EmFlAmAnJA@ KIEnC 9pfile(2) - JDA Tree =n@ JDA ?ollA?JEon oB FileI =HA BENA@ on?A JDA ?onBECKH=JEon EI lo=@A@, JDA ?ommKnE?=JEon MEJDJDA@ALE?AKIAI fcall(2). 6DA@ALE?AHAGKEHAmAnJI=HAIm=ll-IJoH=CA=n@loCE? B=ll EnJo = Im=ll ?DKnk oB JDA @ALE?A ?=JACoHO. 5o MD=JߣI KF? .EHIJ MAߣll look =J EmFHoLAmAnJI Jo JDEI EmFlAmAnJ=JEon BoH = Im=ll, IEmFlA, @ALE?A casella =n@ JDAn AN=mEnAAnD=n?AmAnJIBoHmoHA?=F=>lA@ALE?AI.

3.1. iounit Bottleneck 6DA DECD >=n@ME@JD BElAI, audioin, audioout, =n@ irom, D=LA Im=ll on-?DEF >KBBAHI, Io JDA o>LEoKI JDEnC EI Jo HABlA?J JDEI En JDA HAJKHnA@ iounit. 6DEI D=I = LAHO =@LAHIA ABBA?J KFIJHA=m =I = HA=@ oB &K MEll CAnAH=JA =n AnoHmoKI =moKnJ oB DoIJ Jo DoIJ JH=BBE?. 1B JDAIA BElAI =HA ?onBECKHA@ =I >KBBAHA@ MA ?=n =@LAHJEIA = l=HCA EoKnEJ =n@ D=n@lA JDA l=HCA JH=nI=?JEon En JDA IAHLAH MEJD mKlJEFlA lo?=l IFAA@ JH=nI=?JEonI MEJDJDA@ALE?A. -N=mFlA: 6DA IAHLAH HA?AELAI = Tread HAGKAIJ MEJD IEzA oB "K. 6DA @ALE?A D=I = ! >OJA >KBBAH. 6DA IAHLAH IAn@I mKlJEFlA ! >OJA Tread HAGKAIJI Jo JDA @ALE?A KnJEl onA oB=JDA"K>KBBAHEIBKll,>=IDoHJHA=@,oH?=n Rerror. 5EmEl=HlOBoH Twrite.

3.2. Χutstanding Requests 6DA ?DEF D=I lEmEJA@ HAIoKH?AI BoH IJoHEnC oKJIJ=n@EnC HAGKAIJI. 6DA @ALE?A =H?DEJA?­ JKHA EI IK?D JD=J = HAIJHE?JEon oB = IEnClA HAGKAIJ FAH BElA EI n=JKH=l =n@ =@AGK=JA. 6DA IAHLAH ?oKl@ IEmFlO GKAKA HAGKAIJI FAH BElA. 1J m=O =lIo MEID Jo C=JA BElA oFAnI Jo ABBA?­ JELAlO m=kA A=?D BElA AN?lKIELA-oFAn MEJD M=EJ H=JDAH JD=n AHHoH, =lloMEnC HA=@I/MHEJAI oB =n oFAn BElA Jo oLAHJ=kA M=EJEnC oFAnI. 6DEI EI F=HJE?Kl=HlO D=n@O BoH ?onJHol BElAI. FidI =n@ TagI =HA D=n@lA@ En JDA IAHLAH, JH=nIl=JA@ Jo @ALE?A BElA nKm>AH BoH ?ommK­ nE?=JEonMEJDJDA@ALE?A.

3.3. The Result 9EJD JDAIA mo@EBE?=JEonI JDA IElE?on BooJFHEnJ on JDA @ALE?A EI >oKn@A@ =lM=OI Coo@ =n@Im=llEn>oJDIJoH=CA=n@loCE?.

4. Enhancements Casella D=I IJHE?J HA=l-JEmA ?onIJH=EnJI. )K@Eo EnFKJ =n@ oKJFKJ =HA >oJD %$K*/IA?. ME@E EI mK?D IloMAH >KJ IJEll mKIJ noJ oLAHBloM/Kn@AHBloM. ) FHoCH=m KIEnC embedfs Jo ?onJHol = casella mKIJ KIA mKlJEFlA oKJIJ=n@EnC HA=@I =n@ MHEJAI Jo mAAJ JDAIA ?onIJH=EnJI. )lE>H=HOEIFHoLE@A@JoAn?=FIKl=JAJDEI. 6DAIAHLAHKIAI edf [HAB]JoCK=H­ =nJAAJDA@ALE?A@=J=H=JAIIFA?EBEA@EnJDA?onBECKH=JEonBElA.

5. Example Configuration 6DA?onBECKH=JEonBElABoH casella EIlEIJA@>AloM.

41 # # casella.conf # downlink 2M uplink 2M iounit 32 buffer 8K file audioctl 666 file audioin 222 buffered 176K file audioout 444 buffered 176K file ctl 666 file irom 666 buffered file midictl 666 file midiin 222 buffered 3125 file midiout 444 buffered 3125

42 Mrph: a Morphological Analyzer

Noah Evans [email protected]

ABSTRACT

,ALAloFEnC JoolI BoH N=JKH=l L=nCK=CA 2Ho?AIIEnC EI D=H@, HAGKEHEnC ?=HABKl JKnEnC oB IJ=JEIJE?=l mo@AlI =n@ @=J= FHo?AIIEnC oFJEmEz=JEon. 1JߣI ALAnD=H@AHCELAnJDAm=nO?omFAJEnC=n@En?omF=JE>lAJoolI,An?o@EnCI =n@@=J=IAJIEnKIAEnmo@AHnNL2HAIA=H?D. 6o EmFlAmAnJ nAM JoolI HAIA=H?DAHI D=LA Jo HAEmFlAmAnJ oH FoHJ JDA FHALEoKI JoolI, KIEnC JEmA BoH @ALAloFmAnJ JD=J ?oKl@ >A >AJJAH IFAnJ @oEnC FHo@K?JELA HAIA=H?D. 6DAHA D=LA >AAn =JJAmFJI Jo m=kA FoHJ=>lA, BlANE>lA loM lALAl =n=lOIEI IOIJAmI, noJ=>lO .HAAlEnC, JD=J En?oHFoH=JA = BlANE>lA NL2 Jool ?D=En En = l=nCK=CA En@AFAn@AnJ M=O JD=J ?=n >A A=IElO En?oHFoH=JA@EnJooJDAHJoolI=n@MoHkBloMI. 9A FHAIAnJ = nAM moHFDoloCE?=l =n=lOzAH, mHFD, MDE?D =JJAmFJI Jo EmFlAmAnJ = l=nCK=CA En@AFAn@AnJ moHFDoloCE?=l =n=lOzAH >oJD = LE=>lA LADE?lA BoH HAIA=H?D =n@ JDA @=O Jo @=O KIA. 6DA IOIJAm EI @ELE@A@ EnJo mo@KlAI, MHEJJAn MEJD n=JELA IKFFoHJ BoH KJB& , =n@ KIAI = IDAll =n@ FEFA­ lEnA IOnJ=N JD=J EI IAm=nJE?=llO E@AnJE?=l =?HoII IOIJAmI. 1J EI =lIo MHEJJAn En = IJ=JE?=llO JOFA@ l=nCK=CA MEJD mo@KlA IKFFoHJ, =lloMEnC EJ Jo @On=mE­ ?=llO lo=@ =n@ @EI?=H@ l=nCK=CA HAIoKH?AI =J MEll. 6DEI =lloMI mHFD Jo ?D=nCA JDA FHo?AIIA@ l=nCK=CA on @On=mE?=llO, CELEnC EJ FoJAnJE=l BoH EHHACKl=H@=J=IAJIlEkAJDAMA>.

Introduction MHFDEI=moHFDoloCE?=l=n=lOzAHMHEJJAnEnLEm>oBoHEnBAHno. ) moHFDoloCE?=l =n=lOzAH EI = JoolI BoH J=kEnC = IAnJAn?A =n@ >HA=kEnC EJ KF EnJo EJI ?omFonAnJmoHFDoloCO,=IAJoBJAHmI@AI?HE>EnCJDAEmFlE?EJIJHK?JKHAoBJDAIAnJAn?A. .oHEnIJ=n?AJDAIAnJAn?A:

MDAnJokAnEzA@=n@?l=IIEBEA@>O=moHFDoloCE?=l=n=lOzAH>A?omAI:

43 ­ ­

------

- 6DEI FHoLE@AI =n =nnoJ=JEon JD=J =lloMI JDA IAnJAn?A Jo >A @A=lJ MEJD >O JDA KIAH =n@ @o MD=J JDA KIAH M=nJI MDAn JDAO M=nJ Jo @o CHA=JAH =moKnJI oB HAIA=H?D. 1n JDA ?=IA oB JDEI J=F=nAIA IAnJAn?A EI FHoLE@AI JDA FHonoKn?E=JEon, JDA KnEnBlA?JA@ BoHm oB JDA LAH>, =n@EJIEnBlA?JEonJOFAEnA=?D?olKmnHAIFA?JELAlO. 6DEI EnBoHm=JEon =n@ =nnoJ=JEon FHoLE@A@ >O JDA =n=lOIEI BoHmI JDA >=IEI BoH ?HA=JEnC IolKJEonI Jo l=HCAHFHo>lAmIEnn=JKH=ll=nCK=CAFHo>lAmI,En?lK@EnCIOnJ=NJHAAF=HIEnC =n@=n=FDoH=HAIolKJEon. /ELAn JDAEH EmFoHJ=n?A Jo oJDAH J=IkI, Coo@ moHFDoloCE?=l =n=lOzAHI =HA = BoKn@=JEon=l Jool BoH NL2 HAIA=H?DAH, mK?D oJDAH HAIA=H?D @AFAn@I on EJ. 6DEI mA=nI JD=J = loJ oB ABBoHJCoAIEnJooFJEmEzEnCJDAFAHBoHm=n?A=n@=??KH=?OoB@EBBAHAnJ=n=lOzAHI. 6DA IJHA=mEnC n=JKHA oB JDA moHFDoloCE?=l =n=lOzAHߣI J=IkE.A. = IJHA=m oB EnFKJ IAn­ JAn?AI A=?D JH=nIBoHmA@ EnJo = IAJ oB moFHDoloCE?=l JokAnI =nnoJ=JA@ MEJD lEnCKEIJE? EnBoHm=JEon ?oEn?E@AI nE?AlO MEJD JDA KnEN FEFA@ MoHkBloM, MDE?D ?onnA?JI Im=ll JoolI KIEnCFEFAlEnAIFHoLE@A@>OJDAoFAH=JEnCIOIJAm. 0oMALAH, @AIFEJA JDEI n=JKH=l =BBEnEJO moHFDoloCE?=l =n=lOzAHI =HA H=HAlO EnFlAmAnJA@ =I IoBJM=HA JoolI. 6DEI D=FFAnI BoH = BAM HA=IonI, FHEm=HElO onA oB FoHJ=>ElEJO. /ELAn JDA EmFoHJ=n?A oB moHFDoloCE?=l =n=lOzAHI Jo lEnCKEIJE? =n=lOIEI =n@ JDA FoFKl=HEJO @ALAloF­ AHI =n@ HAIA=H?DAHI m=kA IFA?E=l ABBoHJ Jo EmFlAmAnJ JDA IOIJAm =I = lE>H=HO JD=J ?=n >A KIA@ >O = l=HCAH =FFlE?=JEon oH >O FHoLE@EnC >En@EnCI Jo oJDAH I?HEFJEnC l=nCK=CAI lEkA FAHl =n@ FOJDon. 6DEI =lIo An?oKH=CAI = IJOlA oB FHoCH=mmEnC MDAHA m=nO JOFAI oB BKn?JEon=lEJOEn@AFAn@AnJoBJDA=n=lOzAH,lEkABoHm=JJEnCIOIJAmI=n@?D=H=?JAH IAJ D=n­ @lEnCBKn?JEonI=HAEmFlAmAnJA@EnJoJDA=n=lOzAH@EHA?JlO. *O JHOEnC Jo IDoADoHn =n=lOzAHI EnJo = L=HEAJO oB @EBBAHAnJ oFAH=JEnC IOIJAmI MEJD BKn?­ JEon=lEJO JHOEnC Jo >A =ll JDEnCI Jo =ll KIAHI, moHFDoloCE?=l =n=lOzAHI JOFE?=llO >A?omA =H?=nA =n@ LAH>oIA, m=kEnC EJ @EBBE?KlJ Jo =@@ nAM BKn?JEon=lEJO =n@ ?D=nCA JDA IOIJAm MEJDoKJ m=joH ?D=nCAI Jo JDA Kn@AHlOEnC =n=lOzAH EJIAlB. 6DEI m=kAI EJ LAHO @EBBE?KlJ Jo IKFFoHJ nAM l=nCK=CAI oH EmFlAmAnJ EmFHoLA@ =n=lOIEI IOIJAmI En FHAANEIJEnC IOIJAmI, JOFE?=llOJDAO=HAHAEmFlAmAnJA@BHomI?H=J?D. 6DAHA D=LA >AAn =JJAmFJI Jo @A=l MEJD JDEI FHo>lAm, .HAAlEnC[?EJA] >KJ JDAO B=ll >=?k on JDA mAJDo@ oB KIEnC lE>H=HEAI =n@ oLAHlO ?omFlE?=JA@ EnJAHFHo?AII ?ommKnE?=JEon FHoJo­ ?olIlEkA?oH>=JoEmFlAmAnJ.

44 ­!­

Goal: A software tool that can be used for research 9EJD JDAIA FHo>lAmI MA @AIECnA@ mHFD MEJD JDA Co=l oB FHoLE@EnC = Jool JD=J ?=n HAlE­ =>lO KIA@ BoH >oJD @=O Jo @=OKIA=I=moHFDoloCE?=l=n=lOzAH BoHDECDAHlALAlJ=IkI=n@ >A A=IO Jo KIA Jo =@L=n?A JDA IJ=JA oB JDA =HJ En moHFDoloCE?=l =n=lOzAH HAIA=H?D. 9EJD JDAIAmoJEL=JEonIEnmEn@MAIAJJDABolloMEnCCo=lI: . @ALAloF = MAll AnCEnAAHA@ mo@Kl=H =n=lOzAH IKEJ=>lA Jo CAnAH=lEzEnC EJI mAJD­ o@I. AIFA?E=llO onA MEJD = IAJ EnJAHB=?A. MoHFDoloCE?=l =n=lOzAHI JOFE?=llO KIA onA-IDoJ mAJDo@I[?EJA], Io JDA E@A=l M=O Jo @A=l MEJD JDA IOIJAm EI Jo CAnAH=lEzA onAIDoJI=n@=lloM*=nO*mAJDo@Jo@A=lMEJDEJ.

M=kA EJ FoIIE>lA Io JD=J =nO @ALAloFAH =I MAll =I KIAH ?=n =@@ JDA L=HEoKI F=HJI oB EJ.)JoolBoHHAIA=H?D. . AnCEnAAH = IOIJAm JD=J MoKl@ MoHk =I F=HJ oB JDA EnBAHno/Fl=n ' IoBJM=HA JoolI A?oIOIJAm. CELEnC @=J= En = BoHm JD=J ?oKl@ A=IElO >A HAF=HIA@ KIEnC IJHA=m JH=nI­ BoHmJoolIIEmEl=HJo=MkoHIA@. !. ?DooIA =n EnJAHB=?A JD=J =lloMI JDA KIAH Jo KIA KnEN IJOlA Coo@EAI, >KJ, =J JDA I=mA FHoLE@AI I=nA @AB=KlJI MEJDoKJ ?onBECK=H=>ElEJO. kAAF JDA EnJAHB=?A JDA I=mA =?HoIIIOIJAmI.

Mrph: a software tool for morphological analysis MHFDM=IEmFlAmAnJA@MEJDJDAIACo=lIEnmEn@. 1J EI IJHK?JKHA@ =I = IAJ oB mo@KlAI JD=J MoHkI Jo ?omFoIA. MHFD J=kAI = @EBBAHAnJ =FFHo=?D. EJ EI = IAJ oB mo@KlAI JDA Co=l EI Jo >A =>lA Jo IM=F l=nCK=CAI =n@ @=J= on JDA BlO. EJ KIAI = IOIJAm >=IA@ on JokAnEz=JEon oB =IE=n l=nCK=CAI. I=?HEBE?AI ABBE?En?O BoH JD=J =>ElEJO Jo D=n@lA MoH@I =I FHABENAI. EJ EmFlA­ mAnJI?=?DEnCm=nK=llOJo=lloMEJIAlBJoD=n@lAH=nCAIJD=J=HAmK?Dl=HCAH. KnlEkAm=nOmoHFDoloCE?=l=n=lOzAHIonlO=n=lOzAIKnE?o@A. EJ =lIo =JJAmFJI Jo >A mKlJElEnCK=l >O ECnoHEnC JH=@EJEon=l l=nCK=CA JokAnEz=JEon, KIEnC JDA =FFHo=?D oB =IE=n l=nCK=CA =n=lOzAHI oB @A?E@EnC on FoIIE>lA moHFDI >O @oEnC FHA­ BEN IA=H?DAI. JDEI @oAI IJAmmEnC =n@ lAmmEJEz=JEon =n@ mKlJE MoH@ ANFHAIIEon L=lE@=­ JEonAIIAnJE=llOBoHBHAA.>OECnoHEnC

Interface 7nlEkA m=nO moHFDoloCE?=l =n=lOzAHI mHFD EI EmFlAmAnJA@ =I = IoBJM=HA Jool En JDA KnENJH=@EJEon. lEnCKEIJE? HAIA=H?DAHI ?=n >A JH=@EJEon=l HAIA=H?DAHI, >KJ JDAO JOFE?=llO D=LA = L=HEAJO oB IOIJAmI Jo MoHk on. /ELAn JDA E@EoIOn?HEIAI oB JDAIA IOIJAmI, EJ EI EmFoIIE>lA Jo =IIKmA IKFFoHJBoHJDEnCI. Jo IKFFoHJ =ll FoIIE>lA KIAHI FAoFlA KIA =FFHo=?DAI lEkA +D=IAn[?EJA] oH .HAAlEnC[?EJA] @ALAloFEnC IOIJAmI =I JoolI =n@ lE>H=HEAI, =lloMEnC JDA IOIJAm Jo >A KIA@=IF=HJoB=CHA=JAHmonolEJDE?IOIJAm. 1mFlAmAnJEnC JDA =n=lOzAH En lEm>o o>LE=JAI m=nO oB JDA FHo>lAmI. >oJD En JAHmI oB EnJAHB=?A=n@EmFlAmAnJ=JEon,

Input MHFD ANFA?JI Fl=En KJB& JANJ @=J= =I EnFKJ, noM, ?KHHAnJlO lEmEJA@ Jo JDA BoHm=J oB onA IAnJAn?AFAHlEnA.1JJ=kAIJ=F=nAIAJANJEnFKJ=n@CELAIOoKJDAL=lKAoBJDAEH=n=lOIEI. /ELAn JD=J EJI ANFA?JA@ l=nCK=CA EI KJB& >O D=LEnC n=JELA IKFFoHJ BoH JDA IOIJAm. 5En?A EnBAHno IKFFoHJI KJB n=JELAlO >oJD En JDA FHoCH=mmEnC l=nCK=CA =n@ JDA IOIJAm EnJAH­ B=?A lALAl EJ m=kAI EJ FoIIE>lA BoH mHFD Jo D=n@lA =nO l=nCK=CA n=JKH=llOAN?AFJ HECDJ Jo lABJ l=nCK=CAI lEkA )H=>E? =n@ 0A>HAM MDE?D IJEll ?onBoKn@ JDA ?onIJHK?JEon oB = IEmFlA

45 ­"­

EnJAHB=?A. 6DEI=lloMImHFDJoD=n@lA=nOl=nCK=CA=KJom=JE?=llOFoJAnJE=llO,HECDJnoM EJ onlO IKF­ FoHJI J=F=nAIA. EnJAHIFAHIA@ AnClEID =n@ J=F=nAIA =HA D=n@lA@ En JDA I=mA M=O FHo­ LE@A@JD=JJDAEnFKJEIKJB&.

Χutput 6DA IOIJAm oKJFKJI @=J= En JHAA F=JDI[?EJA]. 6DEI m=O IAAm KnnA?AII=HO >KJ En JDA BKJKHA JDA IOIJAm MEll IKFFoHJ JDA EnFKJ oB L=lKAI =lHA=@O En JHAAF=JD BoHm=J, =lloMEnC JDA IOIJAm Jo FoJAnJE=llO J=kA =@L=nJ=CA oB DECDAH lALAlI oB moHFDoloCE?=l @=J= MDAn @oEnC =n=lOIEI, =lloMEnC FoJAnJE=l FoIEJELA BAA@>=?k looFI MDAHA =nnoJ=JEon EI BA@ >=?k Jo JDA =n=lOzAH =lloMEnC A=?D lALAl oB JDA lEnCKEIJE? =n=lOIEI FHo?AII Jo D=LA FoIEJELA BAA@>=?kMEJDA=?DoJDAH. N/ 2// 8*6/ N// )2+/ N/ ------

- 6DEI I=?HEBE?AI. IomA oB JDA HA=@=>ElEJO oB JDA oHECEn=l BoHm=J, JDA =>>HAL=JEon oB JDA moHA @AI?HEFJELA LAHIEon. M=EnJ=EnEnC JDA oHECEn=l BoHm=J =@@A@ Jo mK?D LEIK=l ?lKJJAH MEJDKnE?o@ABonJI, 6DEIEInoJAIFA?E=llOFlA=IEnCMEJDoJDAHBonJI.

Pipelines KJB& =lIo =lloMI BoH FEFAlEnA IJHA=mEnC ?oLAHA@ En 6DomFoI AJ =l[?EJA]. MDE?D m=kAI EJ FoIIE>lA Jo KIA JDA IOIJAm MEJD @=J= JD=J EI FoJAnJE=llO ?KJ KF, m=kEnC EJ = >AJJAH IoBJ­ M=HAJool?=n@E@=JA. >A?=KIAJDAJANJJD=JmHFDIKFFoHJI?=n >A >HokAn KF A=IElO EJ ?=n IKFFoHJ FEFAlEnEnC En = LAHO n=JKH=l M=O. 6DEI =lloMI EJ Jo >A KIA@ =I JDA F=HJ oB = Jool?D=En MDE?D >KEl@I KF Jo JDA IolKJEon oB = moHA CAnAH=l FHo>lAm. 1n B=?J JDA IOIJAm EI mA=nJ Jo >A KIA@ En +o?OJKI[?EJA] MDE?D @EI?KII FEFAlEnAI =n@JDALE=>ElEJOoB1nBAHno=I=NL2AnLEHonmAnJEn CHA=JAH@AJ=El. 0oMALAH, =I mAnJEonA@ A=HlO FEFAlEnAI =HA EmFoIIE>lA Jo EmFlAmAnJ KIEnC =n oFAH=JEnC IOIJAmI EnDAHAnJ FHEmEJELAI, MDE?D m=kAI EJ EmFoIIE>lA Jo moLA =n=lOzAHI lEkA mHFD >AJMAAn IOIJAmI >A?=KIA JDA oFAH=JEnC IOIJAm ?=nnoJ HA=Ion=>lO >A ANFA?JA@ Jo D=n­ @lAALAHOJDEnCn=JELAlO. ) CHA=J =@L=nJ=CA oB FHoCH=mmEnC = Jool En lEm>o EI JD=J EJ ?omAI MEJD AmK, MDE?D =lloMI JDA IOIJAm Jo >A IAm=nJE?=llO E@AnJE?=l =?HoII Fl=JBoHmI. 9DElA oJDAH >OJA?om­ FElA@ l=nCK=CAI lEkA J=L= =lloM FHoCH=mI Jo >AD=LA IEmEl=HlO =?HoII Fl=JBoHmI JDAO @onߣJ AnIKHA JDA I=mA *Fl=JBoHm* >AJMAAn @EBBAHAnJ IOIJAmI, >HA=kEnC onA oB JDA FHEm=HO =@L=nJ=CAI oB = FoHJ=>lA l=nCK=CA. 6DA GKEHkI oB A=?D IOIJAm BoH?AI JDA KIAH Jo

46 ­#­

=>=n@on. *A?=KIAmHFDEI=IEmFlAIoBJM=HAJoolHKnnEnCEnEnBAHno,EJ EnJAH=?JI MEJD oJDAH JoolIEn EnBAHno KIEnC FEFAlEnAI, =lloMEnC EJ Jo >A MEJDoKJ ANJH= BA=JKHAI oH ANJH=nAoKI EnJAHB=?A. )nO JANJ =BJAH FHo?AIIEnC, =nO ?D=H=?JAH IAJ ?onLAHIEonI ?=n >A @o =I FHA =n@ FoIJ FHo­ ?AIIEnC oLAH FEFAlEnAI, =lloMEnC mHFD Jo ?on?AnJH=JA on EJI FKHFoIA MoHFDoloCE?=l =n=l­ OIEI. .oH AN=mFlA EB OoK M=nJA@ Jo =n=lOzA = MA>F=CA =n@ M=nJA@ =ll AN=mFlAI oB ?onIA?K­ JELAnoKnFDH=IAI. hget http://www.asahi.com | htmfmt | mrph | readline

Implementation 6DEI IA?JEon @AI?HE>AI JDA EmFlAmAnJ=JEon oB mHFD. 1J >ACEnI >O @AI?HE>EnC JDA mo@Kl=H IJHK?JKHA oB JDA EmFlAmAnJ=JEon =n@ JDA >AD=LEoH oB JDA m=En =n=lOzAH. 1J JDAn CoAI on Jo @AI?HE>A JDA EmFlAmAnJ=JEon oB JDA oHECEn=l mo@KlAI BoH JDA IOIJAm =n@ JDA FH=?JE?=l ?onIE@AH=JEonIJD=JMAnJEnJoJDAEH?onIJHK?JEon.

Modular construction

utf8 text stream

Dictionary

Morph

Classifier

List of Morph

The system is implemented as a set of modules which implement the various struc tures of mrph:

47 ­$­

Diction Classific Morph

takes a text stream and views the input as a set of prefixes. These prefixes are then fed to a dictionary which returns the valid morphs. which is then done with that. .Kn@=mAnJ=llOJDAIOIJAmEI=m=FFEnCBHomJANJIJHA=m->=IAJoBmoHFDI. JDA IOIJAm @oAI Io >O J=kEnC JDA FHABENAI =n@ CELEnC JDAm Jo = @E?JEon=HO. EJ JDAn CELAI =?onIJ=nJMAECDJJoJDAKn@ABEnA@=n@KIAIJD=JJoAIJ=>lEIDJDAL=lE@F=JD. On?A JDA L=lE@ F=JD EI AIJ=>lEIDA@ JDAn JDA IOIJAm EI CELAn JDA FHoFAH L=lKA. =n@ JDA IAGKAn?AoBmoHFDIEIFHEnJA@JoIJ=n@=H@oKJFKJ.

Separate system into modules 5En?AJDAIOIJAmEIJ=kEnCIJHA=mIoBKJB&JANJ=n@?onLAHJEnCJDAmEnJomoHFDI. JD=JEIMDO@EBBAHAnJmoHFDmo@KlAInAA@JoD=LA=M=OoB@A=lEnCMEJDJDEI. 6DEI =lloMI JDA IOIJAm Jo >A A=IElO mo@EBEA@. ;oKH @E?JEon=HO @=J= IJHK?JKHA =I lonC =I EJ IKFFoHJIFHABENIA=H?DAI JDAF=JDmo@KlAjKIJJ=kAI=lEIJoBFoIIE>lAmoHFDI=n@MoHkIJD=JoKJEJIAlB. JDA Co=l EI JDA kAAF JDA mo@KlAI =I IAF=H=JA =I FoIIE>lA, Io JD=J MDAn =nO onA oB JDA IOIJAmEI=lJAHA@EJ@oAInߣJ?D=nCAJDAIOIJAmEJIAlB.

Role of Modules 6DEI IAF=H=JEon oB JDA IOIJAm EnJo mo@KlAI EI noJ noLAl, EnBoHm=JEon DE@EnC EI F=HJ oB =nOmo@Kl=HIOIJAm,>KJJDEIEIAIFA?E=llOEmFoHJ=nJHAC=H@EnCF=HJIoBl=nCK=CA. FHoCH=mI lEkA BHAAlEnC KIA = IAJ oB BElAI Jo @AJAHmEnA JDA IJHK?JKHA oB JDA IOIJAm. 6DEI MoHkI Jo = FoEnJ, >KJ =J JDA I=mA JEmA EJ EI lEmEJA@ Jo JDA I?oFA oB EnEJE=l FHoCH=mmAH =n@ =@@I =noJDAH lALAl oB En@EHA?JEon =n@ ?omFlANEJO MDE?D FHA?lK@AI JDA Kn@AHIJ=n@EnC oBJDAIOIJAmEJIAlB. MDAn JDA KIAH M=nJ Jo ?D=nCA l=nCK=CA EJߣI =I IEmFlA =I ?omFElEnC = @E?JEon=HO, IAJ oB F=JDI=n@moHFDIBoHJDAIOIJAm. ;oK M=nJ JDA KIAH Jo >A =>lA Jo J=kA =@L=nJ=CA oB JDA IOIJAm =n@ FKJ ALAHOJDEnC JoCAJDAH.

Tokenization 1n oH@AH Jo @A=l MEJD JDA l=HCAIJ =moKnJ oB l=nCK=CAI MEJD no ?D=nCA En JDA FHo?AIIEnC oB JDA Kn@AHlOEnC IOIJAm JDA IOIJAm EI @A=lJ MEJD En = B=IDEon JD=J m=NEmEzAI JDA M=O JD=J l=nCK=CA EI @A=lJ MEJD. L=nCK=CA EI LEAMA@ =I = IAHEAI o ?D=H=?JAHI H=JDAH JD=n MoH@I. MoH@ >oKn@=HEAI =HA @AJAHmEnA@ AnJEHAlO >O JDA @E?JEon=HO MDE?D @AJAHmEnAI =ll JDAFoIIE>lAFHABENAIoBJDAIAnJAn?AIJHA=mJD=J?=nFHoLE@AL=lE@MoH@I. 6DEI m=O IAAm lEkA = M=IJA En MDEJAIF=?A IAF=H=JA@ l=nCK=CAI, MDAHA D=ID >=IA@ mAJD­ o@I on En@ELE@K=l MoH@I m=O >A moHA ABBE?EAnJ lEkA AnClEID >KJ D=I JDA =@L=nJ=CA oB ?=J?DEnC IEmFlA mKlJEMoH@ ANFHAIIEonI lEkA D=H@ @HELA =KJom=JE?=llO. 6DEI @oAI noJ ?=J?D =ll JDA FoIIE>lA mKlJEMoH@ ANFHAIIEonI FoIIE>lA IAA *on@ AJ =l. [?EJA] BoH = lEIJ oB JDAFHo>lAmIoBmKlJEMoH@ANFHAIIEonI=n@JDAEH@AJHEmAnJ=lABBA?JBoHNL2. 6DEI D=I JDA ABBA?J oB FKnJEnC JDA JokAnEz=JEon BHom JDA D=H@?o@A@ =n=lOzAH EJIAlB Jo JDA @E?JEon=HO=n@EJI?onJAnJI,MDE?D=HAHAFl=?=>lA.

48 ­%­

Using the modules for research *OIAF=H=JEnCoKJJDAmo@KlAIJDAIOIJAm?=n>AoFJEmEzA@EnL=HEoKIM=OI. 6DA lEnCKEIJE? IJHK?JKHA oB JDA L=lKAI >AEnC HA=@ EI AnJEHAlO KF Jo JDA MoHFD mo@KlA. 6DA @E?JEon=HO =n@ JDA =n=lOzAH EJIAlB D=LA no E@A= oB JDA EnJAHn=l IJHK?JKHA oB = mHFD. 6DA moHFD mo@KlA =lIo En?lK@AI = IJHEnC BKn?JEon MDE?D =lloMI EJ Jo FHEnJ EJIAlB =I MAll. o>LE­ =JEnC=nOnAA@BoHJDAmoHFDJoknoMJDAIJ=JA. 6DA@E?JEon=HO

Actual implementation of the modules )ll oB JDEI MoHk Jo mo@Kl=HEzA JDA IOIJAm EI mA=nI noJDEnC EB JDA IOIJAm EI noJ ABBE?EAnJ. 0oMALAH FH=?JE?=l ?on?AHnI =HA EmFoHJ=nJ =I MAll. 6DA @=J= @A=lJ MEJD JDA IOIJAm EI l=HCA AnoKCD JD=J JDA IOIJAm EI kAFJ En = l=HCA AnoKCD IEzA >O FKJJEnC JDA IJKBB JoCAJDAH. JDACo=lIDoKl@>AJoIolLA=l=HCAAnoKCDIK>IA?JEonoBJDAmo@KlAI=n@Ioon.

The dictionary module 6DA ?AnJH=l FHo>lAm oB EmFlAmAnJEnC = @E?JEon=HO mo@KlA EI JD=J JDAHA ?=n >A = DKCA =moKnJ oB MoH@I JD=J = IOIJAm nAA@I Jo Kn@AHIJ=n@. 7nkoMn MoH@I =HA @EI=IJAHoKI BoH JDA =??KH=?O oB moHFDoloCE?=l =n=lOIEI, Io =nO ABBA?JELA moHFDoloCE?=l =n=lOzAH MEll HAGKEHA = l=HCA @E?JEon=HOoKHI, 12)@E?[?EJA] EI !'  MoH@I Jo ABBA?JELAlO @A=l MEJD l=nCK=CAF=HIA@=n@EmFlAmAnJA@. 5o Jo @o JDEI MA nAA@ = @E?JEon=HO IJHK?JKHA JD=J EI l=HCA AnoKCD Jo MoHk MEJD >KJ =J JDA I=mAJEmA. 6DAHAEI=DKCAnKm>AHoBMoH@IJD=JMoHkMAllJoCAJDAH. JDAIA =HA MAll Kn@AHIJoo@ FHo>lAmI oB moHFDoloCE?=l =n=lOIEI, JDA JH=@EJEon=l mAJDo@ oB IolLEnC JDEI EI BoH JDA IOIJAm EI Jo IEmFlO MHEJA JDA @E?JEon=HO IJHK?JKHA Jo =n mm=FߣA@ BElA=n@lAJJDAoFAH=JEnCIOIJAmF=CAEn. DoMALAH JDEI EI EnABBE?EAnJ[?EJA] =n@ non FoHJ=>lA, I=LEnC FHo?AIIoH =n@ mAmoHO IFA?EBE? EnBoHm=JEon Jo JDA @=J= BElA. ?KHHAnJ moHFDoloCE?=l =n=lOzAHI CAJ =HoKn@ JDEI FHo>lAm >O ?omFElEnC JDA IJHK?JKHA BoH =n oHECEn=l @E?JEon=HO BElA MDAn JDAO =HA BEHIJ IAJ KF on = IOI­ JAm, >KJ JDEI = IK>oFJEm=l IolKJEon =n@ onA JD=J EI JH=@EJEon=l IolLA@ En oJDAH M=OI En JDA>Alll=>IIJOlA. 9AIolLA@JDAFHo>lAm>OKIEnC=l=OAHA@@E?JEon=HO. JDA m=En FHo>lAm EI JD=J >O noJ KIEnC = D=ID >=IA@ @=J= IJHK?JKHA MA =HA IJK?k MEJD = JHEA >=IA@ IJHK?JKHA MDE?D EI noJ IF=?A ABBE?EAnJ Jo >ACEn MEJD. ) D=ID >=IA@ IJHK?JKHA IK?D =I @>m  MoKl@ >A >AJJAH >KJ JD=J MoKl@ BoH?A JDA IOIJAm Jo EnBAH JDA JokAnI. >O =@oFJEnC = FHABEN >=IA@ =FFHo=?D JDA @E?JEon=HO ?=n =IIECn FoIIE>lA JokAnI =I EJ CoAI, =lloMEnCJDAn=JKH=lFHo?AIIEnCoB=IE=nl=nCK=CAI=IMAll=I-nClEID. ,oAIJDEI>OEmFlAmAnJEnC=F=JHE?E=JHEAMEJDno@AIJD=J=HAkAFJEnL=HEoKIlALAlI. JDA ?AnJH=l FHo>lAm EI JD=J IEn?A ALAHOJDEnC EI FHABEN >=IA@ OoK ALAnJK=llO An@ KF D=LA Jo IA=H?D JDA AnJEHA @=J= IJHK?JKHA. EB OoK @A?omFoIA JDA @E?JEon=HO. OoK ?=n FoJAnJE=llO mEII moHFDI. Io JDA IOIJAm jKIJ KIAI = D=ID J=>lA MDAHA JDA BKn?JEon EI ?omFKJA@ BoH A=?DMoH@. JDEI mA=nI JD=J JDA IOIJAm FoJAnJE=llO @oAI lookKFI En mK?D IloMAH JEmA JD=n = JHEA. DoMALAH >A?=KIA EJ @oAI JDEI >O CoEnC JDHoKCD JDA IOIJAm. JDEI D=I FoJAnJE=llO FooH >AD=LEoH=n@m=O?=KIAm=nOIAAkI. OoKIJEllB=El>A?=KIAEBOoKCAJJoJDAAn@OoKnALAHknoMMDAHAJDAHA=lAn@EI. 5oMACo=>oKJJDEI>OCoEnCJDHoKCDJDAIOIJAm>O

49 ­&­

Morphs LEkAMEIA >O D=LEnC Jo IJoHA !', kAOI En = @=J=>=IA JDA IOIJAm nAA@I Jo Dol@ JDA L=lKAI IJoHA@ En JDoIA kAOI. -=?D moHFD ?onIEIJI oB = F=HJ oB IFAA?D E@ =n@ = L=HEoKI L=lKAI.JDEImA=nIJD=J=moHFDEn?lK@AIon=LAH=CA=>oKJ ! >OJAI oB @=J=N MoH@I + N L=lKAI+OIomAJDEnCI. )lIo L=HEoKI moHFDI =HA mK?D moHA FoFKl=H JD=n oJDAHI. 6DEI mA=nI JD=J JDA IOIJAm nAA@I Jo ?=?DA JDAm En oH@AH Jo CAJ = LAHO Coo@ >AnABEJ. 6DA ?=?DEnC BoH JDA moHFD mo@KlAEImo@AlA@onJDAIK>BonJIEn2l=n'. 6DA FHo>lAm EI JD=J JDA @E?JEon=HO @oAInߣJ knoM JDA lo?=JEon oB AEJDAH. 6DA IOIJAm BEn@I JDA MoHFDI >O ?DA?kEnC JDA ?=?DA L=lKA BEHIJ. 6DA ?=?DA EI EmFlAmAnJA@ =I = D=ID J=>lA. =nOJDEnC JD=J ANEIJI En JDA D=ID =HA JDAn =L=El=>lA. JDA IOIJAm kAAFI =n =CA BoH A=?D oB JDA moHFDI =n@ lEJJlA KIA@ moHFDI =HA FKHCA@ BHom JDA IOIJAm @KHEnC FAHEo@E? C=H>=CA ?ollA?JEonI. nAA@JokAAF=lEIJoBmoHFDI.JD=JEIJDAFHo>lAm.

The Paths module 6DA F=JDI mo@KlA EI HAl=JELAlO IEmFlA. EJ KIAI = D=H@?o@A@ lEm>o =HH=O, ?omFElA@ BHom =n ANJAHn=l m=JHEN BElA. JDEI AIJ=>lEIDAI JDA FoIIE>lA JH=nIEJEonI BHom onA ?om>En=JEon Jo =noJDAH. 6DA F=JD mo@KlA EI IEmEl=H Jo HACKl=H moHFDoloCE?=l =n=lOzAHI, EJ ?onJ=EnI = ?onjK?JEon J=>lA MDE?D BECKHAI oKJ DoM JDA F=JDI =HA ?onnA?JA@, EJ =lIo ?onJ=EnI = ?onnA?JEon m=JHENMDE?DkAAFIJH=?koBDoMJDAL=lKAI=HA?onnA?JA@EnJDAIOIJAm. .En=llO EJ ?onJ=EnI = L=JJE?A MDE?D FHAIAHLAI JDA IJ=JA oB JDA =n=lOzAH, MDAHA JDA L=lKA EI EnJDAIJHEnC,MDE?DF=JDIANEIJ=n@DoMJDAF=JDIIDoKl@>A?l=IIEBEA@.

An easily modifiable tool for research

Data formats 6H=@EJEon=llO moHFDoloCE?=l =n=lOzAHI, lEkA +D=IAn[?EJA] =n@ MA?=>[?EJA], J=kA JDA mo@­ AHn KnEN =FFHo=?D, mm=FߣEnCEJI@=J=IJHK?JKHAIJoANJAHn=lBElAI=n@JDAnJHA=JEnCJDoIA BElAI=IF=HJoBJDAANA?KJ=>lAEJIAlB.

Data Χrganization 0=LAJDHAA@EBBAHAnJJOFAI.

Morphs, the data. Dictionary the matrix. MoHFDI

0=LA Jo m=nK=llO BECKHA oKJ JDA ?=?DA JOFAI. MoHFDI JOFE?=llO D=LA = CHA=J @A=l oB lo?=l­ EJO.5=m,=?mA

Morph handling 2l=n'oBBAHI=HE?Dmo@AlBoH?=?DEnC.

50 ­'­

mrphs sets of files sucks in files based on their values. files ordered according to their commonality. works in a way similar to

JDACo=lEIJo=LoE@mm=F =?=?DEnCIOIJAmIEmEl=HJoBonJI

Disadvantages 1nBAHno @oAInߣJ HA=llO D=LA JDA IAJ oB JoolI JD=J EJ nAA@I Jo >A FHo@K?JELA BoH moHA JoolI. 6oolI lEkA =Mk =HA LAHO KIABKl BoH l=nCK=CA FHo?AIIEnC >A?=KIA JDAO J=kA JANJK=l EnFKJ @ELE@A@ EnJo BEAl@I >O MDEJA IF=?A =n@ =lloM JDAEH A=IElO =??KmKl=JEon =n@ A@EJEnC. 1nBAHnoߣI IDAll MDElAFoMAHEIIJEllJooLAH>oIABoHGKE?k=n@@EHJOIDAllFEFAlEnA?onIJHK?­ JEon. 1J ?=n >A FHAJJO KClO. M=nO oB JDA KnEN ?onLAnJEonI ?=mA BHom IJHE?JlO =I?EE JANJ MDE?D m=kAIEJD=H@BoHJOFoCH=FDE?=l?onLAnJEonIMDE?D=HADKm=nHA=@=>lAlEkA /1.NP/2.Word 9DE?D>A?omAmK?DD=H@AHMDAnJDAO=HAFKJEnJoFH=?JE?AKIEnCoJDAHl=nCK=CAI. 6H=@EJEon=lF=JDBoHm=JI@onߣJlookJD=J>=@EnCHAAk. /Μα/ /µÌλις εβδοµδα >KJ ?D=H=?JAHI MEJD l=HCA ME@JDI =n@ L=lKAI =HA mK?D moHA @EBBE?KlJ Jo LEIK=lEzA A=IElO KIEnC=nA@EJoHlEkA=?mA.MDE?DFHomFJA@moLEnCJDA@=J=BoHm=JIJo=I?EE.

Conclusion -lEmEn=JAI m=nO oB JDA FHo>lAmI =n@ FEJB=llI JD=J ?omA BHom JHOEnC Jo EmFlAmAnJ = Jool BoH=IoBJM=HAJoolIIOIJAm. LEm>o EI = CHA=J l=nCK=CA BoH @oEnC mKlJElEnCK=l FHoCH=mmEnC. *O =lloM JDA l=nCK=CA EJIAlBJoKIAKJB&=n@EnJACH=JEnCEJMEJDJDAIOIJAm. )lIo >O MoHkEnC JDA I=mA M=O =?HoII =H?DEJA?JKHAI OoK @onߣJ nAA@ Jo Co JDHoKCD JDA I=mA EIIKAI JD=J FAoFlA noHm=llO Co JDHoKCD Jo EnJACH=JA MEJD oJDAH JoolI, AIFA?E=llO l=nCK=CAIlEkAJ=L=. 1J =LoE@I JDA FHo>lAmI MEJD +E.A. FAoFlA >AEnC =>lA Jo H=n@omlO JOFA JDEnCI >KJ EJ lAJI JDAKIAHCAJJDAM=OoB@oEnCJDEnCIHECDJ. Nomm=FEnC. .oH?AIm=nOoBJDAIOIJAmߣI@=Hk?oHnAHIEnJoJDAlECDJ. 6DA =?J oB @oEnC JDEI, =n@ m=kEnC JDA L=HEoKI BoHmAHlO EmFlE?EJ oH HA?on@EJA =IFA?JI oB JDA IOIJAm moHA =??AIIE>lA Jo FHoCH=mmAHI m=kAI JDA IOIJAm mK?D moHA =mAn=>lA Jo ANFAHEmAnJ=JEon. 6DAmo@KlA>oKn@=HEAI=HA?lA=H. NonAoBJDEIEIIFA?EBE?JolEm>oFAHIA. >KJlEm>o@oAIFHoLE@A=M=OoB@oEnCJDEnCI JD=J An?oKH=CAI MAll AnCEnAAHA@ FHoCH=mI MEJDlAII?omFlANEJO.

51 ­ ­

Future work 1nBAHnoߣI IDAll JoolI =HA IJEll EnIKBBE?EAnJ. BoH EnIJ=n?A m=nO JHE?kI JD=J MoHk MAll En KnEN E.A.IoHJ|KnEG-?@onߣJMoHkEn1nBAHno. ) moHFDoloCE?=l =n=lOzAH EI LAHO nE?A. 9=nJ Jo ANFAHEmAnJ MEJD = L=HEAJO oB @E?JEon=HO JOFAI. JDA EnBAHno IDAll, MDElA CAnAH=l =n@ FoMAHBKl @oAInߣJ FHoLE@A = nE?A AnLEHonmAnJ BoH @A=lEnC MEJD KJB& J=>Kl=H oKJFKJ. = KJB& =M=HA lEJJlA l=nCK=CA IEmEl=H Jo oH >=IA@ on =MkMoKl@>AE@A=l. 1nBAHnoHA=llOnAA@I=BonJMEJD?omFlAJA?oLAH=CAoBJDAKnE?o@AIAJ. M=kAJDAIOIJAmBKllO?on?KHHAnJ. 9oHk on En?oHFoH=JEnC FolOmoHFDEIm ?oHHA?JlO. JDA =moKnJ oB FHEL=JA @=J=, >HA=kI JDA EnJAHB=?A. AIFA?E=llO En JAHmI oB FolOmoHFDEIm. ?=n En?lK@A =noJDAH EnJAHn=l mo@KlA, >KJ JD=J=@@I?omFlANEJO. +omAKFMEJD=M=OoBm=kEnCJHAAF=JDIlook>AJJAHMDAnKIA@MEJD=JHAAF=JD.

[)I=D=H=] )I=D=H=, M. =n@ M=JIKmoJo, ;., ߢߢ-NJAn@A@ mo@AlI =n@ JoolI BoH DECD- FAHBoHm=n?AF=HJ-oB-IFAA?DJ=CCAHߣߣ,2Ho?.oB+OL1N/5==H>Hü?kAn,/AHm=nO . [+=HHAH=I"BoI] +=HHAH=I, :. =n@ +D=o, 1. =n@ 2=@Ho, L. =n@ 2=@Ho, M., ߢߢ.HAAlEnC: )n oFAn-IoKH?AIKEJAoBl=nCK=CA=n=lOzAHIߣߣ 2Ho?.oBJDA"JDL4-+ ". [5=C ] 5=C, 1.). =n@ *=l@MEn, 6. =n@ *on@, .. =n@ +oFAIJ=kA, ).). =n@ .lE?kEnCAH, ,., ߢߢMKlJEMoH@ -NFHAIIEonI: ) 2=En En JDA NA?k BoH NL2ߣߣ 2Ho?. oB JDA 6DEH@ 1nJAHn=JEon=l +onBAHAn?Aon+omFKJ=JEon=lLEnCKEIJE?I=n@1nJAllECAnJ6ANJ2Ho?AIIEnC}, F=CAI={ -- #}, OA=H={  }, FK>lEIDAH={5FHEnCAH-8AHl=CLon@on,7K}

52 Semaphores in Plan 9

Sape Mullender *All L=>oH=JoHEAI  &)nJMAHF,*AlCEKm

Russ Cox* M16+5)1L +=m>HE@CA,M=II=?DKIAJJI !'

1. Introduction 5Am=FDoHAI =HA noM moHA JD=n " OA=HI ol@. -@ICAH 9.,EjkIJH= @AI?HE>A@ JDAm En -9, %" [,EjkIJH=, '$# En ,KJ?D]. ) IAm=FDoHA EI = non-nAC=JELA EnJACAH MEJD JMo oFAH=JEonI on EJ, P =n@ V. 6DA oHECEn oB JDA n=mAI P =n@ V EI Kn?lA=H. 1n -9, %", ,Ejk­ IJH= ?=llI IAm=FDoHAI seinpalen ,KJ?D BoH IECn=llEnC FoIJI =n@ =IIo?E=JAI V MEJD verhoog En?HAmAnJ/En?HA=IA =n@ P MEJD prolaag, = non-MoH@ HAIAm>lEnC verlaag @A?HAmAnJ/@A?HA=IA. 0A ?onJEnKAI, ‘‘Opm. 2. Vele seinpalen nemen slechts de waarden 0 en 1 aan. In dat geval fungeert de V−operatie als ‘baanvak vrijgeven’; de P− operatie, de tentatieve passering, kan slechts voltooid worden, als de betrokken seinpaal (of seinpalen) op veilig staat en passering impliceert dan een op onveilig zetten.’’ ߢߢ4Am=Hk . M=nO IECn=lI =IIKmA onlO JDA L=lKAI  =n@ . 1n JD=J ?=IA JDA 8-oFAH=JEon BKn?JEonI =I ߢHAlA=IA >lo?kߣ; JDA 2-oFAH=JEon, JDA JAnJ=JELA F=IIEnC, ?=n onlO >A ?omFlAJA@, EB JDA IECn=l oH IECn=lI EnLolLA@ En@E?=JAI ?lA=H, =n@ F=IIEnC JDAn EmFlEAI IAJJEnC EJ Jo IJoF.ߣߣ 6DKI, EJ m=O >A JD=J P =n@ V MAHA EnIFEHA@ >O JDA H=ElM=O JAHmI passeer F=II=n@ verlaat lA=LA. 9A @EI?=H@ JDA H=ElM=O JAHmEnoloCO =n@ KIA JDA l=nCK=CA oB lo?kI: P EI semacquire =n@ V EI semrelease. 6DA + @A?l=H=JEonI=HA: int semacquire(long *addr, int block); long semrelease(long *addr, long count); Semacquire M=EJI BoH JDA IAm=FDoHA L=lKA *addr Jo >A?omA FoIEJELA =n@ JDAn @A?HA­ mAnJI EJ, HAJKHnEnC ; EB JDA block Bl=C EI zAHo, semacquire HAJKHnI  H=JDAH JD=n M=EJ. 1B semacquire EI EnJAHHKFJA@, EJ HAJKHnI ߝ . Semrelease En?HAmAnJI JDA IAm=FDoHA L=lKA >O JDA IFA?EBEA@?oKnJ. 2l=n ' [2EkA AJ =l., ''#] D=I JH=@EJEon=llO KIA@ = @EBBAHAnJ IOn?DHonEz=JEon mA?D=­ nEIm, ?=llA@ HAn@AzLoKI. 4An@AzLoKI EI = IOmmAJHE? mA?D=nEIm; JD=J EI, EJ @oAI noJ =IIECn @EBBAHAnJ HolAI Jo JDA JMo FHo?AIIAI EnLolLA@. 6DA BEHIJ FHo?AII Jo ?=ll HAn­ @AzLoKI MEll >lo?k KnJEl JDA IA?on@ @oAI. 1n ?onJH=IJ, IAm=FDoHAI =HA =n =IOmmAJHE? mA?D=nEIm: JDA FHo?AII ANA?KJEnC semacquire ?=n >lo?k >KJ JDA FHo?AII ANA?KJEnC ______* NoM =J /ooClA, MoKnJ=En 8EAM, +=lEBoHnE= '""!

53 semrelease EI CK=H=nJAA@ noJ Jo. 9A =@@A@ IAm=FDoHAI Jo 2l=n ' Jo FHoLE@A = M=O BoH = HA=l-JEmA FHo?AII Jo M=kA KF =noJDAH FHo?AII MEJDoKJ HKnnEnC JDA HEIk oB >lo?kEnC. 5En?A JDAn,MA D=LA =lIoKIA@IAm=FDoHAIBoHABBE?EAnJ FHo?AIIM=kAKF=n@lo?kEnC.

2. Hardware primitives 6DA EmFlAmAnJ=JEonI En JDEI F=FAH =IIKmA D=H@M=HA IKFFoHJ BoH =JomE? HA=@-mo@EBO- MHEJA oFAH=JEonI on = IEnClA mAmoHO lo?=JEon. 6DA BKn@=mAnJ=l oFAH=JEon EI ߢߢ?omF=HA =n@IM=F,ߣߣ MDE?D>AD=LAIlEkA JDEI+ BKn?JEon cas,>KJ ANA?KJAI=JomE?=llO: int cas(long *addr, long old, long new) { /* Executes atomically. */ if(*addr != old) return 0; *addr = new; return 1; } 1n onA =JomE? oFAH=JEon, cas ?DA?kI MDAJDAH JDA L=lKA *addr EI AGK=l Jo old =n@, EB Io, ?D=nCAIEJ Jo new. 1J HAJKHnI= Bl=CJAllEnCMDAJDAHEJ ?D=nCA@ *addr. OB ?oKHIA, cas EI noJ EmFlAmAnJA@ En +. 1nIJA=@, MA mKIJ EmFlAmAnJ EJ KIEnC IFA­ ?E=l D=H@M=HA EnIJHK?JEonI. )ll mo@AHn FHo?AIIoHI FHoLE@A = M=O Jo EmFlAmAnJ ?omF=HA =n@ IM=F. 6DA N&$ =H?DEJA?JKHA IEn?A JDA "&$ FHoLE@AI = @EHA?J ?omF=HA =n@ IM=F EnIJHK?JEon, +M2:+0/. OJDAH FHo?AIIoHIߞEn?lK@EnC JDA )lFD=, )4M, M125, =n@ 2oMAH2+ߞFHoLE@A = F=EH oB EnIJHK?JEonI ?=llA@ lo=@ lEnkA@ LL =n@ IJoHA ?on@EJEon=l 5+. 6DA LL EnIJHK?JEon HA=@I BHom = mAmoHO lo?=JEon, =n@ 5+ MHEJAI Jo = mAmoHO lo?=JEon onlO EB   EJ M=I JDA mAmoHO lo?=JEon KIA@ En JDA l=IJ LL EnIJHK?JEon, =n@   JD=J lo?=JEon D=I noJ >AAn ?D=nCA@ IEn?A JDA LL. On JDoIA IOIJAmI, ?omF=HA =n@ IM=F ?=n >A EmFlA­ mAnJA@EnJAHmIoB LL =n@ 5+. 6DA EmFlAmAnJ=JEonI =lIo KIA =n =JomE? =@@EJEon oFAH=JEon xadd JD=J =JomE?=llO =@@I Jo = L=lKA En mAmoHO, HAJKHnEnC JDA nAM L=lKA. 9A @onߣJ nAA@ =@@EJEon=l D=H@M=HA IKFFoHJ BoH xadd,IEn?A EJ ?=n>A EmFlAmAnJA@KIEnC cas: long xadd(long *addr, long delta) { long v;

for(;;){ v = *addr; if(cas(addr, v, v+delta)) return v+delta; } }

3. User−space semaphores 9A EmFlAmAnJA@ semacquire =n@ semrelease =I kAHnAl-FHoLE@A@ IOIJAm ?=llI. .oH ABBE?EAn?O, EJ EI KIABKl Jo D=LA = IAm=FDoHA EmFlAmAnJ=JEon JD=J, EB JDAHA EI no ?on­ JAnJEon, ?=n HKn AnJEHAlO En KIAH IF=?A, onlO B=llEnC >=?k on JDA kAHnAl Jo D=n@lA ?on­ JAnJEon. .ECKHA CELAI JDA EmFlAmAnJ=JEon. 6DA KIAH IF=?A IAm=FDoHA, = Usem, ?on­ IEIJIoB = KIAH-lALAl IAm=FDoHA L=lKA u =n@= kAHnAl L=lKA k:

54 typedef struct Usem Usem; struct Usem { long u; long k; }; 9DAn u EI non-nAC=JELA, EJ HAFHAIAnJI JDA =?JK=l IAm=FDoHA L=lKA. 9DAn u EI nAC=JELA, JDA IAm=FDoHA D=I L=lKA zAHo: =?GKEHAHI mKIJ M=EJ on JDA kAHnAl IAm=FDoHA k =n@ HAlA=IAHImKIJ M=kA JDAmKF. void usemacquire(Usem *s) { if(xadd(&s−>u, −1) < 0) while(semacquire(&s−>k, 1) < 0){ /* Interrupted, retry */ } }

void usemrelease(Usem *s) { if(xadd(&s−>u, 1) <= 0) semrelease(&s−>k, 1); } 1B JDA IAm=FDoHA EI Kn?onJAn@A@, JDA xadd En usemacquire MEll HAJKHn = non-nAC=JELA L=lKA, =LoE@EnC JDA kAHnAl ?=ll. 5EmEl=HlO, JDA xadd En usemrelease MEll HAJKHn = FoIEJELA L=lKA,=lIo=LoE@EnCJDA kAHnAl ?=ll.

4. Scheduling 1n JDA 2l=n ' JDHA=@ lE>H=HO, = FHoCH=m EI m=@A KF oB = ?ollA?JEon oB FHo?AIIAI ID=HEnC mAmoHO. ) JDHA=@ EI = ?oHoKJEnA =IIECnA@ Jo = F=HJE?Kl=H FHo?AII. 9EJDEn = FHo?AII, JDHA=@I I?DA@KlA ?ooFAH=JELAlO. -=?D FHo?AII m=n=CAI JDA JDHA=@I =IIECnA@ Jo EJ, =n@ JDA FHo?AII I?DA@KlAHI HKn =lmoIJ En@AFAn@AnJlO. 6DA onA AN?AFJEon EI JD=J = JDHA=@ En onA FHo?AII mECDJ Co Jo IlAAF BoH AN=mFlA, M=EJEnC on = ?D=nnAl oFAH=JEon =n@ >A MokAn KF >O = JDHA=@ En = @EBBAHAnJ FHo?AII. 6DA JMo FHo?AIIAI nAA@ = M=O Jo ?ooH@E­ n=JA, Io JD=J EB JDA BEHIJ D=I no HKnn=>lA JDHA=@I, EJ ?=n Co Jo IlAAF En JDA kAHnAl, =n@ JDAnJDA IA?on@FHo?AII?=nM=kA EJ KF. 6DA IJ=n@=H@ 2l=n ' JDHA=@ lE>H=HO KIAI HAn@AzLoKI Jo ?ooH@En=JA >AJMAAn FHo­ ?AIIAI. 6DA FHo?AIIAI ID=HA =??AII Jo A=?D oJDAHߣI I?DA@KlEnC GKAKAI: onA FHo?AII EI m=nEFKl=JEnC =noJDAHߣI HKn GKAKA. 6DA FHo?AIIAI mKIJ =lIo ID=HA = Bl=C FHoJA?JA@ >O = IFEn lo?k Jo ?ooH@En=JA, Io JD=J AEJDAH >oJD FHo?AIIAI @A?E@A Jo ?=ll HAn@AzLoKI oH nAE­ JDAH@oAI. .oH JDA HA=l-JEmA JDHA=@ lE>H=HO, MA M=nJA@ Jo HAmoLA =I m=nO IoKH?AI oB >lo?kEnC =I FoIIE>lA, En?lK@EnC JDAIA lo?kI. 9A HAFl=?A@ JDA lo?kA@ HKn GKAKA MEJD = non- >lo?kEnC =HH=O->=IA@ EmFlAmAnJ=JEon oB = FHo@K?AH/?onIKmAH GKAKA. 6D=J EmFlAmAn­ J=JEon EI >AOon@ JDA I?oFA oB JDEI F=FAH. )BJAH m=kEnC JD=J ?D=nCA, JDA onlO lo?k HAm=EnEnC En JDA I?DA@KlAH M=I JDA onA FHoJA?JEnC JDA ߢߢMDAJDAH Jo HAn@AzLoKIߣߣ Bl=C. 6o AlEmEn=JA JD=J onA, MA HAFl=?A@ JDA HAn@AzLoKI MEJD = KIAH-IF=?A IAm=FDoHA ?oKnJ­ EnCJDA nKm>AHoB JDHA=@IonJDA GKAKA.

55 6o M=EJ BoH = JDHA=@ Jo HKn, JDA FHo?AIIߣI I?DA@KlAH @A?HAmAnJI JDA IAm=FDoHA. 1B JDA HKn GKAKA EI AmFJO, JDA usemacquire MEll >lo?k KnJEl EJ EI noJ. 0=LEnC @onA Io, EJ EI CK=H=nJAA@JD=J JDAHA EI= JDHA=@onJDA HKnGKAKA: // Get next thread to run static Thread* runthread(void) { Proc *p;

p = thisproc(); usemacquire(&p−>nready); return qget(&p−>ready); } 5EmEl=HlO, Jo M=kA KF = JDHA=@ ALAn onA En =noJDAH FHo?AII, EJ IKBBE?AI Jo =@@ JDA JDHA=@JoEJIFHo?AIIߣIHKnGKAKA =n@JDAnEn?HAmAnJ JDA IAm=FDoHA: // Wake up thread t to run in its process. static void wakeup(Thread *t) { Proc *p;

p = t−>p; qput(&p−>ready, t); usemrelease(&p−>nready); } 6DEI EmFlAmAnJ=JEon HAmoLAI JDA nAA@ BoH JDA Bl=C =n@ JDA lo?k; moHA EmFoHJ=nJlO, JDA FHo?AII ANA?KJEnC threadwakeup EI CK=H=nJAA@ nALAH Jo >lo?k, >A?=KIA EJ ANA?KJAI usemrelease,noJ usemacquire.

5. Replacing spin locks 6DA 2l=n'KIAH-lALAl Lock EmFlAmAnJ=JEonEI =n =@=FJA@ LAHIEon oB JDA onA KIA@ En JDA kAHnAl. ) lo?k EI HAFHAIAnJA@ >O =n EnJACAH L=lKA:  EI Knlo?kA@, non-zAHo EI lo?kA@. ) FHo?AIIJHEAIJoCH=>JDA lo?k >O KIEnC = JAIJ-=n@-IAJ EnIJHK?JEon Jo ?DA?k MDAJDAH JDA L=lKA EI  =n@, EB Io, IAJ EJ Jo = non-zAHo L=lKA. 1B JDA lo?k EI Kn=L=El=>lA, JDA FHo?AII looFI, JHOEnC HAFA=JA@lO. 1n = mKlJEFHo?AIIoH kAHnAl, JDEI EI = BEnA lo?k EmFlAmAnJ=JEon: JDA lo?k EI DAl@ >O =noJDAH FHo?AIIoH, MDE?D MEll Knlo?k EJ Ioon. 1n KIAH IF=?A, JDEI EmFlAmAnJ=JEon D=I >=@ EnJAH=?JEonI MEJD JDA I?DA@KlAH: EB JDA lo?k EI DAl@ >O =noJDAH FHo?AII JD=J D=I >AAn FHAAmFJA@, IFEnnEnC BoH JDA lo?k MEll noJ =??omFlEID =nOJDEnC. 6DA KIAH-lALAl lo?k EmFlAmAnJ=JEon =@@HAIIAI JDEI >O HAI?DA@KlEnC EJIAlB MEJD (0) >AJMAAn =JJAmFJI =BJAH JDA BEHIJ JDoKI=n@ KnIK??AIIBKl =JJAmFJI. -LAnJK=llO EJ >=?kI oBB moHA,IlAAFEnCBoHmEllEIA?on@I=J = JEmA >AJMAAnlo?k =JJAmFJI. 9A HAFl=?A@ JDAIA IFEn lo?kI MEJD = IAm=FDoHA->=IA@ EmFlAmAnJ=JEon. 7IEnC IAm=FDoHAI =lloMI JDA FHo?AII Jo JAll JDA kAHnAl AN=?JlO MD=J EJ EI M=EJEnC BoH, =LoE@EnC >=@ EnJAH=?JEonI MEJD JDA I?DA@KlAH lEkA JDA onA =>oLA. 6DA IAm=FDoHA->=IA@ EmFlA­ mAnJ=JEonHAFHAIAnJI= lo?k =IJMoL=lKAI,= KIAH-lALAl kAO=n@= kAHnAl IAm=FDoHA: struct Lock { long key; long sem; }; 6DA key ?oKnJI JDA nKm>AH oB FHo?AIIAI EnJAHAIJA@ En Dol@EnC JDA lo?k, En?lK@EnC JDA

56 onA JD=J @oAI Dol@ EJ. 6DKI EB key EI , JDA lo?k EI Knlo?kA@. 1B key EI , JDA lo?k EI DAl@. 1B key EI l=HCAH JD=n , JDA lo?k EI DAl@ >O onA FHo?AII =n@ JDAHA =HA keyߝ FHo?AIIAI M=EJEnCJo=?GKEHA EJ. 6DoIA FHo?AIIAIM=EJ onJDA IAm=FDoHA sem. void lock(Lock *l) { if(xadd(&l−>key, 1) == 1) return; // changed from 0 −> 1: we hold lock // otherwise wait in kernel while(semacquire(&l−>sem, 1) < 0){ /* interrupted; try again */ } }

void unlock(Lock *l) { if(xadd(&l−>key, −1) == 0) return; // changed from 1 −> 0: no contention semrelease(&l−>sem, 1); } LEkA JDA KIAH-lALAl IAm=FDoHA EmFlAmAnJ=JEon @AI?HE>A@ =>oLA, JDA lo?k EmFlAmAnJ=­ JEonD=n@lAIJDA Kn?onJAn@A@?=IA MEJDoKJ nAA@EnCJoAnJAHJDA kAHnAl. 6DA onA IECnEBE?=nJ @EBBAHAn?A >AJMAAn JDA KIAH-lALAl IAm=FDoHAI =>oLA =n@ JDA IAm=FDoHA->=IA@ lo?kI @AI?HE>A@ DAHA EI JDA EnJAHFHAJ=JEon oB JDA KIAH-IF=?A L=lKA. 2l=n ' ?onLAnJEon HAGKEHAI JD=J = zAHoA@ Lock IJHK?JKHA >A =n Knlo?kA@ lo?k. 1n ?on­ JH=IJ, = zAHoA@ Usem IJHK?JKHA EI =n=loCoKI Jo = lo?kA@ lo?k: = usemacquire on = zAHoA@ Usem MEll >lo?k.

6. Kernel Implementation of Semaphores 1nIE@A JDA 2l=n ' kAHnAl, JDAHA =HA JMo kEn@I oB lo?kI: JDA IFEn lo?k Lock IFEnI KnJEl JDA lo?k EI =L=El=>lA, =n@ JDA GKAKEnC lo?k QLock HAI?DA@KlAI JDA ?KHHAnJ FHo?AII KnJEl JDA lo?k EI =L=El=>lA. *A?=KIA =??AIIEnC KIAH mAmoHO mECDJ ?=KIA = lAnCJDO F=CA B=KlJ, JDA kAHnAl @oAI noJ =lloM = FHo?AII Jo Dol@ = Lock MDElA =??AIIEnC KIAH mAmoHO. 5En?A JDA IAm=FDoHA EI IJoHA@ En KIAH mAmoHO, JDAn, JDA o>LEoKI EmFlAmAnJ=JEon EI Jo =?GKEHA = QLock, FAHBoHm JDA IAm=FDoHA oFAH=JEonI, =n@ JDAn HAlA=IA EJ. 7nBoHJKn=JAlO, JDEI EmFlAmAnJ=JEon ?oKl@ ?=KIA semrelease Jo HAI?DA@KlA MDElA =?GKEHEnC JDA QLock, nAC=J­ EnC JDA m=En >AnABEJ oB IAm=FDoHAI BoH HA=l-JEmA FHo?AIIAI. ) moHA ?omFlAN EmFlA­ mAnJ=JEon EI nAA@A@. 6DEI IA?JEon @o?KmAnJI JDA EmFlAmAnJ=JEon. 1J EI noJ nA?AII=HO JoKn@AHIJ=n@JDA HAIJ oB JDA F=FAH=n@?=n>A IkEFFA@onBEHIJ HA=@EnC. -=?D semacquire ?=ll HA?oH@I EJI F=H=mAJAHI En = Sema @=J= IJHK?JKHA =n@ =@@I EJ Jo = lEIJ oB =?JELA ?=llI =IIo?E=JA@ MEJD = F=HJE?Kl=H Segment = ID=HA@ mAmoHO HACEon. 6DA Sema IJHK?JKHA ?onJ=EnI = kAHnAl Rendez BoH KIA >O IlAAF =n@ M=kAKF IAA [2EkA AJ =l., '' ],JDA =@@HAII,=n@= waiting Bl=C:

57 struct Sema { Rendez; long *addr; int waiting; Sema *next; Sema *prev; }; 6DA lEIJ EI FHoJA?JA@ >O = Lock, MDE?D ?=nnoJ ?=KIA JDA FHo?AII Jo HAI?DA@KlA. 6DA IAm=FDoHA L=lKA *addr EI IJoHA@ En KIAH mAmoHO. 6DKI, MA ?=n =??AII JDA lEIJ onlO MDAn Dol@EnC JDA lo?k =n@ MA ?=n =??AII JDA IAm=FDoHA L=lKA onlO MDAn noJ Dol@EnC JDA lo?k. 6DA DAlFAHBKn?JEonI void semqueue(Segment *s, long *addr, Sema *p); void semdequeue(Segment *s, long *addr, Sema *p); void semwakeup(Segment *s, long *addr, int n); =ll m=nEFKl=JA JDA IACmAnJߣI lEIJ oB Sema IJHK?JKHAI. 6DAO =?GKEHA JDA =IIo?E=JA@ Lock, FAHBoHm JDAEH oFAH=JEonI, =n@ HAlA=IA JDA lo?k >ABoHA HAJKHnEnC. Semqueue =n@ semdequeue =@@ p Jo oH HAmoLA p BHom JDA lEIJ. Semwakeup M=lkI JDA lEIJ lookEnC BoH n Sema IJHK?JKHAI MEJD p.waiting IAJ. 1J ?lA=HI p.waiting =n@ JDAn M=kAI KF JDA ?oHHA­ IFon@EnCFHo?AII. 7IEnC JDoIA DAlFAH BKn?JEonI, JDA >=IE? EmFlAmAnJ=JEon oB semacquire =n@ semrelease EI: int semacquire(Segment *s, long *addr) { Sema phore;

semqueue(s, addr, &phore); for(;;){ phore.waiting = 1; if(canacquire(addr)) break; sleep(&phore, semawoke); } semdequeue(s, &phore); semwakeup(s, addr, 1); return 1; }

long semrelease(Segment *s, long *addr, long n) { long v;

v = xadd(addr, n); semwakeup(s, addr, n); return v; } 6DEI LAHIEon omEJI JDA @AJ=ElI =IIo?E=JA@ MEJD HAJKHnEnC ߝ MDAn EnJAHHKFJA@ =n@ =lIo MEJDnon->lo?kEnC?=llI. Semacquire =@@I = Sema Jo JDA IACmAnJߣI lEIJ =n@ IAJI phore.waiting. 6DAn EJ =JJAmFJI Jo =?GKEHA JDA IAm=FDoHA. 1B EJ EI KnIK??AIIBKl, EJ CoAI Jo IlAAF. 6o =LoE@ mEIIA@ M=kAKFI, sleep ?=llI semawoke >ABoHA ?ommEJJEnC Jo IlAAFEnC; semawoke IEmFlO

58 ?DA?kI phore.waiting. -LAnJK=llO, canacquire HAJKHnI JHKA, >HA=kEnC oKJ oB JDA looF. 6DAn semacquire HAmoLAIEJI Sema BHomJDA lEIJ =n@HAJKHnI. 6DA ?=ll Jo semwakeup =J JDA An@ oB semacquire ?oHHA?JI = IK>JlA H=?A JD=J MA BoKn@ KIEnC 5FEn. 5KFFoIA FHo?AII ) ?=llI semacquire =n@ JDA IAm=FDoHA D=I L=lKA . Semacquire GKAKAI EJI Sema =n@ IAJI phore.waiting, canacquire IK??AA@I JDA IAm=­ FDoHA L=lKA EI noM , =n@ semacquire >HA=kI oKJ oB JDA looF. 6DAn FHo?AII * ?=llI semacquire: EJ =@@I EJIAlB Jo JDA lEIJ, B=ElI Jo =?GKEHA JDA IAm=FDoHA JDA L=lKA EI , =n@ CoAI Jo IlAAF. NoM FHo?AII + ?=llI semrelease: EJ En?HAmAnJI JDA IAm=FDoHA JDA L=lKA EI noM  =n@ lookI BoH = IEnClA Sema En JDA lEIJ Jo M=kA KF. 1J BEn@I )ߣI, ?DA?kI JD=J phore.waiting EI IAJ, =n@ JDAn ?=llI JDA kAHnAl wakeup Jo M=kA ). 7nBoHJKn=JAlO, ) nALAH MAnJ Jo IlAAF. 6DA M=kAKF EI loIJ on ), MDE?D D=@ =lHA=@O =?GKEHA@ JDA IAm=­ FDoHA. 1B ) IEmFlO HAmoLA@ EJI Sema BHom JDA lEIJ =n@ HAJKHnA@, JDA IAm=FDoHA L=lKA MoKl@ >A MEJD * IJEll =IlAAF. 6o =??oKnJ BoH JDA FoIIE>lO loIJ M=kAKF, ) mKIJ JHECCAH onA ANJH= semwakeup =I EJ HAJKHnI. 6DEI =LoE@I JDA H=?A, =J JDA ?oIJ oB =n KnnA?AII=HO >KJ D=HmlAIIM=kAKFMDAnJDA H=?A D=InoJ D=FFAnA@.

7. Performance 6o mA=IKHA JDA ?oIJ oB IAm=FDoHA IOn?DHonEz=JEon, MA MHoJA = FHoCH=m En MDE?D JMo FHo?AIIAIFEnC-FonC>AJMAAnJMoIAm=FDoHAI: 2Ho?AII >lo?kIonJDA =?GKEIEJEonoB 5Am=FDoHA , 2Ho?AII HAlA=IAI5Am=FDoHA =n@>lo?kIon5Am=FDoHA , 2Ho?AII HAlA=IAI5Am=FDoHA =n@>lo?kIon5Am=FDoHA , 6DEI looF ANA?KJAI = mEllEon JEmAI. 9A =lIo JEmA@ = FHoCH=m JD=J @oAI JMo mEllEon =?GKEHAI =n@ JMo mEllEon HAlA=IAI on = IAm=FDoHA EnEJE=lEzA@ JoJMomEllEon,IoJD=J nonA oB JDA ?=llI MoKl@ >lo?k. 1n >oJD ?=IAI, JDAHA MAHA = JoJ=l oB BoKH mEllEon IOIJAm ?=llI; JDA FEnC-FonC?=IA =@@IJMomEllEon?onJANJ IMEJ?DAI. 6=>lA CELAIJDA HAIKlJI.

time per system call (microseconds) ______processor cpus ping−pong semacquire semrelease 2AnJEKm111/:Aon,#'&M0z . & .!# .' 2AnJEKm111/:Aon,%'%M0z .&&% .'"' .!& 2AnJEKm18/:Aon, '$M0z " .'% .!& .&" )M,$",  M0z .& . $$ .! $

Table 1 5Am=FDoHAIOIJAm?=llFAHBoHm=n?A.

time per lock operation (microseconds) ______processor cpus spin locks locks 2AnJEKm111/:Aon,#'&M0z #." #." 2AnJEKm111/:Aon,%'%M0z &. #.$ )M,$",  M0z .$ .# 2AnJEKm18/:Aon, '$M0z " "!.& ".'

Table 2 2AHBoHm=n?AoBIFEnlo?kILAHIKIIAm=FDoHAlo?kI.

NANJ, MA lookA@ =J lo?k FAHBoHm=n?A, ?omF=HEnC JDA ?onLAnJEon=l 2l=n ' lo?kI BHom libc Jo JDA nAM onAI KIEnC IAm=FDoHAI BoH IlAAF =n@ M=kAKF. 9A H=n ,oKC M?1lHoOߣI FoMAH IAHEAI FHoCH=m [M?1lHoO, ''], MDE?D IFAn@I =lmoIJ =ll EJI JEmA En ?D=nnAl ?ommKnE?=JEon. 6DA 2l=n ' JDHA=@ lE>H=HOߣI ?D=nnAl EmFlAmAnJ=JEon KIAI =

59 IEnClA Clo>=l lo?k Jo ?ooH@En=JA =ll ?D=nnAl =?JELEJO, En@K?EnC = l=HCA =moKnJ oB lo?k ?on­ JAnJEon. 6DA =FFlE?=JEon ?HA=JAI = JDoKI=n@ FHo?AIIAI =n@ m=kAI %,$! lo?k ?=llI. 6DA nKm>AH oB lo?kI En JDA IAm=FDoHA LAHIEon JD=J HAGKEHA M=EJEnC E.A., = IAm=?GKEHA EI @onA L=HEAI MEl@lO. 1n  HKnI, JDA Im=llAIJ nKm>AH MA I=M M=I %, JDA l=HCAIJ M=I "',=n@JDA =LAH=CA M=I &&. 6=>lA IDoMI JDA FAHBoHm=n?A HAIKlJI. 5KHFHEIEnClO, JDA FAHBoHm=n?A @EBBAHAn?A M=I moIJ FHonoKn?A@ on mKlJEFHo?AIIoHI. N=ELAlO, onA MoKl@ ANFA?J JD=J IFEnnEnC MoKl@ D=LA IomA >AnABEJ on mKlJEFHo?AIIoHI MDAHA=I EJ ?oKl@ D=LA no >AnABEJ on KnEFHo?AIIoHI, >KJ EJ JKHnI oKJ JD=J IFEnnEnC MEJDoKJ HAI?DA@KlEnC JDA BEHIJ  JHEAI D=I no ABBA?J on FAHBoHm=n?A. +onJAnJEon onlO o??KHI IomA # oH Io JEmAI, =n@ JDA JEmA EJ J=kAI Jo IFEn #, JEmAI EI En JDA noEIA. 6DA @EBBAHAn?A >AJMAAn KnEFHo?AI­ IoHI =n@ mKlJEFHo?AIIoHI DAHA EI JD=J on KnEFHo?AIIoHI, JDA BEHIJ sleep(0) MEll FKJ JDA FHo?AII M=EJEnC BoH JDA lo?k =J JDA >=?k oB JDA HA=@O GKAKA Io JD=J, >O JDA JEmA EJ EI I?DA@KlA@ =C=En, JDA lo?k MEll lEkAlO >A =L=El=>lA. On mKlJEFHo?AIIIoHI, ?onJAnJEon BHom oJDAH FHo?AIIAI HKnnEnC IEmKlJ=nAoKIlO m=kAI OEAl@EnC lAII ABBA?JELA. 1J EI =lIo lEkAlO JD=J JDA HAFA=JA@ =JomE? HA=@-mo@EBO-MHEJA EnIJHK?JEonI, =I En JDA JECDJ looF oB JDA IFEn lo?k,?=nIloM JDA AnJEHA mKlJEFHo?AIIoH. 6DA FAHBoHm=n?A oB JDA IAm=FDoHA->=IA@ lo?k EmFlAmAnJ=JEon EI IomAJEmAI mK?D >AJJAH, =n@ nALAH noJE?A=>lO MoHIA, JD=n JDA IFEn lo?kI. 9A MEll HAFl=?A JDA IFEn lo?k EmFlAmAnJ=JEonEnJDA 2l=n'@EIJHE>KJEonIoon.

8. Comparison with other approaches )nO oFAH=JEnC IOIJAm MEJD ?ooFAH=JEnC FHo?AIIAI mKIJ FHoLE@A =n EnJAHFHo?AII IOn?DHonEz=JEon mA?D=nEIm. 1J EI EnIJHK?JELA Jo ?onJH=IJ JDA IAm=FDoHAI @AI?HE>A@ DAHA MEJDmA?D=nEImIEnoJDAHIOIJAmI. M=nO IOIJAmIߞBoH AN=mFlA, *5,, M=?D, O5 :, =n@ ALAn 5OIJAm 8 7N1:ߞFHoLE@A IAm=FDoHAI [*=?D, '&$]. 1n =ll JDoIA IOIJAmI, IAm=FDoHAI mKIJ >A ANFlE?EJlO =llo?=JA@ =n@ @A=llo?=JA@, m=kEnC JDAm moHA ?Km>AHIomA Jo KIA JD=n semacquire =n@ semrelease. 9oHIA, IAm=FDoHAI En JDoIA IOIJAmI o??KFO = Clo>=l E@ IF=?A, Io JD=J EJ EI FoIIE>lA Jo HKn JDA IOIJAm oKJ oB IAm=FDoHAI jKIJ >O HKnnEnC FHoCH=mI JD=J =llo?=JA IAm=FDoHAI >KJ nAClA?J Jo @A=llo?=JA JDAm oH ?H=ID. 6DA 2l=n ' IAm=FDoHAI E@AnJEBO IAm=FDoHAI >O = ID=HA@ mAmoHO lo?=JEon: JMo FHo?AIIAI =HA J=lkEnC =>oKJ JDA I=mA IAm=FDoHA EB *addr EI JDA I=mA MoH@ oB FDOIE?=l mAmoHO En >oJD. .KHJDAH, JDAHA EI no kAHnAl-HAIE@AnJ IAm=FDoHA IJ=JA AN?AFJ MDAn semacquire EI >lo?kEnC. 6DEI m=kAI JDA IAm=FDoHA lA=kIoB 5OIJAm8 EmFoIIE>lA. LEnKN FHoLE@AI = loMAH-lALAl IOIJAm ?=ll n=mA@ BKJAN [.H=nkA =n@ 4KIIAll,  ]. .KJAN EI AIIAnJE=llO ߢߢ?omF=HA =n@ IlAAF,ߣߣ m=kEnC EJ = Coo@ m=J?D BoH ?omF=HA =n@ IM=F->=IA@ =lCoHEJDmI. .KJAN =lIo m=J?DAI FHo?AIIAI >=IA@ on ID=HA@ FDOIE?=l mAm­ oHO, =LoE@EnC JDA 5OIJAm 8 lA=k FHo>lAm. *A?=KIA BKJAN onlO FHoLE@AI ߢߢ?omF=HA =n@ IlAAFߣߣ =n@ ߢߢM=kAKF,ߣߣ BKJAN->=IA@ =lCoHEJDmI =HA HAGKEHA@ Jo D=n@lA JDA Kn?onJAn@A@ ?=IAI En KIAH IF=?A, lEkA oKH KIAH-lALAl IAm=FDoHA =n@ nAM lo?k EmFlAmAnJ=JEonI @o. 6DEI m=kAI BKJAN->=IA@ EmFlAmAnJ=JEonI ABBE?EAnJ; KnBoHJKn=JAlO, JDAO =HA =lIo GKEJA IK>JlA. 6DA oHECEn=l AN=mFlA ?o@A @EIJHE>KJA@ MEJD BKJANAI M=I MHonC; = ?oHHA?J LAHIEon M=I onlO FK>lEIDA@ = OA=H l=JAH [,HAFFAH, !]. 1n ?onJH=IJ, IAm=FDoHAI =HA lAII CAn­ AH=l >KJ A=IEAHJoKn@AHIJ=n@=n@JoKIA ?oHHA?JlO.

60 References [*=?D, '&$] M.J.*=?D, The Design of the UNIX Operating System,2HAnJE?A 0=ll, '&$ [,EjkIJH=, '$#] -.9.,EjkIJH=,ߢߢOLAH5AEnF=lAnߣߣ, EWD74, '$#. DJJF://MMM.?I.KJAN=I.A@K/KIAHI/-9,/AM@NN/-9,%".2,., DJJF://MMM.?I.KJAN=I.A@K/KIAHI/-9,/JH=nI?HEFJEonI/-9,NN/-9,%".DJml [,HAFFAH, !] 7.,HAFFAH,ߢߢ.KJANAI=HA 6HE?kO,ߣߣ FK>lEIDA@onlEnA =J DJJF://FAoFlA.HA@D=J.?om/@HAFFAH/BKJAN.F@B. [.H=nkA =n@4KIIAll,  ] ߢߢ.KII, .KJANAI, =n@ .KHMo?kI: .=IJ 7IAHlALAl Lo?kEnC En LEnKN,ߣߣ Proceedings of the 2002 Ottawa Linux Symposium,OJJ=M=,+=n=@=,  ,FF."%'ߝ"'#. [0olzm=nn, '' ] /.J.0olzm=nn, Design and Validation of Computer Protocols,2HAnJE?A 0=ll, '' [2EkA AJ =l., '' ] 4. 2EkA, ,. 2HAIoJJo, K. 6DomFIon, =n@ /. 0olzm=nn, ߢߢ2Ho?AII IlAAF =n@ M=kAKF on = ID=HA@ mAmoHO mKlJEFHo?AIIoH,ߣߣ Proceedings of the Spring 1991 EurOpen Conference,6HomIø,NoHM=O, '' ,FF. $ ߝ $$. [2EkA AJ =l., ''#] 4. 2EkA, ,. 2HAIoJJo, 5. ,oHM=H@, *. .l=n@HAn=, K. 6DomFIon, 0. 6HE?kAO, 2. 9EnJAH­ >oJJom, ߢߢ2l=n ' BHom *All L=>Iߣߣ, Computing Systems, 8!, 5KmmAH ''#, FF. ߝ #" [2l=n', ] Plan 9 Manual,!H@A@EJEonFK>lEIDA@onlEnA =J DJJF://Fl=n'.>All-l=>I.?om/IOI/m=n

61

62 v9fb: A remote framebuffer infrastructure for Linux

Abhishek Kulkarni, Latchesar Ionkov Los Alamos National Laboratory {kulkarni,lionkov}@lanl.gov

ABSTRACT v9fb is a software infrastructure that allows extending framebuffer devices in Linux over the network by providing an abstraction to them in the form of a filesystem hierarchy. Framebuffer based graphic devices export a synthetic filesystem which offers a simple and easy-to-use interface for performing common framebuffer operations. Remote framebuffer devices could be accessed over the network using the 9P protocol support in Linux. We describe the infrastructure in detail and review some of the benefits it offers similar to Plan 9 distributed systems. We discuss the applications of this infrastructure to remotely display and run interactive applications on a terminal while offloading the computation to remote servers, and more importantly the flexibility it offers in driving tiled-display walls by aggregating graphic devices in the network.

1. Motivation The framebuffer device in Linux offers an abstraction for the graphics hardware so that the applications using them do not have to bother about the low-level hardware interface to the device. Since the framebuffer is represented as a character device, a userspace application can open, read and write to it as a regular file. However, performing several routine graphic device operations like setting the resolution, fetching the color palette involves making use of a device-specific system call. This makes it difficult to export these devices as a network filesystem hierarchy. Several remote display protocols for exchanging graphics over the network already exist. The widely used in Linux is inherently based on a client-server model and imple- ments the X display protocol to exchange bitmap display content between the client and the server. It, however, has been a target of much criticism since the early days[2] because of its overly complex architecture, lack of authentication in the protocol and the limited configura- bility in its client-server setup. Exporting raw pixel data of the framebuffer device makes it possible to run a window system on the CPU server. With the recent ongoing work on per- container device in the Linux kernel, this infrastructure provides the foundation for implementing a multiplexing window system similar to Rio [7] for Linux. Remote display provides a way to interact with geographically distributed resources which are not within the physical proximity of the user. In addition to being used for remote display, v9fb can also be used in a few other interesting scenarios where it is not possible to use these other protocols. For instance, v9fb provides an alternative to monitoring the boot process of a remote machine in a network. This helps in cluster environments where the nodes are not equipped with a serial console to check the boot activity remotely. The booting node mounts the remote framebuffer device exported by the control node and the console of the node is mapped onto the remote framebuffer. The main motivation for this infrastructure is to ease the setup of tiled-display walls for modeling and simulation of scientific data. High-resolution displays are increasingly being used for visualization of large datasets stored at a central storage facility. Display walls made out of commodity clusters are closely tied to the display nodes and do not allow for dynamic configurations. Developing simulation and modeling applications for these high-resolution tiled display walls is typically done using message passing libraries, new programming models or software that use proxies to stream graphic commands over the network [11]. v9fb transparently aggregates the graphic devices in a network and exports a network attached framebuffer thus allowing greater flexibility in setting up a visualization cluster. Network-centric visualization is invariably favored since it ensures integrity and security of the data being maintained at

63 a central location [6]. The application program is provided with a single logical view of the framebuffer device and thus requires no modifications to its code. 2. Introduction Everything in Plan 9, including the graphics infrastructure, is implemented as a file server [8]. The file metaphor describes a well-defined interface to interact with all the resources in a distributed system. This makes it easy to work with the system, keeping it simple yet powerful. Raster graphics capability in Plan 9 is provided by devices like /dev/draw, /dev/screen and /dev/window. Along with the input and console devices, Plan 9 offers a highly configurable and customizable window system that works equally well over the network [7]. Despite considerable efforts, graphics in Linux remains poorly integrated with the rest of the system. The limitations of running the X server as a super user (root) further allows security loopholes which could be used to compromise the system. The framebuffer device abstraction was introduced in Linux starting with kernel version 2.1.107 [12]. The framebuffer device is an abstraction for the graphics hardware and is responsible for initializing the hardware, determin- ing the hardware configuration and capabilities, allocating memory for the graphics hardware and providing common routines to interact with the graphics hardware. The Linux kernel contains drivers that support several different video hardware devices. The v9fb infrastructure exports the raw framebuffer memory and its operations as files. This model could be further extended to support specialized graphics hardware like Graphics Processing Units (GPUs). The Linux kernel 2.6 offers support for the 9P protocol in the form of loadable kernel modules [1]. This allows the kernel to communicate with synthetic fileservers using the 9P distributed resource sharing protocol. v9fb leverages this support to implement a pseudo-framebuffer device which acts as an in-kernel 9P client that communicates with a framebuffer fileserver. The framebuffer appears as a regular character device to the applications using it. Every operation on this device is transparently translated into a 9P message that is sent across to the remote framebuffer fileserver. v9fb can work on any of the transport mechanisms like TCP or virtio offered by the 9P2000 implementation in the Linux kernel.

Figure 1: The local framebuffer device is exported by v9fbfs and mounted in the of a remote CPU server which can draw to the remote device

The synthetic framebuffer filesystem v9fbfs exports a hierarchy that corresponds to various framebuffer operations which can be executed just by reading off or writing to these files. This also allows the framebuffer devices to be mounted locally and to interact with them as if they were local devices as shown in Figure 1. v9fbfs runs on all the display nodes in a visualization cluster and permits a highly-configurable and dynamic setup in which remote display devices can be attached or detached to rendering nodes based on their processing load. v9fb is scalable and can be optimized to support many display devices driving a tiled display wall with an effective resolution of over million pixels. Coupled with the XCPU cluster management framework [4], this provides a holistic high-

64 performance visualization environment that is easy to monitor and maintain. It allows a clear segregation of the display nodes from the render nodes and supports heterogeneous display hardware setup as a result of the framebuffer abstraction. In many cases, simple pixel-based remote display can deliver superior performance than the more complex designs [14] based on other thin-client platform designs. The framebuffer syn- thetic filesystems allow adding multiple layers above the framebuffer much easier. Compression, encryption or the support for high-level drawing primitives on top of the framebuffer can be easily added without affecting the whole model.

Figure 2: Running simulation and modeling programs directly on a hardware-accelerated frame- buffer in absence of the X11 window system

Hardware-accelerated framebuffer makes use of the GPU operations to render graphics on the framebuffer device. Several libraries can use the framebuffer as a target to display high- resolution 2D and 3D graphics. With some of the upcoming changes in the Linux graphics stack like the changes in DRM (Direct Rendering Manager) and Gallium3D, the new proposed architecture for 3D graphics drivers, it would be much easier to display 3D hardware-accelerated graphics on the framebuffer without needing the X server at all as shown in Figure 2. As The framebuffer can be utilized as a drawing surface by the OpenGL applications, the X server and many other graphic drawing libraries like Simple DirectMedia Layer (SDL) or General Graphics Interface (GGI). The remainder of this paper is organized as follows. In Section 3, we look at some of the related work on remote visualization systems and network-attached framebuffers. Section 4 offers a detailed design overview of the v9fb infrastructure describing how each component in the system interacts with the others. The actual implementation details are discussed in Section 5. We conclude by mentioning some of the future work in the last section. 3. Related Work A number of existing proprietary solutions for remote visualization are available. Along with parallel graphics rendering toolkits and cluster management tools, these solutions provide a complete software environment for large-scale modeling and simulations. HP’s Remote Graphics software, Sun’s Visualization System and SGI’s Remote Visualization are among many other proprietary solutions that offer remote access to 2D and 3D graphics. Most of these remote display solutions primarily rely on VNC which uses the Remote Framebuffer Protocol (RFB) to exchange display updates over the network. Tiled display walls usually use pixel-based streaming software to stream the rendered data to the display nodes or a network attached framebuffer. The Scalable Adaptive Graphics Envi- ronment (SAGE), developed at the University of Illinois Chicago, is a distributed visualization architecture specifically designed for decoupling graphics rendering from the graphics display [5]. SAGE dispatches visualization jobs for rendering to the appropriate resource in a cluster and the resultant pixel data to the remote display. Others, like TeraVision, JuxtaView

65 also provide an infrastructure for remotely displaying imagery in a cluster. OpenGL toolkits for cluster-based rendering like Chromium [3] or VirtualGL use techniques like function call interposing to ”snoop” the OpenGL protocol and transfer it over the wire to the remote proxies in a cluster. This techniques make it difficult to keep up with the evolving standards and specifications described by OpenGL and add to the overhead in terms of complexity of the architecture. IBM’s Scalable Graphics Engine (SGE-3) offers a hardware-based approach to a network- attached framebuffer[9, 13]. It aggregates the pixel data generated by a rendering cluster to drive a high-resolution tiled display wall. Several other -first rendering systems like WireGL allow unmodified graphics application to be scaled to work on a high-resolution tiled-display. 4. Design Overview The v9fb infrastructure consists of the following entities interacting with each other to make the process of accessing remote framebuffer devices as transparent as possible.

• v9fbfs • v9fb kernel module • v9fbaggr • v9fbmuxfs v9fbfs is a userspace 9P fileserver that exports a filesystem hierarchy of the framebuffer. The v9fb kernel module creates a virtual framebuffer device that acts a 9P client translating all the framebuffer operations into POSIX-like file I/O operations. These calls are forwarded to either to v9fbfs or v9fbaggr over the 9P protocol. v9fbaggr is another userspace 9P fileserver which aggregates the framebuffer resources provided by multiple v9fbfs fileservers to export a logical view of a single large framebuffer. v9fbaggr offers an exactly similar interface as v9fbfs thus making it seamless to communicate with the v9fb kernel module.

Figure 3: High-performance computing environment for large-scale modeling and simulations using XCPU and V9FB

Figure 3 shows a typical setup of a rendering cluster environment using XCPU and V9FB. At the first glance, the control node appears as a potential bottleneck in this environment. However, the control node only acts as a front-end for submitting jobs. With support for

66 dynamic namespaces offered by XCPU, the aggregated framebuffer device could be mounted in the namespace of each rendering node which directly writes on to a specific framebuffer of the display wall. v9fbmuxfs is a userspace 9P fileserver which is almost similar to v9fbfs. v9fbmuxfs divides a framebuffer into multiple regions exporting each as a logical framebuffer device. It multiplexes the access to each of these regions to simultaneously display the framebuffer output from several clients. Since most modern graphic cards support tiled framebuffers, each tile could be rendered by different machine to achieve a much faster performance. v9fb offers secure delivery of the display data since it uses the authentication support in 9P2000 protocol. The 9P auth information negotiates authentication between the client and the fileserver before exchange of raw pixel data takes place. The ordered delivery of messages in 9P protocol ensures there is no corruption of the frame pixels. Synchronization has not been taken into account but could easily be added into v9fb. Synthetic fileservers allow easy addition and removal of functional layers to the architecture. These can further be in the form of fileservers or simple libraries acting on the exported files. For instance, to make efficient use of the network bandwidth the raw pixel data transferred over the network can be compressed before sending. Several performance optimization techniques have been taken into account to achieve a good performance. 4.1. Performance Optimization v9fb has been designed with low-latency high-bandwidth in mind where the remote display nodes are connected to the control nodes using a suitably high-speed network interconnect like Gigabit Ethernet. Transmitting raw pixel data over the wire consumes considerable bandwidth for real-time visual applications like video streams and interactive simulations. 4.2. Framebuffer compression The raw framebuffer data can be compressed using various compression algorithms before transmitting it across the network. This reduces the load on the network, however adds to the overhead of post-processing the data before displaying it on the framebuffer. Compression helps in low-latency links where the network gets overloaded by large bursts of raw pixel data. Video hardware has already started supporting compression at the device level to reduce power consumption [10]. Compression is done on a per-line basis by using a simple compression algorithm like run-length encoding (RLE) or the LZ77 algorithm. 4.3. Framebuffer caching Caching the framebuffer data at the client can improve the performance in case of non- interactive applications where most accesses involve reading from a static framebuffer. A write to the remotely mounted framebuffer invalidates the cache, and the changes have to be propagated back to the framebuffer fileserver. Introducing caching, however, adds to unmanaged complexity and the performance increases are seldom guaranteed[14]. 4.4. Double Buffering Double buffering at the client and server side can improve performance in most cases. The network-attached framebuffer acts as a back buffer used by the framebuffer fileserver. The scanout buffer acts as a front buffer which represents the memory of the video device. Flipping between the two buffers compensates the network delay to a certain extent and can allow a continuous stream of frames on the video display. 4.5. Multiplexed operations Multiple clients writing to a single framebuffer pose a potential bottleneck in performance. Multiple reads and writes can be multiplexed at the server with separate threads performing the operations at once. This would significantly add to the performance of v9fbaggr which essentially communicates to multiple framebuffer fileservers v9fbfs simultaneously. When mul- tiple Treads or Twrites are to be done in parallel, multiple threads are spawned by the server handling these request in parallel.

67 5. Implementation 5.1. v9fbfs v9fbfs is a userspace 9P fileserver which scans the local machine for existing framebuffer devices and exports an interface in the form of a file hierarchy given below. /ctl /data /mmio /fscreeninfo /vscreeninfo /cmap /con2fbmap /state 5.2. ctl file The ctl file is used to control the framebuffer server and perform some several framebuffer display operations. It supports the following commands : pandisplay The pandisplay command is used to pan or wrap the display when the X or Y offset of the display have changed. blank blankmode Blank the framebuffer based on the supplied blank mode. This could be used to suspend or power down remote idle displays to save power. reload Reload the framebuffer filesystem interface. This looks for newly added framebuffer devices and exports them. 5.3. data file The data file represents the actual raw framebuffer memory buffer usually represented by the /dev/fb[0-7] device in Linux. Writing to this file writes directly to the framebuffer memory. Similarly, this file is read to fetch the current framebuffer contents. 5.4. mmio file This file represents the memory-mapped IO memory of the framebuffer device. Userspace applications can program the MMIO registers by reading or writing to this file. This can be used to provide hardware acceleration to the framebuffer from the userspace. 5.5. fscreeninfo file Reading from this file retrieves the fixed screen information of the framebuffer graphic device. The device-specific framebuffer information like device type, visual properties, acceleration support, the framebuffer memory length and addresses, the length of the scanline in bytes and the memory-mapped I/O addresses of the device is exported by this file. Fixed information cannot be changed, thus this file cannot be written to. 5.6. vscreeninfo file Reading from this file fetches the virtual screen information of the framebuffer. This can be used to determine the display capabilities of the framebuffer, supported resolutions and color palettes, acceleration flags, bits-per-pixel and the margin and sync lengths among other information. Any of the virtual screen information can be changed by writing to this file. 5.7. cmap file Get/Put the color palette information. 5.8. con2fbmap file Used to map the console onto the framebuffer device and vice versa. 5.9. state file State of the framebuffer device which is used by v9fbaggr to maintain synchronization between multiple displays.

68 Reading and/or writing to a particular file invokes a corresponding framebuffer device-specific operation which talks to the underlying framebuffer device. This provides an alternative to using the ioctl system call for device communication and consequently allows the device to be accessed over the network. This filesystem interface exported by v9fbfs can also be mounted as a filesystem using V9FS.

$ ./v9fbfs -d Found framebuffer device /dev/fb0 ... /dev/fb0 : VESA VGA Framebuffer device memory from 0xfb000000 to 0xfb600000 Length: 6291456 bytes Framebuffer MMIO from (nil) to (nil) Length: 0 bytes listening on port 8883

By mounting v9fbfs as a filesystem, framebuffer applications can use this interface to draw to the framebuffer device. With recent support for per-process namespaces in Linux, it allows each process to have an exclusive view of the framebuffer device.

$ mount -t 9p 192.168.10.1 /mnt/fb -o port=8883, uname=abhishek, debug=511 $ ls /mnt/fb/fb0/ cmap con2fbmap ctl data fscreeninfo state vscreeninfo $ cat /mnt/fb/fb0/fscreeninfo VESA VGA 4211081216 6291456 0 0 2 0 0 0 4096 0 0 v9fbfs can handle multiple framebuffer devices (upto 8). It has been implemented using libspfs, a library for writing 9P2000 compliant userspace fileservers in Linux. Applications drawing on the top of the framebuffer usually accept a command-line parameter to draw to a different framebuffer device. Alternatively, the global FRAMEBUFFER environment variable can be set to use a different framebuffer device. 5.10. v9fbaggr v9fbaggr is a userspace 9P server and client typically running on a control node. On startup, v9fbaggr reads a configuration file v9fbaggr.conf which specifies the remote framebuffer devices that it needs to aggregate and their relative geometry to export a single logical framebuffer device. A typical configuration file for a 3x3 tiled display wall is shown below. tile1=192.168.10.40!8883, tile2=192.168.10.64!8883, tile3=192.168.10.67 tile4=192.168.10.41!8883, tile5=192.168.10.65!8883, tile6=192.168.10.68 tile7=192.168.10.42!8883, tile8=192.168.10.66!8883, tile9=192.168.10.69

Currently, each newline in the configuration file represents a new row in the geometry of the tiled display wall. Each entry is represented by a nodename followed by its network address and the port on which the server is listening. Use of a rigid data representation format like s-expressions might be considered in the future. v9fbaggr communicates to the framebuffer fileserver v9fbfs running on these machines, fetches their fixed and variable display information and aggregates the remote display resources to provide a logical view of the 3x3 tiled display wall as a single unit of display. Since, v9fbaggr exports an exactly similar interface as that of v9fbfs, application remain transparent of the underlying multiple display devices spread across the network. Framebuffer operations like panning the display, turning the display blank, reloading the fileservers are translated such that

69 they apply to all the remote framebuffer devices aggregated by v9fbaggr. In addition to this, the commands accepted by the ctl file also takes an additional parameter, the node name, to which the operation is to be applied. v9fbaggr implements a memory management unit to translate the virtual address of the ag- gregated framebuffer to an address of a specific framebuffer device based on the geometry and layout of the tiled display wall. The virtual aggregated framebuffer provides a contiguous linear memory to the application using it. Each memory access to this framebuffer is translated to a 9P read or write to the appropriate framebuffer fileserver. The framebuffer memory of remote framebuffer devices are represented as segments and mapped onto the virtual aggre- gated framebuffer exported by v9fbaggr. Memory accesses to this framebuffer pass through a segment selector which points to the various segment pointers depending on the actual layout of the framebuffer devices. v9fbaggr allows unmodified applications and programs to be run on a tiled display wall. 5.11. v9fb kernel module The v9fb kernel module typically runs on the control node or the head node and creates a pseudo-framebuffer device which translates framebuffer device operations into corresponding 9P calls. The intended use of this kernel module is to mount the filesystem exported by v9fbaggr so that it can act as a passthrough framebuffer device to draw transparently to the tiled display wall. It could also be used to mount a single remote framebuffer device for remote workstation display applications.

$ modprobe v9fb address=192.168.1.40 $ dmesg | -n 2 [118398.958865] v9fb: Enabling remote framebuffer support [118398.960945] fb1: Remote frame buffer device $ rmmod v9fb $ dmesg | tail -n 1 [118401.461253] v9fb: Unmounting remote framebuffer device

The kernel module has been written so that v9fb supports existing framebuffer applications without changing them. It translates the device specific ioctl calls into a corresponding 9P call. For instance, to get the virtual screen information of a framebuffer device, the ioctl call to be used is as follows - ioctl(fd, FBIOGET_VSCREENINFO, vscr); /* vscr is a structure to hold the variable screen information */

The v9fb kernel module translates this into an appropriate 9P operation to read from the vscreeninfo file as shown below.

<<< (0x8059660) Twalk tag 0 fid 3 newfid 4 nwname 1 ’vscreeninfo’ >>> (0x8059660) Rwalk tag 0 nwqid 1 (0000000000000005 0 ’’) <<< (0x8059660) Twalk tag 0 fid 4 newfid 5 nwname 0 >>> (0x8059660) Rwalk tag 0 nwqid 0 <<< (0x8059660) Topen tag 0 fid 5 mode 0 >>> (0x8059660) Ropen tag 0 (0000000000000005 0 ’’) iounit 0 <<< (0x8059660) Tread tag 0 fid 5 offset 0 count 8168 >>> (0x8059660) Rread tag 0 count 110 data 31303234 20373638 20313032 34203736 38203020 300a3332 20300a31 36203820 30203820 38203020 30203820 30203234 20382030 0a300a30 0a343239 34393637 <<< (0x8059660) Tclunk tag 0 fid 5 >>> (0x8059660) Rclunk tag 0

70 <<< (0x8059660) Tclunk tag 0 fid 4 >>> (0x8059660) Rclunk tag 0

This provides a way to serialize and deserialize device-specific framebuffer calls and obtain the equivalent functionality by marshalling these calls using 9P. Most of the framebuffer ioctl() calls are only done at the initialization time and once the display has b een setup properly, majority of the traffic involves reading from and writing to the framebuffer memory. Thus, multiplexing the reads and writes promises considerable performance gains. 5.12. v9fbmuxfs v9fbmuxfs is similar to v9fbfs in a way that it exports the framebuffer device interface as a filesystem. It however creates divides a single framebuffer device into separate regions exporting each as a virtual framebuffer device which a client can write to. Simultaneous rendering and display of a single frame by multiple clients or multiple graphic processing units on a single client can be done with the help of v9fbmuxfs. The implementation of v9fbmuxfs has not been done and thus qualifies as a future work for this infrastructure. 6. Future Work Several issues still remain to be dealt with to use v9fb in a production visualization environment. Due to constraints in time, actual performance metrics for driving tiled display walls using v9fb could not be obtained by the time of this writing. Overall performance can be tuned using several ways discussed in Section 4. Apart from this, we are working to support the following features for the v9fb infrastructure. 6.1. Support for input events Sending keyboard and mouse events over the network forms an integral part of remote display technologies. Currently, v9fb does not address the forwarding of input events over the network. Extending v9fb to support input events is trivial and we have started working on it. 6.2. Hardware-accelerated framebuffer Due to the proprietary binary-only drivers distributed by major graphic card manufacturing firms like NVIDIA, it has become difficult to use hardware acceleration for the framebuffer. With several initiatives to revamp the state of graphics in Linux, it would soon be possible to use the framebuffer or the in-kernel Direct Rendering Manager (DRM) to draw to the video memory. DirectFB is a thin library which provides hardware graphics acceleration to the framebuffer. A DirectFB extension to v9fb would allow using hardware acceleration to draw high-resolution 3D graphics on the framebuffer device. 6.3. Communication between v9fbfs One of the most common uses of the tiled display wall is to display high-resolution imagery. Moving and panning of images on the tiled display wall results in resending the pixel data from the control nodes to all the display nodes. This forms a potential bottleneck at the control node. Enabling communication between the individual framebuffer fileservers would increase the performance of interactive applications on the display wall. 7. Conclusion v9fb provides a novel approach of accessing remote devices over the network in Linux using concepts and ideas employed by Plan 9 since its inception. Withstanding the several difficulties posed by the rigid device subsystem in Linux, this scheme could be easily extended to allow exporting various other devices as a filesystem over the network. v9fb finds various applica- tions in high performance computing and remote visualization technologies. It offers flexibility and configurability leading to dynamic architectures in a large-scale modeling and simulation environment. We are working on several optimizations to this infrastructure to make it capable enough for use in production environments. References [1] Eric Van Hensbergen and Ron Minnich. Grave robbers from outer space: Using 9p2000 under linux. In In Proceedings of Freenix Annual Conference, pages 83–94, 2005. [2] Don Hopkins. The X-Windows Disaster. UNIX-HATERS Handbook.

71 [3] Greg Humphreys, Mike Houston, Ren Ng, Randall Frank, Sean Ahern, Peter D. Kirchner, and James T. Klosowski. Chromium: a stream-processing framework for interactive rendering on clusters. ACM Trans. Graph., 21(3):693–702, 2002. [4] Ronald Minnich and Andrey Mirtchovski. Xcpu: a new, 9p-based, process management system for clusters and grids. In CLUSTER. IEEE, 2006. [5] Krishnaprasad Naveen, Vishwanath Venkatram, Chandrasekhar Vaidya, Schwarz Nicholas, Spale Allan, Zhang Charles, Goldman Gideon, Leigh Jason, and Johnson Andrew. Sage: the scalable adaptive graphics environment. [6] Brian Paul, Sean Ahern, Wes Bethel, Eric Brugger, Rich Cook, Jamison Daniel, Ken Lewis, Jens Owen, and Dale Southard. Chromium renderserver: Scalable and open remote rendering infrastructure. IEEE Transactions on Visualization and Computer Graphics, 14(3):627–639, 2008. [7] Rob Pike. Rio: Design of a concurrent window system. February 2000. [8] Rob Pike, Dave Presotto, Sean Dorward, Bob Flandrena, Ken Thompson, Howard Trickey, and Phil Winterbottom. Plan 9 from Bell Labs. Computing Systems, 8(3):221–254, Summer 1995. [9] Prabhat and Samuel G. Fulcomer. Experiences in driving a cave with ibm scalable graphics engine-3 (sge-3) prototypes. In VRST ’05: Proceedings of the ACM symposium on Virtual reality software and technology, pages 231–234, New York, NY, USA, 2005. ACM. [10] Hojun Shim, Naehyuck Chang, and Massoud Pedram. A compressed frame buffer to reduce display power consumption in mobile systems. In ASP-DAC ’04: Proceedings of the 2004 conference on Asia South Pacific design automation, pages 818–823, Piscataway, NJ, USA, 2004. IEEE Press. [11] Munjae Song. A survey on projector-based pc cluster distributed large screen displays and shader technologies. [12] Geert Uytterhoeven. The Linux Frame Buffer Device Subsystem. Linux Expo ’99, 1999. [13] Bin Wei, Douglas W. Clark, Edward W. Felten, Kai Li, and Gordon Stoll. Performance issues of a distributed frame buffer on a multicomputer. In HWWS ’98: Proceedings of the ACM SIGGRAPH/EUROGRAPHICS workshop on Graphics hardware, pages 87–96, New York, NY, USA, 1998. ACM. [14] S. Jae Yang, Jason Nieh, Matt Selsky, and Nikhil Tiwari. The performance of remote display mechanisms for thin-client computing. In In Proceedings of the 2002 USENIX Annual Technical Conference, 2002.

72