OC-MultICE/README.md

35 lines
1.2 KiB
Markdown
Raw Normal View History

2017-04-19 03:54:24 +10:00
# MultICE
2017-04-19 03:53:21 +10:00
## The MultIplexed Computing Environment for OpenComputers
### Base OS API
#### s(name,function,environment)
Spawns a process from `function` under the name `name`, with the environment table specified in `environment`. Environment doesn't really have much use right now.
2017-04-19 22:52:17 +10:00
#### `l() `
2017-04-19 03:53:21 +10:00
Returns the last event. Doesn't actually work right now.
2017-04-19 22:52:17 +10:00
#### `h(...)`
2017-04-19 03:53:21 +10:00
Pushes an event to the queue, with whatever data you specify. Generally used for IPC.
### Module APIs
#### library/print.lua
These functions should be display device indepentent.
2017-04-19 22:52:17 +10:00
##### `print(...)`
Displays its arguments on the display device as a string, with a newline.
2017-04-19 22:52:17 +10:00
##### `write(...)`
Displays its arguments on the display device as a string, without a newline
#### drivers/keyboard.lua
This is a device-specific driver.
2017-04-19 22:52:17 +10:00
##### `readln()`
Reads a line of input from the keyboard.
#### library/net.lua
Note: Settings have to be set in the kernel module, at the line
```
tM,nP,nID = {}, 4096, 1
```
Where 4096 is the port and 1 is the device ID. Device ID can be any data type, port must be a number.
Network messages can be read from `_G.ev`, they have the type `net_msg`
2017-04-19 22:52:17 +10:00
##### `ns(id,po,msg)`
Sends network message `msg` to device `id` on port `po`