bootcon.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* Boot console: the earliest on-screen output.
  2. *
  3. * Draws 8x16 text straight into the boot framebuffer described at 0x600. It
  4. * needs no heap, no paging (the LFB is identity-accessible), no drivers and
  5. * no shadow buffer, so it can be the first C code in kernel_main. Purpose:
  6. * stage tracing on machines without serial, and a last visible screen if the
  7. * kernel wedges before the WM paints. The WM's first frame covers it;
  8. * bootcon_set_enabled(0) stops drawing before that happens. The face, cell
  9. * grid and top-left origin match the BIOS loader text and the ring-3
  10. * terminal, and a full screen scrolls instead of wrapping.
  11. */
  12. #ifndef BOOTCON_H
  13. #define BOOTCON_H
  14. #define BOOTCON_LOG_PAGES 8
  15. void bootcon_init(void);
  16. int bootcon_ok(void);
  17. void bootcon_set_enabled(int on);
  18. void bootcon_puts(const char *s);
  19. void bootcon_dec(unsigned int v);
  20. void bootcon_hex(unsigned int v);
  21. /* One line with the cached mode geometry and LFB address. */
  22. void bootcon_fb_info(void);
  23. /* Allocate the RAM log after the page allocator is up. The buffer is taken
  24. * from the frame allocator, not BSS, to keep _end below the 0x90000 wall. */
  25. void bootcon_log_init(void);
  26. /* Everything written through bootcon_puts() after bootcon_log_init(),
  27. * including text produced after the WM has taken over the framebuffer. The
  28. * returned buffer is NUL terminated; *len is the number of valid bytes. */
  29. const char *bootcon_log(unsigned int *len);
  30. int bootcon_log_truncated(void);
  31. #endif