kernel: add support for running without any framebuffer
This commit is contained in:
parent
17e6219f24
commit
2d4031eacc
3 changed files with 27 additions and 35 deletions
|
@ -87,35 +87,27 @@ void kmain(void) {
|
|||
}*/
|
||||
|
||||
// Ensure we got a framebuffer.
|
||||
if (framebuffer_request.response == NULL
|
||||
|| framebuffer_request.response->framebuffer_count < 1) {
|
||||
hcf();
|
||||
}
|
||||
if (framebuffer_request.response != NULL) {
|
||||
|
||||
// Fetch the first framebuffer.
|
||||
struct limine_framebuffer *framebuffer = framebuffer_request.response->framebuffers[0];
|
||||
fb = framebuffer;
|
||||
|
||||
// Fetch the first framebuffer.
|
||||
struct limine_framebuffer *framebuffer = framebuffer_request.response->framebuffers[0];
|
||||
fb = framebuffer;
|
||||
((uint32_t*)fb->address)[0] = 0xFFFFFF;
|
||||
|
||||
ft_ctx = flanterm_fb_init(
|
||||
NULL,
|
||||
NULL,
|
||||
framebuffer->address, framebuffer->width, framebuffer->height, framebuffer->pitch,
|
||||
framebuffer->red_mask_size, framebuffer->red_mask_shift,
|
||||
framebuffer->green_mask_size, framebuffer->green_mask_shift,
|
||||
framebuffer->blue_mask_size, framebuffer->blue_mask_shift,
|
||||
NULL,
|
||||
NULL, NULL,
|
||||
NULL, &fg,
|
||||
NULL, NULL,
|
||||
VGA8, 8, 16, 0,
|
||||
0, 0,
|
||||
0
|
||||
);
|
||||
|
||||
if (!ft_ctx) {
|
||||
asm("cli");
|
||||
asm("hlt");
|
||||
ft_ctx = flanterm_fb_init(
|
||||
NULL,
|
||||
NULL,
|
||||
framebuffer->address, framebuffer->width, framebuffer->height, framebuffer->pitch,
|
||||
framebuffer->red_mask_size, framebuffer->red_mask_shift,
|
||||
framebuffer->green_mask_size, framebuffer->green_mask_shift,
|
||||
framebuffer->blue_mask_size, framebuffer->blue_mask_shift,
|
||||
NULL,
|
||||
NULL, NULL,
|
||||
NULL, &fg,
|
||||
NULL, NULL,
|
||||
VGA8, 8, 16, 0,
|
||||
0, 0,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
printf("\n Soaplin 1.0-sild is booting up your computer...\n\n");
|
||||
|
@ -127,10 +119,6 @@ void kmain(void) {
|
|||
|
||||
sse_init();
|
||||
|
||||
float hi = 0.1;
|
||||
hi = hi + 1.1;
|
||||
log("fp: %2.6f\n", hi);
|
||||
|
||||
pmm_init();
|
||||
vmm_init();
|
||||
kernel_vma_context = vma_create_context(vmm_kernel_pm);
|
||||
|
|
|
@ -9,7 +9,8 @@ void log(char *format, ...) {
|
|||
// TODO: replace this call with a call to printf() when the RTC is implemented.
|
||||
char *date = "1970-01-01 00:00:00 | ";
|
||||
int i2 = 0; for (i2; date[i2] != 0; i2++);;
|
||||
flanterm_write(ft_ctx, date, i2);
|
||||
if (ft_ctx)
|
||||
flanterm_write(ft_ctx, date, i2);
|
||||
|
||||
char buf[2048];
|
||||
va_list l;
|
||||
|
@ -18,7 +19,8 @@ void log(char *format, ...) {
|
|||
va_end(l);
|
||||
|
||||
int i = 0; for (i; buf[i] != 0; i++);;
|
||||
flanterm_write(ft_ctx, buf, i);
|
||||
if (ft_ctx)
|
||||
flanterm_write(ft_ctx, buf, i);
|
||||
|
||||
for (int i=0;;i++) {
|
||||
if (date[i] == '\0')
|
||||
|
|
|
@ -26,5 +26,7 @@ void printf(char *format, ...) {
|
|||
|
||||
//rt_print(buf);
|
||||
int i = 0; for (i; buf[i] != 0; i++);;
|
||||
flanterm_write(ft_ctx, buf, i);
|
||||
|
||||
if (ft_ctx)
|
||||
flanterm_write(ft_ctx, buf, i);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue