INTRO(9)

πŸ’– INTRO(9) πŸ’–

okay so welcome to section 9 of the Kernel Developer's Manual bestie, this is literally the intro page and it's your little backstage pass to the kernel ✨


🌸 NAME 🌸

intro β€” introduction to system kernel interfaces 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

This section contains information about the interfaces and subroutines in the kernel. that's it that's the whole vibe, it's the lore hub for kernel devs πŸ’…


✨ PROTOTYPES ANSI-C AND ALL THAT ✨

Yes please. 😌

We would like all code to be fully prototyped. no cap, all of it.

If your code compiles cleanly with cc -Wall we would feel happy about it. πŸ₯° and listen β€” it is important to understand that this is not a question of just shutting up cc, it is a question about avoiding the things it complains about. to put it bluntly: do not hide the problem by casting and other obfuscating practices, solve the problem. periodt. πŸ’€

not me watching you slap a cast on a warning and call it a day… girl no. fix it fr fr πŸ™ˆ

πŸŽ€ INDENTATION AND STYLE πŸŽ€

Believe it or not, there actually exists a guide for indentation and style. it is not generally applied though. 😭 (we know. we know.)

We would appreciate if people would pay attention to it, and at least not violate it blatantly. like, minimum effort babes 🫢

We do not mind it too badly if you have your own style, but please make sure we can read it too. main character energy is fine as long as the rest of us can follow the plot 🌈

Please take time to read style(9) for more information. go read it. right now. it's giving required reading πŸ‘‘


πŸ‘‘ NAMING THINGS πŸ‘‘

Some general rules exist:

  1. If a function is meant as a debugging aid in DDB, it should be enclosed in
#ifdef DDB

#endif /* DDB */

And the name of the procedure should start with the prefix DDB_ to clearly identify the procedure as a debugger routine. πŸ’…


πŸ’œ SCOPE OF SYMBOLS πŸ’œ

It is important to carefully consider the scope of symbols in the kernel. the default is to make everything static, unless some reason requires the opposite. πŸ”₯

There are several reasons for this policy, the main one is that the kernel is one monolithic name-space, and pollution is not a good idea here either. one giant shared namespace bestie, we are not trashing it 🧚

For device drivers and other modules that do not add new internal interfaces to the kernel, the entire source should be in one file if possible. that way all symbols can be made static. slay, tidy, contained ✨

If for some reason a module is split over multiple source files, then try to split the module along some major fault-line and consider using the number of global symbols as your guide. the fewer the better. ⭐


🌈 SEE ALSO 🌈


⭐ HISTORY ⭐

The intro section manual page appeared in FreeBSD 2.2. iconic behavior honestly 🌸


and that's the whole page bestie!! this one came out of Debian and it's dated December 13, 1995 β€” ancient. vintage. a classic. go write some fully-prototyped, -Wall-clean, properly-static-ed code now, i believe in you πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from