From a2a4a155c259d24101435771607b81f167b62cf3 Mon Sep 17 00:00:00 2001 From: Simponic Date: Sat, 20 Feb 2021 23:24:25 -0700 Subject: Changed to nasm --- include/gdt.h | 17 +++++++++++++++++ include/print.h | 19 +++++++++++++++++++ include/types.h | 16 ++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 include/gdt.h create mode 100644 include/print.h create mode 100644 include/types.h (limited to 'include') diff --git a/include/gdt.h b/include/gdt.h new file mode 100644 index 0000000..8b239dd --- /dev/null +++ b/include/gdt.h @@ -0,0 +1,17 @@ +#ifndef GDT_H +#define GDT_H + +#include "types.h" + +struct GDT { + uint32_t limit; + uint32_t base; + uint8_t type; +} __attribute((packed)); + +struct GDT_ptr { + uint16_t limit; + uint32_t base; +} __attribute((packed)); + +#endif //GDT_H diff --git a/include/print.h b/include/print.h new file mode 100644 index 0000000..c46843c --- /dev/null +++ b/include/print.h @@ -0,0 +1,19 @@ +#ifndef PRINT_H +#define PRINT_H + +#include "types.h" + +typedef struct TextOutput { + int terminal_row; + int terminal_column; + int max_row; + int max_column; + uint16_t* vid_mem; +}__attribute__((packed)) TextOutput; + +TextOutput createOutput(const int max_row, const int max_column, uint16_t* vid_mem); +void scrollText(TextOutput* textOutput); +void putChar(uint8_t character, uint8_t background, uint8_t foreground, TextOutput* textOutput); +void print(char* string, uint8_t background, uint8_t foreground, TextOutput* textOutput); + +#endif // PRINT_H diff --git a/include/types.h b/include/types.h new file mode 100644 index 0000000..a4795c6 --- /dev/null +++ b/include/types.h @@ -0,0 +1,16 @@ +#ifndef TYPES_H +#define TYPES_H + +typedef char int8_t; +typedef unsigned char uint8_t; + +typedef short int16_t; +typedef unsigned short uint16_t; + + +typedef int int32_t; +typedef unsigned int uint32_t; + +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif -- cgit v1.2.3-70-g09d2