Split up source and added basic support for different targets.

This commit is contained in:
2024-01-12 17:19:27 +01:00
parent 219a48c616
commit 408e06b2e0
29 changed files with 559 additions and 36 deletions

View File

@@ -0,0 +1,10 @@
#pragma once
#if !defined(BAD_APPLE_OS_PANIC_HPP_INCLUDED)
#define BAD_APPLE_OS_PANIC_HPP_INCLUDED
[[noreturn]] void panic(const char* message) noexcept;
[[noreturn]] void panicf(const char* format, ...) noexcept;
#endif // !defined(BAD_APPLE_OS_PANIC_HPP_INCLUDED)

View File

@@ -0,0 +1,46 @@
#pragma once
#if !defined(OS_TTY_HPP_INCLUDED)
#define OS_TTY_HPP_INCLUDED 1
#include <stddef.h>
#include <stdint.h>
namespace tty
{
enum class VgaColor : uint8_t
{
BLACK = 0,
BLUE = 1,
GREEN = 2,
CYAN = 3,
RED = 4,
MAGENTA = 5,
BROWN = 6,
LIGHT_GREY = 7,
DARK_GREY = 8,
LIGHT_BLUE = 9,
LIGHT_GREEN = 10,
LIGHT_CYAN = 11,
LIGHT_RED = 12,
LIGHT_MAGENTA = 13,
LIGHT_BROWN = 14,
WHITE = 15
};
struct VgaDoubleColor
{
VgaColor foreground : 4 = VgaColor::LIGHT_GREY;
VgaColor background : 4 = VgaColor::BLACK;
};
void initialize();
void setColor(VgaDoubleColor color);
void putEntryAt(char chr, VgaDoubleColor color, size_t posX, size_t posY);
void putChar(char chr);
void write(const char* data, size_t size);
void write(const char* data);
} // namespace tty
#endif // OS_TTY_HPP_INCLUDED