/* Boot console: the earliest on-screen output. * * Draws 8x16 text straight into the boot framebuffer described at 0x600. It * needs no heap, no paging (the LFB is identity-accessible), no drivers and * no shadow buffer, so it can be the first C code in kernel_main. Purpose: * stage tracing on machines without serial, and a last visible screen if the * kernel wedges before the WM paints. The WM's first frame covers it; * bootcon_set_enabled(0) stops drawing before that happens. The face, cell * grid and top-left origin match the BIOS loader text and the ring-3 * terminal, and a full screen scrolls instead of wrapping. */ #ifndef BOOTCON_H #define BOOTCON_H #define BOOTCON_LOG_PAGES 8 void bootcon_init(void); int bootcon_ok(void); void bootcon_set_enabled(int on); void bootcon_puts(const char *s); /* Switch drawing to the LFB's kernel address once paging is on (the LFB may * live in the ioremap window, not at its physical address); 0 is ignored. */ void bootcon_set_lfb(void *va); void bootcon_dec(unsigned int v); void bootcon_hex(unsigned int v); /* One line with the cached mode geometry and LFB address. */ void bootcon_fb_info(void); /* Allocate the RAM log after the page allocator is up. The buffer is taken * from the frame allocator, not BSS, to keep _end below the 0x90000 wall. */ void bootcon_log_init(void); /* Everything written through bootcon_puts() after bootcon_log_init(), * including text produced after the WM has taken over the framebuffer. The * returned buffer is NUL terminated; *len is the number of valid bytes. */ const char *bootcon_log(unsigned int *len); int bootcon_log_truncated(void); #endif