KraKern

C++ Kernel
Log | Files | Refs | README | LICENSE | git clone https://git.ne02ptzero.me/git/KraKern

commit d14171dd290a4ff68c61e326078dd15ee755af8d
parent 1898b0d1b66250a99643b38a199481caf7d9a8b8
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Mon,  1 Feb 2016 18:33:56 +0100

Fix(Modules): Now working !

Diffstat:
Mboot/x86/IDT.cpp | 2+-
Mincludes/core/Io.hpp | 32++++++++++++++++----------------
Mincludes/core/Kernel.hpp | 2--
Dincludes/core/Keyboard.hpp | 147-------------------------------------------------------------------------------
Mincludes/core/Module.hpp | 8++++++--
Mincludes/core/Modules.hpp | 7++++---
Mkernel/Kernel.cpp | 3---
Dkernel/Keyboard.cpp | 45---------------------------------------------
Mkernel/Makefile | 2+-
Mkernel/Modules.cpp | 10+++++++++-
Mmodules/x86/Makefile | 2+-
Amodules/x86/ModuleKeyboard.cpp | 47+++++++++++++++++++++++++++++++++++++++++++++++
Amodules/x86/ModuleKeyboard.hpp | 148+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dmodules/x86/ModuleTest.cpp | 4----
Dmodules/x86/ModuleTest.hpp | 15---------------
Mmodules/x86/modules_conf.cpp | 12+++++++++---
Dmodules/x86/modules_conf.h | 7-------
17 files changed, 242 insertions(+), 251 deletions(-)

