ReactOS  0.4.14-dev-552-g2fad488
inbv.h File Reference

Go to the source code of this file.

Functions

INIT_FUNCTION BOOLEAN NTAPI InbvDriverInitialize (IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG Count)
 
PUCHAR NTAPI InbvGetResourceAddress (IN ULONG ResourceNumber)
 
VOID NTAPI InbvBitBlt (IN PUCHAR Buffer, IN ULONG X, IN ULONG Y)
 
INIT_FUNCTION VOID NTAPI InbvIndicateProgress (VOID)
 
INIT_FUNCTION VOID NTAPI InbvSetProgressBarSubset (_In_ ULONG Floor, _In_ ULONG Ceiling)
 
INIT_FUNCTION VOID NTAPI InbvUpdateProgressBar (IN ULONG Progress)
 
INIT_FUNCTION VOID NTAPI InbvRotBarInit (VOID)
 
INIT_FUNCTION VOID NTAPI DisplayBootBitmap (IN BOOLEAN TextMode)
 
INIT_FUNCTION VOID NTAPI DisplayFilter (IN PCHAR *String)
 
INIT_FUNCTION VOID NTAPI FinalizeBootLogo (VOID)
 
VOID NTAPI InbvPortEnableFifo (IN ULONG PortId, IN BOOLEAN Enable)
 
BOOLEAN NTAPI InbvPortPollOnly (IN ULONG PortId)
 
BOOLEAN NTAPI InbvPortGetByte (IN ULONG PortId, OUT PUCHAR Byte)
 
VOID NTAPI InbvPortPutByte (IN ULONG PortId, IN UCHAR Byte)
 
VOID NTAPI InbvPortTerminate (IN ULONG PortId)
 
BOOLEAN NTAPI InbvPortInitialize (IN ULONG BaudRate, IN ULONG PortNumber, IN PUCHAR PortAddress, OUT PULONG PortId, IN BOOLEAN IsMMIODevice)
 

Variables

BOOLEAN InbvBootDriverInstalled
 

Function Documentation

◆ DisplayBootBitmap()

INIT_FUNCTION VOID NTAPI DisplayBootBitmap ( IN BOOLEAN  TextMode)

Definition at line 1085 of file inbv.c.

