logoalt Hacker News

CapROS: Capability-Based Reliable Operating System

101 pointsby gjvctoday at 12:39 AM49 commentsview on HN

Comments

mfedderlytoday at 2:18 AM

I had the privilege of taking two classes with Dr Shapiro while I was in undergrad. The second class revolved around a related operating system named Coyotos. One of the most memorable classes was a 3 hour session where we worked through the boot sequence step by step [1]. The single lecture helped us all appreciate the delicate dance to bring up an x86 processor, a history lesson in the various features that had been bolted onto x86 over time, and a bunch of helpful debugging tips when your options are limited (it prints "Co" "yo" and "tos" in different stages!).

This was easily one of my most memorable lectures from undergrad, and it really helped to show me that even your operating system is just more software that you can read and understand.

1. https://github.com/vsrinivas/coyotos/blob/c68719b851e253aa11...

show 2 replies
kragentoday at 2:00 AM

Seems like Charlie hasn't been merging pull requests in three years: https://github.com/capros-os/capros

And the list has been idle since then: https://sourceforge.net/p/capros/mailman/capros-devel/

I wonder if something has happened to him? I hope he's okay.

btillytoday at 2:26 AM

The fact that we went with access control lists instead of true capabilities has long been a disappointment to me.

For people who understand OO, capabilities are the simplest model in the world. You hand out objects. You can call methods on the object. What that method call has access to depends on the permissions on the object, not your permissions. Entire classes of security mistakes (most notably the "confused deputy" become impossible.

The only commercial success that was a true capability system was the AS/400. Not coincidently, single stand alone machines averaged 99.99%-99.999% uptime. And it never had a significant security compromise. (Individual systems did, of course, have problems due to weak passwords and poor configuration. But they were still remarkably resistant.

Capability systems work so well that when people wanted to improve security on Linux, they called it capabilities. Even though it wasn't.

Unfortunately, the world went with ACLs. That's baked in to the design of things like Windows and POSIX. Which means that all of the consumer software out there expects ACLs. In order to get them to run on a pure capability system, you have to do things like create a POSIX subsystem. At which point, you've just thrown away the whole reason to use capabilities in the first place.

show 3 replies
Hexayurttoday at 3:20 PM

Waterken was the same kind of logic, applied at web API scale.

https://shiftleft.com/mirrors/www.hpl.hp.com/techreports/201...

The failure of this system and the HP ESpeak system are what left the gap which the blockchain smart contract model filled.

I have complex thoughts about that.

show 1 reply
pyrolisticaltoday at 2:58 AM

https://en.wikipedia.org/wiki/Capability-based_security

It’s like sharing google doc link. You configure the link to be read only or read/write.

Now imagine you can create as many links as you want with all possible permission combinations. Then you have a capability based system

ahlCVAtoday at 7:56 AM

There is also a relatively modern capability-based kernel in the L4 family of microkernels, called Fiasco.OC: https://os.inf.tu-dresden.de/fiasco/overview.html

There are also a bunch of components for building a functional userspace (such as L4Re or Genode).

show 1 reply
retractoday at 6:30 AM

I've written a little bit before about KeyKOS/GNOSIS, which is the capability operating system used by Tymshare to host their timesharing language services on IBM mainframes, in the 70s and 80s. From a comment 3 years ago I'll just repost the relevant part:

> KeyKOS (developed by Tymshare for their commercial computing services in the 1970s) - A capability operating system. If everything in UNIX was a file, then everything in KeyKOS was a memory page and capabilities (keys) to access those pages. The kernel has no state that isn't calculated from values in the virtual memory storage. The system snapshots the virtual memory state regularly. There are subtle consequences from this. Executing processes are effectively memory-mapped files that constantly rewrite themselves, with only the snapshots being written out. Snapshotting the virtual memory state of the system snapshots everything -- including the state of running processes. There's no need for a file system, just a means to map names to sets of pages, which is done by an ordinary process. After a crash, processes and their state are internally consistent, and continue running from their last snapshot. For those who are intrigued, there's a good introduction, written in 1979, by the system's designers available here: http://cap-lore.com/CapTheory/upenn/Gnosis/Gnosis.html (It was GNOSIS before being renamed KeyKOS.) And a later document written in the 90s aimed at UNIX users making the case: http://cap-lore.com/CapTheory/upenn/NanoKernel/NanoKernel.ht... Some work on capability systems continues, but it seems the lessons learned have largely been forgotten.

The core abstraction is simpler than the Unix process model or that of many other operating systems. Processes have keys which access virtual memory pages. All of storage including persistent secondary storage is just one big pool of virtual memory pages. These can be shared between processes. That's all that's necessary to implement things like filesystems and networking which are often thought to require special handling. A filesystem is just names and addresses of pages in storage. Give a process a capability to do shared memory with a process that maintains such a structure. I find the emphasis on minimizing process and kernel state, such that processes can be snapshot and frozen at any time and are inherently persistent, handled as the set of the relevant pages, to be genius. Though the architecture does have the classic microkernel/nanokernel performance penalties, as have been long debated.

iberatortoday at 5:35 AM

Intel did this is 1989 with iAPX 432. Super interesting and SUPER complex (just check out the documentation of cpu architecture), that's it failed hard.

Flat memory model always win vs Star Trek like architecture who bo one understands

show 1 reply
silasdavistoday at 6:17 AM

Most of the links seem to be broken on https://www.capros.org/overview.html

contrarian1234today at 3:10 AM

Most of my "wtf is going on" moments on Linux have to do with permissions. I loath the industry move to even more security. I want a more Emacs-like experience. Multiuser systems have become the exception and most people have a personal computer with one user. Dealing with evil apps is a loosing battle b/c the attack surface is too large.

I think the counter argument to more security is Distro Repos. When was the last time you apt-get'ed some software and had your documents stolen?

If you add blocks then you need to somehow communicate to the use when it's failing and that's hard... You see the shitshow that is Android security where apps have mysterious access to some directories and not others and it's impossible to understand what's going on. Maybe capabilities will work better, it's unclear to me.

show 2 replies
mikewarottoday at 1:58 AM

Why is it that every Capability based system seems to be a toolkit for running a single program instead of an OS ready for daily use? Is it just me?

show 4 replies