ReactOS 0.4.16-dev-289-g096a551
pcbios.h File Reference
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for pcbios.h:

Go to the source code of this file.

Classes

struct  BIOS_MEMORY_MAP
 
struct  _ACPI_BIOS_DATA
 
struct  _DOCKING_STATE_INFORMATION
 
struct  DWORDREGS
 
struct  WORDREGS
 
struct  BYTEREGS
 
union  REGS
 

Macros

#define MAX_BIOS_DESCRIPTORS   80
 
#define INT386_SUCCESS(regs)   ((regs.x.eflags & EFLAGS_CF) == 0)
 
#define REGS_EAX   0
 
#define REGS_EBX   4
 
#define REGS_ECX   8
 
#define REGS_EDX   12
 
#define REGS_ESI   16
 
#define REGS_EDI   20
 
#define REGS_EBP   24
 
#define REGS_DS   28
 
#define REGS_ES   30
 
#define REGS_FS   32
 
#define REGS_GS   34
 
#define REGS_EFLAGS   36
 
#define REGS_SIZE   40
 

Typedefs

typedef struct BIOS_MEMORY_MAPPBIOS_MEMORY_MAP
 
typedef struct _ACPI_BIOS_DATA ACPI_BIOS_DATA
 
typedef struct _ACPI_BIOS_DATAPACPI_BIOS_DATA
 
typedef struct _DOCKING_STATE_INFORMATION DOCKING_STATE_INFORMATION
 
typedef struct _DOCKING_STATE_INFORMATIONPDOCKING_STATE_INFORMATION
 

Enumerations

enum  BIOS_MEMORY_TYPE {
  BiosMemoryUsable = 1 , BiosMemoryBootLoader , BiosMemoryBootStrap , BiosMemoryReserved ,
  BiosMemoryUsable = 1 , BiosMemoryReserved = 2 , BiosMemoryAcpiReclaim = 3 , BiosMemoryAcpiNvs = 4 ,
  BiosMemoryUnusable = 5 , BiosMemoryDisabled = 6 , BiosMemoryPersistent = 7 , BiosMemoryUndefined08 = 8 ,
  BiosMemoryUndefined09 = 9 , BiosMemoryUndefined10 = 10 , BiosMemoryUndefined11 = 11 , BiosMemoryOemDefined12 = 12
}
 

Functions

 C_ASSERT (FIELD_OFFSET(BIOS_MEMORY_MAP, ExtendedAttributes)==20)
 
 C_ASSERT (sizeof(BIOS_MEMORY_MAP)==24)
 
int __cdecl Int386 (int ivec, REGS *in, REGS *out)
 
VOID __cdecl ChainLoadBiosBootSectorCode (IN UCHAR BootDrive OPTIONAL, IN ULONG BootPartition OPTIONAL)
 
VOID __cdecl Relocator16Boot (IN REGS *In, IN USHORT StackSegment, IN USHORT StackPointer, IN USHORT CodeSegment, IN USHORT CodePointer)
 
VOID __cdecl Reboot (VOID)
 
VOID DetectHardware (VOID)
 

Macro Definition Documentation

◆ INT386_SUCCESS

#define INT386_SUCCESS (   regs)    ((regs.x.eflags & EFLAGS_CF) == 0)

Definition at line 179 of file pcbios.h.

◆ MAX_BIOS_DESCRIPTORS

#define MAX_BIOS_DESCRIPTORS   80

Definition at line 12 of file pcbios.h.

◆ REGS_DS

#define REGS_DS   28

Definition at line 205 of file pcbios.h.

◆ REGS_EAX

#define REGS_EAX   0

Definition at line 198 of file pcbios.h.

◆ REGS_EBP

#define REGS_EBP   24

Definition at line 204 of file pcbios.h.

◆ REGS_EBX

#define REGS_EBX   4

Definition at line 199 of file pcbios.h.

◆ REGS_ECX

#define REGS_ECX   8

Definition at line 200 of file pcbios.h.

◆ REGS_EDI

#define REGS_EDI   20

Definition at line 203 of file pcbios.h.

◆ REGS_EDX

#define REGS_EDX   12

Definition at line 201 of file pcbios.h.

◆ REGS_EFLAGS

#define REGS_EFLAGS   36

Definition at line 209 of file pcbios.h.

◆ REGS_ES

#define REGS_ES   30

Definition at line 206 of file pcbios.h.

◆ REGS_ESI

#define REGS_ESI   16

Definition at line 202 of file pcbios.h.

◆ REGS_FS

#define REGS_FS   32

Definition at line 207 of file pcbios.h.

◆ REGS_GS

#define REGS_GS   34

Definition at line 208 of file pcbios.h.

◆ REGS_SIZE

#define REGS_SIZE   40

Definition at line 210 of file pcbios.h.

Typedef Documentation

◆ ACPI_BIOS_DATA

◆ DOCKING_STATE_INFORMATION

◆ PACPI_BIOS_DATA

◆ PBIOS_MEMORY_MAP

◆ PDOCKING_STATE_INFORMATION

Enumeration Type Documentation

◆ BIOS_MEMORY_TYPE

Enumerator
BiosMemoryUsable 
BiosMemoryBootLoader 
BiosMemoryBootStrap 
BiosMemoryReserved 
BiosMemoryUsable 
BiosMemoryReserved 
BiosMemoryAcpiReclaim 
BiosMemoryAcpiNvs 
BiosMemoryUnusable 
BiosMemoryDisabled 
BiosMemoryPersistent 
BiosMemoryUndefined08 
BiosMemoryUndefined09 
BiosMemoryUndefined10 
BiosMemoryUndefined11 
BiosMemoryOemDefined12 

Definition at line 14 of file pcbios.h.

15{
16 // ACPI 1.0.
21 // ACPI 3.0.
23 // ACPI 4.0.
25 // ACPI 6.0.
32 // BiosMemoryUndefinedNN = 13-0xEFFFFFFF
33 // BiosMemoryOemDefinedNN = 0xF0000000-0xFFFFFFFF
BIOS_MEMORY_TYPE
Definition: pcbios.h:15
@ BiosMemoryUsable
Definition: pcbios.h:17
@ BiosMemoryOemDefined12
Definition: pcbios.h:31
@ BiosMemoryUndefined09
Definition: pcbios.h:28
@ BiosMemoryUndefined11
Definition: pcbios.h:30
@ BiosMemoryPersistent
Definition: pcbios.h:26
@ BiosMemoryDisabled
Definition: pcbios.h:24
@ BiosMemoryUnusable
Definition: pcbios.h:22
@ BiosMemoryReserved
Definition: pcbios.h:18
@ BiosMemoryAcpiReclaim
Definition: pcbios.h:19
@ BiosMemoryUndefined10
Definition: pcbios.h:29
@ BiosMemoryUndefined08
Definition: pcbios.h:27
@ BiosMemoryAcpiNvs
Definition: pcbios.h:20

Function Documentation

◆ C_ASSERT() [1/2]

C_ASSERT ( FIELD_OFFSET(BIOS_MEMORY_MAP, ExtendedAttributes)  = =20)

◆ C_ASSERT() [2/2]

C_ASSERT ( sizeof(BIOS_MEMORY_MAP = =24)

◆ ChainLoadBiosBootSectorCode()

VOID __cdecl ChainLoadBiosBootSectorCode ( IN UCHAR BootDrive  OPTIONAL,
IN ULONG BootPartition  OPTIONAL 
)

Definition at line 1729 of file machpc.c.

1732{
1733 REGS Regs;
1734
1735 RtlZeroMemory(&Regs, sizeof(Regs));
1736
1737 /* Set the boot drive and the boot partition */
1738 Regs.b.dl = (UCHAR)(BootDrive ? BootDrive : FrldrBootDrive);
1739 Regs.b.dh = (UCHAR)(BootPartition ? BootPartition : FrldrBootPartition);
1740
1741 /*
1742 * Don't stop the floppy drive motor when we are just booting a bootsector,
1743 * a drive, or a partition. If we were to stop the floppy motor, the BIOS
1744 * wouldn't be informed and if the next read is to a floppy then the BIOS
1745 * will still think the motor is on and this will result in a read error.
1746 */
1747 // DiskStopFloppyMotor();
1748
1749 Relocator16Boot(&Regs,
1750 /* Stack segment:pointer */
1751 0x0000, 0x7C00,
1752 /* Code segment:pointer */
1753 0x0000, 0x7C00);
1754}
VOID __cdecl Relocator16Boot(IN REGS *In, IN USHORT StackSegment, IN USHORT StackPointer, IN USHORT CodeSegment, IN USHORT CodePointer)
unsigned char dl
Definition: pcbios.h:140
unsigned char dh
Definition: pcbios.h:141
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
UCHAR FrldrBootDrive
Definition: uefidisk.c:47
ULONG FrldrBootPartition
Definition: uefidisk.c:48
Definition: pcbios.h:159
BYTEREGS b
Definition: pcbios.h:163
unsigned char UCHAR
Definition: xmlstorage.h:181

◆ DetectHardware()

VOID DetectHardware ( VOID  )

◆ Int386()

◆ Reboot()

VOID __cdecl Reboot ( VOID  )

Definition at line 83 of file uefildr.c.

84{
85 //TODO: Replace with a true firmware reboot eventually
86 WARN("Something has gone wrong - halting FreeLoader\n");
87 for (;;)
88 {
89 NOTHING;
90 }
91}
#define WARN(fmt,...)
Definition: precomp.h:61
#define NOTHING
Definition: input_list.c:10

◆ Relocator16Boot()

VOID __cdecl Relocator16Boot ( IN REGS In,
IN USHORT  StackSegment,
IN USHORT  StackPointer,
IN USHORT  CodeSegment,
IN USHORT  CodePointer 
)