1086 {
1087  PVOID BootCopy = NULL, BootProgress = NULL, BootLogo = NULL, Header = NULL, Footer = NULL;
1088 
1089 #ifdef INBV_ROTBAR_IMPLEMENTED
1090  UCHAR Buffer[24 * 9];
1091  PVOID Bar = NULL, LineBmp = NULL;
1092  ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;
1093  NTSTATUS Status;
1094  HANDLE ThreadHandle = NULL;
1095 #endif
1096 
1097 #ifdef REACTOS_SKUS
1098  PVOID Text = NULL;
1099 #endif
1100 
1101 #ifdef INBV_ROTBAR_IMPLEMENTED
1102  /* Check if the animation thread has already been created */
1103  if (RotBarThreadActive)
1104  {
1105  /* Yes, just reset the progress bar but keep the thread alive */
1106  InbvAcquireLock();
1108  InbvReleaseLock();
1109  }
1110 #endif
1111 
1113 
1114  /* Check if this is text mode */
1115  if (TextMode)
1116  {
1117  /*
1118  * Make the kernel resource section temporarily writable,
1119  * as we are going to change the bitmaps' palette in place.
1120  */
1122 
1123  /* Check the type of the OS: workstation or server */
1124  if (SharedUserData->NtProductType == NtProductWinNt)
1125  {
1126  /* Workstation; set colors */
1127  InbvSetTextColor(15);
1130 
1131  /* Get resources */
1134  }
1135  else
1136  {
1137  /* Server; set colors */
1138  InbvSetTextColor(14);
1141 
1142  /* Get resources */
1145  }
1146 
1147  /* Set the scrolling region */
1148  InbvSetScrollRegion(32, 80, 631, 400);
1149 
1150  /* Make sure we have resources */
1151  if (Header && Footer)
1152  {
1153  /* BitBlt them on the screen */
1154  BitBltAligned(Footer,
1155  TRUE,
1158  0, 0, 0, 59);
1160  FALSE,
1163  0, 0, 0, 0);
1164  }
1165 
1166  /* Restore the kernel resource section protection to be read-only */
1168  }
1169  else
1170  {
1171  /* Is the boot driver installed? */
1172  if (!InbvBootDriverInstalled) return;
1173 
1174  /*
1175  * Make the kernel resource section temporarily writable,
1176  * as we are going to change the bitmaps' palette in place.
1177  */
1179 
1180  /* Load boot screen logo */
1182 
1183 #ifdef REACTOS_SKUS
1184  Text = NULL;
1185  if (SharedUserData->NtProductType == NtProductWinNt)
1186  {
1187 #ifdef INBV_ROTBAR_IMPLEMENTED
1188  /* Workstation product, use appropriate status bar color */
1190 #endif
1191  }
1192  else
1193  {
1194  /* Display correct branding based on server suite */
1196  {
1197  /* Storage Server Edition */
1199  }
1200  else if (ExVerifySuite(ComputeServer))
1201  {
1202  /* Compute Cluster Edition */
1204  }
1205  else
1206  {
1207  /* Normal edition */
1209  }
1210 
1211 #ifdef INBV_ROTBAR_IMPLEMENTED
1212  /* Server product, use appropriate status bar color */
1214 #endif
1215  }
1216 #else
1217  /* Use default status bar */
1219 #endif
1220 
1221  /* Make sure we have a logo */
1222  if (BootLogo)
1223  {
1224  /* Save the main image palette for implementing the fade-in effect */
1225  PBITMAPINFOHEADER BitmapInfoHeader = BootLogo;
1226  LPRGBQUAD Palette = (LPRGBQUAD)((PUCHAR)BootLogo + BitmapInfoHeader->biSize);
1227  RtlCopyMemory(MainPalette, Palette, sizeof(MainPalette));
1228 
1229  /* Draw the logo at the center of the screen */
1230  BitBltAligned(BootLogo,
1231  TRUE,
1234  0, 0, 0, 34);
1235 
1236 #ifdef INBV_ROTBAR_IMPLEMENTED
1237  /* Choose progress bar */
1238  TempRotBarSelection = ROT_BAR_DEFAULT_MODE;
1239 #endif
1240 
1241  /* Set progress bar coordinates and display it */
1243 
1244 #ifdef REACTOS_SKUS
1245  /* Check for non-workstation products */
1246  if (SharedUserData->NtProductType != NtProductWinNt)
1247  {
1248  /* Overwrite part of the logo for a server product */
1249  InbvScreenToBufferBlt(Buffer, 413, 237, 7, 7, 8);
1250  InbvSolidColorFill(418, 230, 454, 256, 0);
1251  InbvBufferToScreenBlt(Buffer, 413, 237, 7, 7, 8);
1252 
1253  /* In setup mode, you haven't selected a SKU yet */
1254  if (ExpInTextModeSetup) Text = NULL;
1255  }
1256 #endif
1257  }
1258 
1259  /* Load and draw progress bar bitmap */
1260  BootProgress = InbvGetResourceAddress(IDB_PROGRESS_BAR);
1261  BitBltAligned(BootProgress,
1262  TRUE,
1265  0, 118, 0, 0);
1266 
1267  /* Load and draw copyright text bitmap */
1269  BitBltAligned(BootCopy,
1270  TRUE,
1273  22, 0, 0, 20);
1274 
1275 #ifdef REACTOS_SKUS
1276  /* Draw the SKU text if it exits */
1277  if (Text) BitBltPalette(Text, TRUE, 180, 121);
1278 #endif
1279 
1280 #ifdef INBV_ROTBAR_IMPLEMENTED
1281  if (Bar)
1282  {
1283  /* Save previous screen pixels to buffer */
1284  InbvScreenToBufferBlt(Buffer, 0, 0, 22, 9, 24);
1285  /* Draw the progress bar bit */
1286  InbvBitBlt(Bar, 0, 0);
1287  /* Store it in global buffer */
1288  InbvScreenToBufferBlt(RotBarBuffer, 0, 0, 22, 9, 24);
1289  /* Restore screen pixels */
1290  InbvBufferToScreenBlt(Buffer, 0, 0, 22, 9, 24);
1291  }
1292 
1293  /*
1294  * Add a rotating bottom horizontal bar when using a progress bar,
1295  * to show that ReactOS can be still alive when the bar does not
1296  * appear to progress.
1297  */
1298  if (TempRotBarSelection == RB_PROGRESS_BAR)
1299  {
1301  if (LineBmp)
1302  {
1303  /* Draw the line and store it in global buffer */
1304  BitBltPalette(LineBmp, TRUE, 0, SCREEN_HEIGHT-6);
1306  }
1307  }
1308  else
1309  {
1310  /* Hide the simple progress bar if not used */
1312  }
1313 #endif
1314 
1315  /* Restore the kernel resource section protection to be read-only */
1317 
1318  /* Display the boot logo and fade it in */
1319  BootLogoFadeIn();
1320 
1321 #ifdef INBV_ROTBAR_IMPLEMENTED
1322  if (!RotBarThreadActive && TempRotBarSelection != RB_UNSPECIFIED)
1323  {
1324  /* Start the animation thread */
1325  Status = PsCreateSystemThread(&ThreadHandle,
1326  0,
1327  NULL,
1328  NULL,
1329  NULL,
1331  NULL);
1332  if (NT_SUCCESS(Status))
1333  {
1334  /* The thread has started, close the handle as we don't need it */
1336  ObCloseHandle(ThreadHandle, KernelMode);
1337  }
1338  }
1339 #endif
1340 
1341  /* Set filter which will draw text display if needed */
1343  }
1344 
1345 #ifdef INBV_ROTBAR_IMPLEMENTED
1346  /* Do we have the animation thread? */
1347  if (RotBarThreadActive)
1348  {
1349  /* We do, initialize the progress bar */
1350  InbvAcquireLock();
1351  RotBarSelection = TempRotBarSelection;
1352  InbvRotBarInit();
1353  InbvReleaseLock();
1354  }
1355 #endif
1356 }
#define IDB_SERVER_FOOTER
Definition: resource.h:25
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
static VOID BootLogoFadeIn(VOID)
Definition: inbv.c:209
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI InbvBufferToScreenBlt(IN PUCHAR Buffer, IN ULONG X, IN ULONG Y, IN ULONG Width, IN ULONG Height, IN ULONG Delta)
Definition: inbv.c:795
VOID NTAPI InbvSolidColorFill(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN ULONG Color)
Definition: inbv.c:719
BOOLEAN NTAPI ExVerifySuite(SUITE_TYPE SuiteType)
Definition: sysinfo.c:377
enum _ROT_BAR_TYPE ROT_BAR_TYPE
static UCHAR RotBarBuffer[24 *9]
Definition: inbv.c:122
#define SCREEN_HEIGHT
Definition: inbv.c:60
static UCHAR RotLineBuffer[SCREEN_WIDTH *6]
Definition: inbv.c:123
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:484
#define SCREEN_WIDTH
Definition: inbv.c:59
Definition: Header.h:8
#define IDB_PROGRESS_BAR
Definition: resource.h:43
#define IDB_SERVER_LOGO
Definition: resource.h:23
BOOLEAN NTAPI MmChangeKernelResourceSectionProtection(IN ULONG_PTR ProtectionMask)
Definition: sysldr.c:2286
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:462
Definition: bufpool.h:45
#define IDB_COPYRIGHT
Definition: resource.h:44
#define IDB_LOGO_DEFAULT
Definition: resource.h:15
VOID NTAPI InbvSetTextColor(IN ULONG Color)
Definition: inbv.c:695
#define IDB_STORAGE_SERVER
Definition: resource.h:37
INIT_FUNCTION VOID NTAPI InbvRotBarInit(VOID)
Definition: inbv.c:1075
#define MM_READONLY
Definition: inbv.c:9
#define IDB_BAR_DEFAULT
Definition: resource.h:14
static VOID NTAPI InbvRotationThread(_In_ PVOID Context)
Definition: inbv.c:983
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ROT_BAR_DEFAULT_MODE
Definition: inbv.c:102
INIT_FUNCTION VOID NTAPI DisplayFilter(PCHAR *String)
Definition: inbv.c:1361
#define SharedUserData
unsigned char UCHAR
Definition: xmlstorage.h:181
NTSTATUS NTAPI ObCloseHandle(IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
Definition: obhandle.c:3376
#define MM_READWRITE
Definition: inbv.c:10
static ROT_BAR_TYPE RotBarSelection
Definition: inbv.c:120
Status
Definition: gdiplustypes.h:24
INIT_FUNCTION VOID NTAPI InbvSetProgressBarCoordinates(IN ULONG Left, IN ULONG Top)
Definition: inbv.c:853
BOOLEAN ExpInTextModeSetup
Definition: init.c:66
static VOID BitBltAligned(IN PVOID Image, IN BOOLEAN NoPalette, IN BBLT_HORZ_ALIGNMENT HorizontalAlignment, IN BBLT_VERT_ALIGNMENT VerticalAlignment, IN ULONG MarginLeft, IN ULONG MarginTop, IN ULONG MarginRight, IN ULONG MarginBottom)
Definition: inbv.c:294
#define IDB_WKSTA_FOOTER
Definition: resource.h:18
static BOOLEAN RotBarThreadActive
Definition: inbv.c:119
NTSTATUS NTAPI PsCreateSystemThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE ProcessHandle, IN PCLIENT_ID ClientId, IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext)
Definition: thread.c:602
VOID NTAPI InbvBitBlt(IN PUCHAR Buffer, IN ULONG X, IN ULONG Y)
Definition: inbv.c:813
VOID NTAPI InbvInstallDisplayStringFilter(IN INBV_DISPLAY_STRING_FILTER Filter)
Definition: inbv.c:625
VOID NTAPI InbvScreenToBufferBlt(IN PUCHAR Buffer, IN ULONG X, IN ULONG Y, IN ULONG Width, IN ULONG Height, IN ULONG Delta)
Definition: inbv.c:834
#define IDB_ROTATING_LINE
Definition: resource.h:42
#define IDB_BAR_WKSTA
Definition: resource.h:20
PUCHAR NTAPI InbvGetResourceAddress(IN ULONG ResourceNumber)
Definition: inbv.c:904
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:87
VOID NTAPI InbvSetScrollRegion(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom)
Definition: inbv.c:684
static RGBQUAD MainPalette[16]
Definition: inbv.c:177
#define IDB_CLUSTER_SERVER
Definition: resource.h:38
static BOOLEAN ShowProgressBar
Definition: inbv.c:91
#define IDB_WKSTA_HEADER
Definition: resource.h:17
char * Text
Definition: combotst.c:136
#define IDB_SERVER_HEADER
Definition: resource.h:24
static VOID BitBltPalette(IN PVOID Image, IN BOOLEAN NoPalette, IN ULONG X, IN ULONG Y)
Definition: inbv.c:262
struct tagRGBQUAD * LPRGBQUAD

