OS Services

Or everything you ever wanted to know about UNIX but were too afraid to ask

Vital Statistics

Name
Dave Jones
Twitter
@waveform80
GitHub
github.com/waveform80

What's UNIX ever done for us?

  • Well, there's the process scheduling
  • and the file-system
  • oh, and the sockets, Dave
  • and the privilege separation
  • and don't forget the memory isolation

Alright!

But aside from the process scheduling, the file-system, the sockets, the privilege separation, and the memory isolation … what has UNIX ever done for us?

Part 1

Processes

Most functions

  • Take n parameters
  • Perform some work
  • Return a value

Weird functions

sys.exit(1)
  • Takes 1 parameter
  • Doesn't return (as far as your program is concerned)

Weirder functions

os.fork()
  • Takes no parameters
  • Returns twice?!

Demo

Part 2

The File System

Atomic operations

  • Exclusive file creation
  • File renaming (within FS)
  • File linking

Demo

What is a file?!

So what's a handle?

The name's expendable?

In fact totally distinct!

Back where we started

So the link thing …

Part 3

mmap

Virtual memory

  • Every process sees the same address space
  • Memory pages can be backed by nothing!
  • Memory pages can be backed by RAM
  • Memory pages can be backed by files

Demo

Part 4

Pipes, FIFOs, Sockets, etc.

No, not those sockets

  • UNIX sockets, like files but …
  • FIFOs, like files but …

Demo

Vital Statistics

Name
Dave Jones
Occupation
File Whisperer
Twitter
@waveform80
GitHub
github.com/waveform80

Available Now!

from your nearest web-server

www.waveform.org.uk/presentations/ipc/

Thank You

Questions? Pub!