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

VorbaniOS - A *nix kernel/OS

Started by Scoopta, 21 March 2017 - 12:50 AM
Scoopta #1
Posted 21 March 2017 - 01:50 AM


Summary

A *nix like operating system. This operating system is under heavy development and might not be perfectly stable. This might be considered by some to be overkill for minecraft but I like it and if you don't…don't use it. More features will be coming. The usability isn't perfect but that will come in time. The big thing about this OS is it's kernel not the userspace. The userland tools are pretty terrible. Ideally someone will build an OS on top of this kernel. If you do that all I ask is that you give me credit for the kernel. It would also be nice if you filed a proposal on bitbucket instead of shipping a modified kernel but that's not a requirement…just a request. There is only a certain amount of CraftOS compatibility. The fs api is mostly compatible however other APIs like peripheral don't exist at all but are replaced with a more *nix like device file approach. If you NEED the peripheral API for CraftOS applications there is a wrapper for it but it's not the best and does have some issues. Once you have the OS installed you can add the following to /etc/pacman/sources.list
HolyCloudNinja vorbani-addons default
and then run
pacman install vLibs
to download it. I would recommend you just directly send commands to the devices as described in the usage section. Anything in /lib that has lib in the start of its name will be automatically loaded at boot. I wouldn't recommend installing this on a computer that already has files on it as those will not be accessible from the OS and unless you're on Minecraft 1.7 or earlier disks containing startup are disabled making accessing your old files impossible. There is a convert system call and corresponding command that can convert CraftOS files but they must already be visible to user space. I.e. on a disk in a folder called root or already in the user space file system on the computer. pastebin and edit are no longer shipped with the OS but must be installed from the official repositories using
pacman install edit
You can replace edit with pastebin to install pastebin.

Installing

You will need to have CCTweaks installed for the OS to run. At least in MC 1.7.10.

pastebin run 56nnyZrK
root's default password is groot
To update the OS run the update command. If you want to run an even more unstable build you can run update development which will switch you to the development tree which is even more unstable than the stable tree.
You can also fresh install the development tree by doing

pastebin run 56nnyZrK development
If you're interested in building your own OS around the kernel there is an OSDK tree for this purpose. The OSDK ships with a bootloader, kernel, and bare-bones init daemon which will open itself in an editor on boot. That's all it ships with and it is only intended for developers. It can can be installed with

pastebin run 56nnyZrK OSDK
The kernel shipped with the SDK tracks development closer than stable does however it still lags behind development. You can find a system call reference here: https://bitbucket.or.../System%20Calls. As I've already said modifying the kernel is not recommended and the kernel internals will never be documented. If you want to modify the kernel you're flying solo. This SDK is designed for building a user space(including init daemon) not for kernel modification.

