GA_devCtx
Declaration
struct GA_devCtx {
char Signature[20];
N_uint32 Version;
N_uint32 DriverRev;
char OemVendorName[80];
char OemCopyright[80];
N_uint16 _FAR_
*AvailableModes;
N_int32 DeviceIndex;
N_uint32 TotalMemory;
N_uint32 Attributes;
N_uint32 WorkArounds;
N_uint32 TextSize;
N_uint32 TextBasePtr;
N_uint32 BankSize;
N_uint32 BankedBasePtr;
N_uint32 LinearSize;
N_uint32 LinearBasePtr;
N_uint32 ZBufferSize;
N_uint32 ZBufferBasePtr;
N_uint32 TexBufferSize;
N_uint32 TexBufferBasePtr;
N_uint32 LockedMemSize;
N_uint32 IOBase;
N_uint32 MMIOBase[4];
N_uint32 MMIOLen[4];
void _FAR_
*DriverStart;
N_uint32 DriverSize;
N_uint32 BusType;
N_uint32 AttributesExt;
N_uint32 res1[18];
void _FAR_
*IOMemMaps[4];
void _FAR_
*TextMem;
void _FAR_
*BankedMem;
void _FAR_
*LinearMem;
void _FAR_
*ZBufferMem;
void _FAR_
*TexBufferMem;
void _FAR_
*LockedMem;
N_uint32 LockedMemPhys;
void _FAR_
*TextFont8x8;
void _FAR_
*TextFont8x14;
void _FAR_
*TextFont8x16;
GA_palette _FAR_
*VGAPal4;
GA_palette _FAR_
*VGAPal8;
N_uint32 res3[18];
struct GA_devCtx _FAR_ *ring0DC;
void _FAR_
*pMdl;
GA_loaderFuncs loader;
}
Prototype In
snap/graphics.h
Description
Main graphics device context structure. This structure consists of a header block that contains configuration information about the graphic device, as well as detection information and runtime state information.
The Signature member is filled with the null terminated string 'GRAPHICS\0' by the driver implementation. This can be used to verify that the file loaded really is an graphics device driver.
The Version member is a BCD value which specifies what revision level of the graphics specification is implemented in the driver. The high byte specifies the major version number and the low byte specifies the minor version number. For example, the BCD value for version 1.0 is 0x100 and the BCD value for version 2.2 would be 0x202.
The DriverRev member specifies the driver revision level, and is used by the driver configuration software to determine which version was used to generate the driver file.
The OemVendorName member contains the name of the vendor that developed the device driver implementation, and can be up to 80 characters in length.
The OemCopyright member contains a copyright string for the vendor that developed the device driver implementation and may be up to 80 characters in length.
The AvailableModes is an pointer within the loaded driver to a list of mode numbers for all displaymodes supported by the graphics driver. Each mode number occupies one word (16-bits), and is terminated by a -1 (0FFFFh). Any modes found in this list are guaranteed to be available for the current configuration.
The TotalMemory member indicates the maximum amount of memory physically installed and available to the frame buffer in 1Kb units. Note that not all graphics modes will be able to address all of this memory.
The Attributes member contains a number of flags that describes certain important characteristics of the graphics controller. The members are exactly the same as those provided in the GA_modeInfo block for each video mode, but the meaning is slightly different. For each flag defined in the GA_AttributeFlagsType enumeration, it represents whether the controller can support these modes in any available graphics modes. Please see the GetVideoModeInfo function for a detailed description of each flags meaning.
The TextSize member contains the size of the text mode framebuffer in bytes. It will generally be 64Kb in length. The TextBasePtr member is a 32-bit physical memory address where the text mode framebuffer memory window is located in the CPU address space. This will generally be 0xB0000 to cover the VGA text framebuffer window (both color and monochrome modes).
The BankSize member contains the size of the banked memory buffer in bytes. It can be either 4Kb or 64Kb in length. The BankedBasePtr member is a 32-bit physical memory address where the banked framebuffer memory window is located in the CPU address space. If the banked framebuffer mode is not available, then this member will be zero.
The LinearSize member is the 32-bit length of the linear frame buffer memory in bytes. In can be any length up to the size of the available video memory. The LinearBasePtr member is the 32-bit physical address of the start of frame buffer memory when the controller is in linear frame buffer memory mode. If the linear framebuffer is not available, then this member will be zero.
The ZBufferSize member is the 32-bit length of the local z-buffer (or depth buffer) memory in bytes. In can be any length up to the size of the available local z-buffer memory. The ZBufferBasePtr member is the 32-bit physical address of the start of local z-buffer memory. Note that if the controller does not have local z-buffer memory, but shares the z-buffer in the local framebuffer memory, these two fields will be set to 0.
The TexMemSize member is the 32-bit length of the local texture memory in bytes. In can be any length up to the size of the available local texture memory. The TexMemBasePtr member is the 32-bit physical address of the start of local texture memory. Note that if the controller does not have local texture memory, but loads textures in the local framebuffer memory, this field will be set to 0.
The LockedMemSize contains the amount of locked, contiguous memory in bytes that the graphics driver requires for programming the hardware. If the graphics accelerator requires DMA transfers for 2D and 3D rendering operations, this member can be set to the length of the block of memory that is required by the driver. The driver loader code will attempt to allocate a block of locked, physically contiguous memory from the operating system and place a pointer to this allocated memory in the LockedMem member for the driver, and the physical address of the start of this memory block in LockedMemPhys. Note that the memory must be locked so it cannot be paged out do disk, and it must be physically contiguous so that DMA operations will work correctly across 4Kb CPU page boundaries. If the driver does not require DMA memory, this value should be set to 0.
The MMIOBase member contains the 32-bit physical base addresses pointing to the start of up to 4 separate memory mapped register areas required by the controller. The MMIOLen member contains the lengths of each of these memory mapped IO areas in bytes. When the application maps the memory mapped IO regions for the driver, the linear address of the mapped memory areas will then be stored in the corresponding entries in the IOMemMaps array, and will be used by the driver for accessing the memory mapped registers on the controller. If any of these regions are not required, the MMIOBase entries will be NULL and do not need to be mapped by the application.
Note: The memory regions pointed to by the MMIOBase addresses have special meanings for the first two and second two addresses that are mapped. If the OS loader is running the driver in user space with a safety level of 2, then the only the first two base addresses will be mapped into user space, and the second two will be mapped only into kernel space (kernel space can also access the user space mappings). Please see QueryFunctions for a more detailed overview of the safety levels and how this relates to these regions.
The IOMemMaps member contains the mapped linear address of the memory mapped register regions defined by the MMIOBase and MMIOLen members.
The TextMem member contains the mapped linear address of the text mode framebuffer, and will be filled in by the application when it has loaded the device driver. This provides the device driver with direct access to the video memory on the controller when in text modes.
The BankedMem member contains the mapped linear address of the banked memory framebuffer, and will be filled in by the application when it has loaded the device driver. This provides the device driver with direct access to the video memory on the controller when in the banked framebuffer modes.
The LinearMem member contains the mapped linear address of the linear memory framebuffer, and will be filled in by the application when it has loaded the device driver. This provides the device driver with direct access to the video memory on the controller when in the linear framebuffer modes.
Note: On some controllers the linear framebuffer address may be different for different color depths, so the value in this variable may change gater initializing a mode. Applications should always reload the address of the linear framebuffer from this variable gater initializing a mode set to ensure that the correct value is always used.
The ZBufferMem member contains the mapped linear address of the local z-buffer memory, and will be filled in by the application when it has loaded the device driver. This provides the device driver with direct access to the local z-buffer memory on the controller. If the controller does not have local z-buffer memory, this member will be set to NULL.
The TexBufferMem member contains the mapped linear address of the local texture memory, and will be filled in by the application when it has loaded the device driver. This provides the device driver with direct access to the local texture memory on the controller. If the controller does not have local texture memory, this member will be set to NULL.
The LockedMem member contains a pointer to the locked DMA memory buffer allocated for the loaded driver. The graphics driver can use this pointer to write data directly to the DMA buffer before transferring it to the hardware. If the driver does not require DMA memory, this value will be set to NULL by the loader.
The LockedMemPhys member contains the 32-bit physical memory address of the locked DMA buffer memory allocated for the driver. The graphics driver can use this physical address to set up DMA transfer operations for memory contained within the DMA transfer buffer. If the driver does not require DMA memory, this value will be set to 0 by the loader.
The TextFont8x8, TextFont8x14 and TextFont8x16 members contain pointers to the 8x8, 8x14 and 8x16 text font bitmaps allocated by the OS loader. This data is used by the driver for VGA and extended text modes that require the bitmap font tables.
Members
Signature |
'GRAPHICS\0' 20 byte signature |
Version |
Driver Interface Version |
DriverRev |
Driver revision number |
OemVendorName |
Vendor Name string |
OemCopyright |
Vendor Copyright string |
AvailableModes |
Offset to supported mode table |
DeviceIndex |
Device index for the driver when loaded from disk |
TotalMemory |
Amount of memory in Kb detected |
Attributes |
Driver attributes |
WorkArounds |
Hardware WorkArounds flags |
TextSize |
Length of the text framebuffer in bytes |
TextBasePtr |
Base address of the text framebuffer |
BankSize |
Bank size in bytes (4Kb or 64Kb) |
BankedBasePtr |
Physical addr of banked buffer |
LinearSize |
Linear buffer size in bytes |
LinearBasePtr |
Physical addr of linear buffer |
ZBufferSize |
Z-buffer size in bytes |
ZBufferBasePtr |
Physical addr of Z-buffer |
TexBufferSize |
Texture buffer size in bytes |
TexBufferBasePtr |
Physical addr of texture buffer |
LockedMemSize |
Amount of locked memory for driver in bytes |
IOBase |
Base address for I/O mapped registers (relocateable) |
MMIOBase |
Base address of memory mapped I/O regions |
MMIOLen |
Length of memory mapped I/O regions in bytes |
DriverStart |
Pointer to the start of the driver in memory |
DriverSize |
Size of the entire driver in memory in bytes |
BusType |
Indicates the type of bus for the device (GA_busType) |
Attributes |
Driver extended attributes flags |
IOMemMaps |
Pointers to mapped I/O memory |
BankedMem |
Ptr to mapped banked video mem |
LinearMem |
Ptr to mapped linear video mem |
ZBufferMem |
Ptr to mapped zbuffer mem |
TexBufferMem |
Ptr to mapped texture buffer mem |
LockedMem |
Ptr to allocated locked memory |
LockedMemPhys |
Physical addr of locked memory |
TextFont8x8 |
Ptr to 8x8 text font data |
TextFont8x14 |
Ptr to 8x14 text font data |
TextFont8x16 |
Ptr to 8x16 text font data |
VGAPal4 |
Ptr to the default VGA 4bpp palette |
VGAPal8 |
Ptr to the default VGA 8bpp palette |
loader |
Internal device driver loader functions |
Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com