Jump to content




Shutting Down Shell?


3 replies to this topic

#1 databrain

  • Members
  • 8 posts
  • LocationThe place beyond the mountain where dragonflies sing.

Posted 09 October 2013 - 05:53 PM

I'm trying to make a gaming OS. However, shell is running in the background. Is it possible to completely shut down shell on startup without messing with the bios?

#2 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 09 October 2013 - 06:14 PM

I am unsure what your question is: do you want to automatically start a program on startup, or are you looking to shut down the terminal program that is running in the above coroutine (if you don't know about coroutines, don't worry about shutting it down).

If the first question, you can simply name your program 'startup' and it will be executed on startup.

If the second, there's no need to shut down the term. It will not boost performance. If you want to prevent people from accessing the term, simply use os.pullEventRaw and make sure your program doesn't crash.

If you still insist that you need to shut down the term for some reason, you can try a top level coroutine override, which can be found by searching for "level coroutine override" in the search bar on these forms (because the minimum search term must be at least 4 letters long).

#3 DerKoch

  • Members
  • 19 posts

Posted 09 October 2013 - 06:14 PM

So you want to have the program started without typing the name into the shell, right?
Look into: Startup

Edit:
Or maybe I just misinterpreted your question...

#4 AgentE382

  • Members
  • 119 posts

Posted 09 October 2013 - 06:46 PM

These are the relevant lines of bios.lua
-- Run the shell
local ok, err = pcall( function()
	parallel.waitForAny(
		function()
			os.run( {}, "rom/programs/shell" )
		end,
		function()
			rednet.run()
		end )
end )

You could read the rest of bios.lua and read rom/programs/shell to figure out how to get around that, but you'll need to override a global function with a custom version to do it. You'll also need to figure out how to hide the debug messages from the user and keep the shell from shutting the computer down when you make it error out.

EDIT: Double ninja'd. Wow.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users