|
| 1 | +ChaOS |
| 2 | +===== |
| 3 | + |
| 4 | +[](https://github.com/Filiprogrammer/ChaOS/actions/workflows/main.yml) |
| 5 | + |
| 6 | +What is ChaOS? |
| 7 | +-------------- |
| 8 | + |
| 9 | +ChaOS is a hobbyist x86 operating system written from scratch in C. |
| 10 | + |
| 11 | +Features |
| 12 | +-------- |
| 13 | + |
| 14 | +- Legacy BIOS bootloader |
| 15 | +- EFI bootloader |
| 16 | +- Pre-emptive single CPU MLFQ multitasking |
| 17 | +- PS/2 keyboard & mouse support |
| 18 | +- VGA text & graphics |
| 19 | +- ATA hard drive support |
| 20 | +- Floppy support |
| 21 | +- FAT file system support |
| 22 | +- ELF user programs |
| 23 | + |
| 24 | +Building |
| 25 | +-------- |
| 26 | + |
| 27 | +*Note: It is recommended to have at least 1 GB of free storage* |
| 28 | + |
| 29 | +### Clone the ChaOS repository |
| 30 | + |
| 31 | +*Note: Do not clone the repository into a path containing whitespaces* |
| 32 | + |
| 33 | +```console |
| 34 | +git clone https://github.com/Filiprogrammer/ChaOS.git |
| 35 | + |
| 36 | +cd ChaOS |
| 37 | +``` |
| 38 | + |
| 39 | +### Download tools |
| 40 | + |
| 41 | +#### Debian |
| 42 | + |
| 43 | +Install wget and unzip if not already installed |
| 44 | + |
| 45 | +```console |
| 46 | +sudo apt install wget unzip |
| 47 | +``` |
| 48 | + |
| 49 | +Download ChaOS tools |
| 50 | + |
| 51 | +```console |
| 52 | +./download_tools.sh |
| 53 | +``` |
| 54 | + |
| 55 | +#### Arch Linux |
| 56 | + |
| 57 | +Install wget and unzip if not already installed |
| 58 | + |
| 59 | +```console |
| 60 | +sudo pacman -Sy wget unzip |
| 61 | +``` |
| 62 | + |
| 63 | +Download ChaOS tools |
| 64 | + |
| 65 | +```console |
| 66 | +./download_tools.sh |
| 67 | +``` |
| 68 | + |
| 69 | +#### Fedora |
| 70 | + |
| 71 | +Install wget and unzip if not already installed |
| 72 | + |
| 73 | +```console |
| 74 | +sudo yum install wget unzip |
| 75 | +``` |
| 76 | + |
| 77 | +Download ChaOS tools |
| 78 | + |
| 79 | +```console |
| 80 | +./download_tools.sh |
| 81 | +``` |
| 82 | + |
| 83 | +#### Windows |
| 84 | + |
| 85 | +Download ChaOS tools |
| 86 | + |
| 87 | +```console |
| 88 | +DOWNLOAD_TOOLS.BAT |
| 89 | +``` |
| 90 | + |
| 91 | +### Build image |
| 92 | + |
| 93 | +#### Linux |
| 94 | + |
| 95 | +```console |
| 96 | +./build_image.sh hd |
| 97 | +``` |
| 98 | + |
| 99 | +#### Windows |
| 100 | + |
| 101 | +```console |
| 102 | +BUILD_IMAGE.BAT hd |
| 103 | +``` |
| 104 | + |
| 105 | +#### VSCode |
| 106 | + |
| 107 | +Press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>B</kbd> |
| 108 | + |
| 109 | +A select dialog will appear where the configuration to be built can be selected. |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | +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. |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | +Running |
| 124 | +------- |
| 125 | + |
| 126 | +### QEMU |
| 127 | + |
| 128 | +To run ChaOS in QEMU, just use the following script. |
| 129 | + |
| 130 | +#### Windows |
| 131 | + |
| 132 | +```console |
| 133 | +QEMU_BOOT.BAT hd |
| 134 | +``` |
| 135 | + |
| 136 | +#### Linux |
| 137 | + |
| 138 | +```console |
| 139 | +./qemu_boot.sh hd |
| 140 | +``` |
| 141 | + |
| 142 | +### VirtualBox |
| 143 | + |
| 144 | +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. |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | +Debugging |
| 149 | +--------- |
| 150 | + |
| 151 | +### Debugging in VSCode |
| 152 | + |
| 153 | +To start debugging in VSCode, press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>D</kbd> or click on the Run tab on the left. Then select a debug configuration and click the green arrow to start debugging. |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | +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. |
| 158 | +To use that, simply type `-exec source ../../gdb_tasks_gui.py` into the Debug Console. |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | +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. |
| 163 | + |
| 164 | + |
0 commit comments