1
0
mirror of https://github.com/20kdc/OC-KittenOS.git synced 2024-11-27 04:48:05 +11:00

bye bye sys-donkonit, hello sys-glacier

because apparently that's a dead meme now? Hmph.
This commit is contained in:
20kdc 2018-03-19 01:27:30 +00:00
parent 6474b9356b
commit 4a57c9f175
10 changed files with 54 additions and 30 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
# This is released into the public domain.
# No warranty is provided, implied or otherwise.
# leaving in preSH.tar.gz for anyone who's interested # leaving in preSH.tar.gz for anyone who's interested
# in how NOT to do compression # in how NOT to do compression
code.tar code.tar

View File

@ -5,7 +5,7 @@
-- Terminology: -- Terminology:
-- "monitor": Either the Null Virtual Monitor[0] (a safetynet), -- "monitor": Either the Null Virtual Monitor[0] (a safetynet),
-- or an actual GPU/Screen pair managed by donkonit. -- or an actual GPU/Screen pair managed by Glacier.
-- "surface": Everest system-level drawing primitive -- "surface": Everest system-level drawing primitive
-- "window" : Everest user-level wrapper around a surface providing a reliable window frame, movement, etc. -- "window" : Everest user-level wrapper around a surface providing a reliable window frame, movement, etc.
-- "line" : A Wx1 area across a surface. -- "line" : A Wx1 area across a surface.

View File

