ReactOS  0.4.14-dev-49-gfb4591c
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 242 of file i386vid.c.

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

Referenced by DetectDisplayController().

◆ BiosIsVesaSupported()

USHORT BiosIsVesaSupported ( VOID  )

Definition at line 160 of file i386vid.c.

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

Referenced by DetectDisplayController().

◆ BiosVesaReadEdid()

BOOLEAN BiosVesaReadEdid ( VOID  )

Definition at line 272 of file i386vid.c.

273 {
274  REGS Regs;
275 
276  TRACE("BiosVesaReadEdid()\n");
277 
279 
280  Regs.w.ax = 0x4F15;
281  Regs.b.bl = 1;
282  Regs.w.cx = 0;
283  Regs.w.dx = 0;
284  Regs.w.es = BIOSCALLBUFSEGMENT;
285  Regs.w.di = BIOSCALLBUFOFFSET;
286  Int386(0x10, &Regs, &Regs);
287 
288  TRACE("AL = 0x%x\n", Regs.b.al);
289  TRACE("AH = 0x%x\n", Regs.b.ah);
290 
291  if (Regs.w.ax != 0x004F)
292  {
293  WARN("VBE/DDC Read EDID function not supported (AL=0x%x) or failed (AH=0x%x)\n",
294  Regs.b.al, Regs.b.ah);
295  return FALSE;
296  }
297 
298  return (Regs.b.ah == 0);
299 }
unsigned short dx
Definition: pcbios.h:102
#define BIOSCALLBUFFER
Definition: x86common.h:12
#define WARN(fmt,...)
Definition: debug.h:111
unsigned short cx
Definition: pcbios.h:101
unsigned short es
Definition: pcbios.h:109
unsigned char ah
Definition: pcbios.h:120
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:122
#define BIOSCALLBUFOFFSET
Definition: x86common.h:22
BYTEREGS b
Definition: pcbios.h:151
unsigned char al
Definition: pcbios.h:119
unsigned short ax
Definition: pcbios.h:99
Definition: pcbios.h:146
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
unsigned short di
Definition: pcbios.h:105
WORDREGS w
Definition: pcbios.h:150

Referenced by DetectDisplayController().

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( HWDETECT  )