Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

15
Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th , 2007

Transcript of Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

Page 1: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

Operating Systems of The Future( and Plan 9 )

Shilad Sen – April 26th, 2007

Page 2: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

2

Today’s Topics

• Design our own world-dominating OS.

• Discuss Plan 9, an OS that many people thought should have dominated the world.

Page 3: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

3

Design a Better OS

• Hypothetical Question:

– Google wants to enter the OS market.

– Provide Google with three examples of something the three major OS’s get “wrong.” What you would you do differently?

Page 4: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

4

Some Areas to Consider• Networking / Sockets• Threading• File I/O• Security• Scheduling• Windowing System / User Interface

Examples:1. Eliminate all non-unicode char *’s.2. Add an “e” “creat()” system call (Ken Thomson)3. Copy / paste: an open problem (consolidate to a

centralized copy/paste server).

Page 5: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

5

How Should We Build Our OS?

Page 6: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

6

Plan 9 from Bell Labs

• Designed in mid 80’s by many of the creators of UNIX (Rob Pike, Ken Thompson, Brian Kernighan, Dennis Ritchie)

• Major Architectural Concepts:– Distributed Operating System– All resources are represented as files– Application resources are organized via customizable

namespaces– Standardized communication protocol (9P)

Page 7: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

7

Everything’s a File!

• In many early operating systems, different types of block devices had different API’s.

• One major innovation in UNIX was the single file I/O API for multiple devices.

• Plan 9 treats virtually all devices and services as file-based services:– telnet– ftp– nfs

Page 8: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

8

Example: Opening a Socket

% cat /net/tcp/clone/ctl

44

% cd /net/tcp/44

% echo connect 128.2.194.80!79 > ctl

% echo ping > data

% cat data

pong

Page 9: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

9

Namespaces

• Any file resource can be “mounted” in a customizable directory hierarchy, or namespace:

• Several directories can be mounted at the same point – replaces the need for a $PATH

bind /home/shilad/bin /binbind /i386/bin /bin

• Copying a local file foo to a remote floppy:import lab.pc /a: /n/doscp foo /n/dos/

• Piping the output of foo on host1 to bar on host2cpu -h host1 foo | cpu -h hos2 bar

Page 10: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

10

Communication Protocol

• File-based API supports 17 standard I/O file operations

• “Device drivers” (e.g. a telnet server) need only implement the 17 operations.

• A mounting service transparently transmits local file commands to remote systems using the 9P protocol.

Page 11: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

11

Process Model

• The rfork system call duplicates a process• Individual resources can be shared,

copied, or created anew:– Name space– Environment– File descriptor table– Memory segments

• Both fork() and pthread_create() are special cases of rfork()

Page 12: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

12

Synchronization

rendezvous system call:

Thread 1 Thread 2rendevous("foo",value1) rendezvous("foo",value2)

both calls blockuntil they receive

the “foo” tagvalue2 value1

Page 13: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

13

Security

• No superuser• An authentication server maintains a

database of authentication keys for all users

• Both client and server exchange encryption challenges and responses so each side is convinced of the others’ identity.

• All 9P network communications are secure

Page 14: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

14

Plan 9’s Failure

• In 1998, Lucent pulled developers off of Plan 9 to focus on related Inferno OS.

• Neither Plan 9 nor Inferno were commercially successful.

• Most experts agree that Plan 9 was technically superior to UNIX but…

• Most experts agree that Plan 9 was not superior enough to convert users of UNIX

Page 15: Operating Systems of The Future ( and Plan 9 ) Shilad Sen – April 26 th, 2007.

15

Plan 9’s Success

• Plan 9 open-sourced in 2000• Dedicated developer and user base

remain today• Google Summer of Code Project• Plan 9 influenced Linux / BSD:

– /proc filesystem– clone() interface– As of 2.6.14, 9P-based file device drivers in

stable Linux Kernel