Proceedings of 3Rd International Workshop on Plan 9 October 30-31, 2008
Total Page:16
File Type:pdf, Size:1020Kb
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, Bell Labs, Alcatel-Lucent 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/Linux 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 Venti To Go Latchesar Ionkov..................................................................................................................................25 Inferno DS : Inferno port to the Nintendo DS Salva Peiro...........................................................................................................................................31 9P For Embedded Devices Bruce Ellis 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*B6A?D+*#*CO56=EFKH51+@E= )*564)+6 9A @AI?HE>A *KH =FFH*=?D *B >HE+CE+C 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#=+ ' PR5 *+ 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 #!.