Kernel Module
This Module provides an interface for other Modules to interact with the Kernel.
Dependencies |
Globals
computer.beep (pitch: number)
Lets the computer emit a simple beep sound with the given pitch.
Details
| Name | Type | Description |
|---|---|---|
Pitch |
number |
a multiplier for the pitch adjustment of the beep sound |
computer.getEEPROM () → string
Returns the current eeprom contents.
Details
| Name | Type | Description |
|---|---|---|
Code |
string |
The EEPROM Code as string |
computer.getInstance () → ComputerCase
Returns a reference to the computer case in which the current code is running.
Details
| Name | Type | Description |
|---|---|---|
Case |
The computer case this lua runtime is running in |
computer.getMemory () → (usage: integer, capacity: integer)
Returns the used memory and memory capacity the computer has.
Details
| Name | Type | Description |
|---|---|---|
Usage |
integer |
The memory usage at the current time |
Capacity |
integer |
The memory capacity the computer has |
computer.getPCIDevices (type: Object-Class?) → Object[]
This function allows you to get all installed PCI-Devices in a computer of a given type. Have a look at this example to fully understand how it works.
Details
| Name | Type | Description |
|---|---|---|
Type |
Object-Class? |
Optional type which will be used to filter all PCI-Devices. If not provided, will return all PCI-Devices |
| Name | Type | Description |
|---|---|---|
Objects |
Object[] |
An array containing instances for each PCI-Device built into the computer |
computer.media : FINMediaSubsystem
Field containing a reference to the Media Subsystem.
computer.millis () → integer
Returns the amount of milliseconds passed since the system started.
Details
| Name | Type | Description |
|---|---|---|
Millis |
integer |
The amount of real milliseconds sinde the ingame-computer started |
computer.panic (error: string)
Crashes the computer with the given error message.
Details
| Name | Type | Description |
|---|---|---|
Error |
string |
an error message |
computer.reset ()
Stops the current code execution immediately and queues the system to restart in the next tick.
computer.setEEPROM (code: string)
Sets the code of the current eeprom. Doesn¬タルt cause a system reset.
Details
| Name | Type | Description |
|---|---|---|
Code |
string |
The new EEPROM Code as string |
filesystem.initFileSystem (path: string) → boolean
Trys to mount the system DevDevice to the given location. The DevDevice is special Device holding DeviceNodes for all filesystems added to the system. (like TmpFS and drives). It is unmountable as well as getting mounted a seccond time.
Details
| Name | Type | Description |
|---|---|---|
Path |
string |
path to the mountpoint were the dev device should get mounted to |
| Name | Type | Description |
|---|---|---|
Success |
boolean |
returns if it was able to mount the DevDevice |
filesystem.makeFileSystem (type: string, name: string) → boolean
Trys to create a new file system of the given type with the given name. The created filesystem will be added to the system DevDevice.
Possible Types:
-
tmpfsA temporary filesystem only existing at runtime in the memory of your computer. All data will be lost when the system stops.
Details
| Name | Type | Description |
|---|---|---|
Type |
string |
the type of the new filesystem |
Name |
string |
the name of the new filesystem you want to create |
| Name | Type | Description |
|---|---|---|
Success |
boolean |
returns true if it was able to create the new filesystem |
filesystem.removeFileSystem (name: string) → boolean
Tries to remove the filesystem with the given name from the system DevDevice. All mounts of the device will run invalid.
Details
| Name | Type | Description |
|---|---|---|
Name |
string |
the name of the new filesystem you want to remove |
| Name | Type | Description |
|---|---|---|
Success |
boolean |
returns true if it was able to remove the new filesystem |