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

how to start to Make a OS?

Started by XX_23Fede99_XX, 28 September 2016 - 01:47 PM
XX_23Fede99_XX #1
Posted 28 September 2016 - 03:47 PM
hi, as the title, I wanted to know what I need to start planning my OS and how to create an installer for it.
Basically I wanted to create an OS based on the monitors. I hope you can help me :)/>
houseofkraft #2
Posted 28 September 2016 - 08:26 PM
First of all you should create your OS on GitHub. http://www.github.com/ you will need to register an account and make a project.

Second of all, You should learn Lua before making a ComputerCraft OS. There are tutorials on Lua for ComputerCraft. (Lua 5.1)

Once you learn Lua you can make your OS. Btw, if you want to make an installer make a table with the file download and the file name you want to save it to. It will save a lot of time especially when you make an update.

EDIT: If you want to see an example of an OS, go to https://github.com/Carbon-OS/CarbonOS that is my WIP OS and you can look at the code.
- House
Edited on 28 September 2016 - 06:28 PM
KingofGamesYami #3
Posted 28 September 2016 - 10:01 PM
Before writing an OS, I would recommend writing some other programs first. Games are a great way to learn the Lua programming language and ComputerCraft specific APIs. I would begin with a simple game with entirely key-based controls, then move on to some requiring mouse input. As you want to create an OS based on monitors, handling monitor_touch events will be necessary - and they are almost identical to mouse_click.

After you have knowledge of Lua and most (if not all) of the ComputerCraft APIs, you should start on advanced topics, such as windows and coroutines. You'll also have to think hard about what features you want in your OS - if security is something you want, you should look into encryption and hashing, and when to apply each.

Once you have mastered the most advanced topics of Lua and ComputerCraft, you should make a final decision on the features of your OS and begin planning the separate files you will need. It is possible to create a single, huge file, but not recommended for a project as large as an OS. To give you an idea of the scale, OneOS is over 120,000 lines of code. You might make that, you might not.

I feel many users rush to create their own "personal" OS because it sounds cool, and end up publishing nothing special. The fact that you want to focus on monitors is a good sign, as you already have something that will set your OS apart from others. I consider the vast majority (85% or higher) of the topics in the "Operating Systems" section of the forums to be unworthy of the name "OS". The single most important point of an OS is to add some sort of additional functionality - something you can't do in CraftOS.
XX_23Fede99_XX #4
Posted 29 September 2016 - 06:42 PM
thanks for help now i read some lua and when i finish i start the creation of my OS
Creator #5
Posted 30 September 2016 - 02:44 PM
thanks for help now i read some lua and when i finish i start the creation of my OS

Seriously dude, don't jump right into it. Its better if you do some other coding before.
Sewbacca #6
Posted 30 September 2016 - 04:37 PM
Too much text:
SpoilerMaybe, i am a bad example, because i started with an OS first.
I never published it, because it hadn't many functions or possibilities and it is very laggy.
It was just a boring shell, with other styles and more functions, but i learned Lua by programming an OS,
while being supported by my friend. I wrote on this 'OS' the most of the time, because i had fun.
I didn't know much about environments, coroutines or metatables. I used the CC APIs.
Didn't know much about these parts was good for me, because i could code without worries about
security or transfer data, performance or OOP. I just programmed my way, but
i did a 'crappy OS':
I like OSes that really try to be unique and not just crappy CraftOS remakes, this is definitely good, keep it up
(from this post)
But it wasn't a fault, because i learned the parts of Lua, by using the language.
I learned writing an API and i made my own rules for writing a program.
I learned about tables.
I learned about manipulating APIs.
And i learned about the file system.
After 'trashifying' (bad coding -> lags + bugs) my shell, i decided to rewrite the OS.
I learned many things about Lua, without tutorials, maybe a bad way, but i did many things better.
After maybe an half and a year or more, i bought a Lua coding book for Lua 5.2.
I learned now from a book and used my knowlege directly in my programs.
I learned about metatables.
I learned about coroutine.
I learned about environments.
And i learned about OOP.
More and more, i understood what i am doing in Lua.
for example:
IOHandle:read().
I rewrote some programs, by using better ways/methods, but that doesn't mean that the methods i used were bad, that means the methods i used were bad in these cases.

And then, i found the computercraft forums very interesting.
Communication between programmers is indispensable, because the others see midtakes, you don't see.
It is like proofreading a text, you don't see mistakes, others do.

I saw more possibilities in Lua, by watching/using other programs.
Also learning C#, shows me more possibilities in Lua.

The thing is, i don't see a wrong way to learn Lua, except learning just from one guy (except he's/she's a good teacher).
You have to find your own way, but we can help you.
And maybe this is bad English, but i learn it by using the language and communicating in English with other people.

Long story short: look at the long story :P/> .
Edited on 30 September 2016 - 02:37 PM