Commit a77b161
committed
integrity of the kernel's core initialization routines.
1. Symbol Verification and Availability
- isr.c : Confirmed that timer_get_ticks is correctly implemented and non-static.
- gdt.c : Verified gdt_init is present and correctly calls the assembly gdt_flush .
- idt.c : Fixed idt_init to ensure it registers all 32 exceptions, all 16 IRQs (after remapping the PIC), and the system call interrupt (128). Crucially, I added the missing call to idt_load , which actually tells the CPU where the IDT is located.
2. Build System Improvements in Makefile
- Unique Object Extensions : The build now uses .c.o and .s.o extensions. This prevents name collisions between C and Assembly files with the same name (like isr.c and isr.s ), which was likely the cause of the "undefined reference" errors.
- Link Order : The linker command now explicitly places -lgcc at the very end:
```
kernel.bin: $(OBJS) linker.ld
$(LD) $(LDFLAGS) $(OBJS) -lgcc
``` This ensures that libgcc's 64-bit math helper functions (like __udivdi3 ) are available to all object files.
3. Linker Script Standardization
- linker.ld : Confirmed that the script defines both kernel_start and kernel_end . These symbols are essential for the physical memory manager ( pmm.c ) to reserve the memory occupied by the kernel itself.1 parent 26a8384 commit a77b161
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
0 commit comments