bootcon.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* Boot console: the earliest on-screen output.
  2. *
  3. * Draws 8x8 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.
  9. */
  10. #ifndef BOOTCON_H
  11. #define BOOTCON_H
  12. #define BOOTCON_LOG_PAGES 8
  13. void bootcon_init(void);
  14. int bootcon_ok(void);
  15. void bootcon_set_enabled(int on);
  16. void bootcon_puts(const char *s);
  17. void bootcon_dec(unsigned int v);
  18. void bootcon_hex(unsigned int v);
  19. /* One line with the cached mode geometry and LFB address. */
  20. void bootcon_fb_info(void);
  21. /* Allocate the RAM log after the page allocator is up. The buffer is taken
  22. * from the frame allocator, not BSS: the low rootfs pack limits _end to
  23. * 0x60000 and a 16 KB static log would overlap it. */
  24. void bootcon_log_init(void);
  25. /* Everything written through bootcon_puts() after bootcon_log_init(),
  26. * including text produced after the WM has taken over the framebuffer. The
  27. * returned buffer is NUL terminated; *len is the number of valid bytes. */
  28. const char *bootcon_log(unsigned int *len);
  29. int bootcon_log_truncated(void);
  30. #endif