ReactOS  0.4.14-dev-368-gfa26425
osloader.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BIOS_MEMORY_MAP
 
struct  _ARM_BOARD_CONFIGURATION_BLOCK
 

Macros

#define ARM_BOARD_CONFIGURATION_MAJOR_VERSION   1
 
#define ARM_BOARD_CONFIGURATION_MINOR_VERSION   4
 

Typedefs

typedef VOID(* POSLOADER_INIT) (IN PVOID BoardInit)
 
typedef struct BIOS_MEMORY_MAPPBIOS_MEMORY_MAP
 
typedef struct _ARM_BOARD_CONFIGURATION_BLOCK ARM_BOARD_CONFIGURATION_BLOCK
 
typedef struct _ARM_BOARD_CONFIGURATION_BLOCKPARM_BOARD_CONFIGURATION_BLOCK
 

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

VOID NTAPI LlbAllocateMemoryEntry (IN BIOS_MEMORY_TYPE Type, IN ULONG BaseAddress, IN ULONG Length)
 
VOID NTAPI LlbSetCommandLine (IN PCHAR CommandLine)
 
VOID NTAPI LlbBuildArmBlock (VOID)
 
VOID NTAPI LlbBuildMemoryMap (VOID)
 
VOID NTAPI LlbLoadOsLoader (VOID)
 
VOID NTAPI LlbBoot (VOID)
 

Macro Definition Documentation

◆ ARM_BOARD_CONFIGURATION_MAJOR_VERSION

#define ARM_BOARD_CONFIGURATION_MAJOR_VERSION   1

Definition at line 42 of file osloader.h.

◆ ARM_BOARD_CONFIGURATION_MINOR_VERSION

#define ARM_BOARD_CONFIGURATION_MINOR_VERSION   4

Definition at line 43 of file osloader.h.

Typedef Documentation

◆ ARM_BOARD_CONFIGURATION_BLOCK

◆ PARM_BOARD_CONFIGURATION_BLOCK

◆ PBIOS_MEMORY_MAP

◆ POSLOADER_INIT

typedef VOID(* POSLOADER_INIT) (IN PVOID BoardInit)

Definition at line 13 of file osloader.h.

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 20 of file osloader.h.

Function Documentation

◆ LlbAllocateMemoryEntry()

VOID NTAPI LlbAllocateMemoryEntry ( IN BIOS_MEMORY_TYPE  Type,
IN ULONG  BaseAddress,
IN ULONG  Length 
)

Definition at line 17 of file loader.c.

20 {
22 
23  /* Get the next memory entry */
24  Entry = MemoryMap;
25  while (Entry->Length) Entry++;
26 
27  /* Fill it out */
28  Entry->Length = Length;
29  Entry->BaseAddress = BaseAddress;
30  Entry->Type = Type;
31 
32  /* Block count */
34 }
Type
Definition: Type.h:6
struct _Entry Entry
Definition: kefuncs.h:640
BIOS_MEMORY_MAP MemoryMap[32]
Definition: loader.c:11
ARM_BOARD_CONFIGURATION_BLOCK ArmBlock
Definition: loader.c:12
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
base of all file and directory entries
Definition: entries.h:82

Referenced by LlbHwBuildMemoryMap().

◆ LlbBoot()

VOID NTAPI LlbBoot ( VOID  )

Definition at line 163 of file loader.c.

164 {
165  /* Setup the ARM block */
167 
168  /* Build the memory map */
170 
171  /* Load the OS loader */
172  LlbLoadOsLoader();
173 
174  /* Jump to the OS Loader (FreeLDR in this case) */
176 }
VOID NTAPI LlbLoadOsLoader(VOID)
Definition: loader.c:128
ARM_BOARD_CONFIGURATION_BLOCK ArmBlock
Definition: loader.c:12
POSLOADER_INIT LoaderInit
Definition: loader.c:13
VOID NTAPI LlbBuildArmBlock(VOID)
Definition: loader.c:46
VOID NTAPI LlbBuildMemoryMap(VOID)
Definition: loader.c:85

Referenced by LlbStartup().

◆ LlbBuildArmBlock()

VOID NTAPI LlbBuildArmBlock ( VOID  )

Definition at line 46 of file loader.c.

