x86_64: e9out device

This commit is contained in:
Matheus
2022-11-04 15:48:02 -03:00
parent f85f79f223
commit 62f51d638f
3 changed files with 31 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#include <kernel/devman.h>
#include <arch/e9.h>
#include <sys/stat.h>
#include <stddef.h>
#include <stdint.h>
static int write(int* error, int minor, void* buff, size_t count, size_t offset){
char* b = buff;
for(uintmax_t i = 0; i < count; ++i)
e9_putc(b[i]);
*error = 0;
return count;
}
static devcalls calls = {
.write = write
};
void e9out_init(){
devman_newdevice("e9out", TYPE_CHARDEV, MAJOR_E9OUT, 0, &calls);
}
+2
View File
@@ -66,6 +66,8 @@ void kmain(){
consoledev_init();
pseudodevs_init();
e9out_init();
fb_init();
+1
View File
@@ -10,6 +10,7 @@
#define MAJOR_FULL 4
#define MAJOR_FB 5
#define MAJOR_KB 6
#define MAJOR_E9OUT 7
typedef struct{
int (*read)(int* error, int minor, void* buff, size_t count, size_t offset);