Jump to content




What are these "operating systems" and how do I make one?


18 replies to this topic

#1 helo

  • New Members
  • 2 posts
  • LocationAustralia

Posted 06 May 2018 - 05:28 AM

Hi guys, helo here. I've been wondering about these "operating systems" that pop up on the forums, and well, they confuse me a little. What are they, what are their point and well, how do I make one? A note if it helps, I use the latest 1.12 version of ComputerCraft, and I've had little experience with the mod or Lua at all. Thanks! ^-^

#2 Marc1miner

  • Members
  • 8 posts

Posted 08 May 2018 - 02:36 AM

An operating system is basically the software your computer runs when it boots, like Windows, Linux and Mac.
Their point is to make computers' basic functionality far better and better for use, like a file system where all files that are user created can be found etc.
How to make one is up to you, what functionality do you want your computer to have?

Some things I find useful are:
- Basic login screen, with users and passwords (also adds a challenge how to store them and keep them save, assuming you're doing mp)
- User interface (like files displayed etc.)
- Basic peripheral attachment and detachment

How to start such project.

First of all, what is your knowledge of lua?
Assuming you know the basics you should start by editing the startup file
You can do that as follows
type this in the computer
edit startup

Then as a test you can type for example
print("test")
then save it and it should print test every time you boot your computer

then you can write there whatever you want and it will run when you start your computer
my advice is to use your startup file as a selector, you select from there what you want to run

here a little example of a selector
function main(int)
if int == 1 then
os.run("ex1")
return true
elseif int == 2 then
os.run("ex2")
return true 
else
return false
end
end
while true do
  input = read()
  input = tonumber(input)
  if main(input) == false then
  print("Program does not exist")
  end
end

I hope this clarifies a lot for you and if you have any question feel free to ask them

#3 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 08 May 2018 - 06:43 AM

Please consider making something more interesting than yet another "Operating System". A game is a much better first project.

However, if you must, I recommend taking a look at the source of the more popular OSs.

#4 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 08 May 2018 - 01:58 PM

View PostKingofGamesYami, on 08 May 2018 - 06:43 AM, said:

Please consider making something more interesting than yet another "Operating System". A game is a much better first project.
I Absolutely Hate it when people say that.

Operating Systems are the best thing ever

Honestly, you should greatly study the lua manuals (Different manuals for different versions), and then continue writing it. When you finish, you should re-write it a few times, greatly bug test it, and then post it.

EDIT: though *nowadays* I do agree it should be an actual OS, not just a GUI. I'm not very proud of mine and Sewbacca's original NyanOS (a GUI)

But you should definitely take a year or two to write an actual OS.

Edited by EveryOS, 08 May 2018 - 05:08 PM.


#5 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 08 May 2018 - 02:54 PM

View PostKingofGamesYami, on 08 May 2018 - 06:43 AM, said:

Please consider making something more interesting than yet another "Operating System"...

I second KOGY's sentiment. Further, if you're new to programming, an 'operating system' is going to be a terrible first project for a variety of reasons. You won't have a finished product for quite awhile (you'll be working for weeks or months without being able to release anything) and you'll be dealing with advanced concepts that, as a new programmer, you will probably struggle with quite a bit just to grasp. On top of that, unless your 'OS' has something special that all the other 'operating systems' don't have, it isn't likely to gain much traction as the forums already have a wide selection of shells, GUIs, and OS's.

However, if you really want to make an 'OS' in CC (and not just a glorified GUI) then you'll definitely want to be familiar with Bomb Bloke's Guide to Coroutines.

#6 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 08 May 2018 - 03:13 PM

View PostDog, on 08 May 2018 - 02:54 PM, said:

You won't have a finished product for quite awhile (you'll be working for weeks or months without being able to release anything) and you'll be dealing with advanced concepts that, as a new programmer, you will probably struggle with quite a bit just to grasp.

Well, I guess I can agree there, I myself am writing an OS too and even with my experience it is quite a nightmare to work with. It's way too time-consuming.

#7 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 08 May 2018 - 05:03 PM

My point was that an OS is a terrible first project. It can be a good project, but it takes a very long time to complete and requires some degree of skill. Writing a few sizable programs (ei a couple hundred lines) before starting will give you a much better idea of what you can and cannot do, and how to structure such a large project with potentially thousands of lines.

#8 CLNinja

  • Members
  • 191 posts

Posted 08 May 2018 - 05:18 PM

View PostKingofGamesYami, on 08 May 2018 - 05:03 PM, said:

My point was that an OS is a terrible first project. It can be a good project, but it takes a very long time to complete and requires some degree of skill. Writing a few sizable programs (ei a couple hundred lines) before starting will give you a much better idea of what you can and cannot do, and how to structure such a large project with potentially thousands of lines.
I absolutely agree with this, mostly.

An OS isn't a good starting project if you're trying to make a GOOD project, however, most people seem to tell people altogether, do not make operating systems, we have too many, etc, etc.

I think if something is fun for you to make, make it if you want, just don't expect praise or good reactions from the community.

#9 MarcoPolo0306

  • Members
  • 71 posts
  • LocationEverywhere and nowhere.

Posted 08 May 2018 - 05:45 PM

NDFJay's OS tutorials are very helpful, as I used this tutorial to make my OS's.

I have programmed in Lua for several years, and as others stated above, it may not be a very good first project. I find it fun, if I didn't then why would I be doing it?

