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

Mysticos v1.0 pr1

Started by MysticT, 23 February 2012 - 04:49 PM
MysticT #1
Posted 23 February 2012 - 05:49 PM
MysticOS

Version: 1.0 pr1


Ok, It's been too long since the last update, so I decided to make a pre-release of v1.0 to let you try it out and help me find any bugs.
I decided to make 3 different versions, so you can use the one that fits your needs.

Shared Features (for the 3 versions):
Spoiler- Libs (known as apis in CraftOS) to make programming easier.
- Buffered output, the screens redraw at 20 FPS (will add functions to change this later)
- Synchronized output on the terminal and the monitors (using the monitor and output programs)
- Processes and Threads!

Server
The server version has no users, so you don't need to login. It's purpouse is to be used as servers that need to run some programs each time it turns on, like gps towers or network routers/servers. It looks more like CraftOS, but with all the MysticOS libs.
Download: disk files
debug version

WorkStation
WorkStation is like a midpoint between Server and Home versions. You can have multiple users, but it has no gui. Each user can only access it's own files, and passwords are saved as sha256 hashes, so your files should be safe.
Download: disk files
debug version

Home
Home version, for those who don't like the command line. It has an easy to use gui, so you can access and use your programs easier.
It also has multiple users, so your files are safe.
Download: Coming soon…
I need to finish the gui lib before releasing this one, so you'll have to wait.

Installation:
1) Download bios.rar
2) Extract the files and move them to (minecraft_folder)/mods/ComputerCraft/lua/ (it will replace your bios.lua, but you can still use CraftOS).
3) Download the disk file for the version you want.
4) Extract the files and put them on a CC disk. (Create one in the game, and copy the files to (minecraft_folder)/saves/computer/disk/(Disk ID)/)
5) Put the disk on a disk drive, reboot the computer and the setup should appear.
6) Have fun with your new OS ^_^/>/>

Running CraftOS programs:
SpoilerMost of the programs should work without changes, since most of the apis and functions have the same names.
However, there's some things that work different, so you might have to do some changes:
Files:
SpoilerMost of the fs lib functions will work. The only difference is in opening files, since fs.open returns an instance of the File class, instead of a file handle. So, every method called on the file must use a colon ( : ) instead of a point ( . ):

-- CraftOS
file.readLine()
-- MysticOS
file:readLine()
Also, each time you open a file, instead of checking if the handle is nil, you have to use the isOpen method:

-- CraftOS
local file = fs.open("Path/To/The/File", "mode")
if file then
  -- use the file
end
-- MysticOS
local file = fs.open("Path/To/The/File", "mode")
if file:isOpen() then
  -- use the file
end
Rednet:
SpoilerThe rednet api is replaced with the net lib. If your program uses rednet, it won't work in MysticOS.
The net lib is easier to use than rednet, but it doesn't work with bundled cable.
Some examples of the net lib usage:

-- CraftOS
-- Start connection
rednet.open("side")
-- Stop connection
rednet.close("side")
-- Checking connection
rednet.isOpen("side")
-- Send messages
rednet.send(id, "Message")
rednet.broadcast("Message")
-- Send files
local file = fs.open("Path/To/File", "r")
if file then
  rednet.send(id, file.readAll())
  file.close()
end
-- Receiving messages
rednet.receive(timeout)

-- MysticOS
-- Start connection
net.connect()
-- Stop connection
net.disconnect()
-- Checking connection
net.isConnected()
-- Send messages
net.send(id, value)
net.broadcast(value)
-- Send files
net.sendFile(id, "Path/To/File")
-- Receiving messages
net.receive(timeout)
As you can see, it detects modems when connecting, so you don't need to specify the side. It even tries to reconnect when the modem is removed from the computer, so if there's another one it will instantly connect.
Also, the send and broadcast functions can take any value as the message, not just strings. It automatically serializes the message and sends it, and when receiving it deserializes it and gives the original value back. So you can simply do:

net.connect()
net.broadcast("Hello")
net.broadcast(10)
local t = {}
t.value = 1
t[1] = "a"
t[2] = "b"
net.broadcast(t)
Http:
SpoilerAll the http functions are inside the net lib, so you have to use this functions:

