Lyra 7 Posted April 20, 2015 Share Posted April 20, 2015 This is a small (obviously) custom BIOS, the chief feature of which is booting over HTTP. This is quite handy when writing a custom operating system as the edit process there tends to be a bit tedious moving hard drives and files around and such. With this, you can do something like: Install the BIOS to an EEPROM, and set the EEPROM data to something like "http://localhost/init.lua" Run an HTTP server on your local machine, and point it at your files Configure OpenComputers to permit making HTTP requests to 127.0.0.1 (disclaimer: this is a very bad idea in multiplayer) Boot your testing computer directly from the files you're editing It can also boot off of any available disks (with OpenOS compatibility and "short" disk addresses), present a pleasant editable menu, print out useful error messages when things break, and behave in general like a proper bootloader. There is room at the top to hardcode a list of boot targets, if that's more convenient than EEPROM data for some reason, and disable the menu if you don't want that. It is in total a little bit over 3kb so there's still a little room for extras. (Network booting and a Lua shell would be interesting.) It may or may not be good with memory depending on exactly how closures work in OpenComputer's Lua implementation, not really sure. Memory usage seems to be difficult or impossible to measure properly. Installation goes something like this, from a working computer: $ wget http://... titanbios.lua $ flash -q titanbios.lua "Titan BIOS" $ lua > component.eeprom.setData("http://localhost:8000/init.lua") Download here. No guarantees: it appears to work so far, but there's probably a bug or two left. So I guess that's sort of useful, maybe, to some people? Oh well. And here's a picture of a bootloader, because those are exciting: Quote Link to post Share on other sites
AliceTheGorgon 0 Posted April 23, 2015 Share Posted April 23, 2015 Awesome script! Any idea how difficult it would be to make this connect to another OpenComputers device instead of a real server (via wireless card)? I've got a horrible/amazing plan to make a drone boot from an NFS server (and possibly even run a full OpenOS install), but I haven't had time to delve into the wireless communication protocol yet. Quote Link to post Share on other sites
mpmxyz 27 Posted April 23, 2015 Share Posted April 23, 2015 Very nice idea. I haven't tested it yet but there is the line local probe = not #targets which is probably not working as expected: probe is always false because #targets always returns a number. Support for OpenComputers networks would be very nice indeed. Maybe there are already some file hosting protocols/programs for OpenComputers out there. (e.g. available via https://github.com/OpenPrograms) Quote Link to post Share on other sites
Lyra 7 Posted April 23, 2015 Author Share Posted April 23, 2015 I'm sure it's possible- after I posted this I was pointed toward some Lua minifiers that net an extra 1-2kb of space or so, which should be enough to implement some kind of network boot. Unfortunately modems are by default limited to only 8kb of data per packet- and while you could make the case that 8kb is enough to implement a more capable second stage, this wouldn't be very satisfying, as ideally this BIOS is the only thing you need to start the whole system. So now the challenge is to figure out how to implement a packetized network boot with proper resend/ack in less than 2kb of minified code. Definitely has to be dirt simple. (Furthermore there should be as little sending required as possible- for a drone I think you want to conserve power, which means not using the wireless card any more than necessary.) And I still want to see if I can pack a Lua shell in here somewhere. The "not #targets" thing is indeed quite broken; evidently I didn't bother to test it. I'm not a huge fan of Lua so I'm still unfamiliar with its boolean semantics (and I definitely prefer languages with more flexible definitions of truthiness). I'm not quite done with this thing, so I'll see what I can come up with. I have some vague ambitions of writing an OS to go with it and this makes an excellent bootloader. Quote Link to post Share on other sites
Izaya 19 Posted May 23, 2015 Share Posted May 23, 2015 So I added an init file for Titan to amie - untested, but it should work. It loads the kernel into RAM and downloads the useful init files to the tmpfs - not that you can do anything with amie yet, but such will happen eventually Quote Link to post Share on other sites
Alissa 1 Posted July 22, 2015 Share Posted July 22, 2015 Can you make the BIOS throw an error about security or something when downloading using HTTP versus HTTPS? Security is kind of a big issue if you want to boot an entire OS from the internet. Quote Link to post Share on other sites
DarkPikachu 3 Posted July 27, 2015 Share Posted July 27, 2015 mind my stupidity, but this means I only have to flash the eeprom once while editing a file on say, copy.com right?? a shared file on copy seems like a better idea for multiplayer rather than a local http server Quote Link to post Share on other sites
mindamp 0 Posted January 19, 2016 Share Posted January 19, 2016 This is really great. So basically you use this eeprom, and just stick an OS disk in the computer. Is there a way to not just load the bootloader via eeprom, but then in turn have the bootloader see the http daemon's files for like OpenOS? So use the HTTP server as a read only FS for auto installing the OS with just an eeprom and disk drive on the computer end? This would be pretty amazing. The next obvious step would be incorporate an NFS somehow so you don't even need the disk drives in OpenComputers anymore. Perhaps more of just a "NFS" card or block. So you could just use the eeprom, and that's it. Quote Link to post Share on other sites
Pigpork 0 Posted July 14, 2016 Share Posted July 14, 2016 Im a noob at oc . But how to whitelist this website because the is a error ("the website is blacklisted") Quote Link to post Share on other sites
DarkPikachu 3 Posted July 14, 2016 Share Posted July 14, 2016 @Pigpork: OC blacklists localhost by default to implement a sort of security for your local network... I use HFS to work around this: http://www.rejetto.com/hfs/?f=dl but I'm also on linux, so as an alt, I've also configured Apache with my own domain name. both work like a charm. Quote Link to post Share on other sites
Pigpork 0 Posted July 15, 2016 Share Posted July 15, 2016 But I removed all the blacklisted websites/ips and my whitelist is empty Quote Link to post Share on other sites
DarkPikachu 3 Posted July 16, 2016 Share Posted July 16, 2016 yeh... I'm telling you to forget the configs set up a virtual FS in HFS, and copy the IP-URL it gives you for your server. (setup is noobishly easy) you'll have to modify the titan-bios localhost URL with that IP-URL you just copied. once you've done that, titan-bios should boot off your HFS-server. I've played around with stuff like that and am even writing NetBiOS (you won't find anything about it) basically, think of OpenOS loaded from the bios over the internet. (I'm working on removing a butt-load of files to reduce net-load) Quote Link to post Share on other sites