-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev: Add devenum and devmsg syscalls
- Loading branch information
Showing
16 changed files
with
232 additions
and
148 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef CRESCENT_DEV_H | ||
#define CRESCENT_DEV_H | ||
|
||
typedef enum { | ||
DEVICE_TYPE_SOUND, | ||
DEVICE_TYPE_FB, | ||
DEVICE_TYPE_STORAGE, | ||
DEVICE_TYPE_MAX | ||
} DeviceType; | ||
|
||
#define DEVMSG_INFO 0 | ||
|
||
#define DEVMSG_SND_MAP 1 | ||
|
||
#define DEVMSG_FB_INFO 1 | ||
#define DEVMSG_FB_MAP 2 | ||
|
||
#endif |
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
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,17 +1,14 @@ | ||
#pragma once | ||
#include "types.h" | ||
#include "crescent/fb.h" | ||
#include "sys/dev.h" | ||
|
||
void fb_set_pixel(SysFramebuffer* self, usize x, usize y, u32 color); | ||
u32 fb_get_pixel(SysFramebuffer* self, usize x, usize y); | ||
void fb_clear(SysFramebuffer* self, u32 color); | ||
typedef struct FbDev { | ||
GenericDevice generic; | ||
void* base; | ||
SysFramebufferInfo info; | ||
} FbDev; | ||
|
||
typedef struct LinkedSysFramebuffer { | ||
struct LinkedSysFramebuffer* next; | ||
SysFramebuffer fb; | ||
} LinkedSysFramebuffer; | ||
|
||
void sys_fb_add(LinkedSysFramebuffer* fb); | ||
void sys_fb_get(SysFramebuffer* res, usize* count); | ||
|
||
extern SysFramebuffer* primary_fb; | ||
void fb_set_pixel(FbDev* self, usize x, usize y, u32 color); | ||
u32 fb_get_pixel(FbDev* self, usize x, usize y); | ||
void fb_clear(FbDev* self, u32 color); |
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 | ||
|
||
typedef struct SysFramebuffer SysFramebuffer; | ||
typedef struct FbDev FbDev; | ||
|
||
void fbcon_init(SysFramebuffer* fb, const void* font); | ||
void fbcon_init(FbDev* fb, const void* font); |
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,2 +1,3 @@ | ||
target_sources(crescent PRIVATE | ||
syscalls.c) | ||
syscalls.c | ||
dev.c) |
Oops, something went wrong.