/NodeOS

linux + node + npm

Primary LanguageShell

Stories in Ready

NodeOS

Lightweight operating system using Node.js as userspace.

NodeOS is an operating system build entirely in Javascript and managed by npm. Any package in npm is a NodeOS package, which at last count was 106,713 packages. The goal of NodeOS is to provide just enough to let npm provide the rest. Since anyone can contribute to npm, anyone can create NodeOS packages. Roadmap

Join the Discussion

find us

  • Web: please use github issues for discussion
  • IRC: join #node-os on Freenode

introduction

NodeOS is a Node.js based operating system, built-off of the Linux kernel. The eventual goal of NodeOS is to produce images that can be run on

  • real hardware like desktop PCs, servers or Raspberry Pi
  • cloud providers like Joyent, Amazon or Rackspace
  • virtual machines like QEmu, VirtualBox, VMWare and KVM
  • PaaS providers like Heroku or Joyent's Manta
  • container providers like Docker

Core development is being done in layers. There could be some differences to adjust better to each target platform, but the general structure is:

  • barebones custom Linux kernel with an initramfs that boots to a Node.js REPL
  • initramfs Basic NodeOS environment to mount a root filesystem partition
  • rootfs NodeOS global services, C/C++ compiler and libraries
  • usersfs multi-user environment with the same behaviour of traditional OSes

All the layers except kernel are bootable, leading both initramfs and rootfs to a Node.js REPL prompt by default.

If you are hacking on NodeOS as a somewhat production server, you are likely building usersfs images since each user is isolated of others, but you can be able to customize all layers. For example, you could be able to modify rootfs to craft a single-user environment or also dedicate a full NodeOS instance to a single application.

Build NodeOS for QEmu from scratch in three steps

  1. Download the project source code and build NodeOS for QEmu

    git clone git@github.com:NodeOS/NodeOS.git
    cd NodeOS
    PLATFORM=qemu ./build
  2. Pick some microwave pop-corn and go to see a movie. No, really, do it.

  3. Exec your fresh compiled NodeOS image

    qemu-system-i386 --kernel barebones/bzImage --initrd initramfs/initramfs.cpio.gz -hda rootfs/rootfs.img -hdb usersfs/usersfs.img -enable-kvm -nographic -append "console=ttyS0 ROOT=/dev/sda USERS=/dev/sdb"

NodeOS on Docker

There are some NodeOS images on Docker Hub, but they can be outdated, so it's recomended to build from source code.

Quick Start

  1. Install Docker

  2. One Liner

    sudo docker run -t -i nodeos/nodeos

or learn how to make a Custom Build

Build from Source

Warning: the build process is hairy, it probably won't work the first time. I'm working on that.

git clone git@github.com:NodeOS/Docker-NodeOS.git
cd Docker-NodeOS
./build