net.httpRequest(url[, post])
net.httpGet(url)
net.httpPost(url, post)
They work exactly like the CraftOS http api.

Any feedback and suggestions are welcome.

The project is now on GitHub! Feel free to make pull requests if you want to add something.

Changelog:
23/2 2012:
- Beta 1.0 release
- Fixed some bugs in the fs api
26/2 2012:
- Beta 1.1 release
- Fixed minor bugs
- Added colors, Keys, net, peripherals and rs APIs
17/7 2012:
- v1.0 pr1 release
- Rewrite of most apis and core files
- Server and WorkStation versions
wilcomega #2
Posted 23 February 2012 - 07:29 PM
wow ^_^/>/>
solvillan #3
Posted 26 February 2012 - 10:55 AM
When i have placed all the files in the correct places and started the computer with the disk in, it outputs an error:

rom/programs/shell :149: attempt to index ? (a nil value)
bonnis #4
Posted 26 February 2012 - 12:14 PM
wow! that's new!
Peram #5
Posted 26 February 2012 - 07:48 PM
I get the same problem as solvillan.
MysticT #6
Posted 26 February 2012 - 10:01 PM
Updated to Beta 1.1
This version should work in CC 1.3, that should fix the errors
Kane Hart #7
Posted 27 February 2012 - 06:08 AM
Sweet. Are you planning on adding things like programs and such and end up creating I guess mshell was it as a kid but anyways adding accessories and etc till one day its like a fullblown loaded os?
Rion #8
Posted 27 February 2012 - 07:04 AM
Well. I guess so, but he won't be able, to do many things, because ComputerCraft is more of an old monochrome DOS computer than a modern one ;)/>/>
Kane Hart #9
Posted 27 February 2012 - 08:43 PM
Well. I guess so, but he won't be able, to do many things, because ComputerCraft is more of an old monochrome DOS computer than a modern one :P/>/>

Actually I kind thought some the old old stuff use to have tons of little tools like calculators etc. note pad you know that silly stuff :)/>/>
JavaJosh94 #10
Posted 01 March 2012 - 12:30 AM
I feel like a noob for asking this, but after I log in all I see is a blank screen with "Menu" and the time at the bottom. How do I do anything with this?
MysticT #11
Posted 01 March 2012 - 12:48 AM
Sweet. Are you planning on adding things like programs and such and end up creating I guess mshell was it as a kid but anyways adding accessories and etc till one day its like a fullblown loaded os?
Yes, when I finish the APIs I'll start doing more programs, I already have some ideas, but you can make your own programs. I'll make some help files and a programing guide to help people make their own programs.

I feel like a noob for asking this, but after I log in all I see is a blank screen with "Menu" and the time at the bottom. How do I do anything with this?
I added a controls section, I forgot to add it before sorry :unsure:/>/>
pcmaster160 #12
Posted 01 March 2012 - 03:15 AM
haha this reminds me of when programs were written entirely of ascii art. cool stuff.
ETHANATOR360 #13
Posted 10 July 2012 - 09:55 PM
i placed all the files in the right place and i got:
rom/craftOS_1_3.startup:329: not a directory
how do i fix this?
MysticT #14
Posted 10 July 2012 - 10:31 PM
I don't have the file anymore (and don't want to download it now :)/>/>), so I'm not sure what's the problem. This version is outdated anyway and I don't recommend using it. I'm working on the next update, I almost rewrote all the code, so it will take some time.
Here's a list of some changes in the next update:
- Full rewrite of almost all the apis.
- Lots of new apis.
- More security.
- 3 OS versions: Home, WorkStation and Server.
- Processes and Threads!!!
And a lot more. But you'll have to wait, cause it takes a lot of time to write all this (code and documentation) and fix bugs.
I'll make a pre-release soon (next week I guess), so make sure to check.
ciba43 #15
Posted 11 July 2012 - 04:34 PM
So, this is the coolest OS? I think yes.
kazagistar #16
Posted 13 July 2012 - 10:07 PM
Your window system is really extensive. How possible would it be to run it standalone? Also, you said you had multitasking… where is it exactly?
MysticT #17
Posted 13 July 2012 - 10:27 PM
Well, as I said before, this is outdated, the new version makes a lot of improvements.
The gui api wasn't really made to run standalone, it's suppose to be run with the os.
There's no real multitasking, you can have multiple windows open, and each one sets event handlers and must act accordingly. I decided to change that, since the programs needed to be written in a certain way to work with this system.
However, I have a processes and threads system working on the next version. It works like the parallel api (using coroutines), but they are added to an unique process queue, instead of making a new one like parallel does. I tested it a lot, and was able to run more than 30 processes at the same time before noticing some lag (the code run by each one was really simple, but should be enough for most programs).

