Skip to content

Commit

Permalink
Fix the build system (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentijnvdBeek committed May 27, 2021
1 parent 06297b3 commit 9018879
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/os_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: build
run: docker build -t course_os .

- name: test
run: docker run course_os sh -c 'cd kernel/build && ninja test-run'
run: docker run course_os sh -c 'cd build && ninja run-test'
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ EXPOSE 1234

# Since we installed the toolchain from the repositories we don't need
# to install them separately. So we can just fake 'em.
RUN cd kernel && meson build --cross-file ../cross_gcc.build && cd build && meson compile
RUN meson build --cross-file cross_gcc.build && cd build && meson compile
VOLUME build /work/kernel/build
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ qemu-system-arm -kernel kernel.elf -m 1G -serial stdio -monitor none -M raspi2 -

## Toolchain
To build and run the project, you will need a cross compiler. Since the kernel is made to run on ARM, the compiler has to output ARM instructions.
You can find in scripts to install known working versions of qemu and the compilation toolchain. Run those and add the generated bin directories to your PATH.
You can find in scripts to install known working versions of qemu and the compilation toolchain. Run those and add the generated bin directories to your PATH.

## Running

Expand All @@ -53,14 +53,14 @@ ninja run-kernel
To run the test suite for the kernel, execute:

```bash
make run-test
ninja run-test
```

## Debugging

To debug the kernel, you have to perform two steps. First you have to build and start the kernel with
```bash
make run-debug
ninja run-debug
```

This prepares qemu so it waits for a debugger to be attached.
Expand All @@ -69,7 +69,7 @@ now, if you have CLion or VSCode you can run the supplied run configuration call

If however you don't have either of those IDEs, or want to use gdb from a terminal, one can run the following command:
```bash
make run-gdb
ninja run-gdb
```

# Creating tests
Expand All @@ -85,7 +85,7 @@ This file can *not* be used to actually run the kernel but it does give clion th

## Emacs/Vim + CCLS

You can use the `compile_commands.json` from the kernel build directory by creating a softlink from that file to this directory. Doing so will keep it up to date.
You can use the `compile_commands.json` from the kernel build directory by creating a softlink from that file to this directory. Doing so will keep it up to date.

## Emacs + GDB

Expand Down
2 changes: 0 additions & 2 deletions project/kernel/src/common/start.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ void load_process() {
/// This function is called by the assembly located in [startup.s].
/// The MMU has already been initialized here but only the first MiB of the kernel has been mapped.
void start(uint32_t * p_bootargs, struct DTHeader * dtb) {
4 + 2;

// Before this point, all code has to be hardware independent.
// After this point, code can request the hardware info struct to find out what
// Code should be ran.
Expand Down

0 comments on commit 9018879

Please sign in to comment.