Compare commits

..

2 Commits

3 changed files with 16 additions and 9 deletions

View File

@ -6,16 +6,25 @@ A lightweight, multi-user operating system for OpenComputers
### The kernel ### The kernel
The kernel can be built using luapreproc: The kernel is composed of a number of modules, found in the *module/* directory. Which modules are included can be customised by changing the include statements in *module/init.lua*; copying it and customizing that is recommended, so you can *git pull* later without having to stash or reset your changes.
./luapreproc.lua module/init.lua kernel.lua #### Unix-like systems
The kernel can be built using the preproc library and provided scripts:
lua build.lua module/init.lua kernel.lua
#### PsychOS
The kernel can be built from inside PsychOS using the preproc library, assuming you have the kernel source available:
preproc("module/init.lua","kernel.lua")
### The boot filesystem ### The boot filesystem
A boot filesystem contains several things: A boot filesystem contains several things:
- The kernel, as init.lua - The kernel, as init.lua
- The exec/ directory, as this contains all executables
- The lib/ directory, containing libraries - The lib/ directory, containing libraries
- The service/ directory, containing system services - The service/ directory, containing system services
@ -23,6 +32,4 @@ This has been automated in the form of build.sh, pending a real makefile.
## Documentation ## Documentation
To generate function documentation, run: Documentation is generated as the system is built with build.sh; a set of markdown files will be placed into *doc/*, as well as an all-in-one *apidoc.md*. If pandoc is installed, an *apidoc.pdf* will also be generated.
./finddesc.lua module/* lib/* > apidoc.md

View File

@ -54,14 +54,14 @@ local function writeBuffer(fo)
return buffer.new("wb",stream) return buffer.new("wb",stream)
end end
function lz16.buffer(stream) function lz16.buffer(stream) -- table -- table -- Wrap a stream to read or write LZ16.
if stream.mode.w then if stream.mode.w then
return writeBuffer(stream) return writeBuffer(stream)
end end
return readBuffer(stream) return readBuffer(stream)
end end
function lz16.open(fname, mode) function lz16.open(fname, mode) -- string string -- table -- Open file *fname* to read or write LZ16-compressed data depending on *mode*
local f = io.open(fname, mode) local f = io.open(fname, mode)
if not f then return false end if not f then return false end
f.mode.b = true f.mode.b = true

View File

@ -98,7 +98,7 @@ function pkgfs.component.close(handle)
return true return true
end end
function pkgfs.add(fname,comp) function pkgfs.add(fname,comp) -- string boolean -- -- Add a package as specified in *fname* to the pkgfs component. If *comp* is true, read it as a LZ16-compressed package.
if fname:sub(1,1) ~= "/" then if fname:sub(1,1) ~= "/" then
fname = "/"..fnormalize(os.getenv("PWD").."/"..fname) fname = "/"..fnormalize(os.getenv("PWD").."/"..fname)
end end