Ideas for OS’s

Nicolas Lenz

2019-10-07

Think freely

File System

Current State

  • Filesystem is a tree with files as leaves
  • Non-leave nodes are folders
  • Files are bytestrings (a bunch of bytes)
  • Permissions (who can write what, who can read what…) are stored for each and every node

Permissions

  • Permissions are inherited
  • Permissions only on folders
  • Entries overwrite parent entries
  • Easiest case could be one entry in root and one in home directory

Typed File System

  • data Node = NodeFolder Folder | NodeFile File
  • data Folder = Folder (Map String Folder)
  • data File = ∀a . (ToByteString a, FromByteString a) => File a
  • root :: Folder

Programs

Everything is a File!

  • An Int or an [Int] file – okay
  • But a Int -> Int file?

Mount executables and libraries

  • Object files are like Java .class-files with signatures
  • Mount them into a folder
  • For example:
    • Call mount calc
    • calc/plus :: Int -> Int -> Int
    • calc/minus :: Int -> Int -> Int
  • Just call them in the shell like a normal function to execute.

Package Management

  • Nix!
  • Mount specific version of library into namespece for program
  • Mounting of programs and libraries should integrate nicely
  • Fast & clean package management

Config Management

  • Well-defined states, roll back and more
  • System builds deterministically from config and volumes
  • Like containers or Nix, but even better

Typed Programs

  • Permissions and more now in signature
  • Install sed :: String -> String -> String from trustworthy.su and still be sure it’ll only take and output strings
  • Via granular monad and effect magic Android-likecan be in signatures
  • Type-safe calls, outputs and compositions

Usage

Shell

  • Katrin Shell
  • …or any normal programming language shell (Python e.g.)
  • …with a library to handle the typed file system
  • No more weird shell languages

APIs

  • All APIs are in the file system
  • Possible thank to function files

Non-native programs

  • Integrate OCI containers (DOCKER DOCKER DOCKER)
  • Can work with the type system and the permissions
  • Or generalize VMs for foreign code
  • Run Android, Windows, etc. → QubesOS

Will it happen?

No. But it’s fun to think about!