ReactOS  0.4.14-dev-114-gc8cbd56
mach.c
Go to the documentation of this file.
1 /*
2  * FreeLoader PowerPC Part
3  * Copyright (C) 2005 Art Yerkes
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 #include "freeldr.h"
20 #include "machine.h"
21 #include "ppcmmu/mmu.h"
22 #include "of.h"
23 #include "prep.h"
24 #include "compat.h"
25 
26 extern void BootMain( PSTR CmdLine );
27 extern ULONG CacheSizeLimit;
31 int mmu_handle = 0;
32 int claimed[4];
36 volatile char *video_mem = 0;
37 
38 void PpcOfwPutChar( int ch ) {
39  char buf[3];
40  if( ch == 0x0a ) { buf[0] = 0x0d; buf[1] = 0x0a; }
41  else { buf[0] = ch; buf[1] = 0; }
42  buf[2] = 0;
43  ofw_write(stdout_handle, buf, strlen(buf));
44 }
45 
46 int PpcFindDevice( int depth, int parent, char *devname, int *nth ) {
47  static char buf[256];
48  int next = 0;
49  int gotname = 0;
50  int match = 0;
51  int i;
52 
53  next = ofw_child( parent );
54 
55  //printf( "next = %x\n", next );
56 
57  gotname = ofw_getprop(parent, "name", buf, 256);
58 
59  //printf( "gotname = %d\n", gotname );
60 
61  match = !strncmp(buf, devname, strlen(devname));
62 
63  if( !nth && match ) return parent;
64 
65  for( i = 0; i < depth; i++ ) PpcOfwPutChar( ' ' );
66 
67  if( depth == 1 ) {
68  if( gotname > 0 ) {
69  printf( "%c Name: %s\n", match ? '*' : ' ', buf );
70  } else {
71  printf( "- No name attribute for %x\n", parent );
72  }
73  }
74 
75  while( !match && next ) {
76  i = PpcFindDevice( depth+1, next, devname, nth );
77  if( i ) return i;
78  next = ofw_peer( next );
79  }
80 
81  return 0;
82 }
83 
85  return FALSE;
86 }
87 
88 int PpcConsGetCh() {
89  char buf;
90  ofw_read( stdin_handle, &buf, 1 );
91  return buf;
92 }
93 
94 void PpcVideoClearScreen( UCHAR Attr ) {
95 }
96 
98  *Width = 80;
99  *Height = 25;
100  *Depth = 16;
101 }
102 
104  ULONG Width, Height, Depth;
105  MachVideoGetDisplaySize( &Width, &Height, &Depth );
106  return Width * Height * Depth / 8;
107 }
108 
110  //printf( "DisplayMode: %s %s\n", DisplayMode, Init ? "true" : "false" );
111  if( Init && !video_mem ) {
113  }
114  return VideoTextMode;
115 }
116 
118  printf("SetTextCursorPosition(%d,%d)\n", X,Y);
119 }
120 
122  printf("HideShowTextCursor(%s)\n", Show ? "true" : "false");
123 }
124 
125 VOID PpcVideoPutChar( int Ch, UCHAR Attr, unsigned X, unsigned Y ) {
126  printf( "\033[%d;%dH%c", Y, X, Ch );
127 }
128 
130  int i,j;
131  ULONG w,h,d;
132  PCHAR ChBuf = Buffer;
133  int offset = 0;
134 
135  MachVideoGetDisplaySize( &w, &h, &d );
136 
137  for( i = 0; i < h; i++ ) {
138  for( j = 0; j < w; j++ ) {
139  offset = (j * 2) + (i * w * 2);
140  if( ChBuf[offset] != video_mem[offset] ) {
141  video_mem[offset] = ChBuf[offset];
142  MachVideoPutChar(ChBuf[offset],0,j+1,i+1);
143  }
144  }
145  }
146 }
147 
149  return FALSE;
150 }
151 
153  UCHAR Red, UCHAR Green, UCHAR Blue ) {
154  printf( "SetPaletteColor(%x,%x,%x,%x)\n", Color, Red, Green, Blue );
155 }
156 
158  UCHAR *Red, UCHAR *Green, UCHAR *Blue ) {
159  printf( "GetPaletteColor(%x)\n", Color);
160 }
161 
163  printf( "Sync\n" );
164 }
165 
169 {
170  if(!mmu_initialized)
171  {
172  MmuInit();
173  MmuDbgInit(0, 0x800003f8);
175  //MmuDbgEnter(0x20);
176  mmu_initialized = 1;
177  }
178 }
179 
181  ULONG MaxMemoryMapSize );
182 
183 /*
184  * Get memory the proper openfirmware way
185  */
187  ULONG MaxMemoryMapSize ) {
188  int i, memhandle, total = 0, slots = 0, last = 0x40000, allocstart = 0x1000000;
189  int regdata[0x40];
190 
191  printf("PpcGetMemoryMap(%d)\n", MaxMemoryMapSize);
192 
193  memhandle = ofw_finddevice("/memory");
194 
195  ofw_getprop(memhandle, "reg", (char *)regdata, sizeof(regdata));
196 
197  /* Try to claim some memory in usable blocks. Try to get some 8mb bits */
198  for( i = 0; i < sizeof(claimed) / sizeof(claimed[0]); ) {
199  if (!claimed[i])
200  claimed[i] = ofw_claim(allocstart, 8 * 1024 * 1024, 0x1000);
201 
202  allocstart += 8 * 1024 * 1024;
203 
204  if (claimed[i]) {
205  if (last < claimed[i]) {
206  BiosMemoryMap[slots].Type = BiosMemoryAcpiReclaim;
207  BiosMemoryMap[slots].BaseAddress = last;
208  BiosMemoryMap[slots].Length = claimed[i] - last;
209  slots++;
210  }
211 
212  BiosMemoryMap[slots].Type = BiosMemoryUsable;
213  BiosMemoryMap[slots].BaseAddress = claimed[i];
214  BiosMemoryMap[slots].Length = 8 * 1024 * 1024;
215 
216  total += BiosMemoryMap[slots].Length;
217  last =
218  BiosMemoryMap[slots].BaseAddress +
219  BiosMemoryMap[slots].Length;
220  slots++;
221  i++;
222  }
223  }
224 
225  /* Get the rest until the end of the memory object as we see it */
226  if (last < regdata[1]) {
227  BiosMemoryMap[slots].Type = BiosMemoryAcpiReclaim;
228  BiosMemoryMap[slots].BaseAddress = last;
229  BiosMemoryMap[slots].Length = regdata[1] - last;
230  slots++;
231  }
232 
233  for (i = 0; i < slots; i++) {
234  printf("MemoryMap[%d] = (%x:%x)\n",
235  i,
237  (int)BiosMemoryMap[i].Length);
238 
239  }
240 
241  mem_range_end = regdata[1];
242 
243  printf( "Returning memory map (%d entries, %dk free, %dk total ram)\n",
244  slots, total / 1024, regdata[1] / 1024 );
245 
246  return slots;
247 }
248 
251  int rlen = 0;
252 
253  if( part_handle == -1 ) {
254  part_handle = ofw_open( BootPart );
255 
256  if( part_handle == -1 ) {
257  printf("Could not open any disk devices we know about\n");
258  return FALSE;
259  }
260  }
261 
262  if( part_handle == -1 ) {
263  printf("Got partition handle %x\n", part_handle);
264  return FALSE;
265  }
266 
267  if( ofw_seek( part_handle,
268  (ULONG)(SectorNumber >> 25),
269  (ULONG)((SectorNumber * 512) & 0xffffffff) ) ) {
270  printf("Seek to %x failed\n", (ULONG)(SectorNumber * 512));
271  return FALSE;
272  }
273 
274  rlen = ofw_read( part_handle, Buffer, (ULONG)(SectorCount * 512) );
275  return rlen > 0;
276 }
277 
278 BOOLEAN PpcDiskGetDriveGeometry( ULONG DriveNumber, PGEOMETRY DriveGeometry ) {
279  printf("GetGeometry(%d)\n", DriveNumber);
280  DriveGeometry->BytesPerSector = 512;
281  DriveGeometry->Heads = 16;
282  DriveGeometry->Sectors = 63;
283  return TRUE;
284 }
285 
287  printf("GetCacheableBlockCount\n");
288  return 1;
289 }
290 
291 TIMEINFO*
293 {
294  static TIMEINFO TimeInfo;
295  //printf("PpcGetTime\n");
296  return &TimeInfo;
297 }
298 
299 VOID NarrowToWide(WCHAR *wide_name, char *name)
300 {
301  char *copy_name;
302  WCHAR *wide_name_ptr;
303  for (wide_name_ptr = wide_name, copy_name = name;
304  (*wide_name_ptr = *copy_name);
305  wide_name_ptr++, copy_name++);
306 }
307 
308 /* Recursively copy the device tree into our representation
309  * It'll be passed to HAL.
310  *
311  * When NT was first done on PPC, it was on PReP hardware, which is very
312  * like PC hardware (really, just a PPC on a PC motherboard). HAL can guess
313  * the addresses of needed resources in this scheme as it can on x86.
314  *
315  * Most PPC hardware doesn't assign fixed addresses to hardware, which is
316  * the problem that open firmware partially solves. It allows hardware makers
317  * much more leeway in building PPC systems. Unfortunately, because
318  * openfirmware as originally specified neither captures nor standardizes
319  * all possible information, and also because of bugs, most OSs use a hybrid
320  * configuration scheme that relies both on verification of devices and
321  * recording information from openfirmware to be treated as hints.
322  */
325  char *name,
326  int innode,
327  ULONG *BusNumber,
329  ULONG *DiskNumber)
330 {
331  int proplen = 0, node = innode;
332  char *prev_name, cur_name[64], data[256], *slash, devtype[64];
333  wchar_t wide_name[64];
335 
336  NarrowToWide(wide_name, name);
337 
338  /* Create a key for this device */
340  (ParentKey,
341  AdapterClass,
342  MultiFunctionAdapter,
343  0,
344  0,
345  (ULONG)-1,
346  NULL,
347  NULL,
348  0,
349  &NewKey);
350 
351  /* Add properties */
352  for (prev_name = ""; ofw_nextprop(node, prev_name, cur_name) == 1; )
353  {
354  proplen = ofw_getproplen(node, cur_name);
355  if (proplen > 256 || proplen < 0)
356  {
357  printf("Warning: not getting prop %s (too long: %d)\n",
358  cur_name, proplen);
359  continue;
360  }
361  ofw_getprop(node, cur_name, data, sizeof(data));
362 
363  /* Get device type so we can examine it */
364  if (!strcmp(cur_name, "device_type"))
365  strcpy(devtype, (char *)data);
366 
367  NarrowToWide(wide_name, cur_name);
368  //RegSetValue(NewKey, wide_name, REG_BINARY, data, proplen);
369 
370  strcpy(data, cur_name);
371  prev_name = data;
372  }
373 
374 #if 0
375  /* Special device handling */
376  if (!strcmp(devtype, "ata"))
377  {
378  OfwHandleDiskController(NewKey, node, *DiskController);
379  (*DiskController)++;
380  *DiskNumber = 0;
381  }
382  else if (!strcmp(devtype, "disk"))
383  {
384  OfwHandleDiskObject(NewKey, node, *DiskController, *DiskNumber);
385  (*DiskNumber)++;
386  }
387 #endif
388 
389  /* Subdevices */
390  for (node = ofw_child(node); node; node = ofw_peer(node))
391  {
392  ofw_package_to_path(node, data, sizeof(data));
393  slash = strrchr(data, '/');
394  if (slash) slash++; else continue;
396  (NewKey, slash, node, BusNumber, DiskController, DiskNumber);
397  }
398 }
399 
402  ULONG BusNumber = 0, DiskController = 0, DiskNumber = 0;
403  int node = ofw_finddevice("/");
404 
406 
408  return RootKey;
409 }
410 
411 VOID
413 {
414  /* UNIMPLEMENTED */
415 }
416 
418 {
435 
437 
441 
443 
446 }
447 
449 {
450  chosen_package = ofw_finddevice( "/chosen" );
451 
452  ofw_getprop(chosen_package, "bootargs",
453  CmdLine, sizeof(CmdLine));
454  ofw_getprop( chosen_package, "stdin",
455  (char *)&stdin_handle, sizeof(stdin_handle) );
456  ofw_getprop( chosen_package, "stdout",
457  (char *)&stdout_handle, sizeof(stdout_handle) );
458  ofw_getprop( chosen_package, "mmu",
459  (char *)&mmu_handle, sizeof(mmu_handle) );
460 
461  // Allow forcing prep for broken OFW
462  if(!strncmp(CmdLine, "bootprep", 8))
463  {
464  printf("Going to PREP init...\n");
465  ofproxy = NULL;
466  PpcPrepInit();
467  return;
468  }
469 
470  printf( "FreeLDR version [%s]\n", FrLdrVersionString );
471 
472  BootMain( CmdLine );
473 }
474 
475 void PpcInit( of_proxy the_ofproxy ) {
476  // Hack to be a bit easier on ram
477  CacheSizeLimit = 64 * 1024;
478  ofproxy = the_ofproxy;
480  if(ofproxy) PpcOfwInit();
481  else PpcPrepInit();
482 }
483 
484 void MachInit(const char *CmdLine) {
485  int i, len;
486  char *sep;
487 
488  BootPart[0] = 0;
489  FrLdrBootPath[0] = 0;
490 
491  printf( "Determining boot device: [%s]\n", CmdLine );
492 
493  sep = NULL;
494  for( i = 0; i < strlen(CmdLine); i++ ) {
495  if( strncmp(CmdLine + i, "boot=", 5) == 0) {
496  strcpy(BootPart, CmdLine + i + 5);
497  sep = strchr(BootPart, ',');
498  if( sep )
499  *sep = 0;
500  while(CmdLine[i] && CmdLine[i]!=',') i++;
501  }
502  }
503 
504  if( strlen(BootPart) == 0 ) {
505  if (ofproxy)
506  len = ofw_getprop(chosen_package, "bootpath",
507  FrLdrBootPath, sizeof(FrLdrBootPath));
508  else
509  len = 0;
510  if( len < 0 ) len = 0;
511  FrLdrBootPath[len] = 0;
512  printf( "Boot Path: %s\n", FrLdrBootPath );
513 
514  sep = strrchr(FrLdrBootPath, ',');
515 
517  if( sep ) {
518  BootPart[sep - FrLdrBootPath] = 0;
519  }
520  }
521 
522  printf( "FreeLDR starting (boot partition: %s)\n", BootPart );
523 }
524 
525 void beep() {
526 }
527 
529  return GetPhysByte(((ULONG)Address)+0x80000000);
530 }
531 
533  SetPhysByte(((ULONG)Address)+0x80000000, Value);
534 }
535 
537  IN ULONG KernelSize,
538  IN PVOID KernelCurrentLoadAddress,
539  IN PVOID KernelTargetLoadAddress,
540  IN UCHAR DriveNumber,
542 {
543  ofw_exit();
544 }
545 
547  IN UCHAR BootDrive OPTIONAL,
548  IN ULONG BootPartition OPTIONAL)
549 {
550  ofw_exit();
551 }
552 
554  __asm__("twi 31,0,0");
555 }
static BOOL copy_name(const char *ptr, char **name)
Definition: reflection.c:154
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
signed char * PCHAR
Definition: retypes.h:7
Definition: bl.h:202
PFREELDR_MEMORY_DESCRIPTOR(* GetMemoryMap)(PULONG MaxMemoryMapSize)
Definition: machine.h:63
#define IN
Definition: typedefs.h:38
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:656
#define TRUE
Definition: types.h:120
void PpcOfwInit()
Definition: mach.c:448
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
VOID PpcInitializeMmu()
Definition: mach.c:168
int PpcFindDevice(int depth, int parent, char *devname, int *nth)
Definition: mach.c:46
void PpcDefaultMachVtbl()
Definition: mach.c:417
int GetPhysByte(int Addr)
static PMEMKEY RootKey
Definition: registry.c:55
#define Y(I)
#define __cdecl
Definition: accygwin.h:79
static void MmuDbgInit(int deviceType, int devicePort)
Definition: mmu.h:267
int PpcConsGetCh()
Definition: mach.c:88
volatile char * video_mem
Definition: mach.c:36
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void BootMain(PSTR CmdLine)
POINT last
Definition: font.c:46
Definition: match.c:28
BOOLEAN PpcDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry)
Definition: mach.c:278
#define MachVideoGetDisplaySize(W, H, D)
Definition: machine.h:96
VOID(* VideoClearScreen)(UCHAR Attr)
Definition: machine.h:45
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
UCHAR NTAPI READ_PORT_UCHAR(PUCHAR Address)
Definition: mach.c:528
int(* of_proxy)(int table_off, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6)
Definition: of.h:10
BOOLEAN AcpiPresent
Definition: mach.c:33
PCONFIGURATION_COMPONENT_DATA(* HwDetect)(VOID)
Definition: machine.h:77
GLintptr offset
Definition: glext.h:5920
VOID(* VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth)
Definition: machine.h:47
#define MmuInit()
Definition: mmu.h:177
void * PageDirectoryEnd
Definition: mach.c:29
PFREELDR_MEMORY_DESCRIPTOR BiosMemoryMap
Definition: meminit.c:33
Definition: bl.h:199
VOID PpcVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: mach.c:152
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define Ch(x, y, z)
Definition: sha2.c:141
VOID PpcVideoHideShowTextCursor(BOOLEAN Show)
Definition: mach.c:121
_In_ ULONG _In_ ULONG PartitionNumber
Definition: iofuncs.h:2056
void DbgBreakPoint()
Definition: mach.c:553
BOOLEAN(* VideoIsPaletteFixed)(VOID)
Definition: machine.h:54
int mmu_initialized
Definition: mach.c:166
BOOLEAN PpcDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
Definition: mach.c:249
CHAR BootPart[MAX_PATH]
Definition: mach.c:34
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
struct node node
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
VOID OfwCopyDeviceTree(PCONFIGURATION_COMPONENT_DATA ParentKey, char *name, int innode, ULONG *BusNumber, ULONG *DiskController, ULONG *DiskNumber)
Definition: mach.c:324
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
PCONFIGURATION_COMPONENT_DATA PpcHwDetect()
Definition: mach.c:400
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
Definition: fw.h:9
#define MachVideoPutChar(Ch, Attr, X, Y)
Definition: machine.h:106
static void MmuSetMemorySize(paddr_t size)
Definition: mmu.h:232
unsigned char BOOLEAN
BOOLEAN(* DiskGetDriveGeometry)(UCHAR DriveNumber, PGEOMETRY DriveGeometry)
Definition: machine.h:68
VOID(* VideoSetTextCursorPosition)(UCHAR X, UCHAR Y)
Definition: machine.h:50
smooth NULL
Definition: ftsmooth.c:416
const PCSTR FrLdrVersionString
Definition: freeldr.c:32
static WCHAR Address[46]
Definition: ping.c:68
Definition: bufpool.h:45
TIMEINFO *(* GetTime)(VOID)
Definition: machine.h:72
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
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 GLint GLint j
Definition: glfuncs.h:250
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
ULONG Sectors
Definition: disk.h:28
PVOID MmAllocateMemory(SIZE_T MemorySize)
VOID(* VideoGetPaletteColor)(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: machine.h:56
#define d
Definition: ke_i.h:81
r parent
Definition: btrfs.c:2897
__wchar_t WCHAR
Definition: xmlstorage.h:180
uint64_t ULONGLONG
Definition: typedefs.h:65
#define MAX_PATH
Definition: compat.h:26
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
VOID __cdecl BootLinuxKernel(IN ULONG KernelSize, IN PVOID KernelCurrentLoadAddress, IN PVOID KernelTargetLoadAddress, IN UCHAR DriveNumber, IN ULONG PartitionNumber)
Definition: mach.c:536
VOID PpcVideoSetTextCursorPosition(ULONG X, ULONG Y)
Definition: mach.c:117
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BOOLEAN(* DiskReadLogicalSectors)(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
Definition: machine.h:67
BOOLEAN(* ConsKbHit)(VOID)
Definition: machine.h:42
static VIDEODISPLAYMODE DisplayMode
Definition: pcvideo.c:115
TIMEINFO * PpcGetTime(VOID)
Definition: mach.c:292
CHAR CmdLine[MAX_PATH]
Definition: mach.c:34
Definition: bl.h:200
VOID PpcVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
Definition: mach.c:129
unsigned char UCHAR
Definition: xmlstorage.h:181
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
void * PageDirectoryStart
Definition: mach.c:29
void PpcPrepInit()
Definition: prep.c:123
VOID(* VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: machine.h:52
VOID PpcVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: mach.c:125
enum tagVIDEODISPLAYMODE VIDEODISPLAYMODE
GLenum GLsizei len
Definition: glext.h:6722
static int chosen_package
Definition: mach.c:30
void PpcVideoClearScreen(UCHAR Attr)
Definition: mach.c:94
of_proxy ofproxy
Definition: mach.c:28
VOID(* VideoSetPaletteColor)(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: machine.h:55
ULONG SectorCount
Definition: part_xbox.c:32
VOID NTAPI FldrCreateComponentKey(IN PCONFIGURATION_COMPONENT_DATA SystemNode, IN CONFIGURATION_CLASS Class, IN CONFIGURATION_TYPE Type, IN IDENTIFIER_FLAG Flags, IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey)
Definition: archwsup.c:147
void PpcInit(of_proxy the_ofproxy)
Definition: mach.c:475
ULONG(* VideoGetBufferSize)(VOID)
Definition: machine.h:48
void beep()
Definition: mach.c:525
int(* ConsGetCh)(VOID)
Definition: machine.h:43
ULONG(* DiskGetCacheableBlockCount)(UCHAR DriveNumber)
Definition: machine.h:69
BOOLEAN PpcVideoIsPaletteFixed()
Definition: mach.c:148
VOID(* ConsPutChar)(int Ch)
Definition: machine.h:41
MACHVTBL MachVtbl
Definition: arcemul.c:21
ULONG BytesPerSector
Definition: disk.h:29
ULONG PpcPrepGetMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize)
Definition: prep.c:67
void MachInit(const char *CmdLine)
Definition: mach.c:484
static unsigned __int64 next
Definition: rand_nt.c:6
BOOLEAN PpcConsKbHit()
Definition: mach.c:84
ULONG PpcDiskGetCacheableBlockCount(ULONG DriveNumber)
Definition: mach.c:286
VOID(* HwIdle)(VOID)
Definition: machine.h:78
signed char * PSTR
Definition: retypes.h:7
Definition: disk.h:24
unsigned int * PULONG
Definition: retypes.h:1
VOID PpcHwIdle(VOID)
Definition: mach.c:412
ULONG PpcVideoGetBufferSize()
Definition: mach.c:103
char * strchr(const char *String, int ch)
Definition: utclib.c:501
static int stdout_handle
Definition: mach.c:30
VOID NarrowToWide(WCHAR *wide_name, char *name)
Definition: mach.c:299
Definition: name.c:36
VOID __cdecl ChainLoadBiosBootSectorCode(IN UCHAR BootDrive OPTIONAL, IN ULONG BootPartition OPTIONAL)
Definition: mach.c:546
VOID(* VideoSync)(VOID)
Definition: machine.h:57
VOID PpcVideoSync()
Definition: mach.c:162
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
void PpcOfwPutChar(int ch)
Definition: mach.c:38
unsigned int ULONG
Definition: retypes.h:1
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532
VOID(* VideoCopyOffScreenBufferToVRAM)(PVOID Buffer)
Definition: machine.h:53
ULONG CacheSizeLimit
Definition: cache.c:34
VIDEODISPLAYMODE(* VideoSetDisplayMode)(char *DisplayMode, BOOLEAN Init)
Definition: machine.h:46
VOID NTAPI FldrCreateSystemKey(OUT PCONFIGURATION_COMPONENT_DATA *SystemNode)
Definition: archwsup.c:89
ULONG PpcGetMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize)
Definition: mach.c:186
long jmp_buf[100]
Definition: of.h:11
CHAR FrLdrBootPath[MAX_PATH]
Definition: mach.c:34
static int stdin_handle
Definition: mach.c:30
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
VIDEODISPLAYMODE PpcVideoSetDisplayMode(char *DisplayMode, BOOLEAN Init)
Definition: mach.c:109
int mmu_handle
Definition: mach.c:31
static int part_handle
Definition: mach.c:30
VOID PpcVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
Definition: mach.c:97
void SetPhysByte(ULONG Addr, ULONG Data)
int mem_range_end
Definition: mach.c:167
#define printf
Definition: config.h:203
VOID(* VideoHideShowTextCursor)(BOOLEAN Show)
Definition: machine.h:51
VOID PpcVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: mach.c:157
Definition: dlist.c:348
jmp_buf jmp
Definition: mach.c:35
ULONG Heads
Definition: disk.h:27
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
int claimed[4]
Definition: mach.c:32