Also, something that's already in the next update: screen api with buffered output. So you can sync all your screens (terminal and monitors) and choose where it should be seen (terminal, monitors or both!). Also adds the possibility to add multiple desktops/shells in some future update.
A little thing on next update is that the Home version will take some more time to be released. This version is the one that will have the new gui api, wich is still in development. The other two (WorkStation and Server) have command line like CraftOS.
kazagistar #18
Posted 13 July 2012 - 11:37 PM
Ahahahaha. Its funny, because I already have one of those. I'll give you a copy to use if you want.
MysticT #19
Posted 13 July 2012 - 11:55 PM
Ahahahaha. Its funny, because I already have one of those. I'll give you a copy to use if you want.
What do you have? The multiple screens?
I designed the screen api to add that in the future, it just needs a few changes, but didn't want to add it yet so I can focus on other things.
I'll make a pre-release soon (maybe a few days), and then the full 1.0 release when I fix every bug (or at least the most critical ones) and the gui api is ready, and maybe when the OCL is defined and working.
MysticT #20
Posted 17 July 2012 - 09:49 PM
Ok, the first pre-release of 1.0 is here, go get it, enjoy it and please report any bug you find.
fire-hazard #21
Posted 18 July 2012 - 03:33 AM
Hey, just tried to install the server and workstation. both came up with the error when booting up

