/* ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. ** Distributed under the terms of the OpenBeOS License. */ #ifndef VESA_H #define VESA_H #include /* VBE info block structure */ #define VESA_SIGNATURE 'ASEV' #define VBE2_SIGNATURE '2EBV' struct vbe_info_block { // VBE 1.x fields uint32 signature; struct { uint8 minor; uint8 major; } version; uint32 oem_string; uint32 capabilities; uint32 mode_list; uint16 total_memory; // in 64k blocks // VBE 2.0+ fields only // Note, the block is 256 bytes in size for VBE 1.x as well, // but doesn't define these fields. VBE 3 doesn't define // any additional fields. uint16 oem_software_revision; uint32 oem_vendor_name_string; uint32 oem_product_name_string; uint32 oem_product_revision_string; uint8 reserved[222]; uint8 oem_data[256]; } _PACKED; /* VBE mode info structure */ struct vbe_mode_info { uint16 attributes; uint8 window_a_attributes; uint8 window_b_attributes; uint16 window_granulatiry; uint16 window_size; uint16 window_a_segment; uint16 window_b_segment; uint32 window_function; // real mode pointer uint16 bytes_per_row; // VBE 1.2 and above uint16 width; uint16 height; uint8 char_width; uint8 char_height; uint8 num_planes; uint8 bits_per_pixel; uint8 num_banks; uint8 memory_model; uint8 bank_size; uint8 num_image_pages; uint8 _reserved0; // direct color fields uint8 red_mask_size; uint8 red_field_position; uint8 green_mask_size; uint8 green_field_position; uint8 blue_mask_size; uint8 blue_field_position; uint8 reserved_mask_size; uint8 reserved_field_position; uint8 direct_color_mode_info; // VBE 2.0 and above uint32 physical_base; uint32 _reserved1; uint16 _reserved2; // VBE 3.0 and above uint16 linear_bytes_per_row; uint8 banked_num_image_pages; uint8 linear_num_image_pages; uint8 linear_red_mask_size; uint8 linear_red_field_position; uint8 linear_green_mask_size; uint8 linear_green_field_position; uint8 linear_blue_mask_size; uint8 linear_blue_field_position; uint8 linear_reserved_mask_size; uint8 linear_reserved_field_position; uint32 max_pixel_clock; // in Hz uint8 _reserved[189]; } _PACKED; // definitions of mode info attributes #define MODE_ATTR_AVAILABLE 1 #define MODE_ATTR_COLOR_MODE 8 #define MODE_ATTR_GRAPHICS_MODE 16 #define MODE_ATTR_LINEAR_BUFFER 128 // memory models #define MODE_MEMORY_TEXT 0 #define MODE_MEMORY_PLANAR 3 #define MODE_MEMORY_PACKED_PIXEL 4 #define MODE_MEMORY_DIRECT_COLOR 6 #define MODE_MEMORY_YUV 7 /* VBE 3.0 protected mode interface * The BIOS area can be scanned for the protected mode * signature that identifies the structure below. */ #define VBE_PM_SIGNATURE 'DIMP' struct vbe_protected_mode_info { uint32 signature; int16 entry_offset; int16 init_offset; uint16 data_selector; uint16 a000_selector; uint16 b000_selector; uint16 b800_selector; uint16 c000_selector; uint8 in_protected_mode; uint8 checksum; } _PACKED; #endif /* VESA_H */