Commit 502f131
committed
resolved the undefined reference issues by improving the build system's file discovery
1. Fix linker.ld
- Kernel Symbols : Added the missing kernel_start = .; symbol at the beginning of the SECTIONS block (at 1MB). This resolves the undefined reference to kernel_start error in kernel.c .
- Layout Integrity : Verified the standard 32-bit ELF layout with the .multiboot section correctly placed at the start of the .text block for GRUB compatibility.
2. Robust File Discovery in Makefile
- Find Command : Replaced the limited $(wildcard ...) pattern with $(shell find $(SRC_DIR) -name "*.c") and $(shell find $(SRC_DIR) -name "*.s") .
- Deep Directory Support : The previous wildcard only searched up to 3 levels deep, which caused it to miss critical files like src/arch/pit.c (providing timer_get_ticks ), src/arch/gdt.c (providing gdt_init ), and src/cpu/isr.c (providing isr_init and register_interrupt_handler ).
- Object Mapping : This change ensures that every source file in the repository, regardless of depth, is correctly compiled into the build/ directory and linked into kernel.bin .
3. Warning Suppression
- Noexecstack : Maintained the -Wl,-z,noexecstack flag in LDFLAGS to suppress the deprecated executable stack warning and improve security.1 parent e305cf8 commit 502f131
2 files changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
0 commit comments