Move headers to include/

This commit is contained in:
2026-03-18 11:48:33 +01:00
parent a1e8aacd01
commit f7735eb3a4
45 changed files with 89 additions and 88 deletions

View File

@@ -25,7 +25,7 @@ $(BUILDDIR):
$(BUILDDIR)/%.o: $(SRC)/%.c $(BUILDDIR)/%.o: $(SRC)/%.c
mkdir -p $(dir $@) mkdir -p $(dir $@)
$(CC) -g -c -Isrc $< $(CC_PROBLEMATIC_FLAGS) $(CC_FLAGS) -o $@ $(CC) -g -c -Iinclude $< $(CC_PROBLEMATIC_FLAGS) $(CC_FLAGS) -o $@
limine/limine: limine/limine:
rm -rf limine rm -rf limine

View File

@@ -15,9 +15,9 @@ enum ErrorCodes {
#define CLEAR_INTERRUPTS __asm__ volatile("cli") #define CLEAR_INTERRUPTS __asm__ volatile("cli")
#define SET_INTERRUPTS __asm__ volatile("sti") #define SET_INTERRUPTS __asm__ volatile("sti")
#include "io/serial/serial.h" #include <io/serial/serial.h>
#include "io/term/term.h" #include <io/term/term.h>
#include "idt/idt.h" #include <idt/idt.h>
#include <stdbool.h> #include <stdbool.h>
extern volatile uint64_t ticks; extern volatile uint64_t ticks;

View File

@@ -11,7 +11,7 @@
#include <stdint.h> #include <stdint.h>
#include <limine.h> #include <limine.h>
#include "mem/heap/kheap.h" #include <mem/kheap.h>
#include <kernel.h> #include <kernel.h>
void paging_init(struct boot_context boot_ctx); void paging_init(struct boot_context boot_ctx);

View File

@@ -8,7 +8,7 @@
#define PROCESS_H #define PROCESS_H
#include <stddef.h> #include <stddef.h>
#include "config.h" #include <config.h>
#include <stdint.h> #include <stdint.h>
typedef enum { typedef enum {

View File

@@ -1,6 +1,8 @@
timeout: 3 timeout: 3
interface_branding: Welcome to the PepperOS disk!
/PepperOS /PepperOS
protocol: limine protocol: limine
comment: Default configuration (warning: spicy)
path: boot():/boot/pepperk path: boot():/boot/pepperk

View File

@@ -5,8 +5,8 @@
*/ */
#include <kernel.h> #include <kernel.h>
#include "limine.h" #include <limine.h>
#include "string/string.h" #include <string/string.h>
#include <stddef.h> #include <stddef.h>
extern struct boot_context boot_ctx; extern struct boot_context boot_ctx;

View File

@@ -5,9 +5,9 @@
*/ */
#include <stddef.h> #include <stddef.h>
#include "idt/idt.h" #include <idt/idt.h>
#include "io/serial/serial.h" #include <io/serial/serial.h>
#include "kernel.h" #include <kernel.h>
extern struct init_status init; extern struct init_status init;
extern int panic_count; extern int panic_count;

View File

@@ -5,7 +5,7 @@
*/ */
#include <stdint.h> #include <stdint.h>
#include "kernel.h" #include <kernel.h>
#include <stddef.h> #include <stddef.h>
extern struct init_status init; extern struct init_status init;

View File

@@ -4,16 +4,16 @@
* @license GPL-3.0-only * @license GPL-3.0-only
*/ */
#include "idt.h" #include <idt/idt.h>
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include "io/serial/serial.h" #include <io/serial/serial.h>
#include "io/kbd/ps2.h" #include <io/kbd/ps2.h>
#include <kernel.h> #include <kernel.h>
#include <stdbool.h> #include <stdbool.h>
#include "sched/scheduler.h" #include <sched/scheduler.h>
#include "config.h" #include <config.h>
#include "sched/process.h" #include <sched/process.h>
struct interrupt_descriptor idt[256]; struct interrupt_descriptor idt[256];
struct idtr idt_reg; struct idtr idt_reg;

View File

@@ -4,10 +4,10 @@
* @license GPL-3.0-only * @license GPL-3.0-only
*/ */
#include "io/serial/serial.h" #include <io/serial/serial.h>
#include "ps2.h" #include <io/kbd/ps2.h>
#include <stdint.h> #include <stdint.h>
#include "io/term/term.h" #include <io/term/term.h>
#include <kernel.h> #include <kernel.h>
#include <stddef.h> #include <stddef.h>

View File

@@ -5,7 +5,7 @@
*/ */
#include <kernel.h> #include <kernel.h>
#include "serial.h" #include <io/serial/serial.h>
extern struct init_status init; extern struct init_status init;

View File

@@ -41,7 +41,7 @@
#define FLANTERM_IN_FLANTERM #define FLANTERM_IN_FLANTERM
#endif #endif
#include "flanterm.h" #include <io/term/flanterm.h>
// Tries to implement this standard for terminfo // Tries to implement this standard for terminfo
// https://man7.org/linux/man-pages/man4/console_codes.4.html // https://man7.org/linux/man-pages/man4/console_codes.4.html

View File

@@ -51,8 +51,8 @@
#define FLANTERM_IN_FLANTERM #define FLANTERM_IN_FLANTERM
#endif #endif
#include "../flanterm.h" #include <io/term/flanterm.h>
#include "fb.h" #include <io/term/flanterm_backends/fb.h>
void *memset(void *, int, size_t); void *memset(void *, int, size_t);
void *memcpy(void *, const void *, size_t); void *memcpy(void *, const void *, size_t);

View File

@@ -13,18 +13,18 @@ because this shitty implementation will be replaced one day by Flanterm
#include <stddef.h> #include <stddef.h>
#include <kernel.h> #include <kernel.h>
#include "term.h" #include <io/term/term.h>
#include "config.h" #include <config.h>
#include "flanterm.h" #include <io/term/flanterm.h>
#include "flanterm_backends/fb.h" #include <io/term/flanterm_backends/fb.h>
#include "mem/heap/kheap.h" #include <mem/kheap.h>
#include "limine.h" #include <limine.h>
#include <stdarg.h> #include <stdarg.h>
#include "sched/spinlock.h" #include <sched/spinlock.h>
#include "io/serial/serial.h" #include <io/serial/serial.h>
#define NANOPRINTF_IMPLEMENTATION #define NANOPRINTF_IMPLEMENTATION
#include "nanoprintf.h" #include <io/term/nanoprintf.h>
extern struct flanterm_context* ft_ctx; extern struct flanterm_context* ft_ctx;
extern struct init_status init; extern struct init_status init;

View File

@@ -7,24 +7,23 @@
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <limine.h> #include <limine.h>
#include "io/term/term.h" #include <io/term/term.h>
#include "io/term/term.h" #include <io/serial/serial.h>
#include "io/serial/serial.h" #include <mem/gdt.h>
#include "mem/gdt/gdt.h" #include <mem/utils.h>
#include "mem/misc/utils.h" #include <idt/idt.h>
#include "idt/idt.h" #include <kernel.h>
#include "kernel.h" #include <time/timer.h>
#include "time/timer.h" #include <io/kbd/ps2.h>
#include "io/kbd/ps2.h" #include <mem/pmm.h>
#include "mem/paging/pmm.h" #include <mem/paging.h>
#include "mem/paging/paging.h" #include <mem/vmm.h>
#include "mem/paging/vmm.h" #include <mem/kheap.h>
#include "mem/heap/kheap.h" #include <sched/process.h>
#include "sched/process.h" #include <sched/scheduler.h>
#include "sched/scheduler.h" #include <config.h>
#include "config.h" #include <io/term/flanterm.h>
#include "io/term/flanterm.h" #include <io/term/flanterm_backends/fb.h>
#include "io/term/flanterm_backends/fb.h"
// Limine version used // Limine version used
__attribute__((used, section(".limine_requests"))) __attribute__((used, section(".limine_requests")))

View File

@@ -4,9 +4,9 @@
* @license GPL-3.0-only * @license GPL-3.0-only
*/ */
#include "gdt.h" #include <mem/gdt.h>
#include <stdint.h> #include <stdint.h>
#include "io/serial/serial.h" #include <io/serial/serial.h>
#include <kernel.h> #include <kernel.h>
// Descriptors are 8-byte wide (64bits) // Descriptors are 8-byte wide (64bits)

View File

@@ -4,13 +4,13 @@
* @license GPL-3.0-only * @license GPL-3.0-only
*/ */
#include "kheap.h" #include <mem/kheap.h>
#include "mem/paging/paging.h" #include <mem/paging.h>
#include "mem/paging/pmm.h" #include <mem/pmm.h>
#include <stddef.h> #include <stddef.h>
#include <kernel.h> #include <kernel.h>
#include "sched/process.h" #include <sched/process.h>
#include "config.h" #include <config.h>
extern uint64_t kernel_phys_base; extern uint64_t kernel_phys_base;
extern uint64_t kernel_virt_base; extern uint64_t kernel_virt_base;

View File

@@ -4,12 +4,12 @@
* @license GPL-3.0-only * @license GPL-3.0-only
*/ */
#include "paging.h" #include <mem/paging.h>
#include "pmm.h" #include <mem/pmm.h>
#include <kernel.h> #include <kernel.h>
#include <stddef.h> #include <stddef.h>
#include <limine.h> #include <limine.h>
#include "config.h" #include <config.h>
/* /*
Paging on x86 uses four different page table levels: Paging on x86 uses four different page table levels:

View File

@@ -11,13 +11,13 @@ it will probably need to get some info from Limine,
to see which pages are used by kernel/bootloader/mmio/fb etc. to see which pages are used by kernel/bootloader/mmio/fb etc.
*/ */
#include "paging.h" #include <mem/paging.h>
#include <limine.h> #include <limine.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <kernel.h> #include <kernel.h>
#include "mem/misc/utils.h" #include <mem/utils.h>
#include "pmm.h" #include <mem/pmm.h>
/* /*
First we'll have to discover the physical memory layout, First we'll have to discover the physical memory layout,

View File

@@ -7,8 +7,8 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <limine.h> #include <limine.h>
#include "kernel.h" #include <kernel.h>
#include "string/string.h" #include <string/string.h>
// We won't be linked to standard library, but still need the basic mem* functions // We won't be linked to standard library, but still need the basic mem* functions
// so everything goes allright with the compiler // so everything goes allright with the compiler

View File

@@ -13,10 +13,10 @@ in a specified virtual space
compared to the PMM which allocs/frees 4kb frames ("physical pages"). compared to the PMM which allocs/frees 4kb frames ("physical pages").
*/ */
#include "vmm.h" #include <mem/vmm.h>
#include "paging.h" #include <mem/paging.h>
#include <stddef.h> #include <stddef.h>
#include "pmm.h" #include <mem/pmm.h>
#include <kernel.h> #include <kernel.h>
void* vmm_pt_root = 0; void* vmm_pt_root = 0;

View File

@@ -5,15 +5,15 @@
*/ */
#include <stddef.h> #include <stddef.h>
#include "process.h" #include <sched/process.h>
#include "mem/heap/kheap.h" #include <mem/kheap.h>
#include "kernel.h" #include <kernel.h>
#include "string/string.h" #include <string/string.h>
#include "mem/gdt/gdt.h" #include <mem/gdt.h>
#include "config.h" #include <config.h>
#include "io/serial/serial.h" #include <io/serial/serial.h>
#include "io/term/flanterm.h" #include <io/term/flanterm.h>
extern struct flanterm_context* ft_ctx; extern struct flanterm_context* ft_ctx;
struct process_t* processes_list; struct process_t* processes_list;

View File

@@ -4,11 +4,11 @@
* @license GPL-3.0-only * @license GPL-3.0-only
*/ */
#include "kernel.h" #include <kernel.h>
#include "process.h" #include <sched/process.h>
#include "mem/paging/paging.h" #include <mem/paging.h>
#include <stdint.h> #include <stdint.h>
#include "io/serial/serial.h" #include <io/serial/serial.h>
extern struct process_t* processes_list; extern struct process_t* processes_list;
extern struct process_t* current_process; extern struct process_t* current_process;

View File

@@ -6,8 +6,8 @@
#include <stdatomic.h> #include <stdatomic.h>
#include <stdbool.h> #include <stdbool.h>
#include "kernel.h" #include <kernel.h>
#include "spinlock.h" #include <sched/spinlock.h>
/* /*
* spinlock_acquire - Lock a lock * spinlock_acquire - Lock a lock

View File

@@ -5,9 +5,9 @@
*/ */
#include <stdint.h> #include <stdint.h>
#include "io/serial/serial.h" #include <io/serial/serial.h>
#include <kernel.h> #include <kernel.h>
#include "config.h" #include <config.h>
/* /*
For now, the timer module will be using the PIC. For now, the timer module will be using the PIC.