3 #include "ppcmmu/mmu.h"
6 int prep_serial
= 0x800003f8;
8 void sync() { __asm__("eieio\n\tsync"); }
12 void PpcPrepPutChar( int ch
) {
14 SetPhysByte(prep_serial
, 0x0d);
17 SetPhysByte(prep_serial
, ch
);
21 BOOLEAN PpcPrepDiskReadLogicalSectors
22 ( ULONG DriveNumber
, ULONGLONG SectorNumber
,
23 ULONG SectorCount
, PVOID Buffer
) {
26 for(secct
= 0; secct
< SectorCount
; secct
++)
28 ide_seek(&ide1_desc
, SectorNumber
+ secct
, 0);
29 ide_read(&ide1_desc
, ((PCHAR
)Buffer
) + secct
* 512, 512);
35 BOOLEAN
PpcPrepConsKbHit()
38 //return GetPhysByte(prep_serial+5) & 1;
41 int PpcPrepConsGetCh()
43 while(!PpcPrepConsKbHit());
44 return GetPhysByte(prep_serial
);
47 void PpcPrepVideoClearScreen(UCHAR Attr
)
52 VIDEODISPLAYMODE
PpcPrepVideoSetDisplayMode( char *DisplayMode
, BOOLEAN Init
)
57 void PpcPrepVideoGetDisplaySize( PULONG Width
, PULONG Height
, PULONG Depth
)
64 void PpcPrepVideoPrepareForReactOS(BOOLEAN setup
)
66 pci_setup(&pci1_desc
);
69 int mmu_initialized
= 0;
71 ULONG
PpcPrepGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap
,
72 ULONG MaxMemoryMapSize
)
75 BiosMemoryMap
[0].Type
= 1;
76 BiosMemoryMap
[0].BaseAddress
= 0xe80000;
77 BiosMemoryMap
[0].Length
= (64 * 1024 * 1024) - BiosMemoryMap
[0].BaseAddress
;
83 MmuSetMemorySize(BiosMemoryMap
[0].Length
+ BiosMemoryMap
[0].BaseAddress
);
89 MachVtbl
.ConsPutChar
= PpcPrepPutChar
;
91 printf("Serial on\n");
93 ide_setup( &ide1_desc
);
95 MachVtbl
.DiskReadLogicalSectors
= PpcPrepDiskReadLogicalSectors
;
97 MachVtbl
.ConsKbHit
= PpcPrepConsKbHit
;
98 MachVtbl
.ConsGetCh
= PpcPrepConsGetCh
;
100 MachVtbl
.VideoClearScreen
= PpcPrepVideoClearScreen
;
101 MachVtbl
.VideoSetDisplayMode
= PpcPrepVideoSetDisplayMode
;
102 MachVtbl
.VideoGetDisplaySize
= PpcPrepVideoGetDisplaySize
;
104 MachVtbl
.VideoPrepareForReactOS
= PpcPrepVideoPrepareForReactOS
;
106 MachVtbl
.GetMemoryMap
= PpcPrepGetMemoryMap
;
108 printf( "FreeLDR version [%s]\n", GetFreeLoaderVersionString() );