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

OSRunner: The solution for multiple OS'es NEW: WIRED PERIPHERAL MANAGEMENT!

Started by MudkipTheEpic, 29 March 2013 - 10:38 AM
MudkipTheEpic #1
Posted 29 March 2013 - 11:38 AM
OSRunner



NEW FEATURE:

PERIPHERAL MANAGEMENT



Added peripheral support, protect your peripherals, configure your OSes to only be able to use only specific peripherals (changable per OS)! (Default all disabled)

In System Settings, Manage Peripherals!

Intro



After months of feature-adding,bug-fixing,and bug-fixing the bugs the bugfix made :P/>/>/>, it's finally out!


Features




OSRunner is a graphic-based utility that lets you run OS'es and other file-hogging programs that you don't want clogging up your main directory. It also emulates a virtual rom, which has all programs but secret/alongtimeago (I couldn't figure out how to copy it!). The nice GUI lets you add custom OS'es, reformat OS'es, and set the default OS. It also has some nice features such as os.reboot support, restoring _G and restarting the sandbox.


How It Works


OSRunner works by editing FS to make all programs, when using files, access them inside of their directory. I could explain MUCH more, but it would become a wall of text. :P/>/>/>


Download


pastebin get BNAxvJ1a install


Github:



Bug Reporting

Report all bugs at the Issues page in GitHub.


Special Thanks

SuicidalSTDz and alakazard12 (GitHub Names) for developing with me.


Everybody who took the time to read this thread, and use this program.




Have fun with OSRunner !

Edit: Added poll.
FuuuAInfiniteLoop(F.A.I.L) #2
Posted 29 March 2013 - 11:58 AM
The startup script gives me an error on line 11 when i use the installer
MudkipTheEpic #3
Posted 29 March 2013 - 12:24 PM
Fixed! Sorry. :P/>
MudkipTheEpic #4
Posted 29 March 2013 - 12:58 PM
Added poll!
FuuuAInfiniteLoop(F.A.I.L) #5
Posted 29 March 2013 - 03:16 PM
I have hacked your sandbox jejeje if you type "cd .." it will go back and back and back till you can access the files in the computer without sandbox. Image:


edit: sorry for the other computer i was coding my new program xDD
Edited on 29 March 2013 - 02:17 PM
MudkipTheEpic #6
Posted 29 March 2013 - 04:19 PM
Um.. that's akward… but I'll get on that right away.

Well, the program was never a jail, more of a utility, but I'll fix it.

How does the .. work?


Edit: I think it is like if you do rom/.. then you get default dir, right? Correct me if I'm wrong.
MudkipTheEpic #7
Posted 29 March 2013 - 04:31 PM
Alright, fixing tomorrow, gotta shell.resolve all entries. :/
kornichen #8
Posted 29 March 2013 - 07:25 PM
I love it :D/>
theoriginalbit #9
Posted 29 March 2013 - 08:50 PM
How does the .. work?
Ok so that I didn't give the wrong explanation (or didn't say it exactly right) I traced back how the shell processes it. very hard traceback but I eventually traced it back to where it works. The parts of the path are iterated through and pushed to a Stack, but if the part of the path is a '..' (or empty) the last element is popped off the stack.

Edit: I think it is like if you do rom/.. then you get default dir, right? Correct me if I'm wrong.
rom/.. would be /
also i discovered from the investigation above that
rom/../rom would be rom. although why you would want to do that I'm not to sure. overall, if you override fs.combine it will change it for every use (fs.combine is the top most accessible function that is used and where .. is processed)

hope this helped :)/> oh btw good job on this, finally something that isn't just an installer but actually adds a sandbox! :)/>
MudkipTheEpic #10
Posted 30 March 2013 - 03:15 AM
D:

I figured out how to do it, but the drawback is that .. and ../.. and so on are valid paths, but just access the sandbox dir! (Nothing wrong with accessing sandbox dir, but making .. and ../.. valid paths is bad.)

How to fix…
MysticT #11
Posted 30 March 2013 - 04:07 AM
Here's some functions I used in the old version of MysticOS to sandbox the users to their own directory:
Spoiler

local sDir = "/OS" -- change the sandbox directory here

local function splitPath(sPath)
	local i = 1
	local t = {}
	for path in string.gmatch(sPath, "[^/\\]*[/\\]?") do
		path = string.gsub(path, "[/\\]", "")
		if path == ".." then
			if i > 1 then
				i = i - 1
				t[i] = nil
			else
				return nil
			end
		elseif path ~= "" and path ~= "." then
			t[i] = path
			i = i + 1
		end
	end
	return t
end

local function resolvePath(sPath)
	local t = splitPath(sPath)
	if t == nil then
		return nil
	end
	local path = ""
	if #t == 0 then
		return sDir
	end
	for _,str in ipairs(t) do
		if path == "" then
			path = sDir.."/"..str
		else
			path = path.."/"..str
		end
	end
	return path
end
The splitPath function just parses the path and returns a table with each part of the path. Then the resolve path uses that table to get the sandboxed path.
It's an old code I used, so there's probably some things to improve, but it should work as a starting point.
Hope this helps. And nice work with this :)/>
MudkipTheEpic #12
Posted 30 March 2013 - 10:39 AM
Fixed in new version! :D/>
MudkipTheEpic #13
Posted 30 March 2013 - 12:59 PM
Any features you guys want me to add?
Sxw #14
Posted 30 March 2013 - 06:13 PM
The same problem applys to ccbox, its being fixed, but….

fs=getfenv(fs.open) Would be able to get at the old fs unless you had patched getfenv. :)/>
MudkipTheEpic #15
Posted 31 March 2013 - 03:59 AM
Umm…. No.

Just tested it. :P/>

And I DID NOT modify getfenv.
MudkipTheEpic #16
Posted 10 April 2013 - 02:26 PM
Added new update with ability to update from inside of app!
Sammich Lord #17
Posted 10 April 2013 - 02:28 PM
I really don't see the use case for this(For meh at least). If for whatever reason I want to run multiple OSes(I don't even run one :P/>) then I would just make a new computer in CCEmu or my new favorite CCDesk.
MudkipTheEpic #18
Posted 10 April 2013 - 02:31 PM
Well, maybe this just isn't for you then. I honestly use it to test file-abusing programs or ones that use lots of files. :P/> But, it can be very useful. Like deleting all files on the OS without using a disk, and the OS has nothing to do about it. :P/> :P/> :P/>

And, I understand why you would not use it in an emulator, but what about in MC (survival mostly, still useful in creative)?
Sammich Lord #19
Posted 10 April 2013 - 02:34 PM
I may use it for testing abusive programs but other than that I can't see myself use it even in MC. I hardly spend the time to use a custom OS because most of them just make a task take longer.
SuicidalSTDz #20
Posted 10 April 2013 - 02:51 PM
I hardly spend the time to use a custom OS because most of them just make a task take longer.
Well yeah, CraftOS is command-line. Most of us devs just go for aesthetics. My OS is fairly efficient in the way it works (For the most part, as well this is just my opinion :P/>) I have made a personal script to run OSRunner in EnderOS since I like it so much, well, and helped with part of the code :P/>

EDIT:
I have hacked your sandbox jejeje if you type "cd .." it will go back and back and back till you can access the files in the computer without sandbox. Image:


edit: sorry for the other computer i was coding my new program xDD
Bravo, you hacked into a non-secure language. Do you want a cookie? Not everything can be 'hacker' free in Lua. As well, Mudkip and I thank you for pointing this bug out.
MudkipTheEpic #21
Posted 10 April 2013 - 03:43 PM
I hardly spend the time to use a custom OS because most of them just make a task take longer.
Well yeah, CraftOS is command-line. Most of us devs just go for aesthetics. My OS is fairly efficient in the way it works (For the most part, as well this is just my opinion :P/>) I have made a personal script to run OSRunner in EnderOS since I like it so much, well, and helped with part of the code :P/>

