diff options
author | Simponic <loganthebean222@gmail.com> | 2021-02-20 23:24:25 -0700 |
---|---|---|
committer | Simponic <loganthebean222@gmail.com> | 2021-02-20 23:24:25 -0700 |
commit | a2a4a155c259d24101435771607b81f167b62cf3 (patch) | |
tree | 8e5dc73b21d02abbfe0f5185050c48908b3249ab /include | |
download | simponicOS-a2a4a155c259d24101435771607b81f167b62cf3.tar.gz simponicOS-a2a4a155c259d24101435771607b81f167b62cf3.zip |
Changed to nasm
Diffstat (limited to 'include')
-rw-r--r-- | include/gdt.h | 17 | ||||
-rw-r--r-- | include/print.h | 19 | ||||
-rw-r--r-- | include/types.h | 16 |
3 files changed, 52 insertions, 0 deletions
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 |