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

Create a new OS

Started by LoneWolf, 26 June 2014 - 04:23 AM
LoneWolf #1
Posted 26 June 2014 - 06:23 AM
I am looking to create my own computercraft OS but I have no clue about how to do this, is there an os template I could use/look at to get a feel for making one?
theoriginalbit #2
Posted 26 June 2014 - 06:31 AM
there definitely isn't a template and I suggest that you start of with a simpler program until you're comfortable with Lua and ComputerCraft. Make sure to read through the PIL and the ComputerCraft wiki.
LoneWolf #3
Posted 26 June 2014 - 06:37 AM
there definitely isn't a template and I suggest that you start of with a simpler program until you're comfortable with Lua and ComputerCraft. Make sure to read through the PIL and the ComputerCraft wiki.

I'm comfortable with ComputerCraft, currently looking for someone willing to teach me LUA. Right now with LUA I'm at the stage where you give me a program and I can edit it to do something I might want similiar to what the program does, but making a whole new program… as far as I got was a simple clock.
Bomb Bloke #4
Posted 26 June 2014 - 07:21 AM
Out of interest, what gave you the idea to make an OS? A lot of new users seem to want to do so, though from where I'm sitting it's a rather poor idea.

So my advice is "don't". That's a "don't bother at all" sort of "don't", not a "work your way up to it" sort of "don't". If you don't like the default CraftOS, take a look at the mountain of other choices over here.

If you really want to code something, my advice is to make something fun. Make a game. Games are fun! Heck, if someone posts a finished program on this forum, I'm unlikely to even open the thread unless I think it's a game. (In the case of an OS, I'm unlikely to even read the title of the thread).

Furthermore, a script doesn't even have to be all that complex to qualify as a game. How about hang-man?
theoriginalbit #5
Posted 26 June 2014 - 07:32 AM
to add to Bomb Blokes point, making games is actually easier, as it is far simpler to tell when something has gone wrong in your code because you'll see things misbehaving (normally).
LoneWolf #6
Posted 26 June 2014 - 10:06 AM
Out of interest, what gave you the idea to make an OS? A lot of new users seem to want to do so, though from where I'm sitting it's a rather poor idea.

So my advice is "don't". That's a "don't bother at all" sort of "don't", not a "work your way up to it" sort of "don't". If you don't like the default CraftOS, take a look at the mountain of other choices over here.

If you really want to code something, my advice is to make something fun. Make a game. Games are fun! Heck, if someone posts a finished program on this forum, I'm unlikely to even open the thread unless I think it's a game. (In the case of an OS, I'm unlikely to even read the title of the thread).

Furthermore, a script doesn't even have to be all that complex to qualify as a game. How about hang-man?

First of all, don't classify me as a new user please… I have been using computercraft for a while now, and I want to make not just a normal os like all the others, just a simple os that contains games and my irc client/server set up.
Bomb Bloke #7
Posted 26 June 2014 - 10:37 AM
No offense intended; it's just that ComputerCraft is based on Lua. You may be able to "use" ComputerCraft, but there's a big difference between "using" and "understanding".

If all you want to make is a "menu", then so be it - that's quite different to an OS.

Start out by reading up on the first eight or nine of these tutorials. By all means skip any you're entirely familiar with, but in particular, you'll need to understand how to rig up loops and work with tables.

Once you've got a handle on that, experiment with creating a basic loop that writes strings from a table onto the screen. Then look into rigging up a movable selection arrow.
oeed #8
Posted 26 June 2014 - 11:01 AM
to add to Bomb Blokes point, making games is actually easier, as it is far simpler to tell when something has gone wrong in your code because you'll see things misbehaving (normally).

Sorry, but I'm gona have to disagree with you two there.
Personally I'm not a fan of making games, I don't know why, but I just don't.

Many, dare I say most, people actually find difficult things more enjoyable then easy ones. Heck, look at Flappy Bird, it was difficult and that's exactly why people loved it.
I've been rewriting much of OneOS and I've found it quite enjoyable, not because it's easy (it isn't :P/>), but because it's difficult.

In the words of JFK,
"We choose to go to the moon in this decade and do the other things, not because they are easy, but because they are hard."

Anyway, got a little off topic.
Lots of people start off with NDF-Jay's YouTube tutorials. I myself did when creating PearOS. It's a good way to understand the basic concepts.
https://www.youtube....Ii82unM3yl5SOfN

I wouldn't spend too much time copying his code though, to be honest it's not great. Look at the concepts rather than the actual code itself. You should avoid keeping everything in the one file, nor should you have things like 'drawMenu1'. You should also use some form of drawing API, keep away from directly writing with term.write, it's messy, doesn't allow for dynamic content (in a good manner at least) and you can't easily buffer it.

You might also want to take a look at some other OSs. My favourites are OneOS (my own) and CraftBang.
Edited on 26 June 2014 - 09:01 AM
LoneWolf #9
Posted 26 June 2014 - 11:24 AM
to add to Bomb Blokes point, making games is actually easier, as it is far simpler to tell when something has gone wrong in your code because you'll see things misbehaving (normally).

Sorry, but I'm gona have to disagree with you two there.
Personally I'm not a fan of making games, I don't know why, but I just don't.

Many, dare I say most, people actually find difficult things more enjoyable then easy ones. Heck, look at Flappy Bird, it was difficult and that's exactly why people loved it.
I've been rewriting much of OneOS and I've found it quite enjoyable, not because it's easy (it isn't :P/>), but because it's difficult.

In the words of JFK,
"We choose to go to the moon in this decade and do the other things, not because they are easy, but because they are hard."

Anyway, got a little off topic.
Lots of people start off with NDF-Jay's YouTube tutorials. I myself did when creating PearOS. It's a good way to understand the basic concepts.
https://www.youtube....Ii82unM3yl5SOfN

I wouldn't spend too much time copying his code though, to be honest it's not great. Look at the concepts rather than the actual code itself. You should avoid keeping everything in the one file, nor should you have things like 'drawMenu1'. You should also use some form of drawing API, keep away from directly writing with term.write, it's messy, doesn't allow for dynamic content (in a good manner at least) and you can't easily buffer it.

You might also want to take a look at some other OSs. My favourites are OneOS (my own) and CraftBang.

for the record I love you OneOs, its amazing. I'm having difficulty with ndfjay's tutorial but I sent him a message about it to receive help if he has time because I heard what happened to him about the security whole [who would do such a thing to someone ._.] I've been scouring open sourced OSes for a while trying to understand the code and I'm getting there… not fast but getting there after all learning things doesn't happen over night.
tenshae #10
Posted 29 August 2014 - 02:38 AM
I learned basic Lua in a day or two, then after a few weeks I had basically mastered CCLua.
cptdeath58 #11
Posted 30 August 2014 - 05:50 AM
Dude if you need a template, look at the mountain of OSes that Bomb Bloke put.
Look through them, and try to understand how they function, then will you may be able to make an OS.
OSes are a lot complicated than you think.
There are bunches of different menus and functions you got to go through to have it function correctly.
Start making a game first, understand how you make different windows and functions of around a 100 - 1000 line game.(Actually rather a guess)
Because OSes end up being from a simple 5000 (Guess again) and over 10000 lines of code.
If you want to make an OS, it isn't my decision. But to be honest, I would follow some of these guys advice.
But just remember, if you do make an OS. It could be the next big thing. (Even though a lot of people I know really don't mess with OSes.)
Edited on 30 August 2014 - 03:52 AM