working on exposing vga to userspace
This commit is contained in:
16
rocklibc/include/sys/video.h
Normal file
16
rocklibc/include/sys/video.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef USER_VIDEO_H
|
||||
#define USER_VIDEO_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define FBIOGET_INFO 0x1
|
||||
|
||||
typedef struct {
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t pitch;
|
||||
uint32_t bpp;
|
||||
uint32_t fb_size;
|
||||
} fb_info_t;
|
||||
|
||||
#endif
|
||||
@@ -17,6 +17,8 @@
|
||||
#define SYS_DUP2 23
|
||||
#define SYS_LSEEK 24
|
||||
#define SYS_WAIT 25
|
||||
#define SYS_MMAP 26
|
||||
#define SYS_IOCTL 27
|
||||
|
||||
int open(const char* path);
|
||||
int write(int fd, const void *buf, size_t count);
|
||||
@@ -25,6 +27,8 @@ int close(int fd);
|
||||
|
||||
int lseek(int fd, size_t offset, int whence);
|
||||
|
||||
void* mmap(int fd);
|
||||
|
||||
void exit(int status) __attribute__((noreturn));
|
||||
|
||||
void* sbrk(int32_t increment);
|
||||
@@ -37,4 +41,6 @@ int exec(const char* path);
|
||||
int dup2(int src, int dst);
|
||||
int waitpid(int pid, int* status);
|
||||
|
||||
int ioctl(int fd, uint32_t request, void* arg);
|
||||
|
||||
#endif
|
||||
@@ -73,4 +73,12 @@ void* sbrk(int32_t increment) {
|
||||
|
||||
int brk(void *addr) {
|
||||
return syscall1(SYS_BRK, (uint32_t)addr);
|
||||
}
|
||||
|
||||
void* mmap(int fd) {
|
||||
return (void*)syscall1(SYS_MMAP, fd);
|
||||
}
|
||||
|
||||
int ioctl(int fd, uint32_t request, void* arg) {
|
||||
return syscall3(SYS_IOCTL, fd, request, arg);
|
||||
}
|
||||
Reference in New Issue
Block a user