added the start of a user guide

This commit is contained in:
Izaya 2017-10-11 18:42:38 +11:00
parent ecb0ae6b46
commit dcf5cf7c35
2 changed files with 68 additions and 1 deletions

View File

@ -21,7 +21,7 @@ PsychOS is a multi-user cooperative multitasking operating system for OpenComput
### Documentation
- [Installation guide](install.html)
- User guide (WIP)
- [User guide](userguide.html)
- [Building PsychOS](building.html)
- [API documentation](api.html)
- [Filesystem layout](fhs.html)

67
docs/userguide.md Normal file
View File

@ -0,0 +1,67 @@
# PsychOS user guide
## Useful key combinations:
`ctrl-shift-c` inside PsychOS will cancel text input or stop certain programs.
`ctrl-shift-r` will soft-reboot the machine, preserving the content of `/tmp`.
## The lush shell
lush is the default shell of PsychOS. It allows executing functions in memory, programs on disk and Lua typed directly into lush, in order of preference.
The default prompt is `[<user>@<hostname> <current directory>]$`
Some example usage:
### running a function
```
[user@host /boot]$ =ps
function: 0x12ed5c0
```
This is checking if ps is indeed a function.
```
[user@host /boot]$ ps
PID User Name
3 superu logflushd
4 superu ncd
5 superu tty[randomstringabcd]: 8f01b7c7,89734f0
6 superu kbd: 1f46ed58
7 superu kbd-clibboard: 1f46ed58
8 superu login manager: randomstringabcd
```
This runs the ps function. You can also have arguments following the function name, separated by spaces.
### running a program on disk
You have the following program stored as count.lua, in the current directory:
```
for i = 1, 5 do
print(i)
end
```
To run it, all you need to do is:
```
[user@host /boot]$ count
```
You should get the expected output:
```
1
2
3
4
5
```
### running Lua code
Running Lua from lush is also simple, in that you just type it in.
```
[user@host /boot]$ for i = 1, 5 do print(i) end
```
You should get the same output as the last example.