Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
476 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
project(eon) | ||
project(karyon) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
add_subdirectory(interpreter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#pragma once | ||
|
||
struct e_Memory; | ||
struct k_Memory; | ||
|
||
extern struct e_Memory* e_Memory_get(); | ||
extern struct k_Memory* k_Memory_get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#pragma once | ||
|
||
enum e_System_Stop_Mode {E_SYSTEM_HALT, E_SYSTEM_RESET}; | ||
enum k_System_Stop_Mode {K_SYSTEM_HALT, K_SYSTEM_RESET}; | ||
|
||
struct e_System { | ||
void (*stop)(struct e_System* system, enum e_System_Stop_Mode mode); | ||
struct k_System { | ||
void (*stop)(struct k_System* system, enum k_System_Stop_Mode mode); | ||
}; | ||
|
||
extern struct e_System* e_System_get(); | ||
extern struct k_System* k_System_get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
#pragma once | ||
#include <stdbool.h> | ||
|
||
#define E_BIT(pos) \ | ||
#define K_BIT(pos) \ | ||
(1 << (pos)) | ||
|
||
#define E_BIT_CLEAR(value, bit_flag) \ | ||
#define K_BIT_CLEAR(value, bit_flag) \ | ||
((value) & (~0 ^ (bit_flag))) | ||
|
||
#define E_BIT_IS_SET(value, bit_flag) \ | ||
#define K_BIT_IS_SET(value, bit_flag) \ | ||
(((value) & (bit_flag)) != 0 ? true : false) | ||
|
||
#define E_BIT_ATTR_PACKED(type) \ | ||
#define K_BIT_ATTR_PACKED(type) \ | ||
type __attribute__((__packed__)) | ||
|
||
#define E_BIT_ATTR_SECTION(name, declaration) \ | ||
#define K_BIT_ATTR_SECTION(name, declaration) \ | ||
declaration __attribute__((section(name))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
#include "../core/Log.h" | ||
#include "vga/Text.h" | ||
|
||
static void prepare(struct e_Log* log, enum e_Log_Level level) { | ||
if (level == E_LOG_ERROR) { | ||
e_VGA_Text_set_color(E_VGA_TEXT_RED, E_VGA_TEXT_BLACK); | ||
static void prepare(struct k_Log* log, enum k_Log_Level level) { | ||
if (level == K_LOG_ERROR) { | ||
k_VGA_Text_set_color(K_VGA_TEXT_RED, K_VGA_TEXT_BLACK); | ||
} | ||
else if (level == E_LOG_WARN) { | ||
e_VGA_Text_set_color(E_VGA_TEXT_YELLOW, E_VGA_TEXT_BLACK); | ||
else if (level == K_LOG_WARN) { | ||
k_VGA_Text_set_color(K_VGA_TEXT_YELLOW, K_VGA_TEXT_BLACK); | ||
} | ||
else { | ||
e_VGA_Text_set_color(E_VGA_TEXT_WHITE, E_VGA_TEXT_BLACK); | ||
k_VGA_Text_set_color(K_VGA_TEXT_WHITE, K_VGA_TEXT_BLACK); | ||
} | ||
} | ||
|
||
static void print_ch(struct e_Log* log, char ch) { | ||
e_VGA_Text_print_ch(ch); | ||
static void print_ch(struct k_Log* log, char ch) { | ||
k_VGA_Text_print_ch(ch); | ||
} | ||
|
||
static void print_str(struct e_Log* log, const char* str) { | ||
e_VGA_Text_print_str(str); | ||
static void print_str(struct k_Log* log, const char* str) { | ||
k_VGA_Text_print_str(str); | ||
} | ||
|
||
// FIXME: remove globals in VGA and use this instance instead? | ||
struct e_Log* e_Log_get() { | ||
static struct e_Log log = {prepare, print_ch, print_str}; | ||
struct k_Log* k_Log_get() { | ||
static struct k_Log log = {prepare, print_ch, print_str}; | ||
return &log; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.