/*
 * @author  xamidev <xamidev@riseup.net>
 * @brief   PepperOS configuration file
 * @license GPL-3.0-only
 */

#ifndef CONFIG_H
#define CONFIG_H

/* version */
#define PEPPEROS_VERSION_MAJOR "0"
#define PEPPEROS_VERSION_MINOR "1"
#define PEPPEROS_VERSION_PATCH "121"
#define PEPPEROS_SPLASH \
"\x1b[38;5;196m                                      \x1b[38;5;231m____  _____\r\n\x1b[0m"\
"\x1b[38;5;196m    ____  ___  ____  ____  ___  _____\x1b[38;5;231m/ __ \\/ ___/\r\n\x1b[0m"\
"\x1b[38;5;196m   / __ \\/ _ \\/ __ \\/ __ \\/ _ \\/ ___\x1b[38;5;231m/ / / /\\__ \\ \r\n\x1b[0m"\
"\x1b[38;5;196m  / /_/ /  __/ /_/ / /_/ /  __/ /  \x1b[38;5;231m/ /_/ /___/ / \r\n\x1b[0m"\
"\x1b[38;5;196m / .___/\\___/ .___/ .___/\\___/_/   \x1b[38;5;231m\\____//____/  \r\n\x1b[0m"\
"\x1b[38;5;196m/_/        /_/   /_/                             \r\n\x1b[0m"\
"     --- version \x1b[38;5;220m"PEPPEROS_VERSION_MAJOR"."PEPPEROS_VERSION_MINOR"."PEPPEROS_VERSION_PATCH"\x1b[0m built on \x1b[38;5;40m"__DATE__" "__TIME__"\x1b[0m\r\n"

/* pedicel */
#define PEDICEL_PROMPT "pedicel$ "
#define PEDICEL_INPUT_SIZE 128

/* process */
#define PROCESS_NAME_MAX 64
#define PROCESS_STACK_SIZE 0x10000 // 64kb
#define PROCESS_STACK_TOP 0x80000000

/* sched */
// 1 tick = 1 ms => quantum = 10ms
#define SCHEDULER_QUANTUM 10

/* kernel */
#define KERNEL_BASE 0xFFFFFFFF80000000ULL
// 2 MB should be enough (as of now, the whole kernel ELF is around 75kb)
#define KERNEL_SIZE 0x200000
#define KERNEL_STACK_SIZE 65536
#define KERNEL_IDT_ENTRIES 33

/* user */
#define USER_STACK_TOP 0x80000000
#define USER_STACK_PAGES 16 // 16*4096 = 64kb
#define USER_CODE_START 0x400000 // like linux
#define USER_RAW_EXTRA_PAGES 8192 // Extra writable pages after raw image for .bss/heap
                                 // TODO: throw this away and make an ELF loader instead bruh

/* paging */
#define PAGING_MAX_PHYS 0x200000000

/* heap */
#define KHEAP_SIZE (32*1024*1024)

/* term */
#define TERM_HISTORY_MAX_LINES 256

/* kbd */
#define KBD_BUFFER_MAX 256

/* time */
#define TIMER_FREQUENCY 1000

/* ssp */
#define STACK_CHK_GUARD 0x7ABA5C007ABA5C00

/* fs */
#define FDT_MAX 8 // Maximum amount of file descriptors per process


#endif
