mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[fb] Create fb driver
Create a new framebuffer driver. Also hackily passing frame buffer size in the list of init handles to all processes and mapping the framebuffer into all processes. Changed bootloader passing frame buffer as a module to its own struct.
This commit is contained in:
41
src/drivers/fb/main.cpp
Normal file
41
src/drivers/fb/main.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "j6/types.h"
|
||||
#include "j6/errors.h"
|
||||
#include "j6/signals.h"
|
||||
|
||||
#include <j6libc/syscalls.h>
|
||||
|
||||
extern "C" {
|
||||
void _init_libc(j6_process_init *);
|
||||
int main(int, const char **);
|
||||
}
|
||||
|
||||
j6_handle_t sys = j6_handle_invalid;
|
||||
size_t size = 0;
|
||||
|
||||
void
|
||||
_init_libc(j6_process_init *init)
|
||||
{
|
||||
sys = init->handles[0];
|
||||
size = reinterpret_cast<size_t>(init->handles[1]);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, const char **argv)
|
||||
{
|
||||
_syscall_system_log("fb driver starting");
|
||||
|
||||
if (size == 0)
|
||||
return 1;
|
||||
|
||||
uint32_t *fb = reinterpret_cast<uint32_t*>(0x100000000);
|
||||
for (size_t i=0; i < size/4; ++i) {
|
||||
fb[i] = 0xff;
|
||||
}
|
||||
|
||||
_syscall_system_log("fb driver done, exiting");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user