RASOPS(9)
π 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 theeraserows()hack to clear the whole screenRI_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 allRI_CURSORβ the cursor is switched onRI_CLEARβ clears the display on startup, fresh slate vibesRI_CENTERβ centers onscreen output π―RI_CURSORCLIPβ the cursor is currently clippedRI_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 anR3G3B2colour map in 8 bit.rasops_init()will generate an appropriateri_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 callingrasops_reconfig()to change the font andri_wsfcookieis non-negative, you must callwsfont_unlock()on it, and reset it to-1or 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
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2001 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms