←  Ask a Pro

ComputerCraft | Programmable Computers for Minecraft

»

Create an OS tutorial

Locked

SNRepoman's Photo SNRepoman 14 Jan 2013

Hi I am working on a mod and thought about trying to create my own version of ComputerCraft within it, but I have barely any sort of programming skills and figured might just be better to run off of the mod and just make a new OS to use within it. This is where the question comes into play is how/where could I learn some coding to make a OS for ComputerCraft like WolfOS?

Also is there a possible why of either making a program within the OS to possible import "updates" like tweets or something into the system so as a notification system?

I would love any sort of assistance that anyone can offer. Also if you would like to assist in creating this mod PM me to ask about the details.
Quote

RunasSudo-AWOLindefinitely's Photo RunasSudo-AWOLindefinitely 14 Jan 2013

If you have barely any sort of programming skills, chances are, no-ones going to try to explain to you how to do it. Learn some Lua, get some experience with making GUIs and come back when you feel like you can do most of the work yourself. No-one will write an OS (or any other program) for you.
Quote

ChunLing's Photo ChunLing 15 Jan 2013

If you want to make a mod, then you need to learn Java, not Lua. While Lua is a fine introductory language for a novice programmer, it isn't the ideal path to learning Java.

If you want to make an OS for CC (or just learn basic programming concepts and skills), then Lua is your path. You must learn it well enough to be able to understand code of OS's posted in the Programs forum.
Quote

crazyguymgd's Photo crazyguymgd 15 Jan 2013

NitrogenFingers did a pretty good menu tutorial that I thought was quite helpful with my first menus.
It's a two part series, here's the first one.

Quote

NeverCast's Photo NeverCast 15 Jan 2013

A snippet from osdev.org

Quote

Not all "make it" in this field, many don't even pass the "Hello World" of OSDev, but perhaps you will go further and create the next Linux? Or Windows? Or are your goals lower - MenuetOS? Or even CP/M?

It's a true fact that OS Development is the hardest part of programming, fortunately for you. You want to make your OS on CC, which isn't technically an OS because you're piggy-backing off bios.lua and likely the Shell, that and Lua is a very high level language so you don't have nearly anywhere near the complexity required to make an OS for a real world machine.

With that said, It is still the most difficult task and you not only have to be very proficient in coding typical applications in Lua, but you also need to have a strong understanding of Operating System structure, how it works and how different operating systems work together. How it is all layed out and how parts of an OS and the user applications communicate.

RunasSudo is right in saying that no one will write it for you, but few may help you, IF you first show a good understanding and do most the work yourself. Most the people on these forums will have no issue fixing a small error in your code, sometimes you just need an extra pair of eyes to look over a block of code to see what is wrong. Coding at 4am can be difficult even for the best of us :P

I wish you good luck and don't let the negative feedback get you down, You are tackling a very difficult task, but it's not impossible; and with determination it could be very possible in the near future. You just have to get some general application experience first and learn about some of the more complex structures of Lua.
Quote

FuuuAInfiniteLoop(F.A.I.L)'s Photo FuuuAInfiniteLoop(F.A.I.L) 16 Jan 2013

Wolfos is one of the old ones OS did you see KREOS or NDF-OS(discontinued) and you cant make an new os for computercraft if you dont modyfied the central mod, you can make a simulation(the ones that i have mentioned) with some skills, First make in a paper all the things do you want to have, second think a way yo do that things, and finally a desing a good gui, make everything and post it on the forums
Quote

bwhodle's Photo bwhodle 25 Jul 2013

IDK why I'm replying to several months old post.
It is not that hard to make an "OS".
(In computercraft, of course)
Anyone who has made an actual (ie. one that actually does something instead of "Hello, World!") Operating System in real life will know that is literally like 1000000000000 times harder than making an "OS" in ComputerCraft. In order to make an "OS" in computercraft all you have to do is edit the bios.lua thingy to whatever you want it to be and that's really pretty much it. Plus you have access to all lua and CC's libraries and stuff.

Bios.lua is pretty much CraftOS, the only real OS. All the others that don't modify bios.lua are pretty much just programs, not "OSs"
Breakdown of bios.lua:
Part 1: function stuffs
1. Entirely commented stuff: Lines 2-93: "save versions of various library functions"
2. 95-108: Redefinition of setmetatable
3. 111-116: os.getVersion(): if turtle then return "TurtleOS 1.5" end return "CraftOS 1.5"
4. 118-120: os.pullEventRaw(..): coroutine
5. 112-128: os.pullEvent(..): pulleventraw wrapper sort of
6. 131-136: sleep(..): timer event
7. 138-196: write(..): term API wrapper mainly
8. 198-205: print(..) write(..) and then a \n
9. 207-213: printError(..) attempt to make it red, print(..), make it white
10. 215-332: read(..): reads input text with char event and stuff for left, right, up, down, backspace, home, delete, and end
11. 334-342: loadfile(..): kind of fs API wrapper
12. 344-352: dofile(..): idk what it does but it does whatever it does
13. 355-378: os.run(..) implementation that does like a lot of stuff
14. 380-389: redefinition of getmetatable
15. 391-420: os.loadAPI(..) idk what it does but it loads apis
16. 422-426: os.unloadAPI(..)
17. 428-430: os.sleep(..): wrapper of sleep function above.
18. 432-438: redefinition of os.shutdown()
19. 440-446: redefinition of os.reboot()
20. 449-469: "installs the lua part of HTTP api if inabled"
Part 2: Actual stuff
1. 472-480: loads all apis in rom/apis
2. 482-491: loads all apis in rom/apis/turtle if its a turtle
3. 495-503: runs the shell program and does "rednet.run()"
4. 506-508: "If the shell errored, let the user read it."
5. 510-515: "Press any key to continue" and then shuts down computer.
And that's the ENTIRE CraftOS.
I mean even MS-DOS was like several hundreds of thousands of lines long (may credit to the fact it was written in assembly not lua) and it looks about the same as CraftOS although it has tons of stuff that only a realistic/real life OS would have.
Quote

Lyqyd's Photo Lyqyd 25 Jul 2013

The "what is a real OS" debate is completely useless, meaningless, and devoid of all interesting content. Your entire post contributes nothing but noise. I highly value maintaining as high a signal to noise ratio in Ask a Pro as possible. The OS debate is entirely unwelcome here in all forms. I don't care what your opinion (or anyone else's, for that matter) is on it, you can keep it to yourself.

This seems to keep cropping up. I suppose I'm going to have to rearrange the sticky posts so that this can be explicitly spelled out. In disappointed it wasn't blatantly obvious that this sort of thing isn't useful.
Quote
Locked