Usage
  • Mounting disks: In order to access the contents of a disk you must first mount it. Floppy disks will have a device file in /dev with a name that starts with fd. There is a mount command to facilitate mounting disks and a umount command to un-mount disks. I.e mount /dev/fd0 /mnt will make the contents of /dev/fd0 available in /mnt. /dev/fd0 being the first floppy disk to be inserted. The second will be /dev/fd1 and so on. Disks containing files made outside the operating system will not be accessible as they have no on disk permissions and probably won't even be visible to opendir(fs.list)
  • Accessing peripherals: Peripherals aren't treated the way CraftOS treats them. They're treated like files. Disk drives don't actually have device files but rather the disks inside them do, printers will show up with parallel port device files I.e /dev/pp0, /dev/pp1, etc. All other peripherals of any type from any mod(modems, computers, etc) will show up as rs232 device files I.e /dev/ttyS0, /dev/ttyS1, etc. To call a function on a peripheral(printers included) you would write the function's name to the device file followed by a space with the parameters I.e. let's say you wanted to open channel 512 for the modem at /dev/ttyS0. You would write
    open 512
    to /dev/ttyS0. To close 512 you would write
    close 512
    If you need to pass a string as a parameter and that string contains a space, prefix the space with \. I.e
    my\ parameter\ containing\ a\ space
    would be passed as one parameter where
    my\ parameter containing\ a\ space
    would be passed as 2 because the space between parameter and containing has no \ so the result would be two parameters. If you need to pass a table as a parameter serialize it using text utils and then escape spaces with a \. This can be done easily by doing
    mytable = textutils.serialize(mytable):gsub(" ", "\\ ")
  • Creating users:
    useradd <username>
  • Setting a users password:
    passwd <username>
    passwd will prompt you to enter and confirm your password. Do not enter it as a parameter.
  • We use POSIX permissions. When files are created they are owned by the user who created them with permission 750. You can use chmod to change the permissions or chown to change the owner(if you are root). If you are not root you must own the file and can only change the group for the file but must leave the owner the same or nothing will happen.
  • The kernel has a few systemcalls, I.e. setuid that require special file permissions. If you have a program that needs to change the current user it must be owned by root and have special permission 6 just like in a POSIX environment. I.e. a file owned by root with permission 755 would mean anyone can read and execute it but only root can edit it. A file with permission 6755 would additionally mean that the program can call setuid to change the current user to any user it wants. Please note if you're running the program as root it can setuid regardless of it's on disk permissions. This is not a bug. Doing this is not recommended because once you set the user to a non-root user you can't go back to root because the program is no longer running as root and lacks the on disk permission required to get it back. If you make a setuid capable program I'd advise against calling any apis as regardless of their own permissions they can setuid because the program calling them can. I'd also recommend using protected execution as covered in the next bullet point for setuid programs as running arbitrary code that can setuid just because you can is less than ideal.
  • Package management is done with the pacman utility. You can use pacman install to install packages and pacman purge to uninstall packages. By default only one repo is available but more can be added by editing /etc/pacman/sources.list. Each repo needs to be on its own line. The format is as follows:
    <bitbucket username> <bitbucket repo name> <hg branch>
  • Packaging software: to setup a repository that can be accessed by the operating systems package manager you must make a mercurial repository on bitbucket. Inside the repository you put folders representing packages. Each folder in the root of your repository corresponds to a package and the names of those folders will be used as the package names. Everything inside of a package's folder corresponds to a filesystem location. For example if my package was called testpkg and put a program called test in /bin the structure from the root of the repository would look like so: testpkg/bin/test. You can put a lua script called postinst in the package I.e testpkg/postinst and it will get run after your package has finished installing. This can be used to make system calls to chmod or chown the installed files or do other things. Please note this script gets run as root so use with caution. All a user has to do to install your package is add your repo to their sources.list as shown above and then pacman install <package name> in this example
    pacman install testpkg
Submitting Issues

Please file bug reports at https://bitbucket.or...scaptos2/issues. You can submit issues anonymously without logging in or creating an account.
Edited on 12 August 2018 - 11:03 PM
DubbelSoftware #2
Posted 21 March 2017 - 07:09 PM
Nice, its good, but can you not make a help command for users that dont know the commands??
I never have used Unix, so possible that can you do in a new update?

-DubbelSoftware
SquidDev #3
Posted 21 March 2017 - 07:36 PM
Whilst this OS doesn't seem quite my cup of tea, I'm very impressed by the work that has gone into it, and the feature set.

One thing I noticed is that you're storing file permissions in the file name itself. This seems a little ugly a solution. One thing I'd suggests is using something like Lyqyd's metadata format: this is a nicer solution to the file permissions system, as well as having some form of compatibility with other systems (well, the ones which use it).
Scoopta #4
Posted 21 March 2017 - 09:05 PM
Nice, its good, but can you not make a help command for users that dont know the commands??
I never have used Unix, so possible that can you do in a new update?

-DubbelSoftware
I can definitely add a help command.

Whilst this OS doesn't seem quite my cup of tea, I'm very impressed by the work that has gone into it, and the feature set.

