Lightweight operating system using Node.js as userspace
The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
Lightweight operating system using Node.js as userspace.
npmis a NodeOS package, that means a selection of more than 400.000 packages. The goal of NodeOS is to provide just enough to let
npmprovide the rest. Since anyone can contribute to it, anyone can create NodeOS packages.
This project won the Spanish 9th National Free Software Championship on the Systems category and was Honorable Mention of its 10th edition. It was also presented as the degree thesis of Jesús Leganes Combarro with a qualification of 10/10 with distinction.
NodeOS is a Node.js based operating system, built-off of the Linux kernel. The NodeOS Project is aiming to, and can already run on some of the following platforms:
Core development is being done in layers. There could be some differences to adjust better to each target platform, but the general structure is:
All the layers are bootable, leading barebones to a raw naked Node.js REPL prompt as PID 1, while initramfs exec actual NodeOS code to isolate user code from the core system and, if available, mount a partition with the users' home directories and root filesystems.
If a usersfs partition is being set at boot time, it will be mounted and the system will consider each one of its folders as the home folder for a valid user on the system, and will execute a
initfile in the root of each of them. If found, the
rootuser will be the first to be considered and will have access to all of the home directories, but by design it will not be possible to elevate permissions once the system has finished booting.
If you are hacking on NodeOS for a somewhat production environment, you are likely interested on building a custom usersfs image or modify it once booted, since each user is isolated from the others and everyone can be able to define its own root filesystem, but you can customize all other layers if you want. For example, you can modify initramfs to login users and mount their home folders from a cloud service or craft a system without global services (no
rootuser), or also dedicate a full NodeOS instance to a single Node.js application.
The iso can be written to a CD-R or flashed to a USB pendrive, but will only provide the read-only rootfs and the changes will be done in memory, losing them after reboot, so you'll manually need to set a read-write usersfs partition if you want to persist them. On the other hand, if you want to flash it to a USB pendrive, We recommended doing it by using
bin/installUSBcommand so it will automatically create a read-write usersfs partition to fill the remaining space and use it as persistent storage.
git clone [email protected]:NodeOS/NodeOS.git cd NodeOS
npm run build
By default it will generate some files that can be used with QEmu, compiled for your current machine architecture. You can configure the build process by passing some environment variables. For example, to force to build for 32 bits, use
BITS=32 npm installinstead.
It will automatically detect what CPU architecture will need to be used on QEmu and exec the correct emulation.
NodeOS can be used as a Single Process OS, where only run a single executable. To do so, set the
SINGLE_USERenvironment variable to the name of a
npmmodule when executing
npm run build. This will run fully from initram, persistence can be achieved by setting this environment variable to an empty string and later using a custom
usersfspartition, but this is still experimental.
NodeOS fully officially supports Docker, published images are available at the DockerHub NodeOS organization. If you are interested in helping or testing, you can build them from source code.
Vagga support is fairly experimental, and help here will be greatly appreciated.
sudo docker run -t -i nodeos/nodeos
git clone https://github.com/NodeOS/NodeOS.git cd NodeOS PLATFORM=docker npm install
This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history available at https://github.com/NodeOS/NodeOS