add_preferred_console(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… add_preferred_console(9)

okay so you're reading a page from the Kernel API Manual β€” yes, the kernel, the literal main character of your whole computer β€” and this one's about telling the kernel which console it should be obsessed with. let's get into it πŸŽ€


✨ NAME ✨

add_preferred_console β€” adds a device to the list of preferred consoles. that's it, that's the whole vibe 🫢


🌸 SYNOPSIS 🌸

int add_preferred_console (const char *name , const short idx , char
       *options );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • name β€” the device name πŸ’« like, who is this console
  • idx β€” the device index πŸ”’ which one of them, bestie
  • options β€” the options for this console πŸŽ€ all the little extras it gets

πŸ’– DESCRIPTION πŸ’–

okay so the tea is: the last preferred console you add is the one that gets used for kernel messages and for stdin/out/err for init. last one in wins, no cap, main character energy πŸ‘‘

normally this is used by console_setup above to handle user-supplied console arguments β€” like when you type console stuff on the kernel command line and it's like "say less, i got you" πŸ’…

but also!! it can be used by arch-specific code, either to override the user, or β€” more commonly β€” to provide a default console (ie from PROM variables) when the user has not supplied one. so if the user ghosted the console args, arch code can step in and be like "don't worry bestie, i'll pick" 🧚


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./kernel/printk/printk.c β€” and honestly the whole friend group:


ngl, that's a long SEE ALSO. the printk girlies stay booked and busy 😭 but every single one of them is listed up there, so go click around, iykyk ⭐

🌈 and that's the page!! this one lives in ./kernel/printk and the version date on it is October 2026 β€” so yeah, she's from the future, iconic behavior honestly πŸ‘‘πŸ’œ stay slay, read your manpages, and may your console always be the preferred one πŸ’…βœ¨

πŸ“¦ where this page comes from