One thing I noticed is that you're storing file permissions in the file name itself. This seems a little ugly a solution. One thing I'd suggests is using something like Lyqyd's metadata format: this is a nicer solution to the file permissions system, as well as having some form of compatibility with other systems (well, the ones which use it).
I thought about using some form of metadata originally but I couldn't think of a really elegant way of doing it. Primarily because moving files would involve going through and updating a metadata file and I never particularly liked the idea of a files location representing its permissions but maybe I'll switch to that because you're right. Using the file name is terrible. If I do that it probably won't be one of the top priorities.
Edited on 21 March 2017 - 10:57 PM
Dave-ee Jones #5
Posted 21 March 2017 - 11:13 PM
Sounds pretty interesting. Is the CLI much different from CraftOS?

Maybe renaming it to Vorbani Kernel might be more appropriate :P/>
Scoopta #6
Posted 21 March 2017 - 11:24 PM
Nice, its good, but can you not make a help command for users that dont know the commands?? I never have used Unix, so possible that can you do in a new update? -DubbelSoftware
There is now a help command in the latest development build. It should get merged into stable soon. There are a few other things I'll probably end up doing before I merge it though.

Sounds pretty interesting. Is the CLI much different from CraftOS?

Maybe renaming it to Vorbani Kernel might be more appropriate :P/>
XD yeah maybe. The shell is terrible. If someone wants to give me a new one I'd be glad to get my hands on a decent one. Maybe I could port the CC shell. So to answer your question yes the shell is quite different. This is an entire OS but the kernel is the only halfway noteworthy thing about it. The userland tools such as shell aren't the best primarily because I haven't put a lot of time into them. That's not to say the kernel is not buggy or good because it's not very mature but it's the thing I'm working on most.
Edited on 21 March 2017 - 10:26 PM
Dave-ee Jones #7
Posted 23 March 2017 - 12:52 AM
Nice, its good, but can you not make a help command for users that dont know the commands?? I never have used Unix, so possible that can you do in a new update? -DubbelSoftware
There is now a help command in the latest development build. It should get merged into stable soon. There are a few other things I'll probably end up doing before I merge it though.

Sounds pretty interesting. Is the CLI much different from CraftOS?

Maybe renaming it to Vorbani Kernel might be more appropriate :P/>
XD yeah maybe. The shell is terrible. If someone wants to give me a new one I'd be glad to get my hands on a decent one. Maybe I could port the CC shell. So to answer your question yes the shell is quite different. This is an entire OS but the kernel is the only halfway noteworthy thing about it. The userland tools such as shell aren't the best primarily because I haven't put a lot of time into them. That's not to say the kernel is not buggy or good because it's not very mature but it's the thing I'm working on most.

Porting the CC Shell isn't too hard…IF you weren't changing the File System and using your Kernel's language instead of CC's…:P/>
Yeah, a decent kernel is quite rare around these forums :P/>
Scoopta #8
Posted 23 March 2017 - 06:02 AM
Nice, its good, but can you not make a help command for users that dont know the commands?? I never have used Unix, so possible that can you do in a new update? -DubbelSoftware
There is now a help command in the latest development build. It should get merged into stable soon. There are a few other things I'll probably end up doing before I merge it though.
Sounds pretty interesting. Is the CLI much different from CraftOS? Maybe renaming it to Vorbani Kernel might be more appropriate :P/>/>
XD yeah maybe. The shell is terrible. If someone wants to give me a new one I'd be glad to get my hands on a decent one. Maybe I could port the CC shell. So to answer your question yes the shell is quite different. This is an entire OS but the kernel is the only halfway noteworthy thing about it. The userland tools such as shell aren't the best primarily because I haven't put a lot of time into them. That's not to say the kernel is not buggy or good because it's not very mature but it's the thing I'm working on most.
Porting the CC Shell isn't too hard…IF you weren't changing the File System and using your Kernel's language instead of CC's… :P/>/> Yeah, a decent kernel is quite rare around these forums :P/>/>
The language is still very much lua and CC lua at that because changing that out requires far too much effort but the file system is not CC at all. As far as a decent kernel…hopefully with time that's what this will be haha.
Edited on 23 March 2017 - 05:03 AM
Scoopta #9
Posted 09 April 2017 - 05:47 AM
Whilst this OS doesn't seem quite my cup of tea, I'm very impressed by the work that has gone into it, and the feature set.

