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

Linear Operating System [Discontinued]

Started by mrdawgza, 11 October 2014 - 06:29 PM
mrdawgza #1
Posted 11 October 2014 - 08:29 PM



LinearOS has been discontinued due to lack of development for over a year. Feel free to use/edit it in whatever way you want.



Discontinuation
SpoilerLinearOS has been discontinued since I have not developed it at all for over a year, mainly because it was quite a big school year, and I expect this year to be
even bigger. This OS was one heck of a ride for me and I enjoyed every moment of developing it.

Actually, I didn't really discontinue it because it has been inactive for a year, but because I haven't touched it in a year, I don't know how I did 'what' and what goes on where.
It'l be easier to build a new OS instead of trying to revive this one.

Before I stopped development, I had a basic working version, the rebuilt using NovaUI, then Bedrock - I may upload that version if I can find it.

As for me? I may or may not develop a new operating system, since I have moved more into web development than Lua and Java.

Linear Operating System is to be used on a advanced computer.
This operating system is a huge update from my previous operating system. This OS includes a lot more features and is more customizable.

Features
-SHA256 secured user accounts.
-Different desktop background for each user.
-ComputerCraft App Store by oeed. (Doesn't work for me at the moment.)
-Each user has their own programs folder, managed by the Program Manager (From OSROS)
-A clock will reveal itself when clicked on the top right desktop corner.
-Mouse File Browser by BigSHinyToys
-Compatible with any ComputerCraft program.
-Automatic Updates
-Manuel updates
-Sleek and fast installer

Installation

To install Linear OS v1.5.1 run


pastebin run vGdQnj5Y

Paste here.
You can find my GitHub repository for LinearOS here.


Known Issues
-The program manager will freeze and require an entire system reboot if you click uninstall without any programs in the programs folder.
-During updates, the OS won't tell you if you have HTTP on or off.
-I am expecting an error to rise with the returns I put in to prevent the stack overload, since that I haven't seen the overload error, yet I haven't used
the OS enough to find out.

Change-log
SpoilerRelease 1.5.1
-User System: Each user has their own programs folder.
-Desktop: The clock has been replaced with a button ([CLOCK]) which will show the time for 1 second when clicked.
-Settings: Computer Statistics has been renamed to About LinearOS.
-Settings: About LinearOS (formerly Computer Statistics) now shows the computer label, ID and the free space in KB.
-LoadOS: Been shortened, a lot. I removed the bar and replaced it with the LINEAR image.
-LoadOS: The computer will check if all system files are present.
-LoadOS: If there is a missing system file, you will receive an error.
-LoadOS: Removed the user function from the Load OS file and put it in a separate file in apis.
-Startup: The startup file will immediately redirect to linear/system/loados.ls instead of displaying the LINEAR image.
-System: I have put a bunch of returns in to prevent the Java stack overload.
-Several bug fixes.

Release 1.4
-System: Automatic updates fixed.
-System: Automatic updates can be toggled.
-UserScreen: Fixed the print where it would display 'v1.0' instead of 'v1.4'
-FirstTimeUserLogIn;Settings: New color selector
-Desktop: Removed the random bar under the menu
-Several bug fixes

Release 1.3
-System: Automatic updates implemented
-Settings: Boot behavior implemented (You can now either boot or not boot LinearOS on startup)
-Userscreen: Fixed the print where it would display 'v1.0' instead of 'v1.3'
-Installer: Recoded, nice and clean.

Release 1.2
-Update function implemented.

Release 1.1
-User System: Fixed the error where the first user registered will receive an error upon logging in.
-AppStore: Implemented the latest App Store code

Screenshots
Spoiler
The user screen


Desktop with a red color bar for user Luke.


The settings screen with a red bar color for the user Luke


The about LinearOS screen with a red bar color for the user Luke


The desktop screen with the main menu drawn with a red bar color for the user Luke.


The desktop screen with a blue bar color for the user Skull.

Thank you to:
Spoiler-LBPHacker for the user system (I copied it from my first ever text based OS), program manager help and configuration help, (all from my previous OS - Same as always in Release 1.6)
-oeed for the ComputerCraft App Store (Getting removed for Release 1.6 - It is broken)
-Dragon53535 and KingofGamesYami for the stack overload help (Gonna sorta be, not there in Release 1.6)
-awesumben13 for his NovaUI and never ending help regarding it. (This is for Release 1.6 lol - Not released, never to be released)

Even though this OS has been discontinued, I may still work on a new one, I haven't decided yet.
Edited on 19 January 2016 - 04:29 PM
mrdawgza #2
Posted 12 October 2014 - 11:23 PM
Release 1.1

-Fixed the bug where if you logged in for the first time with the first registered user, the program would crash (copy failed)
-Replaced the previous ComputerCraft App Store code with the updated code. (Thanks oeed - but I still think it's broken, or maybe it's me. Check your PM)

Release 1.2 Planned Features
Estimated release date: 16/10/2014

-Updates to be implemented.
-Automatic updates to be implemented.
-Different menu bar colors for different users.


Any thoughts on the OS?

Please report any bugs you might have found via this topic or a personal message.
Edited on 12 October 2014 - 09:36 PM
vyse #3
Posted 13 October 2014 - 05:47 AM
this look amazing.. but one problem some reason i get a error when i try to install.. it says l:500 domain error
mrdawgza #4
Posted 13 October 2014 - 09:28 AM
this look amazing.. but one problem some reason i get a error when i try to install.. it says l:500 domain error

Thanks.

The fix for your problem
Linear OS cannot be installed on ComputerCraft v1.63 by default. Since the config now has website whistelisting, all websites but computercraft.info and pastebin.com are not allowed by default.
To get around this change 'S:http_whitelist="pastebin.com;*computercraft.info' in the ComputerCraft.cfg to 'S:http_whitelist=*'. This is fixed as of 1.64pr2.

It is because LinearOS uses GitHub for installation, GitHub is not on the domain whistelist.

About v1.2

I have gotten an updater implemented however it is quite buggy. I will recode it this afternoon and try get release 1.2 out by tonight.

I am also going to release a new installer which will scan for an old version of LinearOS and ask to update it, as well as make it error if it cannot reach Github.
Edited on 24 October 2014 - 04:58 PM
cdel #5
Posted 13 October 2014 - 09:47 AM
I haven't tried this yet, however the screenshots look very pleasing and impressive. :)/>
mrdawgza #6
Posted 13 October 2014 - 10:00 AM
I haven't tried this yet, however the screenshots look very pleasing and impressive. :)/>/>

Thanks. There's just one bug on the desktop where for one third of each second, it doesn't register clicks. This is because of the time, it's quite annoying :P/>
AssossaGPB #7
Posted 13 October 2014 - 02:15 PM
This does look really nice! I'll try it out later.
mrdawgza #8
Posted 13 October 2014 - 06:35 PM
Release 1.2 is now out.

New:
-Update function

This may only be one little update I just wanted to get it out so I can make releasing other updates easier.

Known issues:
-All issues from release 1.1 are carried to release 1.2.

Planned features for release 1.3
-Automatic updates
-Boot behavior
-New installer


Please report any bugs you might have found via this topic or a personal message.
mrdawgza #9
Posted 14 October 2014 - 04:04 PM
Release 1.3 is now out.

New:
-Automatic updates implemented
-Boot behavior implemented
-New installer

Known issues:
-All issues from release 1.2 are also in release 1.3

Planned features for release 1.4
-Fix the Java error one may encounter after using the exit button on programs a bit too much (All programs, switching from program to program)
-Individual user colors
-Make automatic updates configurable.

Please report any bugs you might have found via this topic or a personal message.
Edited on 24 October 2014 - 12:43 PM
mrdawgza #10
Posted 24 October 2014 - 03:03 PM
Release 1.4 is out

New:
-Automatic updates are now actually working.
-Automatic updates can be toggled.
-Each user has their own desktop configuration (both the menu bar color and time format)
-New color selector (logging in as new user and settings)

Fixed:
-Removed the random bar under the main desktop menu.

Known Issues:
All issues from release 1.3 are carried here

Please report any bugs you might have found via this topic or personal message.
Dragon53535 #11
Posted 24 October 2014 - 05:27 PM
Your java error is a Stack Overflow, or at least it looks like it will be.

When you keep calling a function over and over and don't allow any of them to end, then the computer's got all these locations of where to pick up on when each is done.

Say i have a program

function foo()
  bar()
end

function bar()
  foo()
end

foo()
The problem with this, is that it saves the point at which foo is first called, right at the bottom, and knows that whenever foo is done, go back there, however in foo, it goes to bar, and at that point it knows that whenever bar is done, go back to this point, however bar calls foo again, and the cycle keeps continuing without anyone finishing and so eventually the computer is going to have too many locations to remember to go back to, that it overflows, and you get an error.
mrdawgza #12
Posted 24 October 2014 - 06:41 PM
Your java error is a Stack Overflow, or at least it looks like it will be.

When you keep calling a function over and over and don't allow any of them to end, then the computer's got all these locations of where to pick up on when each is done.

Say i have a program

function foo()
  bar()
end

function bar()
  foo()
end

foo()
The problem with this, is that it saves the point at which foo is first called, right at the bottom, and knows that whenever foo is done, go back there, however in foo, it goes to bar, and at that point it knows that whenever bar is done, go back to this point, however bar calls foo again, and the cycle keeps continuing without anyone finishing and so eventually the computer is going to have too many locations to remember to go back to, that it overflows, and you get an error.

Ohh, I thought it was by using shell.run too many times. Thanks for the explanation, but how would I solve this?

BTW, is anyone else having trouble installing apps from the App Store included in this OS? (By oeed ofcourse, it's the standalone
Edited on 24 October 2014 - 04:49 PM
KingofGamesYami #13
Posted 24 October 2014 - 07:17 PM
-snip-
Ohh, I thought it was by using shell.run too many times. Thanks for the explanation, but how would I solve this?

To solve it, don't call stuff like that. Use nested loops if you have too. The stack is 256 calls (if I remember correctly), which makes it really hard to overload, unless you use recursion (which is basically what Dragon said). Recursion can also be caused by programs running each other over and over, for example this program:

local pr = shell.getRunningProgram()
print( pr )
sleep( 0.01 )
shell.run( pr )
Will overload, because there are > 256 instances of the program running. Another solution is to use proper recursion (not recommended, of course) by ending the function when it is called.

Eg.

function foo()
  return bar()
end
function bar()
  return foo()
end
foo()
However, the code posted above suffers from a different problem, too long without yielding. CC kills any co routine that doesn't yield after ~10 seconds. os.pullEvent and some of the turtle API yield, preventing this from occurring.
mrdawgza #14
Posted 24 October 2014 - 07:28 PM
-snip-
Ohh, I thought it was by using shell.run too many times. Thanks for the explanation, but how would I solve this?

To solve it, don't call stuff like that. Use nested loops if you have too. The stack is 256 calls (if I remember correctly), which makes it really hard to overload, unless you use recursion (which is basically what Dragon said). Recursion can also be caused by programs running each other over and over, for example this program:

local pr = shell.getRunningProgram()
print( pr )
sleep( 0.01 )
shell.run( pr )
Will overload, because there are > 256 instances of the program running. Another solution is to use proper recursion (not recommended, of course) by ending the function when it is called.

Eg.

function foo()
  return bar()
end
function bar()
  return foo()
end
foo()
However, the code posted above suffers from a different problem, too long without yielding. CC kills any co routine that doesn't yield after ~10 seconds. os.pullEvent and some of the turtle API yield, preventing this from occurring.

Thanks. I'll look into it. (long term)
mrdawgza #15
Posted 28 October 2014 - 08:47 AM
I've been thinking of removing the clock on the desktop because it's kinda pointless. I don't know many OSs here that have clocks on the desktop. I'm thinking of replacing it for a separate function that displays time. I want to do this because the desktop is quite a pain with the timer for the clock. I've tried ways to get it working smoothly and it doesn't work.
mrdawgza #16
Posted 31 October 2014 - 02:27 PM
Release 1.5.1 is out

-User System: Each user has their own programs folder.
-Desktop: The clock has been replaced with a button ([CLOCK]) which will show the time for 1 second when clicked.
-Settings: Computer Statistics has been renamed to About LinearOS.
-Settings: About LinearOS (formerly Computer Statistics) now shows the computer label, ID and the free space in KB.
-LoadOS: Been shortened, a lot. I removed the bar and replaced it with the LINEAR image.
-LoadOS: The computer will check if all system files are present.
-LoadOS: If there is a missing system file, you will receive an error.
-LoadOS: Removed the user function from the Load OS file and put it in a separate file in apis.
-Startup: The startup file will immediately redirect to linear/system/loados.ls instead of displaying the LINEAR image.
-System: I have put a bunch of returns in to prevent the Java stack overload.
-Several bug fixes.

Regarding my previous post, I have removed the clock to allow more smoother desktop access.
As for the rest of the OS, I have reduced the size (considering the new features).

I think the Java Stack overload error will no longer occur but I am not so sure since I haven't spent a lot of time in the OS

Please report any bugs you might have found via this topic or personal message.
Anavrins #17
Posted 31 October 2014 - 03:50 PM
Nope, you still have it all over the place.
Spoilerhttps://github.com/mrdawgza/linearos/blob/master/1.5.1/linear/system/userScreen.ls#L47
https://github.com/mrdawgza/linearos/blob/master/1.5.1/linear/system/userScreen.ls#L59
https://github.com/mrdawgza/linearos/blob/master/1.5.1/linear/system/userScreen.ls#L100
https://github.com/mrdawgza/linearos/blob/master/1.5.1/linear/system/userScreen.ls#L115
You also have code after "return"s statement that will never be executed, https://github.com/mrdawgza/linearos/blob/master/1.5.1/linear/system/settings.ls#L517
mrdawgza #18
Posted 31 October 2014 - 04:23 PM

Still have what? The Stack overload? I mainly put the return on the desktop and settings programs because they were used the most.

I may have code after the the returns and it hasn't errored yet
com_kieffer #19
Posted 31 October 2014 - 05:06 PM
I may have code after the the returns and it hasn't errored yet

It hasn't errored because it will never be run. It is effectively dead code.
mrdawgza #20
Posted 31 October 2014 - 05:44 PM
I may have code after the the returns and it hasn't errored yet

It hasn't errored because it will never be run. It is effectively dead code.

How do you mean dead? Its working like it did before I put in the returns.
Lyqyd #21
Posted 31 October 2014 - 06:26 PM
Of course it will be executed. These are equivalent:


return func()

return
func()
mrdawgza #22
Posted 07 November 2014 - 04:05 PM
Regarding release 1.5.2 (not out yet):
I have planned release 1.5.2 to include desktop icons, however I will require some help with this.
I have tried using Bedrock however I can't seem to get Bedrock working, at all.
I had ideas on using a table inside the current users folder which would store the icons and the programs the icons would lead to, but there are too
many things I can't think of that would go wrong.
DannySMc #23
Posted 21 November 2014 - 11:11 AM
Looks good, just add more functionality to it, like programs that will help users to make things or help them in minecraft day-to-day life!
mrdawgza #24
Posted 22 November 2014 - 08:42 AM
Looks good, just add more functionality to it, like programs that will help users to make things or help them in minecraft day-to-day life!

I plan to have a rebuilt OS in the next update :P/>


EDIT
This is my 100th post :D/>/>:D/>:D:D:D
Edited on 23 November 2014 - 09:37 AM
oscar124 #25
Posted 22 November 2014 - 04:13 PM
After entering information in the register option it crashes and outputs:

Saving details…
userScreen.ls:95: ././world/computer/165/linear/userfolders/triple/imgs/desktopBg.lsg (No such file or directory)

.3. Fix this, and that FAST!

After entering information in the register option it crashes and outputs:

Saving details…
userScreen.ls:95: ././world/computer/165/linear/userfolders/triple/imgs/desktopBg.lsg (No such file or directory)

.3. Fix this, and that FAST!

Also this is ingame and not any emulator.
Exerro #26
Posted 22 November 2014 - 04:26 PM
After entering information in the register option it crashes and outputs:

Saving details…
userScreen.ls:95: ././world/computer/165/linear/userfolders/triple/imgs/desktopBg.lsg (No such file or directory)

.3. Fix this, and that FAST!

-snip (seriously, why did you quote yourself?)-

Also this is ingame and not any emulator.
Pretty sure this is because you are running an older version of computercraft. In 1.6.5, that error should never occur as it automatically creates the directories. Do you know which version of computercraft you are running?
Edited on 26 November 2014 - 04:04 PM
mrdawgza #27
Posted 22 November 2014 - 06:49 PM
-snip
Pretty sure this is because you are running an older version of computercraft. In 1.6.5, that error should never occur as it automatically creates the directories. Do you know which version of computercraft you are running?


Yeah, this never happens. It doesn't happen to me ingame or in my emulator.
As for the rest of the OS, I'm rebuilding it :D/>
Edited on 23 November 2014 - 09:38 AM
mrdawgza #28
Posted 26 November 2014 - 04:28 PM
Release 1.6 (WIP)

As for release 1.6, I am expecting it to be finished soon.
I have had to restart the rebuild like 6 times before I finally got onto a proper route.

The current alpha I have right now is only doing one thing, logging in - then it sits braindead…
However, the rebuild will look and work a lot better then Release 1.5.1, since it be using NovaUI by awsumben13.

I am currently implementing multitasking and desktop icons, is there anything else I can try put in?
– Edit: I am postponing the multitasking to a later date.
Edited on 11 February 2015 - 05:42 PM
DannySMc #29
Posted 27 November 2014 - 12:22 PM
Looks good, just add more functionality to it, like programs that will help users to make things or help them in minecraft day-to-day life!

I plan to have a rebuilt OS in the next update :P/>


EDIT
This is my 100th post :D/>/> :D/>:D:D:D

Yes but make sure to add them in so they are useful, and make sure they can't error and are physically unbreakable?
mrdawgza #30
Posted 27 November 2014 - 12:34 PM

Yes but make sure to add them in so they are useful, and make sure they can't error and are physically unbreakable?

Hmm? I am rebuilding the OS and it will have useful programs. I am not so sure what you mean by physically unbreakable.
DannySMc #31
Posted 27 November 2014 - 02:36 PM

Yes but make sure to add them in so they are useful, and make sure they can't error and are physically unbreakable?

Hmm? I am rebuilding the OS and it will have useful programs. I am not so sure what you mean by physically unbreakable.

Use:

local status, err = pcall(YOUR_FUNCTION)

as this will stop the program from automatically terminating your code?
mrdawgza #32
Posted 27 November 2014 - 03:29 PM

Use:

local status, err = pcall(YOUR_FUNCTION)

as this will stop the program from automatically terminating your code?


Well, not sure if my code can be terminated through a program; however this is the prevention I have.


local oldPull = os.pullEvent;
os.pullEvent = os.pullEventRaw;
--
--code goes here - such as proceeding to load the OS
--
os.pullEvent = oldPull;
Edited on 27 November 2014 - 03:06 PM
DannySMc #33
Posted 27 November 2014 - 04:40 PM

Use:

local status, err = pcall(YOUR_FUNCTION)

as this will stop the program from automatically terminating your code?


Well, not sure if my code can be terminated through a program; however this is the prevention I have.


local oldPull = os.pullEvent;
os.pullEvent = os.pullEventRaw;
--
--code goes here - such as proceeding to load the OS
--
os.pullEvent = oldPull;

No if an error occurs it will terminate the program, you need to catch the errors and not let it stop the program!
mrdawgza #34
Posted 27 November 2014 - 04:49 PM
No if an error occurs it will terminate the program, you need to catch the errors and not let it stop the program!

Ohh, I believe this will be supported in the rebuild.
Exerro #35
Posted 27 November 2014 - 04:56 PM
I believe he is using NovaUI and a UICanvas to run each program, in which case errors are handled by the UICanvas object, and shouldn't cause any problems in the OS.
DannySMc #36
Posted 28 November 2014 - 09:24 AM
No if an error occurs it will terminate the program, you need to catch the errors and not let it stop the program!

Ohh, I believe this will be supported in the rebuild.

Ahh good :)/> Well happy coding, make sure to tell me when you update it so I can look :P/>