@ -48,7 +48,7 @@ local function loadSettings()
pcall(function () pcall(function ()
local fw = require("sys-filewrap") local fw = require("sys-filewrap")
local se = require("serial") local se = require("serial")
local st = fw(fs.primary, "data/sys-donkonit/sysconf.lua", false) local st = fw(fs.primary, "data/sys-glacier/sysconf.lua", false)
local cfg = st.read("*a") local cfg = st.read("*a")
st.close() st.close()
st = nil st = nil
@ -66,8 +66,8 @@ end
local function saveSettings() local function saveSettings()
local fw = require("sys-filewrap") local fw = require("sys-filewrap")
local se = require("serial") local se = require("serial")
fs.primary.makeDirectory("data/sys-donkonit") fs.primary.makeDirectory("data/sys-glacier")
local st = fw(fs.primary, "data/sys-donkonit/sysconf.lua", true) local st = fw(fs.primary, "data/sys-glacier/sysconf.lua", true)
st.write(se.serialize(settings)) st.write(se.serialize(settings))
st.close() st.close()
end end

View File

@ -10,7 +10,7 @@ local gpu, screen = nil, nil
local shutdownEmergency = neo.requestAccess("k.computer").shutdown local shutdownEmergency = neo.requestAccess("k.computer").shutdown
neo.requestAccess("s.h.key_down") neo.requestAccess("s.h.key_down")
-- donkonit hasn't started yet - this will be dealt with later -- glacier hasn't started yet - this will be dealt with later
local function _(tx) local function _(tx)
return tx return tx
end end
@ -24,9 +24,9 @@ local warnings = {
-- Attempts to call upon nsm for a safe shutdown -- Attempts to call upon nsm for a safe shutdown
local function shutdown(reboot) local function shutdown(reboot)
local donkonit = neo.requestAccess("x.neo.sys.manage") local nsm = neo.requestAccess("x.neo.sys.manage")
if donkonit then if nsm then
donkonit.shutdown(reboot) nsm.shutdown(reboot)
while true do while true do
coroutine.yield() coroutine.yield()
end end
@ -62,11 +62,11 @@ local function retrieveNssMonitor(nss)
end end
-- nss available - this means the monitor pool is now ready. -- nss available - this means the monitor pool is now ready.
-- If no monitors are available, shut down now. -- If no monitors are available, shut down now.
-- donkonit monitor pool output is smaller than, but similar to, Everest monitor data: -- NSS monitor pool output is smaller than, but similar to, Everest monitor data:
-- {gpu, screenAddr} -- {gpu, screenAddr}
local pool = nss.getClaimable() local pool = nss.getClaimable()
while not pool[1] do while not pool[1] do
coroutine.yield() -- wait for presumably a donkonit notification coroutine.yield() -- wait for presumably a NSS notification
pool = nss.getClaimable() pool = nss.getClaimable()
end end
subpool = {} subpool = {}
@ -177,7 +177,7 @@ local function finalPrompt()
end, 2, 5, scrW - 2} end, 2, 5, scrW - 2}
if password == "" then if password == "" then
pw = {function () pw = {function ()
return "Log in..." return _("Log in...")
end, function (key) end, function (key)
if key == 13 then if key == 13 then
waiting = false waiting = false
@ -191,7 +191,7 @@ local function finalPrompt()
end, function (key) end, function (key)
if key == 13 then if key == 13 then
basicDraw() basicDraw()
gpu.set(2, 4, "Shutting down...") gpu.set(2, 4, _("Shutting down..."))
shutdown(false) shutdown(false)
end end
end, 2, scrH - 1, unicode.len(shButton)}, end, 2, scrH - 1, unicode.len(shButton)},
@ -200,7 +200,7 @@ local function finalPrompt()
end, function (key) end, function (key)
if key == 13 then if key == 13 then
basicDraw() basicDraw()
gpu.set(2, 4, "Rebooting...") gpu.set(2, 4, _("Rebooting..."))
shutdown(true) shutdown(true)
end end
end, 3 + unicode.len(shButton), scrH - 1, unicode.len(rbButton)}, end, 3 + unicode.len(shButton), scrH - 1, unicode.len(rbButton)},
@ -209,7 +209,7 @@ local function finalPrompt()
end, function (key) end, function (key)
if key == 13 then if key == 13 then
basicDraw() basicDraw()
gpu.set(2, 4, "Login to activate Safe Mode.") gpu.set(2, 4, _("Login to activate Safe Mode."))
sleep(1) sleep(1)
safeModeActive = true safeModeActive = true
advDraw() advDraw()
@ -259,10 +259,10 @@ local function postPrompt()
if everests then if everests then
local s, e = pcall(everests.startSession) local s, e = pcall(everests.startSession)
if not s then if not s then
table.insert(warnings, "Everest failed to create a session") table.insert(warnings, _("Everest failed to create a session"))
table.insert(warnings, tostring(e)) table.insert(warnings, tostring(e))
else else
warnings = {"Transferring to Everest..."} warnings = {_("Transferring to Everest...")}
advDraw() advDraw()
if performDisclaim then if performDisclaim then
performDisclaim() performDisclaim()
@ -272,7 +272,7 @@ local function postPrompt()
return return
end end
else else
table.insert(warnings, "Couldn't communicate with Everest...") table.insert(warnings, _("Couldn't communicate with Everest..."))
end end
advDraw() advDraw()
sleep(1) sleep(1)
@ -298,7 +298,7 @@ local function initializeSystem()
end end
local w = 1 local w = 1
local steps = { local steps = {
"sys-donkonit", -- (Donkonit : Config, Screen, Power) "sys-glacier", -- (Glacier : Config, Screen, Power)
-- Let that start, and system GC -- Let that start, and system GC
"WAIT", "WAIT",
"WAIT", "WAIT",
@ -340,14 +340,14 @@ local function initializeSystem()
end end
if steps[w] then if steps[w] then
if steps[w] == "INJECT" then if steps[w] == "INJECT" then
local donkonit = neo.requestAccess("x.neo.sys.manage") local nsm = neo.requestAccess("x.neo.sys.manage")
if not donkonit then if not nsm then
table.insert(warnings, "Settings not available for INJECT.") table.insert(warnings, _("Settings not available for INJECT."))
else else
local nextstepsA = {} local nextstepsA = {}
local nextstepsB = {} local nextstepsB = {}
for _, v in ipairs(neo.listApps()) do for _, v in ipairs(neo.listApps()) do
if donkonit.getSetting("run." .. v) == "yes" then if nsm.getSetting("run." .. v) == "yes" then
if v:sub(1, 4) == "sys-" then if v:sub(1, 4) == "sys-" then
table.insert(nextstepsA, v) table.insert(nextstepsA, v)
else else
@ -396,19 +396,19 @@ end
if finalPrompt() then if finalPrompt() then
-- Safe Mode -- Safe Mode
basicDraw() basicDraw()
local donkonit = neo.requestAccess("x.neo.sys.manage") local nsm = neo.requestAccess("x.neo.sys.manage")
if donkonit then if nsm then
gpu.set(2, 4, "Rebooting for Safe Mode...") gpu.set(2, 4, _("Rebooting for Safe Mode..."))
for _, v in ipairs(donkonit.listSettings()) do for _, v in ipairs(nsm.listSettings()) do
if v ~= "password" then if v ~= "password" then
donkonit.delSetting(v) nsm.delSetting(v)
end end
end end
else else
-- assume sysconf.lua did something very bad -- assume sysconf.lua did something very bad
gpu.set(2, 4, "No Donkonit. Wiping configuration completely.") gpu.set(2, 4, "No NSM. Wiping configuration completely.")
local fs = neo.requestAccess("c.filesystem") local fs = neo.requestAccess("c.filesystem")
fs.primary.remove("/data/sys-donkonit/sysconf.lua") fs.primary.remove("/data/sys-glacier/sysconf.lua")
end end
-- Do not give anything a chance to alter the new configuration -- Do not give anything a chance to alter the new configuration
shutdownEmergency(true) shutdownEmergency(true)

View File

@ -1,3 +1,6 @@
-- This is released into the public domain.
-- No warranty is provided, implied or otherwise.
-- BDIVIDE -- BDIVIDE
-- format: -- format:
-- 0-127 for constants -- 0-127 for constants

View File

@ -1,3 +1,5 @@
-- This is released into the public domain. XX
-- No warranty is provided, implied or otherwise. XX
local sector = io.write -- XX local sector = io.write -- XX
-- BUNDIVIDE reference implementation for integration XX -- BUNDIVIDE reference implementation for integration XX
local Cs,Cbu,Cb,Cw,Cp,Ci,CP,CB,CD={},128,"",128,"" local Cs,Cbu,Cb,Cw,Cp,Ci,CP,CB,CD={},128,"",128,""

View File

@ -1,4 +1,7 @@
-- PREPROC: preprocess input -- PREPROC: preprocess input to be 7-bit
-- This is released into the public domain.
-- No warranty is provided, implied or otherwise.
while true do while true do
local c = io.read(1) local c = io.read(1)
if not c then return end if not c then return end

View File

@ -1,3 +1,6 @@
-- This is released into the public domain where possible.
-- No warranty is provided, implied or otherwise.
-- SYSTEM HEROES. -- SYSTEM HEROES.
-- Nabbed Sonic Heroes lyrics follow: -- Nabbed Sonic Heroes lyrics follow:
-- "What comes up, must come down... " -- "What comes up, must come down... "

View File

@ -1,3 +1,6 @@
-- This is released into the public domain.
-- No warranty is provided, implied or otherwise.
os.execute("tar -cf code.tar code") os.execute("tar -cf code.tar code")
os.execute("cat insthead.lua > inst.lua") os.execute("cat insthead.lua > inst.lua")
local f = io.open("inst.lua", "ab") local f = io.open("inst.lua", "ab")

7
package.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# This is released into the public domain.
# No warranty is provided, implied or otherwise.
rm code.tar
tar -cf code.tar code