UNIX in Browser using Browsix

Browsix is a framework that bridges the considerable gap between conventional operating systems and the browser, enabling unmodified programs expecting a Unix-like environment to run directly in the browser. Browsix does this by mapping low-level Unix primitives, like processes and system calls, onto existing browser APIs, likeWeb Workers and postMessage.

Browsix brings all of these abstractions into unmodified browsers, and is isolated and secured to the same extent any normal web page is: at the level of the browser tab.

To use Browsix, client-side JavaScript code creates an instance of a Browsix kernel (which involves telling it how to initialize the filesystem), and then asks the kernel to start or kill processes. Users can also perform HTTP requests to a given Browsix TCP port, and register callbacks a number of events, like when a process has written to standard out or standard error, for when processes exit, and for when ports are ready.

OS ABSTRACTIONS

  • Processes are built on top of Web Workers, letting applications run in parallel and spawn subprocesses. System calls include fork, spawn, exec, and wait.
  • Signals with kill(2) and signal handlers.
  • Shared Filesystem accessible from multiple processes.
  • Pipes are supported with pipe(2) enabling developers to compose processes into pipelines.
  • Sockets include support for TCP socket servers and clients, making it possible to run applications like databases and HTTP servers together with their clients in the browser.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s