Hope this helps!

#10 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 08 May 2018 - 10:44 PM

Though you do not want to write a copy-off. Writing an OS should take at least a few months.

#11 CLNinja

  • Members
  • 191 posts

Posted 09 May 2018 - 03:32 AM

View PostMarcoPolo0306, on 08 May 2018 - 05:45 PM, said:

NDFJay's OS tutorials are very helpful, as I used this tutorial to make my OS's.

I have programmed in Lua for several years, and as others stated above, it may not be a very good first project. I find it fun, if I didn't then why would I be doing it?

Hope this helps!
If you're going to use this, DO NOT copy straight from it. Expand and do something different, because there were at one time about 50 clones of this.

#12 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 09 May 2018 - 12:14 PM

View PostCLNinja, on 09 May 2018 - 03:32 AM, said:

View PostMarcoPolo0306, on 08 May 2018 - 05:45 PM, said:

NDFJay's OS tutorials are very helpful, as I used this tutorial to make my OS's.

I have programmed in Lua for several years, and as others stated above, it may not be a very good first project. I find it fun, if I didn't then why would I be doing it?

Hope this helps!
If you're going to use this, DO NOT copy straight from it. Expand and do something different, because there were at one time about 50 clones of this.
I think I beat you to saying that.

View PostEveryOS, on 08 May 2018 - 10:44 PM, said:

Though you do not want to write a copy-off. Writing an OS should take at least a few months.


#13 Dave-ee Jones

  • Members
  • 456 posts
  • LocationVan Diemen's Land

Posted 10 May 2018 - 12:27 AM

Making an OS can be the best thing you do once you've learned the basics

First project I would recommend doing is a simple doorlock program - everyone starts there, and it's super easy to build off. Look into rednet client/server for authentication, look into making a nicer GUI (with colours!), look into using mouse events to make the GUI more interactive, look into making coroutines or windows for multiple settings and a user-friendly GUI.

You only need half of the above knowledge to make a decent-looking "OS".

#14 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 10 May 2018 - 12:30 PM

View PostDave-ee Jones, on 10 May 2018 - 12:27 AM, said:

First project I would recommend doing is a simple doorlock program - everyone starts there
Exception: Me, I went straight to Operating Systems...

#15 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 12 May 2018 - 11:20 AM

View PostEveryOS, on 08 May 2018 - 10:44 PM, said:

Though you do not want to write a copy-off. Writing an OS should take at least a few months.

That's a terrible generalization. Neither will you ever achieve true OS-esque programs. It'll always be a glorified shell with a bunch of utility programs; You don't have to do any of the low-level stuff an actual OS would be doing. CC isn't designed for this "OS" market anyway IMO.

#16 Restioson

  • Members
  • 20 posts
  • LocationSecret meeting of the South African Internet Users club

Posted 12 May 2018 - 01:35 PM

View PostH4X0RZ, on 12 May 2018 - 11:20 AM, said:

View PostEveryOS, on 08 May 2018 - 10:44 PM, said:

Though you do not want to write a copy-off. Writing an OS should take at least a few months.

That's a terrible generalization. Neither will you ever achieve true OS-esque programs. It'll always be a glorified shell with a bunch of utility programs; You don't have to do any of the low-level stuff an actual OS would be doing. CC isn't designed for this "OS" market anyway IMO.

Okay, let's be fair. You can write the userland of an OS (of a monolithic kernel OS), as CC doesn't expose the lower level details like memory management (paging, etc), port io, MMIO, PCIE, ACPI, etc. In fact, as pointed out by SquidDev it doesn't *have* them in the first place. What you're left with is essentially just the desktop environment (or if you don't have a desktop, then just the environment) of an OS.

Edited by Restioson, 12 May 2018 - 01:43 PM.


#17 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 12 May 2018 - 01:39 PM

That's what H4X0RZ is saying - in computing terms, a shell is "the userland of an OS".

#18 CLNinja

  • Members
  • 191 posts

Posted 12 May 2018 - 04:02 PM

View PostH4X0RZ, on 12 May 2018 - 11:20 AM, said:

That's a terrible generalization. Neither will you ever achieve true OS-esque programs. It'll always be a glorified shell with a bunch of utility programs; You don't have to do any of the low-level stuff an actual OS would be doing. CC isn't designed for this "OS" market anyway IMO.
I'd like to point out that an "OS" can be much more than just a shell. Vorbani for example is a complete overhaul of CraftOS and changes how CC itself works (on the users end)

#19 Restioson

  • Members
  • 20 posts
  • LocationSecret meeting of the South African Internet Users club

Posted 12 May 2018 - 07:07 PM

View PostBomb Bloke, on 12 May 2018 - 01:39 PM, said:

That's what H4X0RZ is saying - in computing terms, a shell is "the userland of an OS".

View PostCLNinja, on 12 May 2018 - 04:02 PM, said:

View PostH4X0RZ, on 12 May 2018 - 11:20 AM, said:

<snip, sorry pako>
I'd like to point out that an "OS" can be much more than just a shell. Vorbani for example is a complete overhaul of CraftOS and changes how CC itself works (on the users end)

A shell isn't necessarily the *only* thing an OS's userland can have. It could have a windowing system or a GUI toolkit for instance. CC "OS"es do tend to just include new shells though.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users