added netboot to SEBIOS.
This commit is contained in:
parent
24e5d76527
commit
caeeb10d25
24
sebios.lua
24
sebios.lua
@ -48,6 +48,23 @@ local function tryLoadFrom(address)
|
|||||||
local buffer = boot_invoke(address,"read",rl)
|
local buffer = boot_invoke(address,"read",rl)
|
||||||
return load(buffer, "=init")
|
return load(buffer, "=init")
|
||||||
end
|
end
|
||||||
|
elseif component.type(address) == "modem" then
|
||||||
|
boot_invoke(address,"open",9671)
|
||||||
|
boot_invoke(address,"broadcast",9671,computer.address())
|
||||||
|
s=""
|
||||||
|
local bt = computer.uptime()
|
||||||
|
while bt+10 > computer.uptime() do
|
||||||
|
computer.beep()
|
||||||
|
local ev={computer.pullSignal(0.5)}
|
||||||
|
if ev[1] == "modem_message" and ev[4] == 9671 then
|
||||||
|
bt=computer.uptime()
|
||||||
|
if ev[6] == "." then break end
|
||||||
|
s=s..ev[6]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if s ~= "" then
|
||||||
|
return load(s,"=init")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -58,6 +75,9 @@ end
|
|||||||
for address in component.list("tape_drive") do
|
for address in component.list("tape_drive") do
|
||||||
bootdevs[#bootdevs+1] = address
|
bootdevs[#bootdevs+1] = address
|
||||||
end
|
end
|
||||||
|
for address in component.list("modem") do
|
||||||
|
bootdevs[#bootdevs+1] = address
|
||||||
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
local gA,sA = component.list("gpu")(),component.list("screen")()
|
local gA,sA = component.list("gpu")(),component.list("screen")()
|
||||||
@ -79,7 +99,9 @@ do
|
|||||||
wl(" ")
|
wl(" ")
|
||||||
for k,v in ipairs(bootdevs) do
|
for k,v in ipairs(bootdevs) do
|
||||||
if v == cba then S = " * " else S = " " end
|
if v == cba then S = " * " else S = " " end
|
||||||
wl(S..tostring(k).." "..v.." "..component.type(v).." "..(component.invoke(v,"getLabel") or ""))
|
local e,l = pcall(component.invoke,v,"getLabel")
|
||||||
|
if not e then l = "" end
|
||||||
|
wl(S..tostring(k).." "..v.." "..component.type(v).." "..(l or ""))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rdraw()
|
rdraw()
|
||||||
|
Loading…
Reference in New Issue
Block a user