ReactOS  0.4.13-dev-257-gfabbd7c
i386vid.c File Reference
#include <freeldr.h>
#include <debug.h>
#include <pshpack2.h>
#include <poppack.h>
Include dependency graph for i386vid.c:

Go to the source code of this file.

Classes

struct  VESA_SVGA_INFO
 

Typedefs

typedef struct VESA_SVGA_INFOPVESA_SVGA_INFO
 

Functions

 DBG_DEFAULT_CHANNEL (HWDETECT)
 
USHORT BiosIsVesaSupported (VOID)
 
BOOLEAN BiosIsVesaDdcSupported (VOID)
 
BOOLEAN BiosVesaReadEdid (VOID)
 

Typedef Documentation

◆ PVESA_SVGA_INFO

Function Documentation

◆ BiosIsVesaDdcSupported()

BOOLEAN BiosIsVesaDdcSupported ( VOID  )

Definition at line 243 of file i386vid.c.

244 {
245  REGS Regs;
246 
247  TRACE("BiosIsVesaDdcSupported()\n");
248 
249  Regs.w.ax = 0x4F15;
250  Regs.b.bl = 0;
251  Regs.w.cx = 0;
252  Regs.w.es = 0;
253  Regs.w.di = 0;
254  Int386(0x10, &Regs, &Regs);
255 
256  TRACE("AL = 0x%x\n", Regs.b.al);
257  TRACE("AH = 0x%x\n", Regs.b.ah);
258 
259  TRACE("BL = 0x%x\n", Regs.b.bl);
260 
261  if (Regs.w.ax != 0x004F)
262  {
263  WARN("VBE/DDC Installation check function not supported (AL=0x%x) or failed (AH=0x%x)\n",
264  Regs.b.al, Regs.b.ah);
265  return FALSE;
266  }
267 
268  return (Regs.b.ah == 0);
269 }
#define WARN(fmt,...)
Definition: debug.h:111
unsigned short cx
Definition: pcbios.h:93
unsigned short es
Definition: pcbios.h:101
unsigned char ah
Definition: pcbios.h:112
int __cdecl Int386(int ivec, REGS *in, REGS *out)
#define TRACE(s)
Definition: solgame.cpp:4
unsigned char bl
Definition: pcbios.h:114
BYTEREGS b
Definition: pcbios.h:143
unsigned char al
Definition: pcbios.h:111
unsigned short ax
Definition: pcbios.h:91
Definition: pcbios.h:138
unsigned short di
Definition: pcbios.h:97
WORDREGS w
Definition: pcbios.h:142

Referenced by DetectDisplayController().

◆ BiosIsVesaSupported()

USHORT BiosIsVesaSupported ( VOID  )

Definition at line 161 of file i386vid.c.

