BuildSystem: Rework calling qemu

I change always manually the serial/graphical. When running cmake
you can define variable QEMU_ACCEL that will be used as accelerator.

Also ninja has the following targets for running qemu
  1. qemu:            Run graphical qemu environment
  2. qemu-nographic:  Run qemu without graphical screen. You should
                      select 'serial only' from grub menu.
  3. qemu-debug:      Run qemu without accelerator and interrupt
                      debugger.
This commit is contained in:
Bananymous
2023-09-27 13:49:01 +03:00
parent 1c26a402b0
commit 8621d8a155
4 changed files with 17 additions and 5 deletions

View File

@@ -14,18 +14,20 @@ Each major component and library has its own subdirectory (kernel, userspace, li
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.
You can and *should* pass cmake variable QEMU_ACCEL set to proper accelerator to cmake commands. For example on Linux this means adding -DQEMU_ACCEL=kvm to the end of all cmake commands.
Create the build directory and cofigure cmake
```sh
mkdir build
cd build
cmake -G Ninja ..
cmake ..
```
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 -G Ninja --fresh .. # We need to reconfigure cmake to use the new compiler
cmake --fresh .. # We need to reconfigure cmake to use the new compiler
ninja libstdc++
```