-
Notifications
You must be signed in to change notification settings - Fork 127
Internal API
Note: the following was added by @ArielAbreu (NOT the author of runtime.js) and is only partially documented.
These are things accessible through requiring 'runtimejs':
Terminal interface object
Collection of colors for the terminal interface.
Prints text
to the terminal. Reprinted repeat
time(s). fg
for text color, bg
for background text color.
Moves screen position by adding the offset
.
Moves screen to specified x
and y
coordinates. Unlike moveOffset()
, it is not relevant to the current screen position.
Keyboard functions provided
Event controller for key down events. By default has one listener (the terminal input controller).
Event controller for key up events.
PCI controller for runtime.js, also enables device drivers.
Finds device using vendorId
and deviceId
and, if found, sets opts
as device driver.
PS2 controller for runtime.js
Sets driver
as driver for keyboard.
??
allocDMA function in runtime.allocator... usage: unknown
Network access in runtime.js
Adds intf
to the interfaces available to runtime.js
Useful for network adapters.
runtime.js TCPSocket interface class, provides access to a TCPSocket. See the runtime.net.TCPSocket page. (yet to be created)
runtime.js TCPServerSocket interface class, provides access to a TCPSocket server. See the runtime.net.TCPSocket page. (yet to be created)
runtime.js UDPSocket interface class, provides access to a UDPSocket. See the runtime.net.UDPSocket page. (yet to be created)
Creates an IP4Address object from a
, b
, c
, and d
, without the dots.
Creates a MACAddress object from a
, b
, c
, d
, e
, and f
, without the colons.
Creates an Interface object from the given macAddr
, which must be an instance of runtime.net.MACAddress.
Collection of IP route functions
Adds a new subnet route
Adds the specifed gateway
and intf
as the default.
??
Controller triggered when an interface is added.
Controller triggered when an interface is removed.
Gets buffer address.
In debug mode? true
or false
, default false
.
Native functions
Shuts down the computer.
Reboots the computer.
Shell access for isolates.
Creates a new shell command accessible to the user via typing the name
in the shell and calls cb
when activated.
cb
should be something like:
runtime.shell.setCommand('foo', function(args, env, done) {
// `args` is a string,
// `env` is the command's environment object,
// and done is called like done([return code]) which tells the shell you're done.
});
Runs shell command name
. opts
should be an object, and accepts:
- args - A string containing arguments for the command,
- stdio - A runtime.stdio.StdioInterface to pipe stdio to.
ex:
var myio = new runtime.stdio.StdioInterface();
myio.onwriteline = function(text) {
console.log('hey! we got: ' + text);
};
myio.onreadline = function(cb) {
cb('foo');
};
runtime.shell.runCommand('foobar', {
args: 'someargs',
stdio: myio
}, function(retcode) {
console.log('exit with ' + retcode);
});
DNS interface for isolates. TODO: document DNS