Do you think it's possible to create a full-fledged operating system in the jаvascript programming language, from which you can boot?
The answer is correct!
Today I want to tell you about the project JsOS .
runtime.js , but after the closure of the latter, became an independent project.
the project is under construction
, so any contribution is welcome.
Let's consider the basic structure of the project.
JsOS consists of two parts (levels):
The low level (the kernel) consists of parts written in C ++ and Assembler. Used for basic loading and transfer of control to a high level. Also, the kernel provides an API for working with hardware.
The high level is completely written in jаvascript and implements the operation of the operating system.
Let's consider in detail the high-level structure:
core- here is the core of the operating system (not to be confused with the low-level kernel) , which provides basic functionality;
driver- Driver and API for working with various devices;
apps- additional custom applications that are installed by the install command;
The main features of the operating system
- A full command interpreter.
- jаvascript Repl (commands starting with #).
- Supports PS /2 mice and keyboards.
- Support for playing sounds on PCSpeaker.
- Support for Virtio (QEMU) and Realtek (rtl8139) network cards.
- Support for ATA hard drives.
- Support for the file system (FAT32).
- Support for VGA and BGA.
- Compatible with Node.js API (modules os, fs, etc.).
- Support for ASCII (UTF-8 in graphical mode).
- Support for graphical and pseudo-graphic ASCII interface.
- Support for PCI devices.
And now let's proceed to practice
On this account, there are 2 options:
- Download .iso image from the Releases section.
- Collect and run the latest version.
It is strongly recommended to use option number ? as it provides more opportunities and not much more difficult than the first.
This requires the installed Node.js and QEMU.
# 1. Clone the repository:
git clone https://github.com/PROPHESSOR/JsOS
# 2. Go to the folder:
# 3. Install the dependencies:
# 4. Install JsOS-CLI:
sudo npm i -g jsos-cli
# 5. Running:
If you acted according to the instructions, the QEMU emulator window will appear, in which JsOS will boot.
If there are problems - create issue and you will be helped.
The main features of the operating system can be seen by entering the command
At the time of writing, the team
help had the following form:
And additional functionality can be connected using the command
install package_name .
Available packages can be viewed from the js /apps folder.
For example, the screenfetch package is the port of the Linux utility of the same name, which displays information about the operating system.
You can install it using the command
install screenfetch , and run -
start screenfetch .
Read more about creating your own packages here .
Now the package also includes packages that demonstrate the capabilities of the operating system:
- The brainfuck is the port of the same programming language. For a quick Hello World, write
start brainfuck hw;
- vim - port of the popular console text editor;
- speakplay - a musical synthesizer on PCSpeaker;
- composer - program for playing melodies on PCSpeaker;
- keylogger - the program showing the information on the pressed key;
- pgtest - demonstration of the capabilities of the pseudo-graphic ASCII interface;
- example and other examples;
All of them work through the commands
Also, at the time of writing the article, work is underway to create a graphical interface (graphics-mode and pseudo-graphics), support for various network cards, as well as support for USB (a usb branch).
If you are familiar with C ++ or jаvascript
and you want to contribute to the development of the operating system - write here .
GitHub project repository JsOS
GitHub repository utility JsOS-CLI
GitHub project repository runtime.js (the project is closed)