Coder Social home page Coder Social logo

filiprogrammer / chaos Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 3.06 MB

A hobby x86 operating system written from scratch in C

Batchfile 0.47% C 94.04% C++ 0.01% Assembly 1.24% GDB 0.01% Python 3.55% Shell 0.57% Makefile 0.13%
kernel operating-system c bootloader

chaos's Introduction

ChaOS

CI

What is ChaOS?

ChaOS is a hobbyist x86 operating system written from scratch in C.

Features

  • Legacy BIOS bootloader
  • EFI bootloader
  • Pre-emptive single CPU MLFQ multitasking
  • PS/2 keyboard & mouse support
  • VGA text & graphics
  • ATA hard drive support
  • Floppy support
  • FAT file system support
  • ELF user programs

Building

Note: It is recommended to have at least 1 GB of free storage

Clone the ChaOS repository

Note: Do not clone the repository into a path containing whitespaces

git clone https://github.com/Filiprogrammer/ChaOS.git

cd ChaOS

Setup tools

Debian

Install tools required to build, run and debug ChaOS.

sudo apt install nasm make qemu-system-x86 qemu-utils dialog gdb python3-tk

Get additional tools by either downloading the binaries:

wget https://github.com/Filiprogrammer/ChaOS/releases/download/v0.2.230727/chaostools-linux.tar.gz
tar -xf chaostools-linux.tar.gz -C tools

Or building them yourself:

sudo apt install wget build-essential file
tools/src/build-i686-elf-tools.sh
tools/src/GenFw/build.sh
tools/src/imgtools/build.sh
tools/src/mkdosfs/build.sh

Windows

To get the tools required to build, run and debug ChaOS on Windows, download the binaries here.

Or gather and build the tools yourself:

Cross-build the additional tools on linux:

sudo apt install wget build-essential file git automake autopoint bison flex libgdk-pixbuf2.0-dev gperf intltool libtool libltdl-dev python3-mako ruby unzip p7zip-full lzip libtool-bin python-is-python3

tools/src/build-i686-elf-tools-win.sh

sudo apt install gcc-mingw-w64-x86-64

tools/src/GenFw/build-win.sh
tools/src/imgtools/build-win.sh
tools/src/mkdosfs/build-win.sh

Build image

Linux

./build_image.sh hd

Windows

BUILD_IMAGE.BAT hd

VSCode

Press Ctrl + Shift + B

A select dialog will appear where the configuration to be built can be selected.

Build image in VSCode 1

Build image in VSCode 2

Build image in VSCode 3

Build image in VSCode 4

Once a configuration has been selected, the build process will start and progress can be tracked in the bottom terminal window. The build script might also ask which user programs to build.

Build image in VSCode 5

Running

QEMU

To run ChaOS in QEMU, just use the following script.

Windows

QEMU_BOOT.BAT hd

Linux

./qemu_boot.sh hd

VirtualBox

To run ChaOS in VirtualBox, create a new virtual machine with at least 32 MB of memory and use the generated HDImage.vdi file as a virtual hard disk.

Create virtual machine in VirtualBox

Debugging

Debugging in VSCode

To start debugging in VSCode, press Ctrl + Shift + D or click on the Run tab on the left. Then select a debug configuration and click the green arrow to start debugging.

Debug in VSCode

During debugging, while the OS is paused, GUI tools can be launched to see, for example, which tasks are running and in which queue they are. To use that, simply type -exec source ../../gdb_tasks_gui.py into the Debug Console.

Debug in VSCode with GDB tasks GUI

Another graphical debugging tool would be a tool that can be used to inspect the heap of the kernel. This can be launched by typing -exec source ../../gdb_heap_gui.py into the Debug Console.

Debug in VSCode with GDB heap GUI

chaos's People

Contributors

filiprogrammer avatar

Stargazers

Johannes avatar

Watchers

Johannes avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.