From 4fb81d2e5769a5a9e637c8601bde35bb0ba2a805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borna=20=C5=A0o=C5=A1tari=C4=87?= Date: Sun, 18 Jan 2026 10:10:39 +0100 Subject: [PATCH 1/5] add compile_commands.json genereation --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1787090..b1149d0 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,9 @@ KERNEL_OBJ += $(patsubst kernel/%.asm, $(BUILD_DIR)/asm_%.o, $(KERNEL_ASM_SRC)) KLIBC_SRC = $(wildcard klibc/src/*.c) KLIBC_OBJ = $(patsubst klibc/src/%.c, $(BUILD_DIR)/klibc/%.o, $(KLIBC_SRC)) +.PHONY: all stage1 stage2 kernel compile-commands $(BUILD_DIR)/compile_commands.json run gdb clean clean-cross clean-all all: $(DISK_IMG) -.PHONY: stage1 stage2 kernel run gdb clean stage1: $(BUILD_DIR) $(AS) $(ASFLAGS) -o $(BUILD_DIR)/$@.o bootloader/$@.asm $(LD) -Ttext=0x7c00 -melf_i386 -o $(BUILD_DIR)/$@.elf $(BUILD_DIR)/$@.o @@ -57,6 +57,10 @@ $(BUILD_DIR): mkdir -p $@ mkdir -p $(BUILD_DIR)/klibc +compile-commands: $(BUILD_DIR)/compile_commands.json +$(BUILD_DIR)/compile_commands.json: $(BUILD_DIR) + bear --output $@ -- make -B + run: qemu-system-i386 -s -S $(DISK_IMG) From daead5ee57c5afb488f9a4a16a16debb8dc6af95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borna=20=C5=A0o=C5=A1tari=C4=87?= Date: Sun, 18 Jan 2026 10:15:38 +0100 Subject: [PATCH 2/5] add clangd config file --- .clangd | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .clangd diff --git a/.clangd b/.clangd new file mode 100644 index 0000000..7728b54 --- /dev/null +++ b/.clangd @@ -0,0 +1,6 @@ +CompileFlags: + CompilationDatabase: build + +Diagnostics: + UnusedIncludes: Strict + MissingIncludes: Strict From 78d5e9a7abf9ef892350f15cd1a9f76948acd4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borna=20=C5=A0o=C5=A1tari=C4=87?= Date: Sun, 18 Jan 2026 10:18:23 +0100 Subject: [PATCH 3/5] added editorconfig file --- .editorconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..3f415b2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[Makefile] +indent_style = tab +indent_size = 8 +tab_width = 8 From e38f1aa2eea87677d6ee1fab5609790d1441a873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borna=20=C5=A0o=C5=A1tari=C4=87?= Date: Sun, 18 Jan 2026 10:40:34 +0100 Subject: [PATCH 4/5] add .clang-format --- .clang-format | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..d9bcc1f --- /dev/null +++ b/.clang-format @@ -0,0 +1,19 @@ +BasedOnStyle: Google +IndentWidth: 4 +TabWidth: 4 +UseTab: Never +ColumnLimit: 80 + +DerivePointerAlignment: false +PointerAlignment: Right +ReferenceAlignment: Right + +IncludeBlocks: Regroup +IncludeCategories: + # Std headers + - Regex: '<[[:alnum:]_.]+>' + Priority: 2 + + # Other headers + - Regex: '.*' + Priority: 1 From a7b0d1152f68b28c4925715789d00c2e454cd2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borna=20=C5=A0o=C5=A1tari=C4=87?= Date: Sun, 18 Jan 2026 10:54:18 +0100 Subject: [PATCH 5/5] add rules for formatting consecutives --- .clang-format | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.clang-format b/.clang-format index d9bcc1f..c97b399 100644 --- a/.clang-format +++ b/.clang-format @@ -8,6 +8,11 @@ DerivePointerAlignment: false PointerAlignment: Right ReferenceAlignment: Right +AlignConsecutiveMacros: Consecutive +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 + IncludeBlocks: Regroup IncludeCategories: # Std headers