12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VCONS (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> VCONS (9)<strong>NAME</strong>vcons —generic virtual console frameworkSYNOPSIS#include intvcons_init(struct vcons_data ∗vd , void ∗cookie ,struct wsscreen_descr ∗desc , struct wsdisplay_accessops ∗accops);intvcons_init_screen(struct vcons_data ∗vd , struct vcons_screen ∗scr ,int exists , long ∗defattr);voidvcons_redraw_screen(struct vcons_screen ∗scr);DESCRIPTIONThese functions are used to setup and control the generic virtual console framework.The vcons_init() function initializes the framework, it needs to be called for each driver that’s going touse vcons.vcons_init_screen() adds a virtual screen to a display.vcons_redraw_screen() redraws a screen. Adriver should call it when returning to terminal emulationmode, for instance when X exits.struct vcons_data contains all information needed to manage virtual consoles on a display, usually itwill be a member of the driver’s softc.struct vcons_screen describes a virtual screen.USAGETo use vcons with a driver itneeds to be initialized by calling vcons_init(), usually in the driver’s attachfunction.vdcookiedescaccopsshould be a pointer to the driver’s struct vcons_data.should be a pointer to the driver’s softc.should point to a struct wsscreen_descr describing the default screen type for this display.points to the driver’s struct wsdisplay_accessops so vcons_init() can fill it inwith its own implementations of alloc_screen(), free_screen(), andshow_screen().Adriver should however provide its own ioctl() and mmap() implementations. Both will receive a pointerto the driver’s struct vcons_data as first parameter.After initialization the driver needs to provide a callback function that will be called whenever ascreen isadded. Its purpose is to set up the struct rasops_info describing the screen. After that the drawingmethods in struct rasops_info will be replaced with wrappers which call the original drawing functions(which may or may not be provided by the driver) only when the respective screen is visible. To add avirtual screen the driver one should call vcons_init_screen() which will call the callback functiondescribed above, allocate storage for characters and attributes based on whatever the callback set up instruct rasops_info, and add the screen to a list kept in struct vcons_data.<strong>NetBSD</strong> 3.0 February 12, 2006 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!