mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
x86_64: e9out device
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
@@ -66,6 +66,8 @@ void kmain(){
|
|||||||
consoledev_init();
|
consoledev_init();
|
||||||
|
|
||||||
pseudodevs_init();
|
pseudodevs_init();
|
||||||
|
|
||||||
|
e9out_init();
|
||||||
|
|
||||||
fb_init();
|
fb_init();
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#define MAJOR_FULL 4
|
#define MAJOR_FULL 4
|
||||||
#define MAJOR_FB 5
|
#define MAJOR_FB 5
|
||||||
#define MAJOR_KB 6
|
#define MAJOR_KB 6
|
||||||
|
#define MAJOR_E9OUT 7
|
||||||
|
|
||||||
typedef struct{
|
typedef struct{
|
||||||
int (*read)(int* error, int minor, void* buff, size_t count, size_t offset);
|
int (*read)(int* error, int minor, void* buff, size_t count, size_t offset);
|
||||||
|
|||||||
Reference in New Issue
Block a user