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,15 +87,11 @@ void kmain(void) {
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// Ensure we got a framebuffer.
|
// Ensure we got a framebuffer.
|
||||||
if (framebuffer_request.response == NULL
|
if (framebuffer_request.response != NULL) {
|
||||||
|| framebuffer_request.response->framebuffer_count < 1) {
|
|
||||||
hcf();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch the first framebuffer.
|
// Fetch the first framebuffer.
|
||||||
struct limine_framebuffer *framebuffer = framebuffer_request.response->framebuffers[0];
|
struct limine_framebuffer *framebuffer = framebuffer_request.response->framebuffers[0];
|
||||||
fb = framebuffer;
|
fb = framebuffer;
|
||||||
((uint32_t*)fb->address)[0] = 0xFFFFFF;
|
|
||||||
|
|
||||||
ft_ctx = flanterm_fb_init(
|
ft_ctx = flanterm_fb_init(
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -112,10 +108,6 @@ void kmain(void) {
|
||||||
0, 0,
|
0, 0,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!ft_ctx) {
|
|
||||||
asm("cli");
|
|
||||||
asm("hlt");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n Soaplin 1.0-sild is booting up your computer...\n\n");
|
printf("\n Soaplin 1.0-sild is booting up your computer...\n\n");
|
||||||
|
@ -127,10 +119,6 @@ void kmain(void) {
|
||||||
|
|
||||||
sse_init();
|
sse_init();
|
||||||
|
|
||||||
float hi = 0.1;
|
|
||||||
hi = hi + 1.1;
|
|
||||||
log("fp: %2.6f\n", hi);
|
|
||||||
|
|
||||||
pmm_init();
|
pmm_init();
|
||||||
vmm_init();
|
vmm_init();
|
||||||
kernel_vma_context = vma_create_context(vmm_kernel_pm);
|
kernel_vma_context = vma_create_context(vmm_kernel_pm);
|
||||||
|
|
|
@ -9,6 +9,7 @@ void log(char *format, ...) {
|
||||||
// TODO: replace this call with a call to printf() when the RTC is implemented.
|
// TODO: replace this call with a call to printf() when the RTC is implemented.
|
||||||
char *date = "1970-01-01 00:00:00 | ";
|
char *date = "1970-01-01 00:00:00 | ";
|
||||||
int i2 = 0; for (i2; date[i2] != 0; i2++);;
|
int i2 = 0; for (i2; date[i2] != 0; i2++);;
|
||||||
|
if (ft_ctx)
|
||||||
flanterm_write(ft_ctx, date, i2);
|
flanterm_write(ft_ctx, date, i2);
|
||||||
|
|
||||||
char buf[2048];
|
char buf[2048];
|
||||||
|
@ -18,6 +19,7 @@ void log(char *format, ...) {
|
||||||
va_end(l);
|
va_end(l);
|
||||||
|
|
||||||
int i = 0; for (i; buf[i] != 0; i++);;
|
int i = 0; for (i; buf[i] != 0; i++);;
|
||||||
|
if (ft_ctx)
|
||||||
flanterm_write(ft_ctx, buf, i);
|
flanterm_write(ft_ctx, buf, i);
|
||||||
|
|
||||||
for (int i=0;;i++) {
|
for (int i=0;;i++) {
|
||||||
|
|
|
@ -26,5 +26,7 @@ void printf(char *format, ...) {
|
||||||
|
|
||||||
//rt_print(buf);
|
//rt_print(buf);
|
||||||
int i = 0; for (i; buf[i] != 0; i++);;
|
int i = 0; for (i; buf[i] != 0; i++);;
|
||||||
|
|
||||||
|
if (ft_ctx)
|
||||||
flanterm_write(ft_ctx, buf, i);
|
flanterm_write(ft_ctx, buf, i);
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue