Documente Academic
Documente Profesional
Documente Cultură
Worst movie ever made (by Ed Wood) An operating system and associated utilities (by the people who made Unix and C) Three design principles:
Resources are represented as file trees Resources are privately assembled by processes Resources are accessed by a standard protocol
Outline
1. 2. 3. 4. 5. 6. 7. 8. 9. A typical Plan 9 installation A traditional file server Some unusual file servers Namespace Overview of the 9P protocol User interface Programming under Plan9 The Inferno operating system The Limbo programming language
CPU server
Emelie
WORM media
SCSI disks
/n /dump /2001
50 60 70 80 90 100
A machine with a Datakit interface can use the TCP interface of another machine
% import harp /net % telnet tcp!www.yahoo.co.jp
tcp
udp
clone
ctl
status
data
local
remote
listen
A raw ps command
% cat /prog/*/status
A Per-process Namespace
User processes construct namespace using mount bind union unmount Most services are conventionally located Comparison
Unix: a global mount table for all processes Plan 9: a mount table per process stored in the kernel
The 9P Protocol
The (invisible) glue that holds Plan 9 together Similar to NFS Composed of 17 messages
3 for authentication 14 for object manipulation
9P Transaction
9P client
user process
9P server
mount (tcp!ip_address)
the clients kernel Tsession Tattach 50 Rattach 100 Tclone 50 70 Twalk 70 dev Twalk 70 cons Topen 70 Ropen 120
9P Authentication
authorization server 9P client the clients kernel user process
challenge_c
9P server
Rsession () challenge_s, id_s, id_c key_c{challenge_s, id_c, nonce} Ok, id_c can speak to id_s nonce{challenge_s} key_s{challenge_s, id_c, nonce} Tattach ()
Programming
New C compilers
8c for Intel, kc for SPARC, ANSI C + goodies (inheritance, ) Simplified preprocessor (no #if, ) No nested include files Smaller library Slightly difference syntax (nil, void main ()) Preprocessing, parsing, register allocation, code generation, assembly
Programming
A new make: mk
Simplified
New Linkers
8l, kl, Perform instruction selection, branch folding, instruction scheduling, executable writing Dont require indications on which library to load Dont do dynamic linking!
/sys/include: machine independent headers /sys/src/9/fs: file server /sys/src/9/port: portable part of the kernel /sys/src/9/pc: Intel specific part of the kernel /sys/src/9/pc/devxxx.c: device drivers /sys/src/libc: libc /sys/src/libdraw: graphics library /sys/src/libio: buffered io /usr: users
User Interface
Commands: Unix-like Text edition: cat, ed, sam, acme Unicode everywhere Mouse centric:
no cursor-addressed programs 3 buttons unavoidable (chored actions)
Plumbing
text-based inter application mechanism
Inferno
A small Plan 9 Can run
As the native operating system As a hosted operating system As a plug-in for Internet Explorer
A different looking:
wm/wm and prefab window managers Graphics with Tk
Limbo
User applications run above the DIS virtual machine A C-like language that compile to bytecodes and that run
Over the VM (30/40 times slower than C) JIT compilation (2/3 times slower than C)
Limbo
Garbage collection:
References counting A special keyword for cyclic data structures
Limbo: Syntax
Pascal-like type declaration x: int; x := 42; C-like assignments Constants EOF: con 1; Enumeration enum {Red, Blue, }: con iota; Strings are not \0 terminated
Compatibility Issues
Compatibility is not an issue (sic) However:
vt: provides vt100 terminals emulation APE: ANSI POSIX Environment (ape/psh: POSIX shell, /bin/cpp: an ANSI C preprocessor, cc: an ANSI C compiler) vnc: to use remote X application wm/brutus: emulates emacs under Inferno drawterm: to use CPU and file servers from Unix or Windows u9fs: runs on NFS machines and understand 9P Plan 9 has an implementation of X
Conclusion
My 2 : Small implementations suitable for educational purposes Systems Software Research is Irrelevant Rob Pike I think Plan 9 was a great idea and it shouldve been released under an open-source license when it was first done, eight years ago () Brian Kernighan After all, Unix took 10 years to catch on (in a
world without Windows nor Linux though)