From a69f945b91005f5b060de67ae776bf7053424e73 Mon Sep 17 00:00:00 2001 From: Astronand Date: Fri, 6 Mar 2026 09:57:45 -0500 Subject: [PATCH] did some reorganizing --- Src/Hyperion-kernel/boot/kernel.lua | 2 +- .../lib/modules/hyperion/92_setup.kmod | 1 + Src/{Hyperion-bash => hysh}/bin/chattr | 0 Src/{Hyperion-bash => hysh}/bin/chgrp | 0 Src/{Hyperion-bash => hysh}/bin/chmod | 0 Src/{Hyperion-bash => hysh}/bin/chown | 0 Src/{Hyperion-bash => hysh}/bin/chroot | 0 Src/{Hyperion-bash => hysh}/bin/help | 0 Src/{Hyperion-bash => hysh}/bin/hfetch | 0 Src/{Hyperion-bash => hysh}/bin/hysh | 0 Src/{Hyperion-bash => hysh}/bin/id | 0 Src/{Hyperion-bash => hysh}/bin/ll | 0 Src/{Hyperion-bash => hysh}/bin/ln | 0 Src/{Hyperion-bash => hysh}/bin/login | 0 Src/{Hyperion-bash => hysh}/bin/loimgcreate | 0 Src/{Hyperion-bash => hysh}/bin/losetup | 0 Src/{Hyperion-bash => hysh}/bin/ls | 0 Src/{Hyperion-bash => hysh}/bin/lsusers | 0 Src/{Hyperion-bash => hysh}/bin/mount | 0 Src/{Hyperion-bash => hysh}/bin/passwd | 0 Src/{Hyperion-bash => hysh}/bin/ps | 0 Src/{Hyperion-bash => hysh}/bin/readlink | 0 Src/{Hyperion-bash => hysh}/bin/su | 0 Src/{Hyperion-bash => hysh}/bin/sudo | 0 Src/{Hyperion-bash => hysh}/bin/sysdump | 0 Src/{Hyperion-bash => hysh}/bin/umount | 0 Src/{Hyperion-bash => hysh}/bin/useradd | 0 Src/{Hyperion-bash => hysh}/bin/userdel | 0 Src/{Hyperion-bash => hysh}/bin/usermod | 0 Src/{Hyperion-bash => hysh}/bin/yes | 0 Src/{Hyperion-bash => lua}/bin/lua | 6 ++--- Src/{Hyperion-bash => micro}/bin/micro | 0 Src/{Hyperion-bash => sed}/bin/sed | 0 Src/{Hyperion-spm => spm}/bin/spm | 0 Src/{Hyperion-core => sysinit}/sbin/init | 0 .../usr/lib/sysinit/sysinit | 2 +- .../HyperionOS-units}/bin/looptest | 0 .../HyperionOS-units}/bin/socktest | 0 manifest.lua | 24 +++++++++---------- 39 files changed, 18 insertions(+), 17 deletions(-) rename Src/{Hyperion-bash => hysh}/bin/chattr (100%) rename Src/{Hyperion-bash => hysh}/bin/chgrp (100%) rename Src/{Hyperion-bash => hysh}/bin/chmod (100%) rename Src/{Hyperion-bash => hysh}/bin/chown (100%) rename Src/{Hyperion-bash => hysh}/bin/chroot (100%) rename Src/{Hyperion-bash => hysh}/bin/help (100%) rename Src/{Hyperion-bash => hysh}/bin/hfetch (100%) rename Src/{Hyperion-bash => hysh}/bin/hysh (100%) rename Src/{Hyperion-bash => hysh}/bin/id (100%) rename Src/{Hyperion-bash => hysh}/bin/ll (100%) rename Src/{Hyperion-bash => hysh}/bin/ln (100%) rename Src/{Hyperion-bash => hysh}/bin/login (100%) rename Src/{Hyperion-bash => hysh}/bin/loimgcreate (100%) rename Src/{Hyperion-bash => hysh}/bin/losetup (100%) rename Src/{Hyperion-bash => hysh}/bin/ls (100%) rename Src/{Hyperion-bash => hysh}/bin/lsusers (100%) rename Src/{Hyperion-bash => hysh}/bin/mount (100%) rename Src/{Hyperion-bash => hysh}/bin/passwd (100%) rename Src/{Hyperion-bash => hysh}/bin/ps (100%) rename Src/{Hyperion-bash => hysh}/bin/readlink (100%) rename Src/{Hyperion-bash => hysh}/bin/su (100%) rename Src/{Hyperion-bash => hysh}/bin/sudo (100%) rename Src/{Hyperion-bash => hysh}/bin/sysdump (100%) rename Src/{Hyperion-bash => hysh}/bin/umount (100%) rename Src/{Hyperion-bash => hysh}/bin/useradd (100%) rename Src/{Hyperion-bash => hysh}/bin/userdel (100%) rename Src/{Hyperion-bash => hysh}/bin/usermod (100%) rename Src/{Hyperion-bash => hysh}/bin/yes (100%) rename Src/{Hyperion-bash => lua}/bin/lua (97%) rename Src/{Hyperion-bash => micro}/bin/micro (100%) rename Src/{Hyperion-bash => sed}/bin/sed (100%) rename Src/{Hyperion-spm => spm}/bin/spm (100%) rename Src/{Hyperion-core => sysinit}/sbin/init (100%) rename Src/{Hyperion-core => sysinit}/usr/lib/sysinit/sysinit (99%) rename {Src/Hyperion-bash => Test/HyperionOS-units}/bin/looptest (100%) rename {Src/Hyperion-bash => Test/HyperionOS-units}/bin/socktest (100%) diff --git a/Src/Hyperion-kernel/boot/kernel.lua b/Src/Hyperion-kernel/boot/kernel.lua index 3a70aba..518b2e4 100644 --- a/Src/Hyperion-kernel/boot/kernel.lua +++ b/Src/Hyperion-kernel/boot/kernel.lua @@ -120,7 +120,7 @@ end local initCfgFunc, err = load(ifs.readAllText("/boot/boot.cfg"), "@boot.cfg") if not initCfgFunc then - kernel.LOG_Text("Failed to load /boot/boot.cfg: "..tostring(err)) + kernel.PANIC("Failed to load /boot/boot.cfg: "..tostring(err)) end ---@diagnostic disable-next-line: param-type-mismatch diff --git a/Src/Hyperion-kernel/lib/modules/hyperion/92_setup.kmod b/Src/Hyperion-kernel/lib/modules/hyperion/92_setup.kmod index 367f9d8..926eb32 100644 --- a/Src/Hyperion-kernel/lib/modules/hyperion/92_setup.kmod +++ b/Src/Hyperion-kernel/lib/modules/hyperion/92_setup.kmod @@ -97,6 +97,7 @@ if kernel.firstBoot then {"tmp", REG, 0, 0, RWXRWXRWX}, {"usr", REG, 0, 0, RWX_RX_RX}, {"var", REG, 0, 0, RWX_RX_RX}, + {"opt", REG, 0, 0, RWXRWXRWX}, }) mergeMeta("/bin", { diff --git a/Src/Hyperion-bash/bin/chattr b/Src/hysh/bin/chattr similarity index 100% rename from Src/Hyperion-bash/bin/chattr rename to Src/hysh/bin/chattr diff --git a/Src/Hyperion-bash/bin/chgrp b/Src/hysh/bin/chgrp similarity index 100% rename from Src/Hyperion-bash/bin/chgrp rename to Src/hysh/bin/chgrp diff --git a/Src/Hyperion-bash/bin/chmod b/Src/hysh/bin/chmod similarity index 100% rename from Src/Hyperion-bash/bin/chmod rename to Src/hysh/bin/chmod diff --git a/Src/Hyperion-bash/bin/chown b/Src/hysh/bin/chown similarity index 100% rename from Src/Hyperion-bash/bin/chown rename to Src/hysh/bin/chown diff --git a/Src/Hyperion-bash/bin/chroot b/Src/hysh/bin/chroot similarity index 100% rename from Src/Hyperion-bash/bin/chroot rename to Src/hysh/bin/chroot diff --git a/Src/Hyperion-bash/bin/help b/Src/hysh/bin/help similarity index 100% rename from Src/Hyperion-bash/bin/help rename to Src/hysh/bin/help diff --git a/Src/Hyperion-bash/bin/hfetch b/Src/hysh/bin/hfetch similarity index 100% rename from Src/Hyperion-bash/bin/hfetch rename to Src/hysh/bin/hfetch diff --git a/Src/Hyperion-bash/bin/hysh b/Src/hysh/bin/hysh similarity index 100% rename from Src/Hyperion-bash/bin/hysh rename to Src/hysh/bin/hysh diff --git a/Src/Hyperion-bash/bin/id b/Src/hysh/bin/id similarity index 100% rename from Src/Hyperion-bash/bin/id rename to Src/hysh/bin/id diff --git a/Src/Hyperion-bash/bin/ll b/Src/hysh/bin/ll similarity index 100% rename from Src/Hyperion-bash/bin/ll rename to Src/hysh/bin/ll diff --git a/Src/Hyperion-bash/bin/ln b/Src/hysh/bin/ln similarity index 100% rename from Src/Hyperion-bash/bin/ln rename to Src/hysh/bin/ln diff --git a/Src/Hyperion-bash/bin/login b/Src/hysh/bin/login similarity index 100% rename from Src/Hyperion-bash/bin/login rename to Src/hysh/bin/login diff --git a/Src/Hyperion-bash/bin/loimgcreate b/Src/hysh/bin/loimgcreate similarity index 100% rename from Src/Hyperion-bash/bin/loimgcreate rename to Src/hysh/bin/loimgcreate diff --git a/Src/Hyperion-bash/bin/losetup b/Src/hysh/bin/losetup similarity index 100% rename from Src/Hyperion-bash/bin/losetup rename to Src/hysh/bin/losetup diff --git a/Src/Hyperion-bash/bin/ls b/Src/hysh/bin/ls similarity index 100% rename from Src/Hyperion-bash/bin/ls rename to Src/hysh/bin/ls diff --git a/Src/Hyperion-bash/bin/lsusers b/Src/hysh/bin/lsusers similarity index 100% rename from Src/Hyperion-bash/bin/lsusers rename to Src/hysh/bin/lsusers diff --git a/Src/Hyperion-bash/bin/mount b/Src/hysh/bin/mount similarity index 100% rename from Src/Hyperion-bash/bin/mount rename to Src/hysh/bin/mount diff --git a/Src/Hyperion-bash/bin/passwd b/Src/hysh/bin/passwd similarity index 100% rename from Src/Hyperion-bash/bin/passwd rename to Src/hysh/bin/passwd diff --git a/Src/Hyperion-bash/bin/ps b/Src/hysh/bin/ps similarity index 100% rename from Src/Hyperion-bash/bin/ps rename to Src/hysh/bin/ps diff --git a/Src/Hyperion-bash/bin/readlink b/Src/hysh/bin/readlink similarity index 100% rename from Src/Hyperion-bash/bin/readlink rename to Src/hysh/bin/readlink diff --git a/Src/Hyperion-bash/bin/su b/Src/hysh/bin/su similarity index 100% rename from Src/Hyperion-bash/bin/su rename to Src/hysh/bin/su diff --git a/Src/Hyperion-bash/bin/sudo b/Src/hysh/bin/sudo similarity index 100% rename from Src/Hyperion-bash/bin/sudo rename to Src/hysh/bin/sudo diff --git a/Src/Hyperion-bash/bin/sysdump b/Src/hysh/bin/sysdump similarity index 100% rename from Src/Hyperion-bash/bin/sysdump rename to Src/hysh/bin/sysdump diff --git a/Src/Hyperion-bash/bin/umount b/Src/hysh/bin/umount similarity index 100% rename from Src/Hyperion-bash/bin/umount rename to Src/hysh/bin/umount diff --git a/Src/Hyperion-bash/bin/useradd b/Src/hysh/bin/useradd similarity index 100% rename from Src/Hyperion-bash/bin/useradd rename to Src/hysh/bin/useradd diff --git a/Src/Hyperion-bash/bin/userdel b/Src/hysh/bin/userdel similarity index 100% rename from Src/Hyperion-bash/bin/userdel rename to Src/hysh/bin/userdel diff --git a/Src/Hyperion-bash/bin/usermod b/Src/hysh/bin/usermod similarity index 100% rename from Src/Hyperion-bash/bin/usermod rename to Src/hysh/bin/usermod diff --git a/Src/Hyperion-bash/bin/yes b/Src/hysh/bin/yes similarity index 100% rename from Src/Hyperion-bash/bin/yes rename to Src/hysh/bin/yes diff --git a/Src/Hyperion-bash/bin/lua b/Src/lua/bin/lua similarity index 97% rename from Src/Hyperion-bash/bin/lua rename to Src/lua/bin/lua index b6f42bb..d7a1a7b 100644 --- a/Src/Hyperion-bash/bin/lua +++ b/Src/lua/bin/lua @@ -288,9 +288,9 @@ local function getUserInput(prompt, history) syscall.devctl(1,"spos",ox,oy) w(input .. " \n") return input - else - input = input:sub(1, cursor-1) .. key .. input:sub(cursor) - cursor = cursor + 1; dirty = true + elseif #key == 1 and key:byte(1) >= 32 and key:byte(1) < 127 then + input=string.sub(input,1,cursor-1)..key..string.sub(input,cursor) + cursor=cursor+1;dirty=true end end local nb = (math.floor(syscall.getUptime() / 500) % 2) == 0 diff --git a/Src/Hyperion-bash/bin/micro b/Src/micro/bin/micro similarity index 100% rename from Src/Hyperion-bash/bin/micro rename to Src/micro/bin/micro diff --git a/Src/Hyperion-bash/bin/sed b/Src/sed/bin/sed similarity index 100% rename from Src/Hyperion-bash/bin/sed rename to Src/sed/bin/sed diff --git a/Src/Hyperion-spm/bin/spm b/Src/spm/bin/spm similarity index 100% rename from Src/Hyperion-spm/bin/spm rename to Src/spm/bin/spm diff --git a/Src/Hyperion-core/sbin/init b/Src/sysinit/sbin/init similarity index 100% rename from Src/Hyperion-core/sbin/init rename to Src/sysinit/sbin/init diff --git a/Src/Hyperion-core/usr/lib/sysinit/sysinit b/Src/sysinit/usr/lib/sysinit/sysinit similarity index 99% rename from Src/Hyperion-core/usr/lib/sysinit/sysinit rename to Src/sysinit/usr/lib/sysinit/sysinit index 574c93a..518774c 100644 --- a/Src/Hyperion-core/usr/lib/sysinit/sysinit +++ b/Src/sysinit/usr/lib/sysinit/sysinit @@ -41,6 +41,6 @@ for i,v in ipairs(files) do end while true do - sleep(1) + sleep(5) kernel.saveLog() end \ No newline at end of file diff --git a/Src/Hyperion-bash/bin/looptest b/Test/HyperionOS-units/bin/looptest similarity index 100% rename from Src/Hyperion-bash/bin/looptest rename to Test/HyperionOS-units/bin/looptest diff --git a/Src/Hyperion-bash/bin/socktest b/Test/HyperionOS-units/bin/socktest similarity index 100% rename from Src/Hyperion-bash/bin/socktest rename to Test/HyperionOS-units/bin/socktest diff --git a/manifest.lua b/manifest.lua index 819fe61..9fa2a2e 100644 --- a/manifest.lua +++ b/manifest.lua @@ -11,7 +11,7 @@ syscall.sethomedir=function(uid, homedir) end --- Reads amount from fd and returns content or nil --- @param fd integer ---- @param amount integer +--- @param amount? integer --- @return string|nil syscall.read=function(fd, amount) end @@ -115,7 +115,7 @@ syscall.umount=function(target) end --- @return integer[] syscall.getTasks=function() end ---- Dump system state for debugging +--- Dump all syscalls for debugging --- @return table syscall.sysdump=function() end @@ -235,16 +235,16 @@ syscall.setuid=function(uid) end --- Replace current task with executable --- @param path string ---- @param args table ---- @param envars table +--- @param args? table +--- @param envars? table syscall.exec=function(path, args, envars) end --- Spawn a new task from executable --- @param path string ---- @param name string ---- @param envars table ---- @param args table ---- @param tgid integer +--- @param name? string +--- @param envars? table +--- @param args? table +--- @param tgid? integer --- @return integer syscall.execspawn=function(path, name, envars, args, tgid) end @@ -268,10 +268,10 @@ syscall.newuser=function(username, password, gid, homedir, shell) end --- Spawn a new task from function --- @param func function ---- @param name string ---- @param envars table ---- @param args table ---- @param tgid integer +--- @param name? string +--- @param envars? table +--- @param args? table +--- @param tgid? integer --- @return integer syscall.spawn=function(func, name, envars, args, tgid) end