Updated readme, added docs folder.

This commit is contained in:
sam 2020-03-22 16:07:10 -04:00
parent 0e52343432
commit a900ff3b54
4 changed files with 88 additions and 38 deletions

View File

@ -1,31 +0,0 @@
LC = luacomp
VER_MAJ = 2
VER_MIN = 0
VER_PAT = 0
VER_STR = $(VER_MAJ).$(VER_MIN).$(VER_PAT)
VER_NAME = New and Improved
MODS = $(wildcard mods/*)
release: dirs zyneo modules
find bin -depth | cpio -o > release.cpio
gzip -9k release.cpio # Maybe one day.
zyneo: bios
VER_STR=$(VER_STR) ZYNEO_PLATFORM=$(PLATFORM) $(LC) src/zy-neo/init.lua -O bin/zyneo.lua
bios:
VER_STR=$(VER_STR) ZYNEO_PLATFORM=$(PLATFORM) $(LC) bsrc/bios/init.lua -O bin/zyneo_bios.lua -mluamin
if [[ $(shell stat --printf=%s) > 4096 ]]; then \
echo "Warning! BIOS is over 4KiB!" > &2; \
fi
modules: $(MODS)
mods/%:
$(LC) src/lkern/$</init.lua -O bin/mods/$<
dirs:
mkdir -p bin/mods

View File

@ -4,16 +4,30 @@
Zorya NEO is the successor to the Zorya 1.x series of BIOS+Bootloaders for OpenComputers. It's design is now much more modular and extendable.
## How do I begin?
wait till it's stable and i release a zorya-neo-installer cpio
Grab the latest release. Install the BIOS before the utilities. The install is self-extracting. Don't download the tsar.
## How do I configure it?
Edit /.zy2/cfg.lua
Edit /.zy2/cfg.lua or use the OpenOS config generator.
## What modules/libraries are included by default?
* Microtel (`krequire "net_minitel"`)
* Zorya LAN Boot 2.0 (`krequire "util_zlan"`)
* Classic Zorya Menu (`loadmod "menu_classic"`)
* Threading library (`krequire "thd"`)
* Virtual Devices library (`loadmod "util_vdev"`)
* Multithreading (`krequire("thd")`)
* TSAR archive reader (`krequire("util_tsar")`)
* CPIO archive reader (`krequire("util_cpio")`)
* URF archive reader (`krequire("util_urf")`)
* Romfs archive reader (`krequire("util_romfs")`)
* Minitel networking (`krequire("net_minitel")`)
* vComponent (`krequire("util_vcomponent")`)
* OEFIv1 (`loadmod("util_oefiv1")`)
* OEFIv2 (`loadmod("util_oefiv2")`)
* OpenOS loader (`loadmod("loader_openos")`)
* Fuchas loader (`loadmod("loader_fuchas")`)
* vBIOS (`loadmod("vdev_vbios")`)
* Search paths configuration (`loadmod("util_searchpaths")`)
* BIOS info component (`loadmod("vdev_biosdev")`)
* VFS (`loadmod("vfs")`)
* Zorya classic menu (`loadmod("menu_classic")`)
## What's the difference between modules and libraries?
There's not really a hard difference. But libraries shouldn't load modules. Modules can load libraries, though.
<hr>

0
docs/README.md Normal file
View File

View File

@ -0,0 +1,67 @@
local romfs = {}
local arc = {}
local function readint(r, n)
local str = assert(r(n), "Unexpected EOF!")
return string.unpack("<i"..n, str)
end
function romfs.read(read, seek, close)
local sig = read(7)
assert(sig, "Read error!")
if sig ~= "romfs\1\0" then error(string.format("Invalid romfs (%.14x != %.14x)", string.unpack("i7", sig), string.unpack("i7", "romfs\1\0"))) end
local tbl = {}
local lname
while lname ~= "TRAILER!!!" do
local nz = read(1):byte()
local name = read(nz)
local fsize = readint(read, 2)
local exec = read(1)
tbl[#tbl+1] = {name = name, size = fsize, exec = exec == "x", pos = seek(0)}
utils.debug_log(nz, name, fsize, exec)
seek(fsize)
lname = name
end
tbl[#tbl] = nil
return setmetatable({tbl=tbl, read=read,seek=seek, close=close}, {__index=arc})
end
function arc:fetch(path)
for i=1, #self.tbl do
if self.tbl[i].name == path then
self.seek(self.tbl[i].pos-self.seek(0))
return self.read(self.tbl[i].size)
end
end
return nil, "file not found"
end
function arc:exists(path)
for i=1, #self.tbl do
if (self.tbl[i].name == path) then
return true
end
end
return false
end
function arc:close()
self.close()
self.tbl = nil
self.read = nil
self.seek= nil
self.close = nil
end
function arc:list_dir(path)
if path:sub(#path) ~= "/" then path = path .. "/" end
local ent = {}
for i=1, #self.tbl do
if (self.tbl[i].name:sub(1, #path) == path and not self.tbl[i].name:find("/", #path+1, false)) then
ent[#ent+1] = self.tbl[i].name
end
end
return ent
end
return romfs