47 {
48  /* Write version number */
51 
52  /* Get arch type */
54 
55  /* Get peripheral clock rate */
57 
58  /* Get timer and serial port base addresses */
61 
62  /* Debug */
63  DbgPrint("Machine Identifier: %lx\nPCLK: %d\nTIMER 0: %p\nSERIAL UART: %p\n",
68 
69  /* Now load the memory map */
71 
72  /* Write firmware callbacks */
81 }
#define DbgPrint
Definition: loader.c:25
VOID LlbFwVideoPutChar(IN INT c, IN UCHAR Attr, IN ULONG X, IN ULONG Y)
Definition: fw.c:88
BIOS_MEMORY_MAP MemoryMap[32]
Definition: loader.c:11
#define ARM_BOARD_CONFIGURATION_MAJOR_VERSION
Definition: osloader.h:42
INT LlbFwGetCh(VOID)
Definition: fw.c:49
ARM_BOARD_CONFIGURATION_BLOCK ArmBlock
Definition: loader.c:12
ULONG LlbFwVideoSetDisplayMode(IN PCHAR DisplayModeName, IN BOOLEAN Init)
Definition: fw.c:60
ULONG NTAPI LlbHwGetSerialUart(VOID)
Definition: hwinfo.c:34
#define ARM_BOARD_CONFIGURATION_MINOR_VERSION
Definition: osloader.h:43
ULONG NTAPI LlbHwGetPClk(VOID)
Definition: hwinfo.c:20
VOID LlbFwVideoClearScreen(IN UCHAR Attr)
Definition: fw.c:81
VOID LlbFwVideoGetDisplaySize(OUT PULONG Width, OUT PULONG Height, OUT PULONG Depth)
Definition: fw.c:68
ULONG NTAPI LlbHwGetTmr0Base(VOID)
Definition: hwinfo.c:27
TIMEINFO * LlbFwGetTime(VOID)
Definition: fw.c:113
PBIOS_MEMORY_MAP MemoryMap
Definition: osloader.h:53
ULONG NTAPI LlbHwGetUartBase(IN ULONG Port)
Definition: hwuart.c:36
VOID LlbFwPutChar(INT Ch)
Definition: fw.c:32
BOOLEAN LlbFwKbHit(VOID)
Definition: fw.c:42
ULONG NTAPI LlbHwGetBoardType(VOID)
Definition: hwinfo.c:13

Referenced by LlbBoot().

◆ LlbBuildMemoryMap()

VOID NTAPI LlbBuildMemoryMap ( VOID  )

Definition at line 85 of file loader.c.

86 {
87  /* Zero out the memory map */
88  memset(MemoryMap, 0, sizeof(MemoryMap));
89 
90  /* Call the hardware-specific function for hardware-defined regions */
92 }
BIOS_MEMORY_MAP MemoryMap[32]
Definition: loader.c:11
VOID NTAPI LlbHwBuildMemoryMap(IN PBIOS_MEMORY_MAP MemoryMap)
Definition: hwinfo.c:101
#define memset(x, y, z)
Definition: compat.h:39

Referenced by LlbBoot().

◆ LlbLoadOsLoader()

VOID NTAPI LlbLoadOsLoader ( VOID  )

Definition at line 128 of file loader.c.

129 {
131 
132  /* Read the current boot device */
133  BootDevice = LlbEnvRead("boot-device");
134  printf("Loading OS Loader from: %s...\n", BootDevice);
135  if (!strcmp(BootDevice, "NAND"))
136  {
137  // todo
138  }
139  else if (!strcmp(BootDevice, "RAMDISK"))
140  {
141  /* Call the hardware-specific function */
143  }
144  else if (!strcmp(BootDevice, "MMC") ||
145  !strcmp(BootDevice, "SD"))
146  {
147  //todo
148  }
149  else if (!strcmp(BootDevice, "HDD"))
150  {
151  //todo
152  }
153 
154  LoaderInit = (PVOID)0x80000000;
155 #ifdef _ZOOM2_ // need something better than this...
156  LoaderInit = (PVOID)0x81070000;
157 #endif
158  printf("OS Loader loaded at 0x%p...JUMP!\n\n\n\n\n", LoaderInit);
159 }
signed char * PCHAR
Definition: retypes.h:7
Definition: bl.h:252
static PVOID
Definition: loader.c:61
POSLOADER_INIT LoaderInit
Definition: loader.c:13
PCHAR NTAPI LlbEnvRead(IN PCHAR ValueName)
Definition: envir.c:127
POSLOADER_INIT NTAPI LlbHwLoadOsLoaderFromRam(VOID)
Definition: loader.c:99
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define printf
Definition: config.h:203

Referenced by LlbBoot().

◆ LlbSetCommandLine()

VOID NTAPI LlbSetCommandLine ( IN PCHAR  CommandLine)

Definition at line 38 of file loader.c.

39 {
40  /* Copy the command line in the ARM block */
41  strcpy(ArmBlock.CommandLine, CommandLine);
42 }
ARM_BOARD_CONFIGURATION_BLOCK ArmBlock
Definition: loader.c:12
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by LlbHwLoadOsLoaderFromRam().