11 Commits

Author SHA1 Message Date
030e5bfd96 Update install/data/tarbad 2026-03-12 20:59:36 -04:00
099638c735 Merge pull request 'update tar' (#12) from 1.2-dev into main
Reviewed-on: #12
2026-03-12 20:55:22 -04:00
4f9eebade2 update tar 2026-03-12 20:54:27 -04:00
5172da1b5b Merge pull request '1.2-dev' (#11) from 1.2-dev into main
Reviewed-on: #11
2026-03-12 19:32:16 -04:00
d08935b68a remove gotos 2026-03-12 19:31:37 -04:00
45b46cf3c4 Merge pull request 'main' (#10) from main into 1.2-dev
Reviewed-on: #10
2026-03-12 19:27:44 -04:00
aeea68bc9b Update install/data/tarbad 2026-03-12 12:12:48 -04:00
f983b13d56 Update install/installcc.lua
make it use right stuff
2026-03-12 12:10:37 -04:00
03c5b106c4 Update Src/Hyperion-kernel/boot/kernel.lua 2026-03-12 11:59:35 -04:00
08323e00ff Update install/data/tarbad 2026-03-12 11:56:58 -04:00
5e3cdbe40c Update install/installcc.lua 2026-03-12 11:51:55 -04:00
6 changed files with 118 additions and 127 deletions

View File

@@ -130,18 +130,22 @@ if not initCfgStatus then
end end
kernel.config = config kernel.config = config
local skip=false
for i,v in ipairs(split(fstab,"\n")) do for i,v in ipairs(split(fstab,"\n")) do
if v:sub(1,1)=="U" then if v:sub(1,1)=="U" then
local id="" local id=""
for i=3,#v do for i=3,#v do
if v:sub(i,i)==";" then if v:sub(i,i)==";" then
if i==3 then kernel.log("Invalid fstab line... Skipping.","WARN") goto endline end if i==3 then kernel.log("Invalid fstab line... Skipping.","WARN") skip = true break end
id=v:sub(3,i-1) id=v:sub(3,i-1)
end end
end end
local path=v:sub(#id+4) if not skip then
ifs.mount(id,path) local path=v:sub(#id+4)
::endline:: ifs.mount(id,path)
else
skip=false
end
end end
end end
kernel.log("Disks initialized") kernel.log("Disks initialized")
@@ -265,15 +269,13 @@ for _,p in ipairs(modules) do
if kernel.config.showModLoad then kernel.log("Loading module "..v, "DBUG", 5) end if kernel.config.showModLoad then kernel.log("Loading module "..v, "DBUG", 5) end
local code=ifs.readAllText(v) local code=ifs.readAllText(v)
if not code then if not code then
kernel.log("ModuReadErr: "..v, "WARN", 8) kernel.panic("Failed to read module "..v)
goto skip
end end
local func,err=load(code,"@"..v) local func,err=load(code,"@"..v)
if not func then kernel.panic("ModuLoadErr: "..tostring(err)) goto skip end if not func then kernel.panic("ModuLoadErr: "..tostring(err)) end
local status, err = xpcall(func,debug.traceback, kernel) local status, err = xpcall(func,debug.traceback, kernel)
if not status then kernel.panic("ModuRunErr: "..tostring(err)) end if not status then kernel.panic("ModuRunErr: "..tostring(err)) end
if kernel.config.showModLoad then kernel.log("Loaded module "..v, "DBUG", 5) end if kernel.config.showModLoad then kernel.log("Loaded module "..v, "DBUG", 5) end
::skip::
end end
end end

View File

@@ -126,36 +126,35 @@ local function doLogin()
syscall.write(1, "Username: ") syscall.write(1, "Username: ")
local username = readLine(nil) local username = readLine(nil)
if username == "" then goto continue end if username ~= "" then
syscall.write(1, "Password: ") syscall.write(1, "Password: ")
local password = readLine("*") local password = readLine("*")
local uid = syscall.getuidbyname(username) local uid = syscall.getuidbyname(username)
local ok, err = syscall.login(uid, password) local ok, err = syscall.login(uid, password)
if ok then if ok then
local uid = syscall.getuid() local uid = syscall.getuid()
local pwent = syscall.getpasswd(uid) local pwent = syscall.getpasswd(uid)
local shell = (pwent and pwent.shell) or "/bin/hysh" local shell = (pwent and pwent.shell) or "/bin/hysh"
local homedir = (pwent and pwent.homedir) or "/" local homedir = (pwent and pwent.homedir) or "/"
syscall.devctl(1, "sfgc", 3) syscall.devctl(1, "sfgc", 3)
syscall.write(1, "\nWelcome, " .. username .. "!\n") syscall.write(1, "\nWelcome, " .. username .. "!\n")
syscall.devctl(1, "sfgc", 1) syscall.devctl(1, "sfgc", 1)
sleep(0.3) sleep(0.3)
spawnShell(username, uid, shell, homedir) spawnShell(username, uid, shell, homedir)
return -- back to login prompt return -- back to login prompt
else else
attempts = attempts + 1 attempts = attempts + 1
sleep(1) sleep(1)
syscall.devctl(1, "sfgc", 2) syscall.devctl(1, "sfgc", 2)
syscall.write(1, "Login incorrect.\n\n") syscall.write(1, "Login incorrect.\n\n")
syscall.devctl(1, "sfgc", 1) syscall.devctl(1, "sfgc", 1)
end
end end
::continue::
end end
syscall.devctl(1, "sfgc", 2) syscall.devctl(1, "sfgc", 2)

View File

@@ -308,16 +308,16 @@ local history = {}
while true do while true do
local code = getUserInput("lua> ", history) local code = getUserInput("lua> ", history)
if code == "" then goto continue end if code ~= "" then
while isIncomplete(code) do while isIncomplete(code) do
code = code .. "\n" .. getUserInput("... ", nil) code = code .. "\n" .. getUserInput("... ", nil)
end
if code ~= history[#history] then
history[#history+1] = code
end
runCode(code)
end end
if code ~= history[#history] then
history[#history+1] = code
end
runCode(code)
::continue::
end end

View File

@@ -139,72 +139,68 @@ local function parseCommands(src)
local c = src:sub(pos, pos) local c = src:sub(pos, pos)
if c == "\n" or c == ";" then if c == "\n" or c == ";" then
pos = pos + 1 pos = pos + 1
goto continue elseif c == "#" then
end
if c == "#" then
while pos <= len and src:sub(pos,pos) ~= "\n" do pos = pos + 1 end while pos <= len and src:sub(pos,pos) ~= "\n" do pos = pos + 1 end
goto continue
end
local addr1, addr2
addr1, pos = parseAddr(src, pos)
skip()
if addr1 and pos <= len and src:sub(pos,pos) == "," then
pos = pos + 1
skip()
addr2, pos = parseAddr(src, pos)
end
skip()
if pos > len then break end
local cmd = src:sub(pos, pos)
pos = pos + 1
if cmd == "s" then
local delim = src:sub(pos, pos); pos = pos + 1
local pat, p1 = parseDelim(src, pos, delim); pos = p1
local repl, p2 = parseDelim(src, pos, delim); pos = p2
local flags = ""
while pos <= len and src:sub(pos,pos):match("[giIp]") do
flags = flags .. src:sub(pos,pos); pos = pos + 1
end
table.insert(cmds, { addr1=addr1, addr2=addr2, cmd="s",
pat=pat, repl=repl, flags=flags })
elseif cmd == "y" then
local delim = src:sub(pos, pos); pos = pos + 1
local srcch, p1 = parseDelim(src, pos, delim); pos = p1
local dstch, p2 = parseDelim(src, pos, delim); pos = p2
table.insert(cmds, { addr1=addr1, addr2=addr2, cmd="y",
src=srcch, dst=dstch })
elseif cmd == "d" or cmd == "p" or cmd == "q" or cmd == "=" then
table.insert(cmds, { addr1=addr1, addr2=addr2, cmd=cmd })
elseif cmd == "{" then
local depth = 1
local start = pos
while pos <= len and depth > 0 do
local ch = src:sub(pos,pos)
if ch == "{" then depth = depth + 1
elseif ch == "}" then depth = depth - 1 end
pos = pos + 1
end
local inner = src:sub(start, pos - 2)
local innerCmds = parseCommands(inner)
for _, ic in ipairs(innerCmds) do
ic.addr1 = ic.addr1 or addr1
ic.addr2 = ic.addr2 or addr2
end
for _, ic in ipairs(innerCmds) do
table.insert(cmds, ic)
end
elseif cmd == "\n" or cmd == ";" then
else else
end
::continue:: local addr1, addr2
addr1, pos = parseAddr(src, pos)
skip()
if addr1 and pos <= len and src:sub(pos,pos) == "," then
pos = pos + 1
skip()
addr2, pos = parseAddr(src, pos)
end
skip()
if pos > len then break end
local cmd = src:sub(pos, pos)
pos = pos + 1
if cmd == "s" then
local delim = src:sub(pos, pos); pos = pos + 1
local pat, p1 = parseDelim(src, pos, delim); pos = p1
local repl, p2 = parseDelim(src, pos, delim); pos = p2
local flags = ""
while pos <= len and src:sub(pos,pos):match("[giIp]") do
flags = flags .. src:sub(pos,pos); pos = pos + 1
end
table.insert(cmds, { addr1=addr1, addr2=addr2, cmd="s",
pat=pat, repl=repl, flags=flags })
elseif cmd == "y" then
local delim = src:sub(pos, pos); pos = pos + 1
local srcch, p1 = parseDelim(src, pos, delim); pos = p1
local dstch, p2 = parseDelim(src, pos, delim); pos = p2
table.insert(cmds, { addr1=addr1, addr2=addr2, cmd="y",
src=srcch, dst=dstch })
elseif cmd == "d" or cmd == "p" or cmd == "q" or cmd == "=" then
table.insert(cmds, { addr1=addr1, addr2=addr2, cmd=cmd })
elseif cmd == "{" then
local depth = 1
local start = pos
while pos <= len and depth > 0 do
local ch = src:sub(pos,pos)
if ch == "{" then depth = depth + 1
elseif ch == "}" then depth = depth - 1 end
pos = pos + 1
end
local inner = src:sub(start, pos - 2)
local innerCmds = parseCommands(inner)
for _, ic in ipairs(innerCmds) do
ic.addr1 = ic.addr1 or addr1
ic.addr2 = ic.addr2 or addr2
end
for _, ic in ipairs(innerCmds) do
table.insert(cmds, ic)
end
elseif cmd == "\n" or cmd == ";" then
else
end
end
end end
return cmds return cmds

Binary file not shown.

View File

@@ -4,24 +4,18 @@ term.clear()
print("Do you want to install HyperionOS? [Y/n]") print("Do you want to install HyperionOS? [Y/n]")
local input=read() local input=read()
if input=="y" or input=="Y" or input=="" then if input=="y" or input=="Y" or input=="" then
goto install print("Installing tar but bad...")
else shell.run("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/branch/main/install/data/tarbad /tar.lua")
goto exit print("Installing HyperionOS...")
print("Installing precompiled tar")
shell.run("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/branch/main/install/data/Build.tar /Build.tar")
shell.run("tar Build.tar /")
print("Removing tar but bad...")
shell.run("rm /tar.lua")
shell.run("rm $")
shell.run("cp Build $")
shell.run("rm Build")
shell.run("rm Build.tar")
fs.copy("/$/boot/cct/eeprom","/startup.lua")
dofile("startup.lua")
end end
::install::
print("Installing tar but bad...")
shell.run("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/branch/1.2-dev/install/data/tarbad /tar.lua")
print("Installing HyperionOS...")
print("Installing precompiled tar")
shell.run("wget https://git.astronand.dev/Hyperion/HyperionOS/raw/branch/1.2-dev/install/data/Build.tar /Build.tar")
shell.run("tar Build.tar /")
print("Removing tar but bad...")
shell.run("rm /tar.lua")
shell.run("rm $")
shell.run("cp Build $")
shell.run("rm Build")
shell.run("rm Build.tar")
fs.copy("/$/boot/cct/eeprom","/startup.lua")
dofile("startup.lua")
::exit::