Skip to content

Latest commit

 

History

History
401 lines (255 loc) · 22.7 KB

Hexagonix.en.md

File metadata and controls

401 lines (255 loc) · 22.7 KB

com 68 funções

Components Libraries Screenshots Contribute More information Source code Download

The Hexagonix Operating System

Hexagonix is a new Unix-like operating system developed from scratch, written in Assembly language for the PC architecture (x86). It is built on Hexagon, a simple and lightweight monolithic kernel designed to be fast and compatible with newer and older hardware (Pentium III and newer with 32 MB of RAM or more).

Hexagonix consists of the Hexagon boot loader (Hexagon Boot or HBoot), the Hexagon (kernel), compatible shells, utilities and libraries. All these components were released under the BSD-3-Clause license.

Some features of Hexagonix:

  • 32-bit operating system;
  • Completely written in x86 Assembly, being fast and light;
  • Inspired by the design of Version 7 UNIX1, but completely written from scratch;
  • Compatible with Intel Pentium III (1999) or newer processors;
  • Compatible with devices with 32 MB of RAM or more;
  • Full kernel with less than 30 kbytes;
  • User environment support;
  • System call with functions accessed by the user environment;
  • Low minimum requirements, compatible with a wide range of devices;
  • Own executable binary format (HAPP);
  • Self-hosting (the assembler used to build Hexagonix can run on top of it);
  • Device abstraction;
  • VESA VBE graphics support in various resolutions;
  • Text mode support;
  • Support for serial and parallel ports (serial communication, debug and printing);
  • Virtual File System (VFS);
  • Support for reading and writing on FAT16 (FAT16B) file systems;
  • Graphic font rendering engine, which can be changed by the user;
  • Real-time clock support;
  • Supports own boot loader (Hexagon Boot - HBoot);
  • Support for users and permissions.
  • Easily extensible;
  • Well documented in Portuguese and English;
  • Fully licensed under BSD-3-Clause2, available here.

Hexagonix is ​​not intended to build a production system, but rather a simple, well-documented system with easy-to-understand interfaces that can be used for educational purposes. Hexagonix aims to research and implement a modern operating system developed purely in x86 Assembly using a current assembler. For more complex, complete and professional systems developed in x86 Assembly, visit projects like MenuetOS or KolibriOS.


Languages available

At this time, the system is available in English and the documentation is available in both Portuguese (Brazil) and English.

The comments and code in the files that make up the system's source code are only available in English (from the System I version onwards. In previous versions, the system and source code were only available in Brazilian Portuguese).

To allow collaboration and attract developers who don't speak Portuguese, the entire system was translated into English and its development will be entirely carried out in this language.

Feel free and encouraged to report translation errors, either by creating an issue in the repository that contains the file, sending an email or creating a Pull Request with the correction.


System components

Hexagonix is divided into a series of components, which work together as soon as the device is turned on. Below you will be able to know briefly each one of them.

Saturno

The first component of Hexagonix is the Saturno. It is responsible for taking control of the boot process performed by the BIOS/UEFI and looking in the volume for the second boot stage. For that, it implements a driver for reading a FAT16 file system. The second boot stage (see below) can implement drivers for other filesystems and is responsible for finding Hexagon, loading HBoot modules or loading a compatible DOS-like system (BETA version).

Saturno


Hexagon Boot (HBoot)

Hexagon Boot (HBoot) is a component designed to allow the Hexagon kernel to boot. Until then, initialization was performed by just one stage, which defined a very basic environment, loaded Hexagon into memory and immediately executed it, providing a very limited set of parameters. This is due to the fact that the code of this stage is restricted to 512 bytes, which limits the performance of several tests and data processing. With HBoot, it was possible to expand the number of tasks performed before running Hexagon, as well as the possibility to provide more information about the device and boot environment. This is particularly important to allow the creation of a device tree that Hexagon can use to decide how to handle each identified device. HBoot is able to check which disk drives are available on the machine, emit a boot tone, obtain the amount of available RAM memory installed and allow or not to proceed with the boot process according to this information. If no user interaction is detected (within 3 seconds after booting HBoot and displaying messages to the user), HBoot will perform additional tests to verify the device's ability to run the system and will load and run Hexagon (present in a file on the volume named HEXAGON.SIS on Hexagonix H1 and HEXAGON on Hexagonix H2 and later versions). After loading, HBoot transfers control to Hexagon, which is initialized and stores the data provided by HBoot in the kernel environment.

HBoot

How to interact with HBoot

The interaction with HBoot is done by pressing the F8 key after booting and displaying messages on the screen. HBoot waits for 3 seconds for any interaction and, if none has occurred, continues executing the boot protocol. The interaction with HBoot can be interesting to load modules in the HBoot format, provide boot parameters to Hexagon, load a DOS-type system whose files are present on the same volume or even load HAPP images from other cores (if the developer wants to use the HBoot implementation in your project). Below, see some more details of additional and diagnostic functions that can be performed via interaction with HBoot before loading Hexagonix.

Report bugs

HBoot has gained a lot of complexity since the beginning of its development in 2020. Due to this increase in code and the nature of its operation (16-bit), bugs can be found. They can be reported in the repository or by email, available at the end of this file.


Hexagon kernel

Hexagon is a monolithic kernel running in 32-bit protected mode, designed with the PC architecture in mind (x86). It's a kernel written from scratch, aiming for the speed and compatibility of modern hardware but also being able to run on older hardware (like a Pentium III). At the moment, it guarantees a single-user environment, despite the use of virtual terminals, and single-tasking, despite the ability to load, keep in memory and control more than one process, in an execution stack. In the future, the kernel may support running multiple processes in preemptive multitasking. Hexagon is a Unix-like kernel and tries to implement POSIX compatibility, although far from it, and forms the basis of the Hexagonix Operating System, although independent of it. It runs executable images in the HAPP format, developed exclusively for Hexagon. Hexagon also implements a very sophisticated API accessible through a system call.

Hexagon Kernel


Hexagonix Unix Environment Utilities

Hexagonix implements, together with Hexagon, a series of Unix-like utilities, with functionality and syntax similar to UNIX and Unix-like systems. Utilities such as init, login, sh, top, ps, cp, rm, cat, clear, man, among others, are included in the standard distribution of Hexagonix. These utilities make up the Hexagonix base utilities package. The login and user-mode environment startup tools are in this package, as well as several configuration files for this environment. These utilities generally do not have a graphical interface, only a command-line interface (CLI). However, they can be requested by applications that have a graphical interface.

Unix-Apps

Some applications and utilities in the Hexagonix environment

Hexagonix includes many of the Unix utilities you may already be familiar with, such as:

  • cat
  • clear
  • cp
  • init
  • login
  • ls
  • man
  • mv
  • ps
  • rm
  • sh (default shell)
  • shutdown
  • su
  • top
  • uname
  • whoami, among others.

Some applications and utilities were developed exclusively for Hexagonix, such as:

  • fnt (Hexagonix graphic font change utility)
  • hash (alternate shell)
  • lshapp (gets and displays information from HAPP images)
  • lshmod (gets and displays information from HBoot modules and HBoot itself)

It is worth remembering that Hexagonix utilities try to implement a POSIX interface as far as possible, similar in syntax to Unix utilities (FreeBSD and Linux used as a model).

Third party applications available for Hexagonix

Hexagonix received a port of the fasm assembler, which was adapted for Hexagonix, allowing the user to develop applications directly on the system. This port is called fasmX. Changes added to the code, as well as the software license, can be found in the fasm repository for Hexagonix. This repository is a fork of original repository. Added code is based on modifications made to the original code and authorial additions. This modified/authored code can be found in the repository, clicking here. fasmX, the fasm port for Hexagonix, is always updated when new features are added to the fasm repository. To indicate that it is a stable and tested version, the fasmX version number always inherits the fasm numbering, followed by a character x (for example, the version based on fasm 1.73.30, after testing, receives the numbering 1.73.30x). You can report bugs or code generation or optimization issues in the Hexagonix version here. To report general fasm bugs, use the official repository.


Hexagonix GUI Utilities

The Andromeda environment (Hexagonix-Andromeda) is built on the solid foundation provided by Hexagonix, including applications and utilities that do not implement the Unix philosophy or have a very different syntax and usage than you would expect from a Unix environment. Here are the system settings app, calculator, font manager, text editors and the IDE developed for Hexagonix. These utilities may or may not have a graphical interface. Together with them, the Hexagonix-Andromeda environment comprises libraries developed to allow the development of applications, such as the Estelar library.

Andromeda-Apps

Some Hexagonix-Andromeda applications and utilities

  • System Settings (config)
  • Quartzo text editor
  • Lyoko IDE for application development
  • Electronic piano return Piano;
  • Serial communication utility
  • Andromeda Shell (ASH) - A new shell for Hexagonix
  • Hexagonix calculator
  • Font change utility
  • Hexagonix shutdown utility

Third party applications available for Hexagonix-Andromeda

There are no third-party applications available for the Hexagonix-Andromeda environment yet. If interested, you can build the first one!


Hexagonix graphic fonts

The default installation of Hexagonix also provides a number of fonts that can be loaded by the settings application or the font utility (font manager). These files are used to change the Hexagonix graphical display font.

Graphics mode fonts for Hexagon are developed as a bitmap in Assembly which, when compiled, generate a binary image of the font with representations of each character. The standard Hexagonix fonts have now been released as open source and are available in the Hexagonix font repository.

Hexagonix-xfnt


System development libraries

Hexagonix also provides functions that must be used to interact with the system environment itself. Libraries are used to access functions implemented by Hexagon or by the libraries themselves, allowing easy development of applications and utilities for both the Hexagonix and Hexagonix-Andromeda environments. The libraries implement functions for displaying text, mathematical calculations, sending messages, opening files and devices, and much more. The core library (hexagon.s) provides functions accessible to both possible distribution environments, while other libraries may be unique to the Hexagonix-Andromeda environment. These libraries include graphical functions to build interfaces in graphical mode (Hexagonix-Andromeda), as well as functions to check the currently running system version. The base Hexagonix utilities perform the Hexagon version check to see if they can be run, using the Unix utility uname or directly via a Hexagon system call.

To learn more and check each function available in the system development libraries, see the libasm repository.

lib

🌙 Screenshots

Contribute and report bugs

Below you can learn more about how to contribute and report bugs found in Hexagonix.

Contribute to the development of Hexagonix

If you have knowledge of creating x86 assembly code and would like to help with system development, feel free to send an email!

Report Errors

You can report bugs and help develop the system. To do so, open an error notification here, informing the error as detailed as possible (such as device brand, processor, amount of RAM, video and connected peripherals, as well as the device used to install the system, such as an internal disk drive or USB removable media). Remember to inform which application the error occurred in, if the error occurs while the system is already in operation. If the problem occurs in the boot process, please report what was displayed/observed behavior of the machine.

Other information


🖼 Inspirations

Several other projects were important to enable the development of Hexagonix. These projects contributed with ideas and design concepts and with well-documented code that allows the understanding of different structures of an operating system, inspiring several functions and features currently available in Hexagonix.

  • MenuetOS, an open source operating system written in x86 Assembly (32 and 64-bit);
  • KolibriOS, an open source operating system written in x86 Assembly (32-bit);
  • MikeOS, an open source operating system written in x86 Assembly (16-bit);
  • Snowdrop OS, public domain operating system written in x86 Assembly (16-bit);
  • Alotware, public domain operating system written in x86 Assembly (32-bit);
  • MS-DOS, historic operating system, now partially in open source, written in Assembly x86 (16-bit);
  • Public Domain Operating System (PDOS), public domain operating system written in C (16 and 32-bit);
  • Version 7 UNIX, historical operating system written in C;
  • FreeBSD, operating system written in C;
  • Linux 0.1.1, kernel written in C;
  • XNU/Darwin, kernel written in C;
  • LittleKernel, operating system written in C and C++;
  • Google Fuchsia, operating system written in C, C++ and other languages;

To all these projects and developers, a huge thank you ❤️.


👥️️ Contributors and contacts

See the AUTHORS and CREDITS files available in each repository for more information about authorship, contributions and contact.


📝 Copyright notice

Read the license for more information about copyright, code ownership, and redistribution that apply only to files available in this repository (does not apply to the set of data and source code files that make up Hexagonix). Always keep an eye on the LICENSE file available in each repository to be aware of legal rights and obligations.

Footnotes

  1. The architecture of Hexagonix (structure and utilities) was inspired by the elegance and simplicity of Version 7 UNIX, although it does not aim for any compatibility or share any code with it. Hexagonix does not use any code derived from Version 7 UNIX or other projects. Hexagonix utilities were written to resemble the function and appearance of their counterparts in Version 7 UNIX.

  2. You can get more information about the license in this article of the FreeBSD project, in the article from the Open Source Initiative or the BSD license page on Wikipedia.