Referenced by DisplayFilter(), and Phase1InitializationDiscard().

◆ DisplayFilter()

INIT_FUNCTION VOID NTAPI DisplayFilter ( IN PCHAR String)

◆ FinalizeBootLogo()

INIT_FUNCTION VOID NTAPI FinalizeBootLogo ( VOID  )

Definition at line 1385 of file inbv.c.

1386 {
1387  /* Acquire lock and check the display state */
1388  InbvAcquireLock();
1390  {
1391  /* Clear the screen */
1393  }
1394 
1395  /* Reset progress bar and lock */
1396 #ifdef INBV_ROTBAR_IMPLEMENTED
1399 #endif
1400  InbvReleaseLock();
1401 }
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState(VOID)
Definition: inbv.c:564
#define SCREEN_HEIGHT
Definition: inbv.c:60
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:484
#define SCREEN_WIDTH
Definition: inbv.c:59
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:462
static ROT_BAR_STATUS PltRotBarStatus
Definition: inbv.c:121
VOID NTAPI VidSolidColorFill(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN UCHAR Color)
Definition: bootvid.c:538
static BOOLEAN RotBarThreadActive
Definition: inbv.c:119

Referenced by Phase1InitializationDiscard().

◆ InbvBitBlt()

VOID NTAPI InbvBitBlt ( IN PUCHAR  Buffer,
IN ULONG  X,
IN ULONG  Y 
)

