mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 10:36:44 +00:00
Moved CapyOS to folder /sys
This commit is contained in:
parent
756b8b35dd
commit
b09ab4bdff
33 changed files with 20 additions and 13 deletions
|
@ -1,3 +0,0 @@
|
||||||
package.path = "/lib/?.lua;/lib/?/init.lua;" .. package.path
|
|
||||||
|
|
||||||
_G.io = require("io")
|
|
|
@ -1,10 +1,11 @@
|
||||||
local version = "0.0.2"
|
local version = "0.0.3"
|
||||||
|
local systemDirectory = "/sys"
|
||||||
|
|
||||||
print("Starting CapyOS")
|
print("Starting CapyOS")
|
||||||
|
|
||||||
local term = require("term")
|
local term = require("term")
|
||||||
local fs = require("fs")
|
local fs = require("fs")
|
||||||
local gpu = require("gpu")
|
local machine = require("machine")
|
||||||
|
|
||||||
local nPrint = print
|
local nPrint = print
|
||||||
local function showError(err)
|
local function showError(err)
|
||||||
|
@ -26,11 +27,12 @@ function os.version()
|
||||||
end
|
end
|
||||||
|
|
||||||
term.setPos(1, 1)
|
term.setPos(1, 1)
|
||||||
term.write(_HOST)
|
term.write(machine.version())
|
||||||
|
term.setPos(1, 3)
|
||||||
|
|
||||||
local files = fs.list("/boot/autorun")
|
local files = fs.list(fs.combine(systemDirectory, "boot/autorun"))
|
||||||
for i = 1, #files do
|
for i = 1, #files do
|
||||||
local func, err = loadfile("/boot/autorun/" .. files[i])
|
local func, err = loadfile(fs.combine(systemDirectory, "boot/autorun", files[i]))
|
||||||
if not func then
|
if not func then
|
||||||
showError(err)
|
showError(err)
|
||||||
break
|
break
|
||||||
|
|
|
@ -6,7 +6,7 @@ local machine = require("machine")
|
||||||
local exit = false
|
local exit = false
|
||||||
local shell = {}
|
local shell = {}
|
||||||
|
|
||||||
shell.path = "./?;./?.lua;/bin/?.lua"
|
shell.path = "./?;./?.lua;/bin/?.lua;/sys/bin/?.lua"
|
||||||
shell.homePath = "/home"
|
shell.homePath = "/home"
|
||||||
|
|
||||||
local currentDir = shell.homePath
|
local currentDir = shell.homePath
|
3
Capy64/Assets/Lua/CapyOS/sys/boot/autorun/00_package.lua
Normal file
3
Capy64/Assets/Lua/CapyOS/sys/boot/autorun/00_package.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
package.path = "/lib/?.lua;/lib/?/init.lua;/sys/lib/?.lua;/sys/lib/?/init.lua;" .. package.path
|
||||||
|
|
||||||
|
_G.io = require("io")
|
|
@ -10,6 +10,6 @@ term.setPos(1, 1)
|
||||||
term.write(os.version())
|
term.write(os.version())
|
||||||
term.setPos(1, 2)
|
term.setPos(1, 2)
|
||||||
|
|
||||||
dofile("/bin/shell.lua")
|
dofile("/sys/bin/shell.lua")
|
||||||
|
|
||||||
machine.shutdown()
|
machine.shutdown()
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
@ -51,13 +51,13 @@ local function writeCenter(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function drawVendorImage()
|
local function drawVendorImage()
|
||||||
if not fs.exists("/boot/vendor.bmp") then
|
if not fs.exists("/sys/vendor.bmp") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local w, h = gpu.getSize()
|
local w, h = gpu.getSize()
|
||||||
local ok, err = pcall(function()
|
local ok, err = pcall(function()
|
||||||
local task<close> = gpu.loadImageAsync("/boot/vendor.bmp")
|
local task<close> = gpu.loadImageAsync("/sys/vendor.bmp")
|
||||||
local buffer<close> = task:await()
|
local buffer<close> = task:await()
|
||||||
|
|
||||||
local x, y =
|
local x, y =
|
||||||
|
@ -95,6 +95,11 @@ local function promptKey()
|
||||||
event.pull("key_down")
|
event.pull("key_down")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function installDefaultOS()
|
||||||
|
fs.delete("/sys", true)
|
||||||
|
installOS()
|
||||||
|
end
|
||||||
|
|
||||||
term.setBlink(false)
|
term.setBlink(false)
|
||||||
|
|
||||||
local function setupScreen()
|
local function setupScreen()
|
||||||
|
@ -105,7 +110,7 @@ local function setupScreen()
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Install default OS",
|
"Install default OS",
|
||||||
installOS,
|
installDefaultOS,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Exit setup",
|
"Exit setup",
|
||||||
|
|
Loading…
Reference in a new issue