EDIT:
I have hacked your sandbox jejeje if you type "cd .." it will go back and back and back till you can access the files in the computer without sandbox. Image:


edit: sorry for the other computer i was coding my new program xDD
Bravo, you hacked into a non-secure language. Do you want a cookie? Not everything can be 'hacker' free in Lua. As well, Mudkip and I thank you for pointing this bug out.

Uhh… Suicidal.. We fixed that a long time ago XD
SuicidalSTDz #22
Posted 10 April 2013 - 04:06 PM
I hardly spend the time to use a custom OS because most of them just make a task take longer.
Well yeah, CraftOS is command-line. Most of us devs just go for aesthetics. My OS is fairly efficient in the way it works (For the most part, as well this is just my opinion :P/>) I have made a personal script to run OSRunner in EnderOS since I like it so much, well, and helped with part of the code :P/>

EDIT:
I have hacked your sandbox jejeje if you type "cd .." it will go back and back and back till you can access the files in the computer without sandbox. Image:


edit: sorry for the other computer i was coding my new program xDD
Bravo, you hacked into a non-secure language. Do you want a cookie? Not everything can be 'hacker' free in Lua. As well, Mudkip and I thank you for pointing this bug out.

Uhh… Suicidal.. We fixed that a long time ago XD
I know. That quote was meant to be made a long time ago, however, I could not post during that time. So, yeah :P/>
MudkipTheEpic #23
Posted 10 April 2013 - 04:12 PM
Added poll on adding new OS'es.
alakazard12 #24
Posted 13 April 2013 - 12:53 PM
Oh yeah, I see you got it all done now :P/>.
SuicidalSTDz #25
Posted 13 April 2013 - 01:53 PM
Oh yeah, I see you got it all done now :P/>.
Indeed so. It is very nice as well. I don't think I could live without it :P/>
alakazard12 #26
Posted 13 April 2013 - 02:26 PM
I still have access to the github repository. :P/>
MudkipTheEpic #27
Posted 13 April 2013 - 04:24 PM
You still wanna develop it?

Edit: Suicidal, he was an early developer. He did the GUI. (Not the code, he painted it)
SuicidalSTDz #28
Posted 13 April 2013 - 04:26 PM
You still wanna develop it?

Edit: Suicidal, he was an early developer. He did the GUI. (Not the code, he painted it)
I know :P/> I saw the edits made by him in the repo and I put 2 and 2 together.
alakazard12 #29
Posted 14 April 2013 - 03:02 AM
Yeah, I can help develop it, I'm currently not working on any projects. Is there a server you're doing this on?
MudkipTheEpic #30
Posted 14 April 2013 - 03:19 AM
Nope. Just Github. But I MAY (rarely a chance of) set up a whitelisted creative CC server.
jesusthekiller #31
Posted 15 April 2013 - 06:25 AM
OSRunner works by editing FS

Smart!
jesusthekiller #32
Posted 15 April 2013 - 06:27 AM
I MAY (rarely a chance of) set up a whitelisted creative CC server.

Heh, I have my second server running with no load on it, you want me to host your server for you? I was planning to make CC server too :D/>
SuicidalSTDz #33
Posted 15 April 2013 - 06:28 AM
OSRunner works by editing FS

Smart!
Well, it is kinda the only logical way to sandbox the program. If you don't overwrite the fs library functions, well, then the user can do whatever they want. Overwriting the fs library functions with our own functions allows us to set limits on what the user can and cannot edit/modify.
jesusthekiller #34
Posted 15 April 2013 - 06:50 AM
True it is :)/>
Sammich Lord #35
Posted 15 April 2013 - 07:41 AM
True it is :)/>
Yoda? :D/>
SuicidalSTDz #36
Posted 15 April 2013 - 08:34 AM
Watch out kids, we've got ourselves a Star Wars fanatic :P/>