Definition at line 813 of file inbv.c.

816 {
817  /* Check if we're installed and we own it */
820  {
821  /* Acquire the lock */
822  InbvAcquireLock();
823 
824  /* Do the blit */
825  VidBitBlt(Buffer, X, Y);
826 
827  /* Release the lock */
828  InbvReleaseLock();
829  }
830 }
#define Y(I)
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:484
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:462
Definition: bufpool.h:45
VOID NTAPI VidBitBlt(IN PUCHAR Buffer, IN ULONG Left, IN ULONG Top)
Definition: bootvid.c:509
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:86
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:87

Referenced by BitBltPalette(), DisplayBootBitmap(), and PopShutdownHandler().

◆ InbvDriverInitialize()

INIT_FUNCTION BOOLEAN NTAPI InbvDriverInitialize ( IN PLOADER_PARAMETER_BLOCK  LoaderBlock,
IN ULONG  Count 
)

Definition at line 421 of file inbv.c.

423 {
424  PCHAR CommandLine;
425  BOOLEAN ResetMode = FALSE; // By default do not reset the video mode
426  ULONG i;
427 
428  /* Quit if we're already installed */
429  if (InbvBootDriverInstalled) return TRUE;
430 
431  /* Initialize the lock and check the current display state */
434  {
435  /* Reset the video mode in case we do not have a custom boot logo */
436  CommandLine = (LoaderBlock->LoadOptions ? _strupr(LoaderBlock->LoadOptions) : NULL);
437  ResetMode = (CommandLine == NULL) || (strstr(CommandLine, "BOOTLOGO") == NULL);
438  }
439 
440  /* Initialize the video */
443  {
444  /* Find bitmap resources in the kernel */
446  for (i = 1; i <= ResourceCount; i++)
447  {
448  /* Do the lookup */
449  ResourceList[i] = FindBitmapResource(LoaderBlock, i);
450  }
451 
452  /* Set the progress bar ranges */
453  InbvSetProgressBarSubset(0, 100);
454  }
455 
456  /* Return install state */
458 }
signed char * PCHAR
Definition: retypes.h:7
#define TRUE
Definition: types.h:120
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
BOOLEAN NTAPI VidInitialize(IN BOOLEAN SetMode)
Definition: bootvid.c:278
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
static PUCHAR ResourceList[1+IDB_MAX_RESOURCE]
Definition: inbv.c:96
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
INIT_FUNCTION PVOID NTAPI FindBitmapResource(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG ResourceId)
Definition: inbv.c:356
static ULONG ResourceCount
Definition: inbv.c:95
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define min(a, b)
Definition: monoChain.cc:55
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:86
unsigned int ULONG
Definition: retypes.h:1
static KSPIN_LOCK BootDriverLock
Definition: inbv.c:84
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:87
INIT_FUNCTION VOID NTAPI InbvSetProgressBarSubset(IN ULONG Floor, IN ULONG Ceiling)
Definition: inbv.c:867

