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

["OS"] RaSOS - a PoC window manager... with windows!

Started by RunasSudo-AWOLindefinitely, 16 January 2013 - 04:33 PM
RunasSudo-AWOLindefinitely #1
Posted 16 January 2013 - 05:33 PM
Okay, this isn’t an OS. But it kinda fits what everyone on these forums calls an “OS”, so I’ll call it that.

RaSOS is not a fully featured OS. It’s not supposed to be a fully featured OS. It’s not bug free. It’s not supposed to be bug free. I'll fix/improve it if I have time. It’s a proof-of-concept I came up with in a couple of minutes to demonstrate how I think OSes in CC should be programmed.

Firstly, it doesn’t use shell.run(). If it used that to launch programs, it wouldn’t be an OS. It would be a fancy program launcher. Instead, RaSOS uses loadfile() and coroutines to load and run programs.

Secondly, it isn’t one or two massive files. It’s like Linux, in that the OS is divided up into several bits, each with their own specific purpose, and each one of those bits can be replaced without affecting the others.
system
The system module of the OS is in charge of loading the other APIs, and after that, hands over control of the main coroutine to the process module.
process
The process module is in charge of the management of processes/threads (coroutines). It keeps track of all the processes running on the computer, and is in charge of their execution.
xwin
The xwin module, named after the (real life) X Window System (on Linux), is in charge of the management of windows. It keeps track of all of the windows open on the system, where they are, etc. Note that it doesn’t do any actual drawing. The drawing of windows is left to the active window manager.
raswm
The raswm module is the default window manager in the OS. It is in charge of how everything looks on the screen, and the drawing of windows. It is also in charge of processing user input (dragging windows, clicking the “close” button, etc.)

Like I said before, any one of these components may be replaced. The most useful to replace would be the window manager. RaSWM is designed to look like Mac OS 9 (with some adjustments) and does not have any configuration options. If you don’t like the look of it, you could program a separate window manager and replace the raswm module, without touching anything else.

Okay. I think I’ve finished my rant on how OSes in CC aren’t OS-ey enough. Picture time!

What it’s supposed to look like (the plan):


What it actually looks like (the reality):



Download (why would you want to download this?):
v0.1b2 | Dropbox
v0.1b1 | Dropbox

Place files in root directory of computer. Run “sys/bin/system”. Press the “R” button. Click "Terminal1" to spawn a new instance of “testTerm”. Press the green button (“_”) to make it into a strip. Move it around. Whoo (dejectedly). Press the “R” button again. Click Shutdown. That's it.

Changelog
Spoilerv0.1b2
  • (Not a cliche) Complete rewrite
    • New "program" API - uses event handlers instead of infinite rendering
    • R button actually opens a menu now
    • New "Run File" button/program
    • New error message "API"
v0.1b1
  • Initial release

Thank you for reading this. Please go away now. *returns to programming*
Edited on 19 January 2013 - 03:55 PM
lieudusty #2
Posted 16 January 2013 - 06:14 PM
Looks nice with the windows :D/>
Sammich Lord #3
Posted 16 January 2013 - 06:30 PM
Will we be able to modify and re-distribute this?
RunasSudo-AWOLindefinitely #4
Posted 16 January 2013 - 07:27 PM
Will we be able to modify and re-distribute this?
Oh! S**t, I forgot to add the GPL disclaimer to all the files!!

EDIT: There, added!
Edited on 16 January 2013 - 06:29 PM
FuuuAInfiniteLoop(F.A.I.L) #5
Posted 17 January 2013 - 02:07 AM
For the windows You should try craftemu so you can emulate shells and programs and for the windows you hould see liquydos
ElectricOverride #6
Posted 17 January 2013 - 07:33 AM
This looks great, nice job!
RunasSudo-AWOLindefinitely #7
Posted 17 January 2013 - 12:13 PM
For the windows You should try craftemu so you can emulate shells and programs and for the windows you hould see liquydos
I've not heard of that (and neither has Google), but I'm writing my own system to do that. And for the windows, I've already seen lyqydOS, and that gave me some ideas on how to implement the system (I actually came up with this idea before I saw it).

EDIT: Derpity derp. You mean Taskforce! I'm still writing my own system.
Edited on 17 January 2013 - 05:08 PM
FuuuAInfiniteLoop(F.A.I.L) #8
Posted 19 January 2013 - 01:39 AM
For the windows You should try craftemu so you can emulate shells and programs and for the windows you hould see liquydos
I've not heard of that (and neither has Google), but I'm writing my own system to do that. And for the windows, I've already seen lyqydOS, and that gave me some ideas on how to implement the system (I actually came up with this idea before I saw it).

EDIT: Derpity derp. You mean Taskforce! I'm still writing my own system.
in taskforce it uses craftemu look at the functions, im making my own os and uses gorutine and redirect by gopher.

Add the posibility to drag is easy
RunasSudo-AWOLindefinitely #9
Posted 19 January 2013 - 04:58 PM
v0.1b2 released
This version is incompatible with previous versions. Thoroughly.

It's a complete rewrite sort-of!
Programs work completely differently now (event handlers instead of while true loops). Windows stack correctly. There are two example terminals. There is a menu for the R button. There is a "Run File" option. There is a error message "API". There is a shutdown option.

See OP for moreless information (and a download link).

It's like a whole new gameOS
Mendax #10
Posted 20 January 2013 - 03:38 PM
One idea for your windows: Borders.
RunasSudo-AWOLindefinitely #11
Posted 20 January 2013 - 04:19 PM
One idea for your windows: Borders.
I thought about that idea, but I decided that it would take up too much space, and be rather ugly to look at.
Mendax #12
Posted 20 January 2013 - 04:25 PM
Fair enough :)/>

EDIT: For once, that smile doesn't look evil :P/>
rick3333 #13
Posted 03 February 2013 - 03:39 PM
how do you install this on a computer???
SuicidalSTDz #14
Posted 03 February 2013 - 04:39 PM
If you are in singleplayer you can either enable HTTP or copy the code into notepad++/notepad/ or just copy it into the program file. As for multiplayer, you can either write all the code in by hand(Which is the worst idea, almost as bad as the Necromancers D:)OR you can use pastebin. Copy all the code within the dropbox download and paste it in pastebin (www.pastebin.com), then on your little computer in minecraft you will want to do the following:
-Right click the computer!
-Type: pastebin get [insertPastebinIDHere] <path>
-Run the program!
If HTTP is not enabled on the server D:
Then you must either, A, talk to your server administrator or, B, type it by hand :P/>
Hope this helped! :)/>
NeptunasLT #15
Posted 10 February 2013 - 06:38 AM
Holy [Crap]!!!!!!!!!!!!
It's best OS!
Plus: Looks Like Linux :)/>

[Again, this is a family-friendly forum. -L]
tesla1889 #16
Posted 10 February 2013 - 08:14 AM
i like the unix model of OSs the best, and any linux-like distro is quite a sight for sore eyes
FuuuAInfiniteLoop(F.A.I.L) #17
Posted 11 February 2013 - 10:54 AM
you should add in the menu a program to run the shell(is on rom/programs/shell) so you can run other programs on it

edit: I have looked up the codes you should make a term object for every windows so its easier