162 {
163  REGS Regs;
165  //USHORT* VideoModes;
166  //USHORT Index;
167 
168  TRACE("BiosIsVesaSupported()\n");
169 
170  RtlZeroMemory(SvgaInfo, sizeof(VESA_SVGA_INFO));
171 
172  // Make sure we receive version 2.0 info
173  SvgaInfo->Signature[0] = 'V';
174  SvgaInfo->Signature[1] = 'B';
175  SvgaInfo->Signature[2] = 'E';
176  SvgaInfo->Signature[3] = '2';
177 
178  // Int 10h AX=4F00h
179  // VESA SuperVGA BIOS (VBE) - GET SuperVGA INFORMATION
180  //
181  // AX = 4F00h
182  // ES:DI -> buffer for SuperVGA information (see #00077)
183  // Return:
184  // AL = 4Fh if function supported
185  // AH = status
186  // 00h successful
187  // ES:DI buffer filled
188  // 01h failed
189  // ---VBE v2.0---
190  // 02h function not supported by current hardware configuration
191  // 03h function invalid in current video mode
192  //
193  // Determine whether VESA BIOS extensions are present and the
194  // capabilities supported by the display adapter
195  //
196  // Installation check;VESA SuperVGA
197  Regs.w.ax = 0x4F00;
198  Regs.w.es = BIOSCALLBUFSEGMENT;
199  Regs.w.di = BIOSCALLBUFOFFSET;
200  Int386(0x10, &Regs, &Regs);
201 
202  TRACE("AL = 0x%x\n", Regs.b.al);
203  TRACE("AH = 0x%x\n", Regs.b.ah);
204 
205  if (Regs.w.ax != 0x004F)
206  {
207  WARN("VBE Get SuperVGA information function not supported (AL=0x%x) or failed (AH=0x%x)\n",
208  Regs.b.al, Regs.b.ah);
209  return 0x0000;
210  }
211 
212  TRACE("Supported.\n");
213  TRACE("SvgaInfo->Signature[4] = %c%c%c%c\n", SvgaInfo->Signature[0], SvgaInfo->Signature[1], SvgaInfo->Signature[2], SvgaInfo->Signature[3]);
214  TRACE("SvgaInfo->VesaVersion = v%d.%d\n", ((SvgaInfo->VesaVersion >> 8) & 0xFF), (SvgaInfo->VesaVersion & 0xFF));
215  TRACE("SvgaInfo->OemNamePtr = 0x%x\n", SvgaInfo->OemNamePtr);
216  TRACE("SvgaInfo->Capabilities = 0x%x\n", SvgaInfo->Capabilities);
217  TRACE("SvgaInfo->VideoMemory = %dK\n", SvgaInfo->TotalVideoMemory * 64);
218  TRACE("---VBE v2.0 ---\n");
219  TRACE("SvgaInfo->OemSoftwareVersion = v%d.%d\n", ((SvgaInfo->OemSoftwareVersion >> 8) & 0x0F) + (((SvgaInfo->OemSoftwareVersion >> 12) & 0x0F) * 10), (SvgaInfo->OemSoftwareVersion & 0x0F) + (((SvgaInfo->OemSoftwareVersion >> 4) & 0x0F) * 10));
220  TRACE("SvgaInfo->VendorNamePtr = 0x%x\n", SvgaInfo->VendorNamePtr);
221  TRACE("SvgaInfo->ProductNamePtr = 0x%x\n", SvgaInfo->ProductNamePtr);
222  TRACE("SvgaInfo->ProductRevisionStringPtr = 0x%x\n", SvgaInfo->ProductRevisionStringPtr);
223  TRACE("SvgaInfo->VBE/AF Version = 0x%x (BCD WORD)\n", SvgaInfo->VBE_AF_Version);
224 
225  if (SvgaInfo->Signature[0] != 'V' ||
226  SvgaInfo->Signature[1] != 'E' ||
227  SvgaInfo->Signature[2] != 'S' ||
228  SvgaInfo->Signature[3] != 'A')
229  {
230  ERR("Bad signature in VESA information (%c%c%c%c)\n",
231  SvgaInfo->Signature[0],
232  SvgaInfo->Signature[1],
233  SvgaInfo->Signature[2],
234  SvgaInfo->Signature[3]);
235  return 0x0000;
236  }
237 
238  return SvgaInfo->VesaVersion;
239 }
USHORT VBE_AF_Version
Definition: i386vid.c:48
#define BIOSCALLBUFFER
Definition: x86common.h:12
#define WARN(fmt,...)
Definition: debug.h:111
ULONG ProductRevisionStringPtr
Definition: i386vid.c:47
unsigned short es
Definition: pcbios.h:101
unsigned char ah
Definition: pcbios.h:112
struct VESA_SVGA_INFO * PVESA_SVGA_INFO
int __cdecl Int386(int ivec, REGS *in, REGS *out)
ULONG OemNamePtr
Definition: i386vid.c:33
#define BIOSCALLBUFSEGMENT
Definition: x86common.h:21
UCHAR Signature[4]
Definition: i386vid.c:29
ULONG Capabilities
Definition: i386vid.c:35
#define TRACE(s)
Definition: solgame.cpp:4
ULONG ProductNamePtr
Definition: i386vid.c:46
#define BIOSCALLBUFOFFSET
Definition: x86common.h:22
BYTEREGS b
Definition: pcbios.h:143
unsigned char al
Definition: pcbios.h:111
#define ERR(fmt,...)
Definition: debug.h:109
unsigned short ax
Definition: pcbios.h:91
USHORT VesaVersion
Definition: i386vid.c:32
Definition: pcbios.h:138
USHORT OemSoftwareVersion
Definition: i386vid.c:44
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
USHORT TotalVideoMemory
Definition: i386vid.c:38
ULONG VendorNamePtr
Definition: i386vid.c:45
unsigned short di
Definition: pcbios.h:97
WORDREGS w
Definition: pcbios.h:142

Referenced by DetectDisplayController().

◆ BiosVesaReadEdid()

BOOLEAN BiosVesaReadEdid ( VOID  )

Definition at line 273 of file i386vid.c.

274 {
275  REGS Regs;
276 
277  TRACE("BiosVesaReadEdid()\n");
278 
280 
281  Regs.w.ax = 0x4F15;
282  Regs.b.bl = 1;
283  Regs.w.cx = 0;
284  Regs.w.dx = 0;
285  Regs.w.es = BIOSCALLBUFSEGMENT;
286  Regs.w.di = BIOSCALLBUFOFFSET;
287  Int386(0x10, &Regs, &Regs);
288 
289  TRACE("AL = 0x%x\n", Regs.b.al);
290  TRACE("AH = 0x%x\n", Regs.b.ah);
291 
292  if (Regs.w.ax != 0x004F)
293  {
294  WARN("VBE/DDC Read EDID function not supported (AL=0x%x) or failed (AH=0x%x)\n",
295  Regs.b.al, Regs.b.ah);
296  return FALSE;
297  }
298 
299  return (Regs.b.ah == 0);
300 }
unsigned short dx
Definition: pcbios.h:94
#define BIOSCALLBUFFER
Definition: x86common.h:12
#define WARN(fmt,...)
Definition: debug.h:111
unsigned short cx
Definition: pcbios.h:93
unsigned short es
Definition: pcbios.h:101
unsigned char ah
Definition: pcbios.h:112
int __cdecl Int386(int ivec, REGS *in, REGS *out)
#define BIOSCALLBUFSEGMENT
Definition: x86common.h:21
#define TRACE(s)
Definition: solgame.cpp:4
unsigned char bl
Definition: pcbios.h:114
#define BIOSCALLBUFOFFSET
Definition: x86common.h:22
BYTEREGS b
Definition: pcbios.h:143
unsigned char al
Definition: pcbios.h:111
unsigned short ax
Definition: pcbios.h:91
Definition: pcbios.h:138
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
unsigned short di
Definition: pcbios.h:97
WORDREGS w
Definition: pcbios.h:142

Referenced by DetectDisplayController().

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( HWDETECT  )