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

What do you consider an "OS"?

Started by lieudusty, 10 November 2012 - 02:45 PM
lieudusty #1
Posted 10 November 2012 - 03:45 PM
Hi everyone! ^_^/>/>

I'd like to know what you guys think an OS in ComputerCraft would be. Reply away :unsure:/>/>
Espen #2
Posted 10 November 2012 - 04:35 PM
A mockup OS, or glorified interface.
At most it's one that gathers some more or less useful functions and programs in a package.
:unsure:/>/>
Tiin57 #3
Posted 10 November 2012 - 04:42 PM
A proper OS, as has been stated before, includes a complete rewrite of or heavy modification to the bios.lua, a major overhaul of the interface, and multiple new APIs and programs to allow integration into said OS.
Espen #4
Posted 10 November 2012 - 04:56 PM
But that still wouldn't make it a proper OS though. At most a simulated one.
The modifications you described would just be an overhaul of the native ComputerCraft environment.
No hard feelings, just stating my disagreement with the usage of the term 'OS'.^^
AfterLifeLochie #5
Posted 10 November 2012 - 05:06 PM
I quote my previous comment in a very similar topic;
I think it depends on your definition of "operating system" in contrast with "shell".

Consider first, that, an operating system provides a platform for the user to conduct tasks, run processes, and all the while, doing base tasks such as memory allocation, disk management, etcetera. The reason CC itself has, and is at heart, an operating system, is that the BIOS itself provides the kernel, and the shell just provides a form of "user interface", much like bash in NIX systems and DOS (or, hesitantly, CMD) in Windows.

This creates a form of distinction between the two; those that are "replacement shells" and "operating systems".

If the OS actually has a form of BIOS or kernel that re-implements, or implements, a level of global functionality (either via wrappers, some clever metatable work, etc) to either the standard shell, or even a custom one, then you can class it as an operating system.

On the other side of the line, if it's just a shell that does something different to the normal one, personally, I wouldn't call it an OS. It's not changing the base behaviour of ComputerCraft, doesn't alter the way objects and the system itself works and just doesn't qualify to the point where it "provides a kernel".

It's a blurry distinction, but a distinction nonetheless. And as far as "replacing the BIOS" goes, it's not actually essential: some clever metatable work, or wrappers, work just as fine.
Espen #6
Posted 10 November 2012 - 06:31 PM
I quote my previous comment in a very similar topic;
-snip-
I've just wrote a novel and then had to reboot. Thanks BSOD, very much appreciated. :unsure:/>/>
Because of that I thought I'd try something more symbolic. I'm not a really good word-smith, so maybe this is more clear to some.

What Wikipedia or any other source will describe when being asked about what an OS is:
_G.OS

What I hear other people saying:
local OS = "specialized definition"
assert( OS == _G.OS )	--> assertion failed

All I'm trying to say:
local OS = "specialized definition"
OS ~= _G.OS

And you basically said:
local OS = "specialized definition"
_G.OS = OS	--> totally ok

So I'm not disagreeing with what you just posted, because you set up a specialized definition under which e.g. "bios.lua" actually is the kernel, or could be considered as such.
Under the general/default definition though (_G) it isn't a kernel, but at most merely simulates/resembles a virtual one from the POV of a ComputerCraft computer.
It's akin to saying a painting of a remote control is a remote control.
Well, it's not a remote control as it is generally defined, but if you redefine the term "remote control" to include the idea or resemblance of a remote control, then you'd be absolutely correct.
But you would always have to make that distinction beforehand, as the default definition of it does not include a mere depiction of it.
"Could you hand me the remote?" - "Sure, here you go..."  *hands a picture of it*
That's the clash of two different understandings of what defines a "remote control".

The problem is that many people don't make that distinction when talking about OSes for CC (as I tried to show in simplified form above).
And with the number of "OS"es littered about I'm not so sure this distinction is as self-evident as it might appear.
I'm sure there is a mixture of people who know and think it's self-evident that they don't mean a real OS, people who neither know nor care, and people who actually don't know and just assume it's a real OS.
Making such a distinction might be viewed as finicky by the former two, but I generally try to make sure the latter don't fall victim to a misconception.
Wow, reading this again really makes me sound like I have a certain something up my something.
But I assure you I mean well and it just sounds finicky and complicated when I try to bring my thoughts into written form.
In my mind it's just a simple thought, not much worth so many words really.
Well, as I was saying at the beginning: Not really a word-smith.^^