Referenced by Phase1InitializationDiscard().

◆ InbvGetResourceAddress()

PUCHAR NTAPI InbvGetResourceAddress ( IN ULONG  ResourceNumber)

Definition at line 904 of file inbv.c.

905 {
906  /* Validate the resource number */
907  if (ResourceNumber > ResourceCount) return NULL;
908 
909  /* Return the address */
910  return ResourceList[ResourceNumber];
911 }
static PUCHAR ResourceList[1+IDB_MAX_RESOURCE]
Definition: inbv.c:96
smooth NULL
Definition: ftsmooth.c:416
static ULONG ResourceCount
Definition: inbv.c:95

Referenced by DisplayBootBitmap(), and PopShutdownHandler().

◆ InbvIndicateProgress()

INIT_FUNCTION VOID NTAPI InbvIndicateProgress ( VOID  )

Definition at line 883 of file inbv.c.

884 {
885  ULONG Percentage;
886 
887  /* Increase progress */
889 
890  /* Compute new percentage */
891  Percentage = min(100 * InbvProgressIndicator.Count /
893  99);
894  if (Percentage != InbvProgressIndicator.Percentage)
895  {
896  /* Percentage has moved, update the progress bar */
897  InbvProgressIndicator.Percentage = Percentage;
898  InbvUpdateProgressBar(Percentage);
899  }
900 }
static BT_PROGRESS_INDICATOR InbvProgressIndicator
Definition: inbv.c:93
INIT_FUNCTION VOID NTAPI InbvUpdateProgressBar(IN ULONG Progress)
Definition: inbv.c:765
#define min(a, b)
Definition: monoChain.cc:55
unsigned int ULONG
Definition: retypes.h:1