MOS-S/system/libs/Math:23: attempt to index ? (a n
Press any key to continue
MysticT #22
Posted 18 July 2012 - 04:21 PM
Hey, just tried to install the server and workstation. both came up with the error when booting up

MOS-S/system/libs/Math:23: attempt to index ? (a n
Press any key to continue
Hmm… It looks like the class lib is not loaded for some reason. It works for me, did you change anything? Check if the file "MOS-S/system/libs/class" is there.
I think I'll add some debug code to the core, so you can see if there's an error.
MysticT #23
Posted 18 July 2012 - 08:38 PM
Added debug version. It's the same, but prints some info while loading to catch any error.
Tiin57 #24
Posted 03 August 2012 - 09:38 PM
Any updates?
MysticT #25
Posted 03 August 2012 - 10:17 PM
Any updates?
I haven't worked much on it. I have some things planned, but I also need some feedback to fix bugs and add features people want.

There's a lot of features I didn't list on the OP (like redstone output saving and loading!), just because there's a lot and I can't remember all of them :P/>/>
So try it out, discover all it's power, and please give me some feedback ;)/>/>
THUNDERGROOVE #26
Posted 13 August 2012 - 07:14 PM
Installing now!
On my Tekkit server we'll see how it goes

EDIT: Looks like it didn't work:(

error

MOS-S/system/libs/hash:21: attempt to index ? a n
Press any key to continue
MysticT #27
Posted 13 August 2012 - 08:06 PM
Installing now!
On my Tekkit server we'll see how it goes

EDIT: Looks like it didn't work:(

error

MOS-S/system/libs/hash:21: attempt to index ? a n
Press any key to continue
It looks like the bit32 lib is not loaded. Could you try with the debug version and tell me if it shows an error? Also, what os you/the server is using (the real computer, like windows, linux, macos, etc)?
I think the libs are loading in a different order (not alphabetical) so the ones that depend on another are failing. I'll what I can do about it.
THUNDERGROOVE #28
Posted 13 August 2012 - 08:33 PM
It looks like the bit32 lib is not loaded. Could you try with the debug version and tell me if it shows an error? Also, what os you/the server is using (the real computer, like windows, linux, macos, etc)?
I think the libs are loading in a different order (not alphabetical) so the ones that depend on another are failing. I'll what I can do about it.
Okay let me download the debug versions and reinstall.
The server is running Ubuntu 12.04LTS and the client is Windows 7.
Let me get back to you on the debug info

EDIT: Same error but under it it reads

Loading system library..Done
Initalizing system envirmoent..
Loading librarys...
Loading library hash...
From there it just hangs till you press button and reboots
MysticT #29
Posted 13 August 2012 - 11:17 PM
Just what I thought, linux doesn't order the files list allphabetically, so the libraries load in a differrent order. I'll fix it and upload a new version in a few days.
Cranium #30
Posted 13 August 2012 - 11:35 PM
I'm gonna have to try this out! Does it work with 1.3? I'm still using tekkit….
(BTW, on your name tag, you spelled "sensei" wrong)
MysticT #31
Posted 14 August 2012 - 12:05 AM
I'm gonna have to try this out! Does it work with 1.3? I'm still using tekkit….
Yes, it was actually developed in 1.33. There's a few bugs, and it doesn't work on linux (see posts above), but it should work on other oses.

(BTW, on your name tag, you spelled "sensei" wrong)
lol, didn't even notice it changed, last time I saw it said "Request your own title" (or something like that), and I never did :P/>/>
THUNDERGROOVE #32
Posted 14 August 2012 - 01:46 AM
Just what I thought, linux doesn't order the files list allphabetically, so the libraries load in a differrent order. I'll fix it and upload a new version in a few days.
Okay works for me. I might attempt to figure it out myself. Wish me luck…
Mr. Fang #33
Posted 27 September 2012 - 03:49 PM
When will the "Home Version" of your MysticOS be released?
MysticT #34
Posted 27 September 2012 - 05:38 PM
When will the "Home Version" of your MysticOS be released?
Not any time soon sadly. I haven't worked on this for a long time, but I plan to continue when I have some time.
There will be a lot of changes to all versions. I think I'll wait for colored output before doing the Home version.
brucelong #35
Posted 02 October 2012 - 03:33 PM
Over rednet, can this interact with craftOS computers? Or do all the computers have to be either Mystic or CraftOS?
Doyle3694 #36
Posted 02 October 2012 - 05:16 PM
How would you have both installed at the same time?
MysticT #37
Posted 02 October 2012 - 10:24 PM
Over rednet, can this interact with craftOS computers? Or do all the computers have to be either Mystic or CraftOS?
Well, it sends over modems, so any computer with a modem can send/receive messages to/from MysticOS. The thing is that the net lib adds a header to the message, so it knows it was sent by MysticOS. You could receive the message, then remove the header and unserialize the message (it's serialized to be able to send any value).

How would you have both installed at the same time?
Install the rom, then put one of the disks and install that version, then put the other disk to install the other one. Remember to select the multi-boot option, so you can access both.

Progress update:
Changed the design (again) to separate the core functionality (the kernel) from the different interfaces (the shell).
New and improved file system. All the files are accessible now (no more user directories), but they have (soon configurable) permissions.
Some other minor changes and bug fixes.
Jazza_Hat #38
Posted 28 October 2012 - 01:35 AM
Hi, I was wondering if I could use some of your code for my small OS I'm making? I'll be sure to give you credit for each part I use.
MysticT #39
Posted 28 October 2012 - 01:52 AM
Sure, it's open source anyway :D/>/>
Also, I'm making a lot of changes, and most of it is being rewriten.
CoolisTheName007 #40
Posted 07 November 2012 - 12:37 AM
This looks very interesting. Do you think adding the possibility of handling events not only by the first parameter, a string, but also by it's arguments is a good idea? And what about locking resources? sys.protect coupled with something like sys.isProtected should do it. Plus, even if you are able to create processes and threads, I can think of some situations where you would like to run a chain of coroutines inside an arbitrary coroutine, or switch from a coroutine to another.

The fact is I'm making a coroutine API and though it would take me some time to get used to your OS, I see advantages in using and developing a pre-existing system like yours.
Btw, do you override the error function? I am developing a password protection program that is supposed to run on top of everything, and if a program throws an error it shouldn't end the protection program.