Возврат текущего фреймбуффера ядром

This commit is contained in:
Aren Elchinyan 2023-12-16 00:13:37 +03:00
parent f4d5158799
commit b909a5f963
3 changed files with 13 additions and 4 deletions

View File

@ -64,7 +64,7 @@ typedef struct {
typedef struct {
uint64_t offset;
void (*fb_printf)(char *str, ...); // Временная функция
framebuffer_t *(*alloc_framebuffer)( );
framebuffer_t (*alloc_framebuffer)( );
void (*free_framebuffer)(framebuffer_t *frame);
void *(*alloc)(uint64_t size);
void (*free)(void *ptr);

View File

@ -12,11 +12,20 @@
#include <sys.h>
module_info_t *current_module;
extern uint32_t *fb_addr;
extern uint32_t text_color;
extern uint32_t background;
extern uint64_t width;
extern uint64_t height;
extern uint64_t pitch;
extern uint16_t bpp;
void sys_init( ) {}
static framebuffer_t *sys_alloc_framebuffer( ) {
return (framebuffer_t *)0;
static framebuffer_t sys_alloc_framebuffer( ) {
return (framebuffer_t){
.address = fb_addr, .width = width, .height = height, .pitch = pitch, .bpp = bpp, .reserved = 0
};
}
static void sys_free_framebuffer(framebuffer_t *frame) {

View File

@ -97,7 +97,7 @@ typedef struct {
typedef struct {
uint64_t offset;
void (*fb_printf)(char *str, ...);
framebuffer_t *(*alloc_framebuffer)( );
framebuffer_t (*alloc_framebuffer)( );
void (*free_framebuffer)(framebuffer_t *frame);
void *(*alloc)(uint64_t size);
void (*free)(void *ptr);