On topic: Hmm, I might have just found a bug. Brb :P/>

Nvm <_</>
MudkipTheEpic #37
Posted 15 April 2013 - 09:18 AM
Watch out kids, we've got ourselves a Star Wars fanatic :P/>/>

On topic: Hmm, I might have just found a bug. Brb :P/>/>
Nvm <_</>/>

What "bug" did you "find"?
SuicidalSTDz #38
Posted 15 April 2013 - 09:20 AM
Watch out kids, we've got ourselves a Star Wars fanatic :P/>/>

On topic: Hmm, I might have just found a bug. Brb :P/>/>
Nvm <_</>/>

What "bug" did you "find"?
During startup, it just sat there. It was just CC-Emu :P/>
MudkipTheEpic #39
Posted 15 April 2013 - 09:40 AM
Not to be mean or anything, but I would like to know why people are saying "Meh, I dont use it" in the poll. Is it because you don't use OS'es, or what? I just wanna know so I can improve the program. ;)/>
Sxw #40
Posted 16 April 2013 - 06:08 PM
I think you should add a option to boot an os from a disk.
jesusthekiller #41
Posted 16 April 2013 - 09:52 PM

Indeed true it is. But me be no Star Wars fan tho, yoda just funny sounds. :P/>
MudkipTheEpic #42
Posted 21 April 2013 - 06:59 AM
Added "os.queueEvent("") coroutine.yield()"'s all over the place when reinstalling to stop too long without yielding. :D/>
jesusthekiller #43
Posted 21 April 2013 - 09:07 AM
Added "os.queueEvent("") coroutine.yield()"'s all over the place when reinstalling to stop too long without yielding. :D/>

Yeah, I hate this error too…
MudkipTheEpic #44
Posted 21 April 2013 - 09:08 AM
Hate or had… maybe both. :P/>

Edit: Just wondering, why did someone choose "I HATE IT!" in the poll… Or was it just a troll.
Edited on 21 April 2013 - 09:02 AM
MudkipTheEpic #45
Posted 22 April 2013 - 05:30 AM
Added PearOS along with partial BSOD.

(Worthy enough of a double post, : P)
alakazard12 #46
Posted 22 April 2013 - 09:32 AM
I have added disk support :)/>
MudkipTheEpic #47
Posted 23 April 2013 - 04:15 AM
Added peripheral support, protect your peripherals, configure your OSes to only be able to use only specific peripherals (changable per OS)! (Default all disabled)

In System Settings, Manage Peripherals!
jdude104 #48
Posted 24 April 2013 - 10:32 AM
Found out the hard way that it doesnt work with the normal computer
MudkipTheEpic #49
Posted 24 April 2013 - 01:27 PM
Yah… forgot to add a clause for that…. Uhh…. This would be pretty impossible to modify for normal. Just use advanced (unless ur on tekkit).
MudkipTheEpic #50
Posted 18 May 2013 - 11:01 AM
Sorry for bump, but added huge new feature: Wired peripheral support! Includes new "pages" of peripheral support, where you can select individual peripherals on a network to be able to interact with! Please post any bugs that didn't get caught during the bug-testing!

(First time I ever used a branch system for beta, and the app "Github for Mac" doesn't like it! XD)
jdude104 #51
Posted 01 June 2013 - 05:55 PM

This happens every time I try to start an OS
MudkipTheEpic #52
Posted 01 June 2013 - 06:27 PM

This happens every time I try to start an OS

Make sure you are on a version of ComputerCraft with peripheral cables.
nutcase84 #53
Posted 02 June 2013 - 07:11 PM
Do you want a cookie?

No, I wants a sammitch. :D/>
gudenau #54
Posted 19 June 2013 - 08:09 PM
Now we just need shared files and this will be perfect!
MudkipTheEpic #55
Posted 19 June 2013 - 08:26 PM
Now we just need shared files and this will be perfect!

Between computers? I'm working on that, but as a separate program.