forked from Hyperion/HyperionOS
2 lines
1.0 KiB
Plaintext
2 lines
1.0 KiB
Plaintext
local a=...a.log("Loading init system...")a.log("InitPath: "..a.config.initPath)local b,c=pcall(a.vfs.access,a.config.initPath,"rx")if not b then a.PANIC("Init binary not executable: "..a.config.initPath.." ("..tostring(c)..")")end;local d=a.vfs.open(a.config.initPath,"r")if not d then a.panic("Failed to open "..a.config.initPath)end;local e=a.vfs.read(d,1024*1024*4)if not d then a.panic("Failed to read "..a.config.initPath)end;a.vfs.close(d)local f,g=load(e,"@sysinit","t",a._U)if not f then a.PANIC("Failed to load init system: "..g)end;a.tasks["1"]={coro=coroutine.create(function()local h,g=xpcall(f,debug.traceback,a)if not h then a.panic("Init system crashed: "..tostring(g))else a.panic("Init system exited: "..tostring(g))end end),name="sysinit",status="R",pid=1,tgid=1,uid=0,fd={},envars={},args={},exit="",sleep=0,ivs=0,vs=0,parent=a.kernelTask,siblings=a.kernelTask.children,children={},syscallReturn={},cwd="/",timeSlice=0,lastTime=0,totalTime=0,numRuns=0}a.log("created init task with PID 1")a.log("Initializing init system...")
|