2020-04-11 21:59:39 +00:00
|
|
|
#pragma once
|
2020-02-06 20:20:58 +00:00
|
|
|
/************************
|
|
|
|
*** Team Kitty, 2020 ***
|
2020-08-22 23:48:49 +00:00
|
|
|
*** Chroma ***
|
2020-02-06 20:20:58 +00:00
|
|
|
***********************/
|
|
|
|
|
2020-08-22 23:48:49 +00:00
|
|
|
/* This file serves as the central kernel header. Every file in the kernel should include this header.
|
|
|
|
* It provides functionality to every core component of the system, and provides unrestricted cross-communication between modules.
|
|
|
|
* It also provides the symbols for the framebuffer and configuration file, which are both equually important.
|
|
|
|
*/
|
|
|
|
|
2020-02-06 20:20:58 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include <kernel/boot/boot.h>
|
|
|
|
#include <kernel/system/io.h>
|
|
|
|
#include <kernel/system/memory.h>
|
2020-08-22 23:48:49 +00:00
|
|
|
#include <kernel/system/pci.h>
|
2020-11-09 18:39:34 +00:00
|
|
|
#include <kernel/system/stack.h>
|
2020-02-06 20:20:58 +00:00
|
|
|
|
2020-10-18 16:27:07 +00:00
|
|
|
//Removed cause "wacky copyrighted stuff"
|
|
|
|
//#include <kernel/system/screen.h>
|
2020-09-03 20:37:03 +00:00
|
|
|
|
2020-04-11 21:59:39 +00:00
|
|
|
extern size_t LoadAddr;
|
2020-02-06 20:20:58 +00:00
|
|
|
extern bootinfo bootldr;
|
|
|
|
extern unsigned char* environment;
|
|
|
|
extern uint8_t fb;
|
2020-04-11 21:59:39 +00:00
|
|
|
extern volatile unsigned char _binary_font_psf_start;
|
2020-11-28 16:43:43 +00:00
|
|
|
extern volatile size_t* _kernel_text_start;
|
2020-04-11 21:59:39 +00:00
|
|
|
|
2020-09-03 20:37:03 +00:00
|
|
|
extern address_space_t KernelAddressSpace;
|
|
|
|
|
2020-04-11 21:59:39 +00:00
|
|
|
typedef struct {
|
|
|
|
uint32_t magic;
|
|
|
|
uint32_t version;
|
|
|
|
uint32_t headerSize;
|
|
|
|
uint32_t flags;
|
|
|
|
uint32_t numGlyphs;
|
|
|
|
uint32_t glyphSize;
|
|
|
|
uint32_t glyphHeight;
|
|
|
|
uint32_t glyphWidth;
|
|
|
|
uint8_t glyphs;
|
|
|
|
} __attribute__((packed)) psf_t;
|
|
|
|
|
|
|
|
|
|
|
|
size_t KernelAddr;
|
|
|
|
size_t KernelEnd;
|
|
|
|
size_t MemoryPages;
|
|
|
|
size_t MemorySize;
|
2020-02-06 20:20:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
void DrawPixel(uint32_t x, uint32_t y, uint32_t color);
|
|
|
|
void FillScreen(uint32_t color);
|
|
|
|
|
2020-09-25 15:48:20 +00:00
|
|
|
void SetupExtensions();
|
|
|
|
void PrepareCPU();
|
|
|
|
|
2020-02-06 20:20:58 +00:00
|
|
|
void WriteString(const char* string);
|
|
|
|
void WriteChar(const char character);
|
|
|
|
|
2020-04-11 21:59:39 +00:00
|
|
|
void WriteStringWithFont(const char* string);
|
|
|
|
|
2020-02-06 20:20:58 +00:00
|
|
|
void InitInterrupts();
|
|
|
|
void InitSerial();
|
|
|
|
void InitPrint();
|
|
|
|
|
|
|
|
void SetupInitialGDT();
|
|
|
|
void SetupIDT();
|
2020-08-27 00:39:56 +00:00
|
|
|
|
|
|
|
int Main();
|
|
|
|
|
|
|
|
void Exit();
|
2020-09-03 20:37:03 +00:00
|
|
|
|
|
|
|
void SomethingWentWrong(const char* Message);
|