Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The structure of krOS

1. The FS (File System)

krOS is coded in Luau. The FS is, through the lifetime of the OS, a Virtual File System. Each file is stored inside of the hierarchy dictionary. On shutdown, the OS convers that entire dictionary into JSON, which is then compressed down by ZLib, then saved into 512KB buffer chunks. On startup, the 512KB buffer chunks are converted into the ZLib compressed format, decompressed back into JSON, then decoded back into the original dictionary that lives on to be the FS.
Not the most realistic approach, definitely, but it is a very usable one that causes little issues and allows a lot of control.
File system operations retrieve/write data to the dictionary/entries from the dictionary.

2. The PM (Process Manager)

The PM stores each process in a Luau table, with the key being its PID. It contains a lot of information about the process and references to its resources so they can be freed when the process gets shut down. Processes are scheduled using Roblox’s native task.spawn(), which has worked fine so far and multitasking hasn’t been an issue.
The PM acts more as a JIT compiler. Applications are stored as Lua 5.1 source code, which the PM passes to vLua, which will compile to bytecode that will be run by the VM.

3. The VGA

VGA is usually a low resolution way to display text, but in krOS VGA is the first, primitive text output. If you’ve ever done OSDev, the address 0xB8000 may closely represent what this does. Its only job is to display text to the screen, nothing else.

4. The AGO (Advanced Graphics Output)

The AGO’s job is to display more advanced objects to the screen. It does not however offer pixel-level control like a real OS would, just a lot of Roblox GUI. It NEVER returns the GUI itself, only an ID that can be used to manipulate the GUI through controlled functions.

5. The WM (Window Manager)

The WM is NOT made over the AGO. This was done to improve performance of the overall OS while keeping maximum control at the kernel level. Its job is to create windows, return IDs, and offer basic window manipulation functions.

5. The GM (Graphics Manager)

The GM displays objects inside of windows created with the window manager. It also only returns IDs, not real Roblox objects, with functions to manipulate those IDs.

Note

None of the graphics APIs return actual Roblox objects because that would allow escaping from the virtual Luau environment using the .Parent property, which would allow direct access to all Roblox Local services.

6. The environment itself

The environment for each process is, under normal circumstances with no intrusive exploits used, fully blocked. You can not get to the Roblox services. You can only use the functions that are given to you. Some Roblox DataTypes are given, but they are primitives that do not lead anywhere, such as Vector2, etc.

7. Structure of krOS fs

krOS’s root folder isn’t the usual / from Linux. It is the simple phrase root that is the first folder in the entire hierarchy. The entire OS root/ hierarchy looks like this:

root/
├── assets
├── bin
├── lib
├── sys
└── user

assets

Contains core assets, such as images (the rbxassetid://), etc.

bin

Contains valid files that can be run

lib

Contains libraries that are meant to be imported

sys

Contains core system files

user

Contains user files