RASOPS(9)

πŸ“¦
version 11.0 Β· 2 versions
, in nixpkgs unstable

πŸ’… RASOPS(9) β€” like, the raster display operations page, bestie

okay so this is the RASOPS(9) man page from the Kernel Developer's Manual, and it's genuinely iconic for anyone doing console/framebuffer stuff ✨ pull up a chair, we're learning raster ops together 🫢


🌸 NAME 🌸

rasops, rasops_init, rasops_reconfig β€” raster display operations. that's the whole vibe, no cap.

✨ SYNOPSIS ✨

#include <dev/rasops/rasops.h>

int
rasops_init(struct rasops_info *ri, int wantrows, int wantcols);

int
rasops_reconfig(struct rasops_info *ri, int wantrows, int wantcols);

options RASOPS_DEFAULT_WIDTH=80
options RASOPS_DEFAULT_HEIGHT=25

look at that, so clean πŸ”₯

πŸŽ€ DESCRIPTION πŸŽ€

so the rasops subsystem is literally just a set of raster operations for wscons(9). that's it. that's the whole thing. main character energy fr.

the primary data type you'll be living in is the rasops_info structure, which lives in <dev/rasops/rasops.h> πŸ’–

πŸ’« valid values for the ri_flg member πŸ’«

  • RI_FULLCLEAR β€” it's the eraserows() hack to clear the whole screen
  • RI_FORCEMONO β€” you get monochrome output even if we could do color (we could, but we're choosing not to, and honestly? valid)
  • RI_BSWAP β€” the framebuffer endianness doesn't match the CPU 😭 they're not on the same page at all
  • RI_CURSOR β€” the cursor is switched on
  • RI_CLEAR β€” clears the display on startup, fresh slate vibes
  • RI_CENTER β€” centers onscreen output 🎯
  • RI_CURSORCLIP β€” the cursor is currently clipped
  • RI_CFGDONE β€” rasops_reconfig() completed successfully βœ…
  • RI_NO_AUTO β€” do not generate box drawing characters for ISO fonts. use this when it is not safe to allocate memory, for example when you're setting up an early console ⚠️ like, respect the constraint.
  • RI_ENABLE_ALPHA β€” this one tells everyone the caller supports anti-aliased fonts in the given colour depth. and heads up: without this flag, rasops_init() will only pick bitmap fonts. so if you want the fancy fonts, set the flag, iykyk πŸ¦‹
  • RI_8BIT_IS_RGB β€” the caller uses an R3G3B2 colour map in 8 bit. rasops_init() will generate an appropriate ri_devcmap[], but the caller still needs to set up the actual colour map itself. team effort, bestie 🫢

πŸ‘‘ FUNCTIONS πŸ‘‘

rasops_init() initialises a rasops_info descriptor. rasops_reconfig() is the one you call to reconfigure it if the parameters have changed in some way. glow-up time πŸ’…

the arguments wantrows and wantcols are the number of rows and columns we'd like. passing zero for either one of them uses the default β€” normally 80 by 25, but it can be changed with the config options RASOPS_DEFAULT_WIDTH and RASOPS_DEFAULT_HEIGHT.

🌈 optimization tea 🌈

in terms of optimization, bitmap fonts of width 8 or 16 work the best for all depths. and for depths other than 1, the fonts of width 12 are also optimized. that's the whole performance lore, screenshot it πŸ“Έ

⚠️ important, don't skip this one: if you're calling rasops_reconfig() to change the font and ri_wsfcookie is non-negative, you must call wsfont_unlock() on it, and reset it to -1 or a new, valid cookie. like, mandatory. no vibes-based skipping πŸ™ˆ

πŸ¦‹ CODE REFERENCES πŸ¦‹

the rasops subsystem is implemented within the directory sys/dev/rasops. the rasops module itself is implemented within the file sys/dev/rasops/rasops.c. go look, it's all there πŸ’œ

⭐ SEE ALSO ⭐

intro(9), wscons(9), wsdisplay(9), wsfont(9) β€” the whole friend group, go say hi 🫢

🌸 HISTORY 🌸

the rasops subsystem appeared in NetBSD 1.5. vintage. iconic. periodt.

πŸ’– AUTHORS πŸ’–

the rasops subsystem was written by Andrew Doran ad@NetBSD.org. thank you for your service king πŸ‘‘


and that's the page!! this version was brought to you by the Debian crew, dated August 7, 2019 β€” mwah, hope this helped bestie, go forth and rasterize responsibly πŸ§šπŸ’œ

πŸ“¦ where this page comes from