Referenced by IopInitializeBuiltinDriver(), and IopInitializeSystemDrivers().

◆ InbvPortEnableFifo()

VOID NTAPI InbvPortEnableFifo ( IN ULONG  PortId,
IN BOOLEAN  Enable 
)

Definition at line 56 of file inbvport.c.

58 {
59  /* Set FIFO as requested */
60  CpEnableFifo(Port[PortId].Address, Enable);
61 }
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
static WCHAR Address[46]
Definition: ping.c:68
VOID NTAPI CpEnableFifo(IN PUCHAR Address, IN BOOLEAN Enable)
Definition: cport.c:54
CPPORT Port[4]
Definition: inbvport.c:16

Referenced by HdlspEnableTerminal().

◆ InbvPortGetByte()

BOOLEAN NTAPI InbvPortGetByte ( IN ULONG  PortId,
OUT PUCHAR  Byte 
)

Definition at line 38 of file inbvport.c.

40 {
41  /* Read a byte from the port */
42  return CpGetByte(&Port[PortId], Byte, TRUE, FALSE) == CP_GET_SUCCESS;
43 }
#define TRUE
Definition: types.h:120
unsigned char Byte
Definition: zconf.h:391
USHORT NTAPI CpGetByte(IN PCPPORT Port, OUT PUCHAR Byte, IN BOOLEAN Wait, IN BOOLEAN Poll)
Definition: cport.c:256
CPPORT Port[4]
Definition: inbvport.c:16
#define CP_GET_SUCCESS
Definition: cportlib.h:18

Referenced by HdlspDispatch().

◆ InbvPortInitialize()

BOOLEAN NTAPI InbvPortInitialize ( IN ULONG  BaudRate,
IN ULONG  PortNumber,
IN PUCHAR  PortAddress,
OUT PULONG  PortId,
IN BOOLEAN  IsMMIODevice 
)

Definition at line 73 of file inbvport.c.

78 {
79  /* Not yet supported */
80  ASSERT(IsMMIODevice == FALSE);
81 
82  /* Set default baud rate */
83  if (BaudRate == 0) BaudRate = 19200;
84 
85  /* Check if port or address given */
86  if (PortNumber)
87  {
88  /* Pick correct address for port */
89  if (!PortAddress)
90  {
91  switch (PortNumber)
92  {
93  case 1:
94  PortAddress = (PUCHAR)0x3F8;
95  break;
96 
97  case 2:
98  PortAddress = (PUCHAR)0x2F8;
99  break;
100 
101  case 3:
102  PortAddress = (PUCHAR)0x3E8;
103  break;
104 
105  default:
106  PortNumber = 4;
107  PortAddress = (PUCHAR)0x2E8;
108  }
109  }
110  }
111  else
112  {
113  /* Pick correct port for address */
114  PortAddress = (PUCHAR)0x2F8;
115  if (CpDoesPortExist(PortAddress))
116  {
117  PortNumber = 2;
118  }
119  else
120  {
121  PortAddress = (PUCHAR)0x3F8;
122  if (!CpDoesPortExist(PortAddress)) return FALSE;
123  PortNumber = 1;
124  }
125  }
126 
127  /* Initialize the port unless it's already up, and then return it */
128  if (Port[PortNumber - 1].Address) return FALSE;
129 
130  CpInitialize(&Port[PortNumber - 1], PortAddress, BaudRate);
131  *PortId = PortNumber - 1;
132 
133  return TRUE;
134 }
#define TRUE
Definition: types.h:120
unsigned char * PUCHAR
Definition: retypes.h:3
BOOLEAN NTAPI CpDoesPortExist(IN PUCHAR Address)
Definition: cport.c:227
ULONG PortNumber
Definition: storport.c:18
static WCHAR Address[46]
Definition: ping.c:68
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
CPPORT Port[4]
Definition: inbvport.c:16
NTSTATUS NTAPI CpInitialize(IN PCPPORT Port, IN PUCHAR Address, IN ULONG BaudRate)
Definition: cport.c:88

