Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Commit 7e9d9af

Browse files
author
Face Kapow
committed
Merge master back in
2 parents 8378fee + 30abc90 commit 7e9d9af

2,854 files changed

Lines changed: 417246 additions & 262890 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,11 @@ disk/boot/initrd-downloaded
2525
disk/boot/runtime-downloaded
2626
netdump.txt
2727
/js/node_modules
28+
/node_modules
29+
/out
2830
/js/initrd
2931
/build/system/kernel.js
32+
release.tag
33+
npm-debug.log
34+
/src/kernel/version-autogenerated.h
35+
/runtimecorelib.json

.jshintrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/*
2+
/*/
3+
!/js/
4+
!/scripts/

.runtimeignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/node_modules/async
2+
/node_modules/eslint
3+
/node_modules/eslint-plugin-runtime-internal
4+
/node_modules/runtime-tools
5+
/node_modules/runtimeify
6+
/node_modules/tape
7+
/node_modules/eslint-config-runtime
8+
/test
9+
tape/
10+
module-singleton/test-modules/
11+
test.js
12+
README.md
13+
LICENSE.isaac
14+
LICENSE
15+
/node_modules/util/test/
16+
/src
17+
/deps
18+
/tmp
19+
/scripts
20+
/testcc
21+
/disk
22+
/docker
23+
/docs
24+
/gen
25+
/out
26+
/runtimejs
27+
*.o

.travis.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
language: cpp
22
compiler: gcc
3-
3+
sudo: false
44
before_script:
5-
- cd tools
6-
- wget https://github.com/runtimejs/toolchain-bin-linux/raw/master/x86_64-elf-4.9.1-Linux-x86_64.tar.xz
7-
- tar -xf x86_64-elf-4.9.1-Linux-x86_64.tar.xz
8-
- wget https://github.com/runtimejs/toolchain-bin-linux/raw/master/fasm-1.71.21.tgz
9-
- tar -xf fasm-1.71.21.tgz
10-
- cd ..
11-
- export PATH=$PWD/tools/x86_64-elf-4.9.1-Linux-x86_64/bin:$PWD/tools/fasm:$PATH
12-
13-
script: scons
5+
- npm install -g npm@2
6+
- node scripts/make-release.js "$TRAVIS_TAG"
7+
- cd tools
8+
- wget https://github.com/runtimejs/toolchain-bin-linux/raw/master/x86_64-elf-4.9.1-Linux-x86_64.tar.xz
9+
- tar -xf x86_64-elf-4.9.1-Linux-x86_64.tar.xz
10+
- wget https://github.com/runtimejs/toolchain-bin-linux/raw/master/fasm-1.71.21.tgz
11+
- tar -xf fasm-1.71.21.tgz
12+
- cd ..
13+
- export PATH=$PWD/tools/x86_64-elf-4.9.1-Linux-x86_64/bin:$PWD/tools/fasm:$PATH
14+
script: RUNTIME_BUILD=release scons
15+
after_success: gzip disk/boot/runtime
16+
deploy:
17+
- provider: releases
18+
skip_cleanup: true
19+
api_key:
20+
secure: P+Ei+zxl/jN4Mt+sIm0jfikU0F81yQJEDQgLharThnblm8SILYLZ4jo+vSC7YA5u75wjj6ej3Guxk/Nm0Ajg4C9K7BLVZViZzrRhT8VdxZ8680EOn0A7/abHKA8AT+By8n4sOMhGgbsOLUUHQC+Bo7KLA2S2NGLgHJCKuEatPjg=
21+
file: disk/boot/runtime.gz
22+
on:
23+
tags: true
24+
repo: runtimejs/runtime
25+
- provider: npm
26+
skip_cleanup: true
27+
email: shayief@gmail.com
28+
api_key:
29+
secure: Prcon+FjPLo1nh6hdJ1byLAUTMU/vfq3fBLzkxQIyJTVKIeKg9mPVtNoCmvbgxsSVTdS+gPjIoMpt0LgZCUq/cDRJAtOIaAqbm+fVNJBTwgkgwYAG7hCjEprAhUYiqutT+7KhgNZSKUBNJo/w5sWl8xdsSbfHyldGP6XBcocL50=
30+
on:
31+
tags: true
32+
repo: runtimejs/runtime

CHANGELOG.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

