diff --git a/.editorconfig b/.editorconfig index 41a1382f..2e1ed055 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,3 +19,8 @@ indent_size = 2 [{CMakeLists.txt,*.cmake}] indent_size = 2 indent_style = space + +[*.md] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = false diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 00000000..b72d9e6a --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,72 @@ +# ๐ Installation Guide + +This guide will help you install Fennix on your system. + +## ๐ ๏ธ Preparing the Environment + +There are two ways to build the project: + +1. **๐ณ Use Dev Container (Recommended)** + * This is the easiest way to prepare the environment for building the project. But firstly, you need to install [Docker](https://docs.docker.com/get-docker/) and [Visual Studio Code](https://code.visualstudio.com/). + * After installing Docker and Visual Studio Code, you can open the project in Visual Studio Code and click on the "Reopen in Container" button. + * This will open the project in a Dev Container with all the required tools installed. + * If you encounter errors while the Dev Container is building, ensure the following are correctly configured: + * `/tmp/.X11-unix` + * Environment variable `XAUTHORITY` + * `/run/user/1000/pulse/native` + * **Note:** These configurations are only necessary if you plan to use QEMU inside the container. +2. **๐ป Build the Project Locally** + * The instructions below will guide you through the process of building the project locally. + +**NOTE:** You MUST have `autoconf 2.69` and `automake 1.15.1` versions installed on your system. A complete list of dependencies can be found in the [.devcontainer/Dockerfile](.devcontainer/Dockerfile) file. + +Before building the project, you need to build the cross-compiler toolchain and QEMU. +You can do this by running the following command: + +```sh +make setup +``` + +This will clone, patch, and build the required tools for you. + +Alternatively, if you wish to skip building QEMU, you can run `make setup-no-qemu`. +However, in this case, you will need to manually specify the path to the QEMU binary in the `config.mk` file. + +## ๐๏ธ Building the Project + +To build the project, run: + +```sh +make build +``` + +This will build the kernel, userspace, and drivers. The resulting ISO image will be `Fennix.iso`. + +## ๐ Running the OS + +To run the OS, execute: + +```sh +make run +``` + +The `run` target will automatically build the project if it hasn't been built yet. + +## โ๏ธ Additional Configuration + +You can customize the project by editing the `config.mk` file. + +## ๐งช Debugging + +If you use Visual Studio Code, you can press `F5` to start debugging the OS. +The configuration is already set up for you. + +Alternatively, you can run the following command to start debugging: + +```sh +make debug +``` + +This will start QEMU in debug mode, allowing you to connect to it using GDB. + +The GDB FIFO file is located at `/tmp/gdb-fennix`. diff --git a/Makefile b/Makefile index 15dbd7e4..057f97a6 100644 --- a/Makefile +++ b/Makefile @@ -111,6 +111,9 @@ setup: $(MAKE) prepare $(MAKE) tools +setup-no-qemu: + $(MAKE) --quiet -C tools ci + build: build_kernel build_bootloader build_userspace build_drivers build_image dump: @@ -313,6 +316,8 @@ endif vscode_debug: build_kernel build_userspace build_drivers build_image vscode_debug_only +debug: vscode_debug + qemu: qemu_vdisk clean_logs touch serial.log # x-terminal-emulator -e tail -f serial.log & diff --git a/README.md b/README.md index 46ee42da..3105b4a5 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@
-
+
-
+