feat(kernel): genesis of Airlys 64-bit sovereign OS kernel (Phase 1)
This commit is contained in:
commit
7210b60fc7
15 files changed
+746
No files matched your search
@@ -0,0 +1,15 @@
|
||||
#ifndef AIRLYS_KERNEL_H
|
||||
#define AIRLYS_KERNEL_H
|
||||
|
||||
#include <airlys/types.h>
|
||||
#include <airlys/vga.h>
|
||||
|
||||
#define AIRLYS_VERSION_MAJOR 0
|
||||
#define AIRLYS_VERSION_MINOR 1
|
||||
#define AIRLYS_VERSION_PATCH 0
|
||||
#define AIRLYS_CODENAME "Genesis"
|
||||
|
||||
void kernel_main(uint64_t magic, uint64_t addr);
|
||||
void kernel_panic(const char* message);
|
||||
|
||||
#endif /* AIRLYS_KERNEL_H */
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef AIRLYS_TYPES_H
|
||||
#define AIRLYS_TYPES_H
|
||||
|
||||
/*
|
||||
* Airlys Operating System Kernel - Core Types
|
||||
* Engineered by Er. Adam Eehan (Founder & CEO, Aira Group of Technology)
|
||||
* Pure freestanding - Zero C Standard Library dependencies
|
||||
*/
|
||||
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef signed long long int64_t;
|
||||
|
||||
typedef uint64_t size_t;
|
||||
typedef int64_t ssize_t;
|
||||
typedef uint64_t uintptr_t;
|
||||
typedef int64_t intptr_t;
|
||||
|
||||
#define NULL ((void*)0)
|
||||
|
||||
typedef enum {
|
||||
false = 0,
|
||||
true = 1
|
||||
} bool;
|
||||
|
||||
#endif /* AIRLYS_TYPES_H */
|
||||
@@ -0,0 +1,47 @@
|
||||
#ifndef AIRLYS_VGA_H
|
||||
#define AIRLYS_VGA_H
|
||||
|
||||
#include <airlys/types.h>
|
||||
|
||||
/* Hardware VGA text buffer at physical address 0xB8000 */
|
||||
#define VGA_BUFFER_PHYSICAL 0xB8000
|
||||
#define VGA_WIDTH 80
|
||||
#define VGA_HEIGHT 25
|
||||
|
||||
typedef enum {
|
||||
VGA_COLOR_BLACK = 0,
|
||||
VGA_COLOR_BLUE = 1,
|
||||
VGA_COLOR_GREEN = 2,
|
||||
VGA_COLOR_CYAN = 3,
|
||||
VGA_COLOR_RED = 4,
|
||||
VGA_COLOR_MAGENTA = 5,
|
||||
VGA_COLOR_BROWN = 6,
|
||||
VGA_COLOR_LIGHT_GREY = 7,
|
||||
VGA_COLOR_DARK_GREY = 8,
|
||||
VGA_COLOR_LIGHT_BLUE = 9,
|
||||
VGA_COLOR_LIGHT_GREEN = 10,
|
||||
VGA_COLOR_LIGHT_CYAN = 11,
|
||||
VGA_COLOR_LIGHT_RED = 12,
|
||||
VGA_COLOR_LIGHT_MAGENTA = 13,
|
||||
VGA_COLOR_LIGHT_BROWN = 14,
|
||||
VGA_COLOR_WHITE = 15,
|
||||
} vga_color_t;
|
||||
|
||||
static inline uint8_t vga_entry_color(vga_color_t fg, vga_color_t bg) {
|
||||
return (uint8_t)(fg | (bg << 4));
|
||||
}
|
||||
|
||||
static inline uint16_t vga_entry(unsigned char uc, uint8_t color) {
|
||||
return (uint16_t)uc | ((uint16_t)color << 8);
|
||||
}
|
||||
|
||||
void vga_init(void);
|
||||
void vga_set_color(vga_color_t fg, vga_color_t bg);
|
||||
void vga_clear(void);
|
||||
void vga_putchar(char c);
|
||||
void vga_write(const char* data, size_t size);
|
||||
void vga_puts(const char* str);
|
||||
void vga_puthex(uint64_t val);
|
||||
void vga_putdec(uint64_t val);
|
||||
|
||||
#endif /* AIRLYS_VGA_H */
|
||||
Reference in new issue
Block a user