From fd9f4bd7724b4440bede4ccbb3670e88289402d9 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Sat, 26 Jul 2025 15:27:23 +0200 Subject: Move include files to a subdirectory Move the include files to the toxic/ subdirectory, so it gets a bit more organized. Ah, yeah, OS name will be renamed to ToxicOS Signed-off-by: Carlos Maiolino --- src/include/toxic/kernel.h | 6 ++++++ src/include/toxic/string.h | 10 ++++++++++ src/include/toxic/vga.h | 25 +++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 src/include/toxic/kernel.h create mode 100644 src/include/toxic/string.h create mode 100644 src/include/toxic/vga.h (limited to 'src/include/toxic') diff --git a/src/include/toxic/kernel.h b/src/include/toxic/kernel.h new file mode 100644 index 0000000..2007693 --- /dev/null +++ b/src/include/toxic/kernel.h @@ -0,0 +1,6 @@ +#ifndef KERNEL_H +#define KERNEL_H + +void kernel_main(); + +#endif /* KERNEL_H */ diff --git a/src/include/toxic/string.h b/src/include/toxic/string.h new file mode 100644 index 0000000..69d8bd2 --- /dev/null +++ b/src/include/toxic/string.h @@ -0,0 +1,10 @@ +#ifndef STRING_H +#define STRING_H + +#include + +size_t strlen(const char *s); +char *strcpy(char *restrict dst, const char *restrict src); + +void *memset(void *s, int c, size_t n); +#endif /* STRING_H */ diff --git a/src/include/toxic/vga.h b/src/include/toxic/vga.h new file mode 100644 index 0000000..7aaa210 --- /dev/null +++ b/src/include/toxic/vga.h @@ -0,0 +1,25 @@ +#ifndef VGA_H +#define VGA_H +#include + +#define VGA_ADDRESS 0xb8000 +#define VGA_WIDTH 80 +#define VGA_HEIGHT 20 + +struct vga_display { + uint16_t *buf; + uint16_t color; + size_t row; + size_t col; +}; + +extern struct vga_display display; + +void vga_put_char(size_t row, size_t col, char c, uint16_t color); +void vga_write_char(char c); +void vprintl(char *str); + +void init_display(uint16_t color); + + +#endif /* VGA_H */ -- cgit v1.2.3