Debug startup tasks

Updated: October 28, 2024

In addition to the debug kernel callouts, the startup code must provide some functions that enable it to output the debug information.

Note: For information about the kernel callouts the startup code provides, and instructions on how to modify existing kernel callouts or write your own, see the Kernel Callouts chapter.
The functions required to output debug information include:

These functions don't need to be position-independent, so they can be written in C. Both the startup debug functions and the kernel debug callouts are specified in a structure that is often set up in the startup code’s main() function. For example:

const struct debug_device debug_devices[] = {
    {   "console",
        {    "",
            NULL
        },
        init_vga,
        put_vga,
        {   &display_char_vga,
            &poll_key_pckbd,
        }
    },
    {   "8250",
        {   "0x3f8^0.57600.1843200.16",
            "0x2f8^0.57600.1843200.16"
        },
        init_8250,
        put_8250,
        {   &display_char_8250,
            &poll_key_8250,
            &break_detect_8250,
        }
    },
};