diff --git a/boot/x86/IDT.cpp b/boot/x86/IDT.cpp @@ -8,7 +8,7 @@ extern "C" { void isr_default_int(int id) { if (id == 1) - __kern.keyboard.get(); + __kern.mods->call_keyboard(); } void do_syscalls(int n) { diff --git a/includes/core/Io.hpp b/includes/core/Io.hpp @@ -11,22 +11,22 @@ # define SCREENLIM 0xB8FA0 // Colors defines -# define COLOR_BLACK 0x0 -# define COLOR_BLUE 0x1 -# define COLOR_GREEN 0x2 -# define COLOR_CYAN 0x3 -# define COLOR_RED 0x4 -# define COLOR_MAGENTA 0x5 -# define COLOR_ORANGE 0x6 -# define COLOR_LIGHT_GREY 0x7 -# define COLOR_DARK_GREY 0x8 -# define COLOR_LIGHT_BLUE 0x9 -# define COLOR_LIGHT_GREEN 0xA -# define COLOR_LIGHT_CYAN 0xB -# define COLOR_LIGHT_RED 0xC -# define COLOR_LIGHT_MAGENTA 0xD -# define COLOR_YELLOW 0xE -# define COLOR_WHITE 0xF +# define COLOR_BLACK 0x0 +# define COLOR_BLUE 0x1 +# define COLOR_GREEN 0x2 +# define COLOR_CYAN 0x3 +# define COLOR_RED 0x4 +# define COLOR_MAGENTA 0x5 +# define COLOR_ORANGE 0x6 +# define COLOR_LIGHT_GREY 0x7 +# define COLOR_DARK_GREY 0x8 +# define COLOR_LIGHT_BLUE 0x9 +# define COLOR_LIGHT_GREEN 0xA +# define COLOR_LIGHT_CYAN 0xB +# define COLOR_LIGHT_RED 0xC +# define COLOR_LIGHT_MAGENTA 0xD +# define COLOR_YELLOW 0xE +# define COLOR_WHITE 0xF class Io { public: diff --git a/includes/core/Kernel.hpp b/includes/core/Kernel.hpp @@ -6,7 +6,6 @@ # include <x86.hpp> # include <Io.hpp> # include <Memory.hpp> -# include <Keyboard.hpp> # include <FileSystem.hpp> # include <ProcessTable.hpp> @@ -23,7 +22,6 @@ class Kernel { GDT gdt; IDT idt; Memory mem; - Keyboard keyboard; FileSystem fs; ProcessTable pt; Modules *mods; diff --git a/includes/core/Keyboard.hpp b/includes/core/Keyboard.hpp @@ -1,147 +0,0 @@ -#ifndef __KEYBOARD__ -# define __KEYBOARD__ -# include <os.h> - -class Keyboard { - public: - void init(void); - void get(void); - - private: - u8 _lshift; - u8 _rshift; - u8 _alt; - u8 _ctrl; - char *_map; -}; - -// The following table is all the key. No interest in it. - -extern "C" { - enum { - KEY_TAB = 7, - KEY_BACKSPACE = 8, - KEY_ENTER = 10, - KEY_ESCAPE = 27, - KEY_F1 = 255, - KEY_F2 = 254, - KEY_F3 = 253, - KEY_F4 = 252, - KEY_F5 = 251, - KEY_F6 = 250, - KEY_F7 = 249, - KEY_F8 = 248, - KEY_F9 = 247, - KEY_F10 = 246, - KEY_F11 = 245, - KEY_F12 = 244 - }; -}; - -# ifndef __KERNEL__ - -char kbdmap_default[] = { - KEY_ESCAPE, KEY_ESCAPE, KEY_ESCAPE, KEY_ESCAPE, /* esc (0x01) */ - '1', '!', '1', '1', - '2', '@', '2', '2', - '3', '#', '3', '3', - '4', '$', '4', '4', - '5', '%', '5', '5', - '6', ':', '6', '6', - '7', '&', '7', '7', - '8', '*', '8', '8', - '9', '(', '9', '9', - '0', ')', '0', '0', - '-', '_', '-', '-', - '=', '+', '=', '=', - 0x08, 0x08, 0x7F, 0x08, /* backspace */ - 0x09, 0x09, 0x09, 0x09, /* tab */ - 'a', 'A', 'a', 'a', - 'z', 'Z', 'z', 'z', - 'e', 'E', 'e', 'e', - 'r', 'R', 'r', 'r', - 't', 'T', 't', 't', - 'y', 'Y', 'y', 'y', - 'u', 'U', 'u', 'u', - 'i', 'I', 'i', 'i', - 'o', 'O', 'o', 'o', - 'p', 'P', 'p', 'p', - '^', '"', '^', '^', - '$', '£', ' ', '$', - 0x0A, 0x0A, 0x0A, 0x0A, /* enter */ - 0xFF, 0xFF, 0xFF, 0xFF, /* ctrl */ - 'q', 'Q', 'q', 'q', - 's', 'S', 's', 's', - 'd', 'D', 'd', 'd', - 'f', 'F', 'f', 'f', - 'g', 'G', 'g', 'g', - 'h', 'H', 'h', 'h', - 'j', 'J', 'j', 'j', - 'k', 'K', 'k', 'k', - 'l', 'L', 'l', 'l', - 'm', 'M', 'm', 'm', - 0x27, 0x22, 0x27, 0x27, /* '" */ - '*', '~', '`', '`', /* `~ */ - 0xFF, 0xFF, 0xFF, 0xFF, /* Lshift (0x2a) */ - '<', '>', '\\', '\\', - 'w', 'W', 'w', 'w', - 'x', 'X', 'x', 'x', - 'c', 'C', 'c', 'c', - 'v', 'V', 'v', 'v', - 'b', 'B', 'b', 'b', - 'n', 'N', 'n', 'n', - ',', '?', ',', ',', - 0x2C, 0x3C, 0x2C, 0x2C, /* ,< */ - 0x2E, 0x3E, 0x2E, 0x2E, /* .> */ - 0x2F, 0x3F, 0x2F, 0x2F, /* /? */ - 0xFF, 0xFF, 0xFF, 0xFF, /* Rshift (0x36) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x37) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x38) */ - ' ', ' ', ' ', ' ', /* space */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x3a) */ - KEY_F1, 0xFF, 0xFF, 0xFF, /* (0x3b) */ - KEY_F2, 0xFF, 0xFF, 0xFF, /* (0x3c) */ - KEY_F3, 0xFF, 0xFF, 0xFF, /* (0x3d) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x3e) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x3f) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x40) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x41) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x42) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x43) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x44) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x45) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x46) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x47) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x48) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x49) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4a) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4b) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4c) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4d) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4e) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4f) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x50) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x51) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x52) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x53) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x54) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x55) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x56) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x57) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x58) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x59) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5a) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5b) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5c) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5d) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5e) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5f) */ - 0xFF, 0xFF, 0xFF, 0xFF, /* (0x60) */ - 0xFF, 0xFF, 0xFF, 0xFF /* (0x61) */ -}; - -# endif - -# include <Kernel.hpp> - -#endif diff --git a/includes/core/Module.hpp b/includes/core/Module.hpp @@ -6,12 +6,13 @@ enum { MODULE_FILESYSTEM, - MODULE_DEVICE + MODULE_DEVICE, + MODULE_KEYBOARD }; class Module : public File { public: - Module(char *name, u8 t) : File(name, t) {}; + Module(char *n, u8 t) : File(n, t), flags(t), name(n) {}; virtual u32 open(u32 flag) { return -1; }; virtual u32 close(void) { return -1; }; virtual u32 read(u32 pos, u8 *buffer, u32 size) { return -1; }; @@ -19,6 +20,9 @@ class Module : public File { virtual u32 ioctl(u32 id, u8 *buffer) { return -1; }; virtual u32 remove(void) { return -1; }; virtual void scan(void) {}; + + u8 flags; + char *name; }; # include <Kernel.hpp> diff --git a/includes/core/Modules.hpp b/includes/core/Modules.hpp @@ -6,22 +6,23 @@ extern Kernel __kern; # define MODULE_SIZE 255 -# define REGISTER_MODULE(m, r, n, name) m n(name, r) -# define import_module(m, n) extern m n; +# define import_module(m, r, n, name) m *n = new m(name, r); # define main_module void Modules::load_modules(void) -# define reg_module(n, z) __kern.io.loading(z); this->_tmp = (struct s_modules *)__kern.mem.kmalloc(sizeof(struct s_modules)); this->_tmp->m = &n; this->_tmp->name = z; this->_list[this->_mod_count++] = this->_tmp; __kern.io.done(); +# define reg_module(n) __kern.io.loading(n->name); this->_tmp = (struct s_modules *)__kern.mem.kmalloc(sizeof(struct s_modules)); this->_tmp->m = n; this->_tmp->name = n->name; this->_tmp->flags = n->flags; this->_list[this->_mod_count++] = this->_tmp; __kern.io.done(); class Module; struct s_modules { Module *m; const char *name; + u8 flags; }; class Modules { public: void init(void); void load_modules(void); + void call_keyboard(void); private: struct s_modules *_list[MODULE_SIZE]; diff --git a/kernel/Kernel.cpp b/kernel/Kernel.cpp @@ -4,7 +4,6 @@ extern Io __io; extern GDT __gdt; extern IDT __idt; extern Memory __mem; -extern Keyboard __keyboard; extern Modules __modules; Kernel __kern; @@ -34,8 +33,6 @@ void Kernel::init(multiboot_info *mbi) { this->gdt.init(); this->idt.init(); this->mem.init(mbi->high_mem); - this->keyboard = *(new Keyboard()); - this->keyboard.init(); this->fs = *(new FileSystem()); this->fs.init(); this->pt = *(new ProcessTable()); diff --git a/kernel/Keyboard.cpp b/kernel/Keyboard.cpp @@ -1,45 +0,0 @@ -# include <Keyboard.hpp> - -Keyboard __keyboard; - -void Keyboard::init(void) { - __kern.io.loading("Keyboard ..."); - this->_lshift = 0; - this->_rshift = 0; - this->_alt = 0; - this->_ctrl = 0; - this->_map = kbdmap_default; - __kern.io.done(); -} - -void Keyboard::get(void) { - u8 i; - - while ((__kern.io.ibyte(0x64) & 0x01) == 0); - i = __kern.io.ibyte(0x60) - 1; - if (i < 0x80) { - switch (i) { - case 0x29: this->_lshift = 1; break; - case 0x35: this->_rshift = 1; break; - case 0x1C: this->_ctrl = 1; break; - case 0x37: this->_alt = 1; break; - default: - if (this->_alt) { - __kern.io.putc(this->_map[i * 4 + 2]); - } else if (this->_rshift || this->_lshift) { - __kern.io.putc(this->_map[i * 4 + 1]); - } else { - __kern.io.putc(this->_map[i * 4]); - } - break; - } - } else { - i -= 0x80; - switch (i) { - case 0x29: this->_lshift = 0; break; - case 0x35: this->_rshift = 0; break; - case 0x1C: this->_ctrl = 0; break; - case 0x37: this->_alt = 0; break; - } - } -} diff --git a/kernel/Makefile b/kernel/Makefile @@ -1 +1 @@ -OBJS += kernel/main.o kernel/Io.o kernel/Kernel.o kernel/Memory.o kernel/Keyboard.o kernel/Process.o kernel/File.o kernel/FileSystem.o kernel/ProcessTable.o kernel/Modules.o +OBJS += kernel/main.o kernel/Io.o kernel/Kernel.o kernel/Memory.o kernel/Process.o kernel/File.o kernel/FileSystem.o kernel/ProcessTable.o kernel/Modules.o diff --git a/kernel/Modules.cpp b/kernel/Modules.cpp @@ -1,4 +1,5 @@ # include <Modules.hpp> +# include <Module.hpp> Modules __modules; @@ -14,4 +15,11 @@ void Modules::init(void) { this->load_modules(); } - +void Modules::call_keyboard(void) { + for (int i = 0; i < this->_mod_count; i++) { + if (this->_list[i]->flags == (MODULE_DEVICE | MODULE_KEYBOARD)) { + this->_list[i]->m->scan(); + break ; + } + } +} diff --git a/modules/x86/Makefile b/modules/x86/Makefile @@ -1 +1 @@ -OBJS += modules/$(ARCH)/modules_conf.o modules/$(ARCH)/ModuleTest.o +OBJS += modules/$(ARCH)/modules_conf.o modules/$(ARCH)/ModuleKeyboard.o diff --git a/modules/x86/ModuleKeyboard.cpp b/modules/x86/ModuleKeyboard.cpp @@ -0,0 +1,47 @@ +# include <ModuleKeyboard.hpp> + +ModuleKeyboard::ModuleKeyboard(char *name, u8 t) : Module(name, t) { + this->_lshift = 0; + this->_rshift = 0; + this->_alt = 0; + this->_ctrl = 0; + this->_map = kbdmap_default; + this->name = name; +} + +ModuleKeyboard::~ModuleKeyboard(void) { + +} + +void ModuleKeyboard::scan(void) { + u8 i; + + while ((__kern.io.ibyte(0x64) & 0x01) == 0); + i = __kern.io.ibyte(0x60) - 1; + if (i < 0x80) { + switch (i) { + case 0x29: this->_lshift = 1; break; + case 0x35: this->_rshift = 1; break; + case 0x1C: this->_ctrl = 1; break; + case 0x37: this->_alt = 1; break; + default: + if (this->_alt) { + __kern.io.putc(this->_map[i * 4 + 2]); + } else if (this->_rshift || this->_lshift) { + __kern.io.putc(this->_map[i * 4 + 1]); + } else { + __kern.io.putc(this->_map[i * 4]); + } + break; + } + } else { + i -= 0x80; + switch (i) { + case 0x29: this->_lshift = 0; break; + case 0x35: this->_rshift = 0; break; + case 0x1C: this->_ctrl = 0; break; + case 0x37: this->_alt = 0; break; + } + } + +} diff --git a/modules/x86/ModuleKeyboard.hpp b/modules/x86/ModuleKeyboard.hpp @@ -0,0 +1,148 @@ +#ifndef __MODULE_TEST__ +# define __MODULE_TEST__ +# define __DO_NOT_LOAD_MODULES__ + +# include <Module.hpp> + +class ModuleKeyboard : public Module { + public: + ModuleKeyboard(char *name, u8 t); + ~ModuleKeyboard(void); + + virtual void scan(void); + private: + u8 _lshift; + u8 _rshift; + u8 _alt; + u8 _ctrl; + char *_map; +}; + +// The following table is all the keys. No interest in it. + +extern "C" { + enum { + KEY_TAB = 7, + KEY_BACKSPACE = 8, + KEY_ENTER = 10, + KEY_ESCAPE = 27, + KEY_F1 = 255, + KEY_F2 = 254, + KEY_F3 = 253, + KEY_F4 = 252, + KEY_F5 = 251, + KEY_F6 = 250, + KEY_F7 = 249, + KEY_F8 = 248, + KEY_F9 = 247, + KEY_F10 = 246, + KEY_F11 = 245, + KEY_F12 = 244 + }; +}; + +# ifndef __MODULE_CONF__ + +char kbdmap_default[] = { + KEY_ESCAPE, KEY_ESCAPE, KEY_ESCAPE, KEY_ESCAPE, /* esc (0x01) */ + '1', '!', '1', '1', + '2', '@', '2', '2', + '3', '#', '3', '3', + '4', '$', '4', '4', + '5', '%', '5', '5', + '6', ':', '6', '6', + '7', '&', '7', '7', + '8', '*', '8', '8', + '9', '(', '9', '9', + '0', ')', '0', '0', + '-', '_', '-', '-', + '=', '+', '=', '=', + 0x08, 0x08, 0x7F, 0x08, /* backspace */ + 0x09, 0x09, 0x09, 0x09, /* tab */ + 'a', 'A', 'a', 'a', + 'z', 'Z', 'z', 'z', + 'e', 'E', 'e', 'e', + 'r', 'R', 'r', 'r', + 't', 'T', 't', 't', + 'y', 'Y', 'y', 'y', + 'u', 'U', 'u', 'u', + 'i', 'I', 'i', 'i', + 'o', 'O', 'o', 'o', + 'p', 'P', 'p', 'p', + '^', '"', '^', '^', + '$', '£', ' ', '$', + 0x0A, 0x0A, 0x0A, 0x0A, /* enter */ + 0xFF, 0xFF, 0xFF, 0xFF, /* ctrl */ + 'q', 'Q', 'q', 'q', + 's', 'S', 's', 's', + 'd', 'D', 'd', 'd', + 'f', 'F', 'f', 'f', + 'g', 'G', 'g', 'g', + 'h', 'H', 'h', 'h', + 'j', 'J', 'j', 'j', + 'k', 'K', 'k', 'k', + 'l', 'L', 'l', 'l', + 'm', 'M', 'm', 'm', + 0x27, 0x22, 0x27, 0x27, /* '" */ + '*', '~', '`', '`', /* `~ */ + 0xFF, 0xFF, 0xFF, 0xFF, /* Lshift (0x2a) */ + '<', '>', '\\', '\\', + 'w', 'W', 'w', 'w', + 'x', 'X', 'x', 'x', + 'c', 'C', 'c', 'c', + 'v', 'V', 'v', 'v', + 'b', 'B', 'b', 'b', + 'n', 'N', 'n', 'n', + ',', '?', ',', ',', + 0x2C, 0x3C, 0x2C, 0x2C, /* ,< */ + 0x2E, 0x3E, 0x2E, 0x2E, /* .> */ + 0x2F, 0x3F, 0x2F, 0x2F, /* /? */ + 0xFF, 0xFF, 0xFF, 0xFF, /* Rshift (0x36) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x37) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x38) */ + ' ', ' ', ' ', ' ', /* space */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x3a) */ + KEY_F1, 0xFF, 0xFF, 0xFF, /* (0x3b) */ + KEY_F2, 0xFF, 0xFF, 0xFF, /* (0x3c) */ + KEY_F3, 0xFF, 0xFF, 0xFF, /* (0x3d) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x3e) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x3f) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x40) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x41) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x42) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x43) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x44) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x45) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x46) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x47) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x48) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x49) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4a) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4b) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4c) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4d) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4e) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x4f) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x50) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x51) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x52) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x53) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x54) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x55) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x56) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x57) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x58) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x59) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5a) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5b) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5c) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5d) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5e) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x5f) */ + 0xFF, 0xFF, 0xFF, 0xFF, /* (0x60) */ + 0xFF, 0xFF, 0xFF, 0xFF /* (0x61) */ +}; + +# endif + +#endif diff --git a/modules/x86/ModuleTest.cpp b/modules/x86/ModuleTest.cpp @@ -1,4 +0,0 @@ -# include <ModuleTest.hpp> - - -REGISTER_MODULE(ModuleTest, MODULE_DEVICE, module_test, "module_test"); diff --git a/modules/x86/ModuleTest.hpp b/modules/x86/ModuleTest.hpp @@ -1,15 +0,0 @@ -#ifndef __MODULE_TEST__ -# define __MODULE_TEST__ -# define __DO_NOT_LOAD_MODULES__ - -# include <Module.hpp> - -class ModuleTest : public Module { - public: - ModuleTest(char *name, u8 t) : Module(name, t) { - __kern.io.puts("Hi there o/"); - }; - ~ModuleTest(void) {}; -}; - -#endif diff --git a/modules/x86/modules_conf.cpp b/modules/x86/modules_conf.cpp @@ -1,7 +1,13 @@ -# include <ModuleTest.hpp> +#ifndef __MODULE_CONF__ +# define __MODULE_CONF__ +# include <ModuleKeyboard.hpp> -import_module(ModuleTest, module_test); main_module { - reg_module(module_test, "module_test"); + // Importations Lines + import_module(ModuleKeyboard, MODULE_DEVICE | MODULE_KEYBOARD, module_keyboard, "module_keyboard"); + + // Creations lines + reg_module(module_keyboard); } +#endif diff --git a/modules/x86/modules_conf.h b/modules/x86/modules_conf.h @@ -1,7 +0,0 @@ -# include <ModuleTest.hpp> - -import_module(ModuleTest, module_test); - -main_module { - reg_module(module_test, "module_test"); -}