One thing I noticed is that you're storing file permissions in the file name itself. This seems a little ugly a solution. One thing I'd suggests is using something like Lyqyd's metadata format: this is a nicer solution to the file permissions system, as well as having some form of compatibility with other systems (well, the ones which use it).
The current dev tree now has a metadata system that isn't as kludgy. It's not lyqyd's. I basically just store all the metadata into a table and then serialize it and then unserialize it to get the data back when needed.
CLNinja #10
Posted 09 April 2017 - 08:07 AM
Alright! If you're on the dev tree and have pacman, you can edit /etc/pacman/sources.list and add this to it:

HolyCloudNinja vorbani-addons default

And then run

pacman install vLibs

and you get most of the peripheral API installed, along with autoloading of connected peripherals into device files.
086 #11
Posted 09 April 2017 - 04:30 PM
and uhh..
how do you get rid of it?
completely bricked my computer and a floppy with a startup won't erase it, and i can't access lua to reset the label
Bomb Bloke #12
Posted 10 April 2017 - 01:34 AM
If a computer won't boot from disk, then you should be able to place the whole system into a disk drive and use another computer to wipe it.
CLNinja #13
Posted 11 April 2017 - 03:10 AM
and uhh..
how do you get rid of it?
completely bricked my computer and a floppy with a startup won't erase it, and i can't access lua to reset the label
I'll refer to what bomb bloke said, but if that doesn't work and you're in singleplayer, go into the save files and remove startup. If you're on a server, either ask the owner to do it, or you may be screwed.
Scoopta #14
Posted 11 April 2017 - 03:15 AM
and uhh.. how do you get rid of it? completely bricked my computer and a floppy with a startup won't erase it, and i can't access lua to reset the label
There isn't really a way to remove it. One other thing. Define bricked because if there's a bug I'd like to know about it assuming it hasn't already been fixed in the latest dev tree. Also "I wouldn't recommend installing this on a computer that already has files on it as those will not be accessible from the OS and unless you're on Minecraft 1.7 or earlier disks containing startup are disabled making accessing your old files impossible."
Bomb Bloke #15
Posted 12 April 2017 - 02:50 AM
… disks containing startup are disabled making accessing your old files impossible.

Again: in builds of CC where startup can be disabled, computers can also be used as floppy disks.
Scoopta #16
Posted 12 April 2017 - 03:35 AM
… disks containing startup are disabled making accessing your old files impossible.

Again: in builds of CC where startup can be disabled, computers can also be used as floppy disks.
I didn't know that when I made the original post and my point in quoting myself was to say "I already warned that this might be an issue"
CLNinja #17
Posted 12 April 2017 - 08:15 PM
I've updated libperiph to have full functionality for the peripheral API. Peripheral.find now works, and multiple peripherals can now be attached.
rahph #18
Posted 28 June 2017 - 10:04 PM
I made a program for this OS that makes all the colours look nice and bright. It requires a github version of computercraft for palettes. To install it on VorbaniOS, run

pacman add rahph\ assortedtools\ default\
And then

pacman install libvibrant

Color comparisons as well as a CraftOS version coming soon ;-)
CLNinja #19
Posted 15 July 2017 - 03:43 PM
libperiph is now defunct. If you are using the OS and need backwards compatible peripheral support, pacman install libmod after pacman add HolyCloudNinja\ vorbani-addons\ default
CLNinja #20
Posted 06 November 2017 - 06:34 PM
Newest patch includes disabling of the debug API