From 2c136dae2d91a7a23932c0f5f0e929175872242b Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 31 Aug 2023 17:54:12 +0300 Subject: [PATCH] Update README.md --- README.md | 38 ++++++++++++++++++++------------------ assets/banan-os.png | Bin 0 -> 11586 bytes 2 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 assets/banan-os.png diff --git a/README.md b/README.md index cfbc5b20be..e5da495fe2 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,53 @@ -![lines](https://img.shields.io/tokei/lines/github/bananymous/banan-os) ![license](https://img.shields.io/github/license/bananymous/banan-os) # banan-os -This is my hobby operating system written in C++. Currently runs on x86 based architectures (32 and 64 bit). Currently this operating system supports ext2 filesystem, ata drives (pio mode), vesa/vbe graphics mode and multithreaded processing. -![ss](https://user-images.githubusercontent.com/68776844/230458915-a0c3f1b4-e747-401a-bc0c-07a62d18927c.png) +This is my hobby operating system written in C++. Currently supports only x86_64 architecture. We have a read-only ext2 filesystem, read-write ramfs, IDE disk drivers in ATA PIO mode, userspace processes, executable loading from ELF format, linear VBE graphics and multithreaded processing on single core. + +![screenshot from qemu running banan-os](assets/banan-os.png) + +## Code structure + +Each major component and library has its own subdirectory (kernel, userspace, libc, ...). Each directory contains directory *include*, which has **all** of the header files of the component. Every header is included by its absolute path. ## Building -> **_NOTE:_** I will be using ninja in these build instructions but you may use any other buildsystem cmake supports. If you want to use ninja, you can either define a environment variable 'CMAKE_GENERATOR=Ninja' or pass '-G Ninja' to all commands invoking cmake. + +There does not exist a complete list of needed packages for building. From the top of my head I can say that *cmake*, *ninja*, *make*, *grub*, *rsync* and emulator (*qemu* or *bochs*) are needed. Create the build directory and cofigure cmake ```sh mkdir build cd build -cmake .. +cmake -G Ninja .. ``` -  - -> **_NOTE:_** The following step has to be done only once. This might take a long time since we are compiling binutils and gcc. - To build the toolchain for this os. You can run the following command. +> ***NOTE:*** The following step has to be done only once. This might take a long time since we are compiling binutils and gcc. ```sh ninja toolchain -cmake --fresh .. # We need to reconfigure cmake to use the new compiler +cmake -G Ninja --fresh .. # We need to reconfigure cmake to use the new compiler ninja libstdc++ ``` -  - -To build the os itself you can run either of the following commands. You will need root access since we need to mount the disk image to install grub. +To build the os itself you can run either of the following commands. You will need root access since the sysroot has "proper" permissions. ```sh ninja qemu ninja bochs ``` -  - You can also build the kernel or disk image without running it: ```sh ninja kernel ninja image ``` -  - -If you have corrupted your disk image or want to create new one, you can either manually delete _banan-os.img_ and cmake will automatically create you a new one or you can run the following command. +If you have corrupted your disk image or want to create new one, you can either manually delete *banan-os.img* and cmake will automatically create you a new one or you can run the following command. ```sh ninja image-full ``` + +> ***NOTE*** ```ninja clean``` has to be ran with root permissions, since it deletes the root filesystem. + +### Contributing + +Currently I don't accept contributions to this repository unless explicitly told otherwise. This is a learning project for me and I want to do everything myself. Feel free to fork/clone this repo and tinker with it yourself. \ No newline at end of file diff --git a/assets/banan-os.png b/assets/banan-os.png new file mode 100644 index 0000000000000000000000000000000000000000..cd8322689b2aea4bf59e95a8a45e01965db46809 GIT binary patch literal 11586 zcmeHteLR!<|No^DDL360a&yWl-Ki56a#Ko0quhjwkxFQ$+>e=4qFbp%xlP%`Fh%5M zo6<=oCYp(Cq|7!fwi%mkzxO)ldrs$bKA-RJuiqcP$K&(Q^RS! z=2C=5DR*R3Hz<)~B&)G!>9P^3Y_E7E&^GRV2?Y7wyOQijl8n`}!}H@d;spB##m`mr z59lXM4U}G7byWwJkX3%H_LhyX*kzOUlB&hd{(N>%~Px&wzg&5mJt4=hF~+2QfiN5Zun6StIRZN|{xCjGhzHo~J1t zoi4Vyif>@VvT_AY`m%MT@mD&mvGKiFL3|yLEa_;?MiufBMD_J){Ha02J^;!wM`K*3 zFWQ*&?S-g~CYs?>i(rgr_sV@qJu%X+Et#F$s5^3PBp<2x%F0T?+YQ7*{h9t0_QM-C z+S38`Uq@@?)+7-ljy;f~?`%R6xPr^2=#w*i<3^tf#+&t*)0iI2d>K0*zuY&*PzsQ; zif&!(vg4*6dbmJ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