Jump to content




InZernet Boot Loader

command lua utility

2 replies to this topic

#1 lifewcody

  • Members
  • 143 posts
  • Locationstill looking....

Posted 19 June 2015 - 07:07 AM

First of all, I don't want any comments saying "This isn't a bootloader, etc, etc"

This is just a *simple* concept of a boot loader, and it would allow people to add their own OS's to it, etc.

How to install:

pastebin run BYbC7pvk

You don't have to save it and this is the only file, the program is packed in there. Just run it, it reboots and it is installed.

"When I rebooted it just shows the normal CraftOS"

-- As expected, by default just CraftOS is the only OS. Scroll down to learn how to add an OS


How to add an OS

1) Open the file: /boot/ibl/ibl.cfg
2) Add:
[ "OS NAME HERE" ] = {
  [ "location" ] = "/myos",
},

It should look something like:
{
  CraftOS = {
	location = "exit",
  },
  default = 0,
  [ "OS NAME HERE" ] = {
	[ "location" ] = "/myos",
  },
}

How to add an OS if you are an OS:

if fs.exists("/boot/ibl/ibl.cfg") then -- IBL is installed
  local iblConfigR = fs.open("/boot/ibl/ibl.cfg", "r") -- open IBL configuration file
  local iblConfig = textutils.unserialize(iblConfigR.readAll()) -- Put IBL configuration file in variable
  iblConfigR.close() -- close the fs.open reader
  iblConfig["OS NAME HERE"] = { -- replace OS NAME HERE with your OS or file you want to load
	[ "location" ] = "/myos", -- replace /myos with the location of the file to run
  } -- We need to end it, right?
  local iblConfigW = fs.open("/boot/ibl/ibl.cfg", "w") -- prepare to write the IBL configuration file back by opening fs.open
  iblConfigW.write(textutils.serialize(iblConfig)) -- serialize it to make it fancy for us HuMaNs
  iblConfigW.close() -- close the IBL configuraton writer
end -- FIN

Then when you reboot the second time, it will show all the available OS's to boot from [type the number 1/2/3, etc] to load into it

Errors / Comments / Suggestions?

Post them below, would love to add on to it.

FAQ:

"File no found when I load an OS"
-- It can't find the specified file to load from, please make sure the file is there.

TODO:

- Add recovery mode, basically it will keep a count on how many times the OS crashed, or if the OS did crash and enters recovery mode which allows you to boot into craftos instead of auto booting.
- Rename arguments to flags and make them actually work
- Make default operational

Edited by jubba890, 19 June 2015 - 07:17 AM.


#2 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 19 June 2015 - 09:10 AM

Is this something like a bios?

#3 lifewcody

  • Members
  • 143 posts
  • Locationstill looking....

Posted 19 June 2015 - 10:23 AM

View PostCreator, on 19 June 2015 - 09:10 AM, said:

Is this something like a bios?

I guess it could be at this point. Right now it was something I threw together so someone could expand on it or something. All it does it load the an OS or program at startup.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users