Files
jsix_import/src/drivers/fb/main.cpp
Justin C. Miller 5787aff866 [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.
2020-12-27 18:49:38 -08:00

42 lines
693 B
C++

#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;
}