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

ZephyrOS (working title) - my first OS

Started by Pharap, 08 March 2013 - 02:24 PM
Pharap #1
Posted 08 March 2013 - 03:24 PM
Ok, so there are loads and loads of ComputerCraft Operating systems already.

And yes I'm going to claim mine can do windowing and all that jazz.
Why do I think mine is going to be better than any of the others?
Well tbh, what OS you use is entirely up to you, I'm going to be tailoring this one to my own likes and needs so it may not be to your tastes.

I'm going to work my way up to a beta (already did an indev/alpha, the system was horrible, I decided to redo it from scratch) then probably release a bit of it (at least a demo) to see what people think, then decide whether to go ahead with it and release a full version.

SpoilerFirstly I'd like to point out that I am fairly experienced with the actual windows forms API that windows uses to host basic applications, and as such I know what features are generally the more useful ones, particularly event hooking. Baring in mind that lua is a fully interpreted language running on a VM (running on top of the JVM in this case) I will be slimming things down a bit to keep a balance between memory, features and performance, but I may go ahead with adding extra features that may be a tad more intensive (think of it like this, there's a reason you don't run 7 instances of minecraft at a time - it munches resources).

I also have experience with games development (made tower defence in XNA with it's own asynchronous auto-updater that adheres to an online repository, plus the gui was pretty sweet as well) so I know a few of the features that come in handy there, so hopefully I'll be able to trim some things down for the sake of game development.

Anyway, onto the propaganda (aka the features).
SpoilerArguably Enhanced graphics:
[Confirmed@17/04/2013]
Easier to use, slightly faster than the regular graphics. Why? - for now that's classified.
I'd say this is what I'm most proud of, it makes graphics handling much easier and frankly was my biggest stroke of genius.

Windows-Style System:
[Confirmed@17/04/2013]
Taking a lot of inspiration from microsoft here. I know they don't always get things right *cough* IE *cough* but generally they have some decent ideas and it's what most people are used to, so I'm not going to deny a working formula.

Alternate-Style System:
[Postponed@17/04/2013]
Here's something windows doesn't give you. On top of having a windows style desktop (aka windows explorer) I'm going to implement some other desktop styles to suit your needs. I plan to have a system based on the Nintendo 3DS home screen (because frankly I have to appreciate what an improvement it was on the old systems) which will probably be restricted to improve performance for games built in lua. By restricted I mean the system will boot with minimal APIs, apis must be loaded manually and it is encouraged that only the necessities are used. To help with that I will probably build a system.

If people want other styles like mac style or playstation style homescreens, I may go on to develop those. (I know game system styles are better for non-colour computers for one thing, Plus I'd like to make a steam-style system at some point)

Backwards compatibility:
[Confirmed@17/04/2013]
I hope to offer a compatibility mode designed to run programs that work on CraftOS so you don't have to worry about converting your programs if you don't want to (though it is advised in some cases). I already have an idea for how I'm going to manage it, this is covered in my next point/interjection:

How is this all possible!?
I'm rewriting an entire shell - of course it's possible.
By taking the native APIs and intercepting their input and output, I can add security layers and perform checks to keep the system running nicely. It's nothing CraftOS doesn't do (to a smaller scale). CraftOS intercepts up the native metatable assignment system to give you the ability to set a table as the __index of a metatable. This is like that but much bigger. That reminds me, my next point:

Pseudo-ReadOnly Files:
[Postponed@17/04/2013]
By intercepting the fs API, I can develop a system that marks files as being readonly or requiring certain rights to access. Which brings me to my next point:

Admin Rights:
[Postponed@17/04/2013]
Going with the windows theme, this is a MUE (multi-user environment) which means some people are admin, some are not, and the system is always king. Yet another windows trick up my sleeve:
Update: 17/04/2013
Until a MUE version is developed, Admin rights are an unnecessary feature as there is only the user and the system. The User is thus Admin by default. Same goes for readonly files for now.

System Registry:
[Postponed@17/04/2013]
Now, some of you out there will be thinking 'my god the man's gone crazy'. In fact most people who know about the system registry probably are. I'll have you know I was crazy before I started programming, any features of my programs that come about as a result of this are merely the side effect of volatile genius.
The system registry is a many misunderstood thing to most people. Heck even I don't fully get it. What I do get though, is that it's a database full of important configuration data (like config files) that greatly replace Microsoft's original initialisation (.ini) files over the years.

The main idea is to stop things like boot.ini getting edited with ease.
There were actually several games that did this by accident and practically bricked people's computers.
The reason this works is that the registry acts as a virtual file system, (like the real life system, but slimmed down and more organised, and part of the system, not part of the hard disk) loading all its data from a protected database file at startup.
Since the system is virtual, even if someone blitzes a bunch of files, as long as the main database is intact, the registry remains untouched. It is for this reason that the registry is used to store things like admin rights, file associations and the local data for the current and offline users.

Essentially, just know that the registry is there to help you, and I hope to make it a bit friendlier than the actual windows registry.

Customisability:

[Confirmed@17/04/2013]
I intend to allow things like changing the desktop background. And not just to a single colour, to a full blown sprite if you want!
I can afford this because of the graphics system. I'll also probably allow for the taskbar to have different orientations (even though I haven't figured out how to do that on my own windows computer) as well as changing the window theme (the colour that gets set as the background for the task bar and the window control bar, the thing the _ [ ] and X appear on).

That's pretty much a basic overview. No screenshots of the current system doing anything much, but I have a screenshot of the indev/alpha's file browser and the new system's smaller windows (hoping to allow restored windows this time, not having them all maximised.

[attachment=1044:System.png]

The yellow outline computer is the current small windowed system (moving the window around is quite smooth) and the red outlined system is from my old system. I will replicate the old file browser in the new system sure enough.
SpoilerOut of interest the listbox allows the selecting of items as well as allowing you to scroll down with the arrows, and the text box works almost perfectly (ie just like the edit program in CraftOS, but on one line with a fixed width). The buttons do stuff on click, the window minimises when minimise is clicked and the program is killed when X is pressed. The start menu was also half finished. All these features I plan to recreate with my new advancements.

If I get round to compiling win3 (the old shell, in the form of a program) or getting over my fear of people taking credit for my work or copying my ideas, I will put up the old system so people can see what it did.
Anyway, I've almost committed myself to this project now, so there's no backing out really (<neurosis> except for college work and games, or if people don't like what I have to offer or don't think I'm capable… </neurosis>)

Well, I hope to keep working on this, I have the ideas, now I just need the effort.
Go program, and have fun.

PS - Give Gabe a hearty cheer for winning his Bafta.
PPS - I guess they thought he was big enough to count for all the nominees.
PPPS - A fat joke a day keeps episode 3 away!

Update - 19/03/2013 - 04:46
Project is currently behind schedule.
SpoilerThis is mostly because I stopped to write a registry-based virtual machine (it runs bytecode and can run HelloWorld, which I have already written for it).
I am currently writing a BrainF*** VM, but I will get back to writing my OS sometime in the week.
(I'd like to point out BrainF*** doesn't need to compile to bytecode, it's instructions are only 1 character long)

On a more OS related note, I have decided (for several reasons I will list at a later date) that the default programming environment for using the windowing system offered by my os will not by default be capable of running code aimed to be run on CraftOS.
Instead, the OS will come with a program that emulates CraftOS almost exactly. The key difference will be that 'term' will interface with the program window, not the computer monitor itself (as such getSize returns the size of the window).
The program will be known as "CraftBox" and will emulate as much as possible, bearing in mind the requirements of the OS.

Programs written for ZephyrOS should be designed to work with the OS. This is because the multi-program environment it runs must give each program its own execution time. This does seem a tad harsh, but it's no different really to regular CraftOS programs. All that is asked is that people remember to yield their programs to accommodate for other processes. In exchange you're getting the window feature, the ability to allow for the window to handle it's own minimising, maximising and closing or to take over complete control of managing the window. On top of this I hope to offer a library that handles things like text boxes and buttons for you, so you can throw things together quickly.

If you don't like the idea of working with the OS or don't like Windows-styled computers, there are plenty of other OSs out there and I wont be offended if you prefer them.

However if you've ever used the Windows Forms library and liked it, this OS is (will be) for you.

Update - 17/04/2013 - 16:43
Project is currently even further behind schedule.
SpoilerDue to my recent return to college combined with my stupid workload and preoccupation over the holidays (wrote a brainf**k VM, an almost complete chip8 emulator and invented a file format, pretty dang impressive from my point of view) ZephyrOS is currently behind schedule. However to ensure I have a version ready within a few months, I have decided to slim the features down a bit for now:

ZephyrOS will postpone mult-user capabilities to simplify the otherwise overcomplicated multi-process management system. This is a tradeoff; by dropping the ability to have more than one user, the multi-process features will be finished faster and be easier to maintain. A multi user environment will now be added to the 'possible future features' list.

There will be a slim down on the multi processing capabilities until the release of the first version, after which I will reassess the features and bring them in slowly. I am primarily aiming for a nice balanced system, so having the ability to have multiple windows open is no good if it's going to cause too much lag or be too hard to maintain.

I am not adding any Admin-rights based features due to the fact a SUE (single user environment) does not really require them. I may consider them, along with readonly files, at a later date if prompted, but until further notice these features are floating in the aether. The registry is also postponed for now since I am essentially starting small and building up.

The key features that do remain:
Intelligent Graphics System
Window-based GUI system
Multi-process Environment
Password locking
CraftOS backwards compatibility (in the form of CraftBox)
File management system

So do keep reminding me and I'll get these things done when I get chance.
(PS- I'm considering learning lua bytecode in order to help with optimisation as well.)
Edited on 18 April 2013 - 03:37 AM
Sammich Lord #2
Posted 08 March 2013 - 03:54 PM
Seems cool. Big wall of text though.
Mailmanq! #3
Posted 08 March 2013 - 03:54 PM
Sounds pretty amazing! Can't wait!
Pharap #4
Posted 08 March 2013 - 04:09 PM
Seems cool. Big wall of text though.
Yeah, I do that, particularly when it's late lol
I get some of my best work done when it's so late I can do nothing but ramble on.

Sounds pretty amazing! Can't wait!
Thanks. Gonna be some time unfortunately, but it'll be worth the weight.
Mailmanq! #5
Posted 08 March 2013 - 04:11 PM
Sounds pretty amazing! Can't wait!
Thanks. Gonna be some time unfortunately, but it'll be worth the weight.
grammarNazi.correct("*wait");
Pharap #6
Posted 08 March 2013 - 04:21 PM
Sounds pretty amazing! Can't wait!
Thanks. Gonna be some time unfortunately, but it'll be worth the weight.
grammarNazi.correct("*wait");
Dammit, you didn't get the joke lol
Cranium #7
Posted 08 March 2013 - 04:36 PM
If you're going to post walls of text as interesting as that, you should definitely get an avatar at least… I hope you're back on these forums for good.
SuicidalSTDz #8
Posted 08 March 2013 - 04:38 PM
Dammit, you didn't get the joke lol
I got the joke ;)/> I am really looking forward to seeing this OS released.
Pharap #9
Posted 08 March 2013 - 04:48 PM
If you're going to post walls of text as interesting as that, you should definitely get an avatar at least… I hope you're back on these forums for good.
I hope so to. I've been cooking this one for a while, I built that indev system back when mouse events were first added.
Something to know - if it weren't for ZephyrOS indev, I never would have added the mouse_drag event into the event table on the wiki (I'm listed in the os.pullEvent page history. I felt happy knowing I contributed something :D/>)

I shall attempt to have an avatar soon, I may just have to borrow my steam one, it depends.
Dammit, you didn't get the joke lol
I got the joke ;)/> I am really looking forward to seeing this OS released.
I knew someone would, can't have a forum full of gamers without one of them getting a gaming joke.
Maybe I'll make ZepyhrOS version 3's development time really long on purpose lol
(Assuming version 1 ever gets off the ground)
Pharap #10
Posted 19 March 2013 - 05:31 PM
Seems cool. Big wall of text though.
Wall of text fixed (I figured out how to use spoiler tags lol)
YoYoYonnY #11
Posted 28 August 2013 - 03:18 PM
The Picture is a bit small… Mayby use imgur? ( http://www.imgur.com )
Pharap #12
Posted 09 September 2013 - 06:27 AM
The Picture is a bit small… Mayby use imgur? ( http://www.imgur.com )
Have you tried clicking on the image?
That screenshot is actual size.
Lyqyd #13
Posted 09 September 2013 - 10:27 AM
Thread closed. Report your thread when you have code to post.