PRE-ALPHA 3.0.0 - Rewrote the kernel to use a more modular design, changed some terms, added process sandboxing for security.

COMING IN THE FULL RELEASE:
- A user system
- A functional IPC (Inter-Process Communication) system

THINGS CAN AND WILL CHANGE FROM NOW UNTIL THE FINAL RELEASE.
This commit is contained in:
WahPlus
2025-08-17 16:38:08 +03:00
parent fdc54a8839
commit cbf25999f0
52 changed files with 1232 additions and 955 deletions
+38 -19
View File
@@ -1,5 +1,24 @@
local gpu = component.proxy(component.list("gpu")())
local resx, resy = gpu.getResolution()
local resX, resY = gpu.getResolution()
-- Architecture check
local foundArchitecture = false
for _, arch in pairs(computer.getArchitectures()) do
if arch == "Lua 5.3" then
foundArchitecture = true
break
end
end
if foundArchitecture then
computer.setArchitecture("Lua 5.3")
else
gpu.set(1, 1, "Required architecture (Lua 5.3) is not supported.")
gpu.set(1, 2, "Halting.")
while true do
computer.pullSignal()
end
end
local function loadfile(file)
checkArg(1, file, "string")
@@ -17,36 +36,36 @@ local function handleError(errorMessage)
return(errorMessage.."\n \n"..debug.traceback())
end
function loadthething()
loadfile("/halyde/core/boot.lua")(loadfile)
function loadBoot()
loadfile("/halyde/kernel/boot.lua")(loadfile)
end
gpu.setBackground(0x000000)
gpu.fill(1, 1, resx, resy, " ")
local result, reason = xpcall(loadthething, handleError)
gpu.fill(1, 1, resX, resY, " ")
-- Copying low-level functions in case of post-preload failure
local pullSignal = computer.pullSignal
local shutdown = computer.shutdown
local result, reason = xpcall(loadBoot, handleError)
if not result then
if import then
local computer = import("computer")
end
gpu.setBackground(0x000000)
gpu.fill(1, 1, resx, resy, " ")
gpu.fill(1, 1, resX, resY, " ")
gpu.setBackground(0x800000)
gpu.setForeground(0xFFFFFF)
gpu.set(2,2,"A critical error has occurred.")
local i = 4
reason = reason:gsub("\t", " ")
for line in string.gmatch((reason ~= nil and tostring(reason)) or "unknown error", "([^\n]*)\n?") do
reason = tostring(reason):gsub("\t", " ")
for line in string.gmatch(reason or "unknown error", "([^\n]*)\n?") do
gpu.set(2,i,line)
i = i + 1
end
if computer~=nil then
gpu.set(2,i+1, "Press any key to restart.")
local evname
repeat
evname = computer.pullSignal()
until evname == "key_down"
computer.shutdown(true)
end
gpu.set(2,i+1, "Press any key to restart.")
local evname
repeat
evname = pullSignal()
until evname == "key_down"
shutdown(true)
while true do
coroutine.yield()
end