Referenced by HdlspEnableTerminal().

◆ InbvPortPollOnly()

BOOLEAN NTAPI InbvPortPollOnly ( IN ULONG  PortId)

Definition at line 28 of file inbvport.c.

29 {
30  UCHAR Dummy;
31 
32  /* Poll a byte from the port */
33  return CpGetByte(&Port[PortId], &Dummy, FALSE, TRUE) == CP_GET_SUCCESS;
34 }
#define TRUE
Definition: types.h:120
USHORT NTAPI CpGetByte(IN PCPPORT Port, OUT PUCHAR Byte, IN BOOLEAN Wait, IN BOOLEAN Poll)
Definition: cport.c:256
unsigned char UCHAR
Definition: xmlstorage.h:181
CPPORT Port[4]
Definition: inbvport.c:16
#define CP_GET_SUCCESS
Definition: cportlib.h:18

Referenced by HdlspDispatch().

◆ InbvPortPutByte()

VOID NTAPI InbvPortPutByte ( IN ULONG  PortId,
IN UCHAR  Byte 
)

Definition at line 47 of file inbvport.c.

49 {
50  /* Send the byte */
51  CpPutByte(&Port[PortId], Byte);
52 }
unsigned char Byte
Definition: zconf.h:391
VOID NTAPI CpPutByte(IN PCPPORT Port, IN UCHAR Byte)
Definition: cport.c:306
CPPORT Port[4]
Definition: inbvport.c:16

Referenced by HdlspPutData(), and HdlspSendStringAtBaud().

◆ InbvPortTerminate()

VOID NTAPI InbvPortTerminate ( IN ULONG  PortId)

Definition at line 65 of file inbvport.c.

66 {
67  /* The port is now available */
68  Port[PortId].Address = NULL;
69 }
smooth NULL
Definition: ftsmooth.c:416
CPPORT Port[4]
Definition: inbvport.c:16
PUCHAR Address
Definition: cportlib.h:29

Referenced by HdlspEnableTerminal().

◆ InbvRotBarInit()

INIT_FUNCTION VOID NTAPI InbvRotBarInit ( VOID  )

Definition at line 1075 of file inbv.c.

1076 {
1078  /* Perform other initialization if needed */
1079 }
static ROT_BAR_STATUS PltRotBarStatus
Definition: inbv.c:121

Referenced by DisplayBootBitmap().

◆ InbvSetProgressBarSubset()

INIT_FUNCTION VOID NTAPI InbvSetProgressBarSubset ( _In_ ULONG  Floor,
_In_ ULONG  Ceiling 
)

◆ InbvUpdateProgressBar()

INIT_FUNCTION VOID NTAPI InbvUpdateProgressBar ( IN ULONG  Progress)

Definition at line 765 of file inbv.c.

766 {
767  ULONG FillCount, BoundedProgress;
768 
769  /* Make sure the progress bar is enabled, that we own and are installed */
770  if (ShowProgressBar &&
773  {
774  /* Compute fill count */
775  BoundedProgress = (InbvProgressState.Floor / 100) + Progress;
776  FillCount = 121 * (InbvProgressState.Bias * BoundedProgress) / 1000000;
777 
778  /* Acquire the lock */
779  InbvAcquireLock();
780 
781  /* Fill the progress bar */
784  ProgressBarLeft + FillCount,
785  ProgressBarTop + 12,
786  15);
787 
788  /* Release the lock */
789  InbvReleaseLock();
790  }
791 }
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:484
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:462
static ULONG ProgressBarLeft
Definition: inbv.c:90
static INBV_PROGRESS_STATE InbvProgressState
Definition: inbv.c:92
VOID NTAPI VidSolidColorFill(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN UCHAR Color)
Definition: bootvid.c:538
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:86
unsigned int ULONG
Definition: retypes.h:1
static ULONG ProgressBarTop
Definition: inbv.c:90
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:87
static BOOLEAN ShowProgressBar
Definition: inbv.c:91

Referenced by InbvIndicateProgress(), and Phase1InitializationDiscard().

Variable Documentation

◆ InbvBootDriverInstalled