diff --git a/common/protos/limine.c b/common/protos/limine.c index 37c3a267..6401e2f8 100644 --- a/common/protos/limine.c +++ b/common/protos/limine.c @@ -494,12 +494,14 @@ FEAT_START fb = fbinfo; + if (terminal_request->callback != 0) { #if defined (__i386__) - term_callback = stivale2_term_callback; - stivale2_term_callback_ptr = terminal_request->callback; + term_callback = stivale2_term_callback; + stivale2_term_callback_ptr = terminal_request->callback; #elif defined (__x86_64__) - term_callback = (void *)terminal_request->callback; + term_callback = (void *)terminal_request->callback; #endif + } term_arg = reported_addr(terminal); @@ -731,7 +733,7 @@ FEAT_START memmap_request->response = reported_addr(memmap_response); FEAT_END - // Clear terminal for kernels that will use the stivale2 terminal + // Clear terminal for kernels that will use the Limine terminal term_write((uint64_t)(uintptr_t)("\e[2J\e[H"), 7); term_runtime = true; diff --git a/common/protos/stivale2.c b/common/protos/stivale2.c index 26161e22..8080ebf3 100644 --- a/common/protos/stivale2.c +++ b/common/protos/stivale2.c @@ -555,12 +555,14 @@ failed_to_load_header_section: if (terminal_hdr_tag->flags & (1 << 0)) { // We provide callback tag->flags |= (1 << 2); + if (terminal_hdr_tag->callback != 0) { #if defined (__i386__) - term_callback = stivale2_term_callback; - stivale2_term_callback_ptr = terminal_hdr_tag->callback; + term_callback = stivale2_term_callback; + stivale2_term_callback_ptr = terminal_hdr_tag->callback; #elif defined (__x86_64__) - term_callback = (void *)terminal_hdr_tag->callback; + term_callback = (void *)terminal_hdr_tag->callback; #endif + } } // We provide max allowed string length