Hope this was not actually more confusing than I set it out to be. ^_^/>/>

Edit: Corrected a little negation error.
Edited on 10 November 2012 - 05:34 PM
AfterLifeLochie #7
Posted 10 November 2012 - 06:53 PM
I can understand what you're saying completely; from the perspective of CC, the combination of the Computer class and the BIOS file really is the kernel, because it's passing all the calls (not _G.os) to the system (or in the case of CC, directly back to the shell). But, in the situation of a real computer system, no, it's not a real kernel, or even remotely close to an OS, it's more like an emulation environment. It comes down to context, I suppose.

Considering that ComputerCraft runs from Lua, and not C, the BIOS is realistically, the best (and the closest) we have to a kernel, even though it really isn't. :unsure:/>/>
Shnupbups #8
Posted 10 November 2012 - 07:00 PM
New shell, new programs, new apis.
ElvishJerricco #9
Posted 10 November 2012 - 08:06 PM
We need to take a step back here. When you boot up a real life computer, what happens? Well there's several stages
  1. The ROM with the BIOS loads into memory and begins excecuting
  2. The BIOS then finds a place to boot from
  3. The program (bootloader) in that place begins to load a larger program that does the rest. This is because the bootloader can only be so big for the BIOS to load it. It also allows for multiple OS's to be installed on the same computer, allowing the user to select which one to boot at runtime
  4. That program (aka kernel) then sits idly, doing whatever the user or the internal hardware commands
  5. The primary job of that kernel, however, is to manage processes and provide APIs
So how does one implement this into CC?
  1. Step one, we can replace with just the way CC works. It just starts doing things
  2. Then it finds a place to boot from. It chooses either the disk drive or the hdd and loads startup
  3. startup is like our bootloader. We should use it select an OS to boot and provide a small amount of setup for that OS
  4. This OS will listen for all events and run them as needed
  5. But the primary job is to launch programs and to setup all the APIs for them
I'm currently writing an OS. I'm nearing completion so when you see JerryOS you'll know. The first three steps are relatively trivial. It's steps 4 and 5 that the OS really needs to take the lead in. Managing events in a new way is a must, and programs being managed needs to be different. In my OS, I did away with every single CC API that could be replaced. If it was written in lua in the /ComputerCraft/lua/ folder, I made my own. And loading APIs is completely different. I designed the APIs to be modules that are imported at runtime on a per-program basis for the sake of memory protection.

I decided on a way to do things that I thought was better for the programmers who write programs for my OS, and I did those better things. I provided a completely new environment nothing like CraftOS because that's what a truly different OS is. Why do you think Windows programs can't be run on Linux without an emulator?

Point is, don't wimp out with an OS. Creating a small little new UI layer over CraftOS isn't a new OS. That's just a clever shell. And a few new APIs here and there are hardly anything. There needs to be drastic differences to be something new.


EDIT: For the sake of clarity, it's technically imposible to write a new OS for CC because CC doesn't have an OS to begin with. It's just a program running on whatever physical computer you're using. But it very closely resembles what a real OS does, and that's why we can call these things OS's


EDIT2: I would like to add a little bit to my explanation of what an OS is. It's called an Operating System because it's the system that makes other software capable of operating. Creating a cool looking shell doesn't do that. An OS has to manually run and manage tasks. It can't rely on CraftOS to do that for it.
cmurtheepic #10
Posted 22 November 2012 - 05:09 PM
i would like if it had some what easier selection of the programs yu made insted of having to look them up it would allow you to add them to the GUI in the background similar to windows
ElvishJerricco #11
Posted 23 November 2012 - 05:55 AM
i would like if it had some what easier selection of the programs yu made insted of having to look them up it would allow you to add them to the GUI in the background similar to windows

That's not an inherent trait of an OS though. An OS doesn't absolutely have to have that.
Tiin57 #12
Posted 23 November 2012 - 12:42 PM
xD I dislike those noobies who say "Operating Systems don't exist in computer craft" when simple, OPERATING SYSTEM. SYSTEM OF OPERATIONS. EACH FILE CONTAINS A SET OF OPERATIONS. PUT A BUNCH OF FILES TOGETHER THAT WORK IN HARMONY ITS A SYSTEM OF OPERATIONS.

;)/>/> those noobies need to get it through their thick heads.
I dislike being called a "noobie". -.-
I also dislike attempts to disprove me in CAPS LIKE THIS.
Sammich Lord #13
Posted 23 November 2012 - 12:48 PM
:3 I use the caps simply because people don't like it.

If you don't like it? Great! It's more annoying!
If you like it? Great! You read it more!
If you read it more because it's more visible? Great! Continue reading!

xD
Mk: Major troll ;)/>/>
Sammich Lord #14
Posted 23 November 2012 - 01:01 PM
xD you say it with such a wonderful smiley at the end! Thank you!
I respect the good trolls ;)/>/>
Tiin57 #15
Posted 23 November 2012 - 01:03 PM
I must say, props for the open attitude towards trolls. +1, Mk.
BigSHinyToys #16
Posted 23 November 2012 - 01:53 PM
Under the definition of and operating system as provided by wikipedia It is possible to create an operating system in computer craft.
An operating system (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs. The operating system is a vital component of the system software in a computer system. Application programs usually require an operating system to function.
http://en.wikipedia.org/wiki/Operating_system

A CC OS would need to control access to peripheral devices example WIFI disk drive and printer. It would need to provide services example network demons for user level applications to access. It would provide multi tasking and memory protection by sand boxing applications. That would not make it a real bare metal operating system but would be as close as you can get to that in computer craft.

In terms of computer craft main points defines a CCOS
* multi tasking
* control over event management
* control over terminal and monitor operations.
* a shell of some kind
* a group of useful application software

optionally
* networking protocol.
* file system protection.

A kernel is something that is not possible in computer craft as it requites direct access to hardware RAM CPU connected devices on the south bridge.


So yes technically a operating system is not possible. you could call most current CC OS's shell extensions. But I think the term OS is used because it sounds good and describes some of the attributes and services they provide.
Espen #17
Posted 23 November 2012 - 03:03 PM
So yes technically a operating system is not possible. you could call most current CC OS's shell extensions. But I think the term OS is used because it sounds good and describes some of the attributes and services they provide.
Wow, good thing I refreshed before posting. I was just finished typing what felt like a novel, but your post looks much nicer.^^
I definitely agree on what you said, especially the last sentence.
"because it sounds good" is probably the reason for choosing "OS" to describe one's CC program (or suit of CC programs).

Now, If one doesn't know any better then that's not really an issue.
Then there are those who know the difference very well and just use it loosely because, as you said, it sounds cool. And why not?
Personally, I don't have anything against that.
I'll try to help the former by explaining to them their misunderstanding and don't mind the latter, as they know themselves.

Only when someone stubbornly tries to argue that a carrot is an orange (just because it has the same color and you can eat it or for whatever reason else) then I'd definitely try to make him/her understand the difference. And if that someone is vehemently standing his/her ground, then I'd get at least midly confused over why someone would do that? ;)/>/>
I would never want to stand in my own way to acquision of knowledge and understanding. So it's a bit puzzling to me how anyone would by acting like that.
It's always easier to get angry and I have to admit that every now and then I have been irritated myself.
But I generally try to keep my cool and be rational about these things. After all, is getting angry about some issue on a forum somewhere in the internet really of any worth?

Having said all this, my future MO regarding "operating systems" in CC will be:
If you don't know X is not an OS -> somebody (else) will tell you soon enough.^^
If you know X is not an OS, but still use the term for whatever reason -> fine by me. :P/>/>
If you don't know X is not an OS, but you insist it is -> *sigh*… no energy for more and also I'd rather do something fun than argue over a moot point -_-/>/>
Sammich Lord #18
Posted 23 November 2012 - 03:48 PM
I gave human like 20 rep points XD haha
I have a total of like 35 rep points… not even sure what they are used for…
Orwell #19
Posted 23 November 2012 - 05:09 PM
I gave human like 20 rep points XD haha
I have a total of like 35 rep points… not even sure what they are used for…
You can buy shares with them when these forums go commercial. ;)/>/>
Sammich Lord #20
Posted 23 November 2012 - 05:12 PM
I gave human like 20 rep points XD haha
I have a total of like 35 rep points… not even sure what they are used for…
You can buy shares with them when these forums go commercial. ;)/>/>
This is one of the only posts I actually laughed at. Nice this_is.