Operating system in JavaScript? JsOS

Greetings, Khabarovsk!
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!
Operating system in JavaScript? JsOS
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
  2. A full command interpreter.  
  3. jаvascript Repl (commands starting with #).  
  4. Supports PS /2 mice and keyboards.  
  5. Support for playing sounds on PCSpeaker.  
  6. Support for Virtio (QEMU) and Realtek (rtl8139) network cards.  
  7. Support for ATA hard drives.  
  8. Support for the file system (FAT32).  
  9. Support for VGA and BGA.  
  10. Compatible with Node.js API (modules os, fs, etc.).  
  11. Support for ASCII (UTF-8 in graphical mode).  
  12. Support for graphical and pseudo-graphic ASCII interface.  
  13. Support for PCI devices.  




And now let's proceed to practice


On this account, there are 2 options:

  2. Download .iso image from the Releases section.  
  3. 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:
cd JsOS
# 3. Install the dependencies:
npm i
# 4. Install JsOS-CLI:
sudo npm i -g jsos-cli
# 5. Running:
jsos start




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 help .


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 install and start .
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)

+ 0 -

Add comment