This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Mr. Bateman's profile picture

Flashback - Edit ROM, and flash images to ROM!

Started by Mr. Bateman, 27 September 2014 - 02:26 PM
Mr. Bateman #1
Posted 27 September 2014 - 04:26 PM
Flashback v1.0.2



Alright, some disclaimers before I continue:
  • This does not edit the actual ROM, it creates a virtual drive which acts as the proxy for the ROM, therefore tricking programs and the OS into thinking that the new directory is the actual ROM. Pretty complex.
  • This means that the altered ROM is reset at each reboot, and each instance of ROM is "sandboxed" to each individual computer. Security and safety are still retained.
  • This also means that ROM is not read-only anymore, and you can edit it after flashing an image. I'm not sure whether to call this a bug or a feature.
  • This program can only be called after CraftOS boots, or the "startup" file is executed. Using this utility to change how autorun works will not work, full stop. (It's not possible to do it software-wise, you have to manually add a resource pack to do that.)
  • This is still very buggy, as it deals with low-level stuff.
I think the important stuff is out of the way, so lets get to how to use it:
flashback [<imagepath>] [-s]
Calling flashback on it's own will just make the ROM editable. Adding -s will make the new ROM blank. Not recommended.
Adding <imagepath> will extract the RAMDisk exported image to the new ROM, and will overwrite anything.

Examples:
flashback
Makes ROM editable.
flashback -s
Makes ROM blank, still allowing changes.
flashback image
Creates a new ROM using contents of the old ROM, and then extracts the image on top of that.
flashback image -s
Creates a ROM only containing contents of the image.

Example ROM images
Ayy
Testing the water here, adds two new programs called "ayylmao" and "nicememe". I'll leave you to figure out what they do.

Download:
pastebin get DBvkcKUY ayy
To flash to ROM:
flashback ayy

Warning:
Read this before you download, please.
Calling flashback with the -s argument will erase non-user-created programs, such as cd and dir. Use this if you want to create the ROM from scratch, or you know what you are doing.
If you run into the issue of not being able to do anything, rebooting fixes the problem.

And, for the love of Christopher Nolan, DO NOT RUN FLASHBACK TWICE (inbetween every reboot). It will instantly crash, for reasons unknown. This is the highest priority to fix, as it could potentially be the tip of the bug iceberg.

Assuming you've read all the warning signs and understand that here be dragons, this is the installer.
pastebin run kvpKm0Tp
Go nuts. Use it to create that kernel you've always wanted to make, or use -s to break cd just for the hell of it. Maybe you want to show that pesky parallels API who's boss, or maybe you want to cause more bugs when you try to fix them. In the end, I am not liable for any damages you cause, be it software, hardware or property.

Github Link
Edited on 28 September 2014 - 12:14 PM
Mr. Bateman #2
Posted 28 September 2014 - 01:31 PM
Updated to 1.0.2, fixes the bug with using an image and -s at the same time, and also fixes another bug related to loading images.
I've updated the OP with a test image I've been using.
wilcomega #3
Posted 04 October 2014 - 06:48 PM
i dont really see a good use for this atm, but pretty cool anyways! ;)/>
comp500 #4
Posted 25 February 2015 - 05:16 PM
One reason it'll stop working if you run it twice is that FS will be patched twice, possibly creating a conflict?!

This is quite cool. I probably won't use it but I'll take some ideas from your vfs with the stuff I want to use it for.
I'm going to be making a sandboxed temporary login system for 'public' computers on a server. It'll download data from github/pastebin then run it in a ramdisk. As I need to override the whole root FS, I won't be able to use your vfs.
DannySMc #5
Posted 03 March 2015 - 04:04 PM
Quite cool, could you add it to my app store? go to my profile :D/>
Mr. Bateman #6
Posted 06 March 2015 - 08:18 AM
Quite cool, could you add it to my app store? go to my profile :D/>
I don't believe there is any use for it outside being a proof-of-concept API, and especially not since no-one else has made any images that can be flashed.
cdel #7
Posted 08 March 2015 - 08:33 AM
When I get some free time, I will create an image and post it here. :D/>