menu "Kernel configuration"

        config KERNEL_TARGET_HAS_MMU
                bool
                prompt "Enable MMU support in the kernel" if TARGET_HAS_MMU
                default n
                help
                        Boolean to mark whether the target has an MMU/Memory Mapper. If this option is selected,
                        the target needs to have a memory mapping organized as 4 pages of 16KB. Each page can be
                        mapped to any 16KB of physical address space.
                        As such, when enabled, the target must implement an `mmu_h.asm` interface.

        config KERNEL_REPRODUCIBLE_BUILD
                bool "Generate a reproducible binary"
                default n
                help
                        When this option is enabled, compiling the project several times with
                        the same configuration will produce the exact same binary. Thus, information
                        like build time will be excluded from the binary.

        config KERNEL_STACK_ADDR
                hex "Kernel stack virtual address"
                default 0xFFFF
                range 0x0000 0xFFFF
                help
                        After initializing the MMU, the kernel will set the Stack Pointer (SP).
                        This value defines the top of the stack in the virtual memory. It is highly
                        advised to use the top of the usable RAM.
                        If the kernel has MMU support, this value will also be the user stack address.
                        Else, the user stack address will be KERNEL_BSS address minus 1.

        config KERNEL_RAM_START
                hex
                prompt "Kernel RAM start address" if !KERNEL_TARGET_HAS_MMU
                default 0xC000
                range 0x0000 0xFFFF
                help
                        When the kernel has no MMU support, this value must be set to beginning of the kernel usable RAM.
                        This space ends at KERNEL_STACK_ADDR. It will containt he BSS, drivers RAM and kernel stack.
                        The user programs stack will be set the the KERNEL_RAM_START - 1.
                        When the kernel has MMU support, this is not required as the kernel will take a whole a whole
                        virtual page: 16KB.

        config KERNEL_COLDBOOT_HOOK
                bool "Hook routine at coldboot"
                default n
                help
                        When enabled, the kernel will call the routine named `target_coldboot` right
                        after initializing the MMU (if any) and setting up the stack.
                        This routine must be defined in the target code.

        config KERNEL_EXIT_HOOK
            bool "Hook routine at program exit"
            default n
            help
                        When enabled, the kernel will call the routine named `target_exit` right
                        after exiting a user program.
                        This routine must be defined in the target code.

        config KERNEL_MAX_LOADED_DRIVERS
                int "Maximum number of loaded drivers"
                default 16
                range 0 255
                help
                        Maximum number of drivers that can be loaded into the kernel.
                        This is valid for both loaded drivers at compile time and at runtime.
                        Must be a power of 2.

        config KERNEL_MAX_OPENED_DEVICES
                int "Maximum number of opened devices"
                default 16
                range 16 128
                help
                        Maximum number of opened devices for a program. This includes opened
                        drivers as well as opened files.

        config KERNEL_MAX_OPENED_FILES
                int "Maximum number of opened files"
                default 16
                range 16 128
                help
                        Maximum number of opened files at once. This only does not include opened
                        drivers.

        config KERNEL_PATH_MAX
                int "Maximum path length (files/directories)"
                default 128
                range 64 4096
                help
                        Maximum length of a single absolute file path. Incrementing this value will make
                        the kernel use more RAM.

        config KERNEL_INIT_EXECUTABLE
                string "Executable to launch on boot"
                default "A:/init.bin"
                help
                        Executable to load and execute on after system boot

        config KERNEL_INIT_EXECUTABLE_ADDR
                hex "Virtual address to load the initial program in"
                range 0x4000 0xFF00
                default 0x4000
                help
                        After the kernel has finished initializing all its components and its drivers,
                        it will load the KERNEL_INIT_EXECUTABLE in RAM. This constant defines the virtual
                        address where it will be loaded and executed from.

        config KERNEL_LOG_SUPPORT_ANSI_COLOR
                bool "Mark whether Kernel logger can use ANSI escape sequences for printing colors"
                default y
                help
                        Kernel logger, by default, prints logs without any color. However, if this option
                        is enable, it will be able to print error messages in red, warning messages in yellow
                        and info messages in green.

        config KERNEL_ENABLE_ZEALFS_SUPPORT
                bool "Enable support for ZealFS file system"
                default y
                help
                        If this option is enabled, ZealFS support will be added to the kernel, thus, disks using
                        it can be mounted.
                        Disable this option if you don't have any disk using ZealFS or if you want to reduce
                        kernel size. (saves around 1.3KB)
endmenu