NOTICE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ This product includes software libraries:
1212
- crc64 function by Salvatore Sanfilippo <antirez at gmail dot com>
1313
- expect.js library by Guillermo Rauch (https://github.com/LearnBoost/expect.js/)
1414
- concurrentqueue by Cameron Desrochers (https://github.com/cameron314/concurrentqueue)
15+
- miniz (https://code.google.com/p/miniz/), located at deps/miniz
1516

1617
These libraries have their own licenses.

README.md

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,69 @@
22

33
[![Build Status](https://travis-ci.org/runtimejs/runtime.svg?branch=master)](https://travis-ci.org/runtimejs/runtime) [![npm](https://img.shields.io/npm/v/runtimejs.svg)](https://www.npmjs.com/package/runtimejs) [![Gem](https://img.shields.io/badge/freenode-%23runtimejs-blue.svg)](https://freenode.net/) [![Travis](https://img.shields.io/badge/GITTER-JOIN_CHAT_%E2%86%92-1dce73.svg)](https://gitter.im/runtimejs/runtime)
44

5-
__runtime.js__ is an open-source library operating system for the cloud that runs JavaScript, could be bundled up with an application and deployed as a lightweight and immutable VM image.
5+
__runtime.js__ is an open-source library operating system (unikernel) for the cloud that runs JavaScript, can be bundled up with an application and deployed as a lightweight and immutable VM image.
66

77
It's built on [V8 JavaScript engine](https://code.google.com/p/v8/) and uses event-driven and non-blocking I/O model inspired by [Node.js](https://nodejs.org/). At the moment [KVM](http://www.linux-kvm.org/page/Main_Page) is the only supported hypervisor.
88

9-
Example **index.js**:
9+
It tries to be compatible with npm module ecosystem and supports some of the Node.js API.
1010

11-
```js
12-
var runtime = require('runtimejs')
13-
console.log('Hello world!')
14-
```
11+
_WARNING: project is in development and not ready for production use._
1512

16-
Let's bundle up and run it!
13+
### Installation
1714

18-
```bash
19-
# install dependencies
20-
npm install runtimejs
21-
npm install runtimeify -g
22-
npm install runtime-tools -g
15+
First thing is the command line tool `runtime-cli`, it will add `runtime` command to the shell. Type `runtime` to get full usage help.
2316

24-
# bundle up ramdisk image
25-
runtimeify index.js -o initrd
17+
```
18+
npm install runtime-cli -g
19+
```
2620

27-
# make sure you have QEMU installed
21+
Make sure QEMU is installed, it enables running applications locally.
22+
23+
```
2824
brew install qemu # OSX
2925
sudo apt-get install qemu # Ubuntu
26+
```
27+
28+
### Getting Started
29+
30+
Create new project and add `index.js` entry point file:
3031

31-
# run it in QEMU
32-
runtime-qemu ./initrd
32+
```
33+
mkdir project
34+
cd project
35+
npm init
36+
npm install runtimejs --save
37+
echo "console.log('ok')" > index.js
3338
```
3439

35-
WARNING: project is in development and not ready for production use. Contributions are welcome.
40+
Run project locally in QEMU:
3641

37-
## How does it work?
42+
```
43+
runtime start
44+
```
3845

39-
There are two main components: operating system (OS) kernel and a <a href="https://www.npmjs.com/package/runtimejs"><nobr>core JavaScript library</nobr></a>.
46+
That's it, it should start and print `ok` in the console.
4047

41-
The kernel is the C++ program that manages low-level resources like CPU and memory, runs applications using embedded <a href="https://code.google.com/p/v8/"><nobr>V8 JavaScript engine</nobr></a>, and exposes raw hardware to JavaScript.
48+
Optionally you can let it watch directory for changes and restart QEMU automatically:
4249

43-
Application, its dependencies and the core library are bundled up using <a href="http://browserify.org/">Browserify</a>, then packed into ramdisk image for kernel to use.
50+
```
51+
runtime watch
52+
```
4453

45-
runtime.js is a library operating system, because application uses it as its own dependency (library). Internal architecture is similar to [exokernels](https://en.wikipedia.org/wiki/Exokernel), where system exposes the hardware to application code and forces as few abstractions as possible.
54+
## How does it work?
55+
56+
There are two main components: operating system kernel and a <a href="https://www.npmjs.com/package/runtimejs"><nobr>JavaScript library</nobr></a>.
57+
58+
The kernel is written in C++ and manages low-level resources like CPU and memory, runs JavaScript using embedded V8 engine. Library drives the entire system and manages hardware devices (usually virtualized by hypervisor).
4659

4760
## Docs
4861

4962
[API docs](https://github.com/runtimejs/runtime/wiki/API-docs)
5063

64+
## Community
65+
66+
[Modules and projects developed by the community for runtime.js](https://github.com/runtimejs/runtime/wiki/Community)
67+
5168
License
5269
----
5370
Apache License, Version 2.0

SConstruct

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import datetime
44

55
SetOption('num_jobs', 4)
66

7-
build = "debug"
7+
build = os.getenv('RUNTIME_BUILD', "debug")
8+
print 'Build', build
89

910
config = {
10-
"project_name": "runtimejs",
11+
"project_name": "out/runtimejs",
1112
"binary_output_file": "disk/boot/runtime",
1213
"toolchain_bin_path": "",
1314
"fasm_pathname": "fasm",
@@ -50,7 +51,6 @@ config = {
5051
'-nostdinc++',
5152
'-std=c++11',
5253
'-O3',
53-
'-fno-rtti',
5454
'-U__STRICT_ANSI__',
5555
'-DENABLE_DEBUGGER_SUPPORT',
5656
'-DENABLE_DISASSEMBLER',
@@ -117,12 +117,15 @@ config = {
117117
'deps/acpica/source/include',
118118
'deps/printf',
119119
'deps/libsodium/src/libsodium/include',
120+
'deps/miniz',
120121
'src',
121122
'test',
122123
],
123124
"libs": [
124125
'v8',
126+
'cxxrt',
125127
'cxx',
128+
'miniz',
126129
'acpica',
127130
'printf',
128131
'sodium',
@@ -211,8 +214,12 @@ def BuildProject(env_base):
211214
env.Replace(LIBS = config["libs"])
212215
env.Replace(LIBPATH = ['deps'])
213216

217+
version_header = env.Command('src/kernel/version-autogenerated.h', 'package.json',
218+
'node scripts/update-versions.js')
219+
214220
proj_name = config["project_name"]
215221
env.Depends(proj_name, obj_js);
222+
env.Depends(proj_name, version_header)
216223
env.Depends(proj_name, config["link_script"])
217224
output_elf = env.Program(proj_name, sources["cc"] + obj_asm)
218225

build/system/init.js

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)