@@ -6,19 +6,19 @@ A lightweight, multi-user operating system for OpenComputers | |||||
### The kernel | ### The kernel | ||||
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. | |||||
The kernel is composed of a number of modules, found in the *module/* directory, as specified by a file in the *kcfg* directory, `base` by default. Which modules are included can be customised by changing the include statements in the kernel configuration file; copying it and customizing that is recommended, so you can *git pull* later without having to stash or reset your changes. | |||||
#### Unix-like systems | #### Unix-like systems | ||||
The kernel can be built using the preproc library and provided scripts: | The kernel can be built using the preproc library and provided scripts: | ||||
lua build.lua module/init.lua kernel.lua | |||||
lua build.lua kcfg/base.cfg kernel.lua | |||||
#### PsychOS | #### PsychOS | ||||
The kernel can be built from inside PsychOS using the preproc library, assuming you have the kernel source available: | 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") | |||||
preproc("kcfg/base.cfg","kernel.lua") | |||||
### The boot filesystem | ### The boot filesystem | ||||
@@ -27,6 +27,7 @@ A boot filesystem contains several things: | |||||
- The kernel, as init.lua | - The kernel, as init.lua | ||||
- The lib/ directory, containing libraries | - The lib/ directory, containing libraries | ||||
- The service/ directory, containing system services | - The service/ directory, containing system services | ||||
- The exec/ directory, containing single-shot executable files | |||||
This has been automated in the form of build.sh, pending a real makefile. | This has been automated in the form of build.sh, pending a real makefile. | ||||
@@ -1 +1 @@ | |||||
{enabled={"getty","minitel"}} | |||||
{enabled={"getty","minitel","fsmanager"}} |
@@ -1,3 +1,4 @@ | |||||
--#includepkglib "diskpart" "lib/part/mtpt.lua" "part/mtpt" | |||||
--#includepkglib "diskpart" "lib/diskpart.lua" "diskpart" | --#includepkglib "diskpart" "lib/diskpart.lua" "diskpart" | ||||
--#includepkglib "rtfs" "lib/rtfs.lua" "rtfs" | --#includepkglib "rtfs" "lib/rtfs.lua" "rtfs" | ||||
do | do | ||||
@@ -1,3 +1,4 @@ | |||||
--#include "module/ocelot-debug.lua" | |||||
do | do | ||||
syslog = {} | syslog = {} | ||||
syslog.emergency = 0 | syslog.emergency = 0 | ||||
@@ -60,7 +60,7 @@ end | |||||
preproc.directives.include = preproc.preproc | preproc.directives.include = preproc.preproc | ||||
function preproc.directives.includelib(file, name) -- string string -- string -- Returns a preprocessed inlined library | function preproc.directives.includelib(file, name) -- string string -- string -- Returns a preprocessed inlined library | ||||
return string.format("package.loaded.%s = (function()\n%s\nend)()", name, preproc.preproc(file)) | |||||
return string.format("package.loaded['%s'] = (function()\n%s\nend)()", name, preproc.preproc(file)) | |||||
end | end | ||||
function preproc.directives.includepkgfile(package, file) | function preproc.directives.includepkgfile(package, file) | ||||
@@ -79,27 +79,9 @@ function preproc.directives.includepkgfile(package, file) | |||||
end | end | ||||
function preproc.directives.includepkglib(package, file, name) -- string string -- string -- Returns a preprocessed inlined library | function preproc.directives.includepkglib(package, file, name) -- string string -- string -- Returns a preprocessed inlined library | ||||
return string.format("package.loaded.%s = (function()\n%s\nend)()", name, preproc.directives.includepkgfile(package, file)) | |||||
return string.format("package.loaded['%s'] = (function()\n%s\nend)()", name, preproc.directives.includepkgfile(package, file)) | |||||
end | end | ||||
--[[ | |||||
function preproc.directives.includepkglib(package, file, name) | |||||
if (_OSVERSION or ""):sub(1,7) == "PsychOS" then | |||||
return preproc.directives.includelib(string.format("/pkg/%s", file), name) | |||||
else | |||||
for path in (os.getenv("PSYCHOSPACKAGES") or "../PsychOSPackages"):gmatch("[^:]+") do | |||||
print(string.format("%s/%s/%s", path, package, file)) | |||||
local f = io.open(string.format("%s/%s/%s", path, package, file), "r") | |||||
if f then | |||||
f:close() | |||||
return preproc.directives.includelib(string.format("%s/%s/%s", path, package, file), name) | |||||
end | |||||
end | |||||
end | |||||
error(string.format("unable to locate library %s from package %s", name, package)) | |||||
end | |||||
]] | |||||
return setmetatable(preproc,{__call=function(_,...) | return setmetatable(preproc,{__call=function(_,...) | ||||
local tA = {...} | local tA = {...} | ||||
local out = table.remove(tA,#tA) | local out = table.remove(tA,#tA) | ||||