First OS
How to make and boot your first OS.
Let's make your first OS, by the end of this guide you will have the following file structure:
Start by creating all the folders (but src/apps is optional!), and then let's make src/system.json file (which is, actually, optional too):
{
"name": "ExampleOS",
"version": "v0.0.1",
"logo": "/system/logo.png",
"loading": "circle"
}Once you have made the folders, system.json (or decided to skip it) and logo file (optional), you need to create a file for your OS code.
OS code file must be in /system mount, named system or sys, and have any supported language extension. Currently supported languages: JavaScript, PHP, Ruby, but this list will increase in future updates.
Language support
At the moment, all examples were only tested with JavaScript.
Other languages may work, but if not - feel free to contact CatCore support using Discord (send a friend request to topcatto) or using GitHub.
Python support is currently in progress.
Once you have created the file, paste this example code:
CatCore.loadProgress();<?php
$CatCore->loadProgress();
?>CatCore.loadProgress()Next, compile your first OS and open it. After some waiting, you should have a black screen - congratulations with your first OS! 🎉
Troubleshooting
If you have some issues, press Ctrl + Shift + F8 inside your OS, even while it's booting.
There's a great chance a log panel will open up containing enough information to fix problems.
If you still can't get your first OS to work, contact CatCore support using Discord (send a friend request to topcatto) or using GitHub.
For future development, you may use an IDE application that can speed up your OS development. This guide recommends VSCode, as it's the only one tested with CatCore. To use IDE integration, just open os-compiler folder in your IDE and if your IDE supports it, it will automatically pick-up all the needed files. You might need to compile at least one time for IDE integration to work properly.
JavaScript top-level await
If you're using JavaScript, your IDE might not like top-level await, even though it's supported.
We can't fix this issue, so you'll have to just add an async wrapper.
And lastly, you should learn how to control the bootscreen:
// Loop from 1% to 100%
for (var i = 1; i <= 100; i++) {
// Set the loading progress
CatCore.loadProgress(i);
// Wait 0.1 seconds
await CatCore.delay(0.1 *CatCore.SECOND);
}
// Without an argument, it completely ends the boot and hides the boot screen
CatCore.loadProgress();<?php
// Loop from 1% to 100%
for (var i = 1; i <= 100; i++) {
// Set the loading progress
$CatCore->loadProgress(i);
// Wait 0.1 seconds
await $CatCore->delay(0.1 *CatCore.SECOND);
}
// Without an argument, it completely ends the boot and hides the boot screen
$CatCore->loadProgress();
?># Loop from 1% to 100%
(1..100).each do |i|
# Set the loading progress
CatCore.loadProgress(i)
# Wait 0.1 seconds
await CatCore.delay(0.1 *CatCore::SECOND)
end
# Without an argument, it completely ends the boot and hides the boot screen
CatCore.loadProgress()Did not understand?
If you have trouble understanding the code, you probably should learn basic programming in the language you're using and make sure you understand English enough.
This code shows a for loop and uses functions with basic names like load progress and delay.
In JavaScript, top-level await is allowed, even if your IDE shows that as an error.
If you're a Ruby developer, you might not know about await at all, as Ruby does not have that keyword, so you'll have to learn it like in other languages.
Simple explanation of await is just to wait for that function to finish, even if it takes a long time in the background.
Now, that you have basic understanding of CatCore, you can make a text-based terminal OS, a graphical OS, or even both at the same time, and it's your choice, so choose what you want to start with: