Author: arty
Date: Sun Jan 6 17:52:00 2008
New Revision: 31625
URL:
http://svn.reactos.org/svn/reactos?rev=31625&view=rev
Log:
t's a bit embarrasing that some of this was undone until recently, but we now
correctly communicate the boot-time memory map to kernel land. In question is
still how the ppcmmu idea of free pages and the ntoskrnl one will coincide.
Lots of things were adapted in ofwldr as ntoskrnl and freeldr changed a bit
since this was forked. Also, some hacks were in here to allow ofwldr to be
ignorant of how some things were mapped. That's fixed.
Many stupid and obvious bugs have been fixed.
I've basically gutted a lot of HAL stuff, so it isn't committed here.
I had mistakenly used the same array size as x86 did in the ports array in
kdcom. This is corrected.
I added in some support for boot time device detection (sadly, I haven't yet
decided what will become of openfirmware properties yet).
Much has been done to simplify the mess that mboot became.
Added:
trunk/reactos/ntoskrnl/ke/powerpc/thrdini.c (with props)
Removed:
trunk/reactos/include/reactos/ppcboot.h
trunk/reactos/include/reactos/ppcdebug.h
trunk/reactos/include/reactos/ppcfont.h
Modified:
trunk/reactos/ReactOS-ppc.rbuild
trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s
trunk/reactos/boot/freeldr/freeldr/arch/powerpc/loader.c
trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c
trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c
trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c
trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h
trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_pci.c
trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c
trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild
trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h
trunk/reactos/boot/freeldr/freeldr/include/of.h
trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
trunk/reactos/drivers/base/kdcom/kdbg.c
trunk/reactos/include/psdk/intrin_ppc.h
trunk/reactos/include/reactos/idl/idl.rbuild
trunk/reactos/include/reactos/libs/ppcmmu/mmu.h
trunk/reactos/include/reactos/wine/port.h
trunk/reactos/lib/ppcmmu/devint.s
trunk/reactos/lib/ppcmmu/mmuobject.c
trunk/reactos/ntoskrnl/include/internal/ke_x.h
trunk/reactos/ntoskrnl/ke/freeldr.c
trunk/reactos/ntoskrnl/ke/powerpc/kiinit.c
trunk/reactos/ntoskrnl/ke/powerpc/main_asm.S
trunk/reactos/ntoskrnl/ke/powerpc/ppc_irq.c
trunk/reactos/ntoskrnl/ke/powerpc/systimer.c
trunk/reactos/ntoskrnl/mm/mminit.c
trunk/reactos/tools/ofw_interface/calls.ofw
Modified: trunk/reactos/ReactOS-ppc.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-ppc.rbuild?rev=316…
==============================================================================
--- trunk/reactos/ReactOS-ppc.rbuild (original)
+++ trunk/reactos/ReactOS-ppc.rbuild Sun Jan 6 17:52:00 2008
@@ -11,7 +11,7 @@
<property name="MKHIVE_OPTIONS" value="-be" />
<property name="OFWLDR_LINKFORMAT" value="-L$(INTERMEDIATE)/lib/ppcmmu
-lppcmmu_code -nostdlib -nostartfiles -lgcc -Wl,-e,__start -Wl,-Ttext,0xe00000
-N"/>
- <property name="NTOSKRNL_SHARED" value="-Wl,--file-alignment,0x1000
-Wl,--section-alignment,0x1000 -nostartfiles"/>
+ <property name="NTOSKRNL_SHARED" value="-Wl,--file-alignment,0x1000
-Wl,--section-alignment,0x1000 -nostartfiles -shared"/>
<define name="__MSVCRT__"/>
<compilerflag>-fshort-wchar</compilerflag>
@@ -20,5 +20,4 @@
<compilerflag>-meabi</compilerflag>
<compilerflag>-O2</compilerflag>
<compilerflag>-Wno-strict-aliasing</compilerflag>
-
</project>
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s Sun Jan 6 17:52:00 2008
@@ -104,7 +104,7 @@
.long 0,0,0,0
.globl _bss
- .section ".bss"
+ .section ".bss2"
_bss:
.long 0
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/loader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/loader.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/loader.c Sun Jan 6 17:52:00 2008
@@ -26,6 +26,7 @@
#undef DbgPrint
#define DbgPrint printf
+extern PVOID KernelBase;
extern PVOID KernelMemory;
PVOID
@@ -264,9 +265,10 @@
*ImportAddressList = LdrPEGetExportByName((PVOID)LoaderModule->ModStart,
pe_name->Name, pe_name->Hint);
/* Fixup the address to be virtual */
- *ImportAddressList = (PVOID)((ULONG_PTR)*ImportAddressList + (KSEG0_BASE -
(ULONG_PTR)KernelMemory));
-
- //DbgPrint("Looked for: %s and found: %p\n", pe_name->Name,
*ImportAddressList);
+ *ImportAddressList = (PVOID)(ULONG_PTR)*ImportAddressList +
(ULONG_PTR)KernelBase - (ULONG_PTR)KernelMemory;
+
+
+ //DbgPrint("Looked for: %s and found: %x\n", pe_name->Name,
*ImportAddressList);
if ((*ImportAddressList) == NULL)
{
DbgPrint("Failed to import %s from %s\n", pe_name->Name,
LoaderModule->String);
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c Sun Jan 6 17:52:00 2008
@@ -20,7 +20,6 @@
#include "machine.h"
#include "ppcmmu/mmu.h"
#include "of.h"
-#include "ppcboot.h"
#include "prep.h"
#include "compat.h"
@@ -29,14 +28,13 @@
extern ULONG CacheSizeLimit;
of_proxy ofproxy;
void *PageDirectoryStart, *PageDirectoryEnd;
-static int chosen_package, stdin_handle, stdout_handle,
- part_handle = -1, kernel_mem = 0;
-int mmu_handle = 0, FixedMemory = 0;
+static int chosen_package, stdin_handle, stdout_handle, part_handle = -1;
+int mmu_handle = 0;
+int claimed[4];
BOOLEAN AcpiPresent = FALSE;
char BootPath[0x100] = { 0 }, BootPart[0x100] = { 0 }, CmdLine[0x100] = {
"bootprep" };
jmp_buf jmp;
volatile char *video_mem = 0;
-boot_infos_t BootInfo;
void PpcOfwPutChar( int ch ) {
char buf[3];
@@ -166,136 +164,15 @@
printf( "Sync\n" );
}
-static int prom_next_node(int *nodep)
-{
- int node;
-
- if ((node = *nodep) != 0
- && (*nodep = ofw_child(node)) != 0)
- return 1;
- if ((*nodep = ofw_peer(node)) != 0)
- return 1;
- for (;;) {
- if ((node = ofw_parent(node)) == 0)
- return 0;
- if ((*nodep = ofw_peer(node)) != 0)
- return 1;
- }
-}
-
-/* Appropriated from linux' btext.c
- * author:
- * Benjamin Herrenschmidt <benh(a)kernel.crashing.org>
- */
-VOID PpcVideoPrepareForReactOS(BOOLEAN Setup) {
- int i, j, k, /* display_handle, */ display_package, display_size = 0;
- int node, ret, elts;
- int device_address;
- //pci_reg_property display_regs[8];
- char type[256], path[256], name[256];
- char logo[] = {
- " "
- " XXXXXX "
- " X X "
- " X X X X "
- " X X "
- " X XXXX X "
- " X XX X "
- " X X "
- " XXXXXX "
- " "
- };
- int logo_x = 10, logo_y = 10;
- int logo_scale_x = 8, logo_scale_y = 8;
-
-
- for( node = ofw_finddevice("/"); prom_next_node(&node); ) {
- memset(type, 0, sizeof(type));
- memset(path, 0, sizeof(path));
-
- ret = ofw_getprop(node, "name", name, sizeof(name));
-
- if(ofw_getprop(node, "device_type", type, sizeof(type)) <= 0) {
- printf("Could not get type for node %x\n", node);
- continue;
- }
-
- printf("Node %x ret %d name %s type %s\n", node, ret, name, type);
-
- if(strcmp(type, "display") == 0) break;
- }
-
- if(!node) return;
-
- if(ofw_package_to_path(node, path, sizeof(path)) < 0) {
- printf("could not get path for display package %x\n", node);
- return;
- }
-
- printf("Opening display package: %s\n", path);
- display_package = ofw_finddevice(path);
- printf("display package %x\n", display_package);
-
- BootInfo.dispDeviceRect[0] = BootInfo.dispDeviceRect[1] = 0;
-
- ofw_getprop(display_package, "width",
- (void *)&BootInfo.dispDeviceRect[2], sizeof(int));
- ofw_getprop(display_package, "height",
- (void *)&BootInfo.dispDeviceRect[3], sizeof(int));
- ofw_getprop(display_package, "depth",
- (void *)&BootInfo.dispDeviceDepth, sizeof(int));
- ofw_getprop(display_package, "linebytes",
- (void *)&BootInfo.dispDeviceRowBytes, sizeof(int));
-
- BootInfo.dispDeviceRect[2] = BootInfo.dispDeviceRect[2];
- BootInfo.dispDeviceRect[3] = BootInfo.dispDeviceRect[3];
- BootInfo.dispDeviceDepth = BootInfo.dispDeviceDepth;
- BootInfo.dispDeviceRowBytes = BootInfo.dispDeviceRowBytes;
-
- if(ofw_getprop
- (display_package,
- "address",
- (void *)&device_address,
- sizeof(device_address)) < 1) {
- printf("Could not get device base\n");
- return;
- }
-
- BootInfo.dispDeviceBase = (PVOID)(device_address);
-
- display_size = BootInfo.dispDeviceRowBytes * BootInfo.dispDeviceRect[3];
-
- printf("Display size is %x bytes (%x per row times %x rows)\n",
- display_size,
- BootInfo.dispDeviceRowBytes,
- BootInfo.dispDeviceRect[3]);
-
- printf("display is at %x\n", BootInfo.dispDeviceBase);
-
- for( i = 0; i < logo_y * logo_scale_y; i++ ) {
- for( j = 0; j < logo_x * logo_scale_x; j++ ) {
- elts = (j/logo_scale_x) + ((i/logo_scale_y) * logo_x);
-
- for( k = 0; k < BootInfo.dispDeviceDepth/8; k++ ) {
- SetPhysByte(((ULONG_PTR)BootInfo.dispDeviceBase)+
- k +
- ((j * (BootInfo.dispDeviceDepth/8)) +
- (i * (BootInfo.dispDeviceRowBytes))),
- logo[elts] == ' ' ? 0 : 255);
- }
- }
- }
-}
-
int mmu_initialized = 0;
int mem_range_end;
-VOID PpcInitializeMmu(int max_mem)
+VOID PpcInitializeMmu()
{
if(!mmu_initialized)
{
MmuInit();
MmuDbgInit(0, 0x800003f8);
- MmuSetMemorySize(mem_range_end > max_mem ? mem_range_end : max_mem);
+ MmuSetMemorySize(mem_range_end);
//MmuDbgEnter(0x20);
mmu_initialized = 1;
}
@@ -309,67 +186,63 @@
*/
ULONG PpcGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap,
ULONG MaxMemoryMapSize ) {
- int i, memhandle, returned, total = 0, slots = 0;
- int memdata[0x40];
+ int i, memhandle, total = 0, slots = 0, last = 0x40000, allocstart = 0x1000000;
+ int regdata[0x40];
printf("PpcGetMemoryMap(%d)\n", MaxMemoryMapSize);
memhandle = ofw_finddevice("/memory");
- returned = ofw_getprop(memhandle, "available",
- (char *)memdata, sizeof(memdata));
-
- printf("Returned data: %d\n", returned);
- if( returned == -1 ) {
- printf("getprop /memory[@reg] failed\n");
- return PpcPrepGetMemoryMap( BiosMemoryMap, MaxMemoryMapSize );
- }
-
- for( i = 0; i < returned; i++ ) {
- printf("%x ", memdata[i]);
- }
- printf("\n");
-
- for( i = 0; i < returned / 2; i++ ) {
- BiosMemoryMap[slots].Type = BiosMemoryUsable;
- BiosMemoryMap[slots].BaseAddress = memdata[i*2];
- BiosMemoryMap[slots].Length = memdata[i*2+1];
- printf("MemoryMap[%d] = (%x:%x)\n",
- i,
- (int)BiosMemoryMap[slots].BaseAddress,
- (int)BiosMemoryMap[slots].Length);
-
- // Track end of ram
- if (BiosMemoryMap[slots].BaseAddress + BiosMemoryMap[slots].Length >
- mem_range_end)
- {
- mem_range_end =
- BiosMemoryMap[slots].BaseAddress + BiosMemoryMap[slots].Length;
+ ofw_getprop(memhandle, "reg", (char *)regdata, sizeof(regdata));
+
+ /* Try to claim some memory in usable blocks. Try to get some 8mb bits */
+ for( i = 0; i < sizeof(claimed) / sizeof(claimed[0]); ) {
+ if (!claimed[i])
+ claimed[i] = ofw_claim(allocstart, 8 * 1024 * 1024, 0x1000);
+
+ allocstart += 8 * 1024 * 1024;
+
+ if (claimed[i]) {
+ if (last < claimed[i]) {
+ BiosMemoryMap[slots].Type = BiosMemoryAcpiReclaim;
+ BiosMemoryMap[slots].BaseAddress = last;
+ BiosMemoryMap[slots].Length = claimed[i] - last;
+ slots++;
+ }
+
+ BiosMemoryMap[slots].Type = BiosMemoryUsable;
+ BiosMemoryMap[slots].BaseAddress = claimed[i];
+ BiosMemoryMap[slots].Length = 8 * 1024 * 1024;
+
+ total += BiosMemoryMap[slots].Length;
+ last =
+ BiosMemoryMap[slots].BaseAddress +
+ BiosMemoryMap[slots].Length;
+ slots++;
+ i++;
}
-
- /* Hack for pearpc */
- if( kernel_mem ) {
- BiosMemoryMap[slots].Length = kernel_mem * 1024;
- if( !FixedMemory ) {
- ofw_claim((int)BiosMemoryMap[slots].BaseAddress,
- (int)BiosMemoryMap[slots].Length,
- 0x1000);
- FixedMemory = BiosMemoryMap[slots].BaseAddress;
- }
- total += BiosMemoryMap[slots].Length;
- slots++;
- break;
- /* Normal way */
- } else if( BiosMemoryMap[slots].Length &&
- ofw_claim((int)BiosMemoryMap[slots].BaseAddress,
- (int)BiosMemoryMap[slots].Length,
- 0x1000) ) {
- total += BiosMemoryMap[slots].Length;
- slots++;
- }
- }
-
- printf( "Returning memory map (%dk total)\n", total / 1024 );
+ }
+
+ /* Get the rest until the end of the memory object as we see it */
+ if (last < regdata[1]) {
+ BiosMemoryMap[slots].Type = BiosMemoryAcpiReclaim;
+ BiosMemoryMap[slots].BaseAddress = last;
+ BiosMemoryMap[slots].Length = regdata[1] - last;
+ slots++;
+ }
+
+ for (i = 0; i < slots; i++) {
+ printf("MemoryMap[%d] = (%x:%x)\n",
+ i,
+ (int)BiosMemoryMap[i].BaseAddress,
+ (int)BiosMemoryMap[i].Length);
+
+ }
+
+ mem_range_end = regdata[1];
+
+ printf( "Returning memory map (%d entries, %dk free, %dk total ram)\n",
+ slots, total / 1024, regdata[1] / 1024 );
return slots;
}
@@ -472,6 +345,15 @@
VOID PpcRTCGetCurrentDateTime( PULONG Hear, PULONG Month, PULONG Day,
PULONG Hour, PULONG Minute, PULONG Second ) {
//printf("RTCGeturrentDateTime\n");
+}
+
+VOID NarrowToWide(WCHAR *wide_name, char *name)
+{
+ char *copy_name;
+ WCHAR *wide_name_ptr;
+ for (wide_name_ptr = wide_name, copy_name = name;
+ (*wide_name_ptr = *copy_name);
+ wide_name_ptr++, copy_name++);
}
/* Recursively copy the device tree into our representation
@@ -489,10 +371,31 @@
* configuration scheme that relies both on verification of devices and
* recording information from openfirmware to be treated as hints.
*/
-VOID OfwCopyDeviceTree(PPPC_DEVICE_TREE tree, int innode)
+VOID OfwCopyDeviceTree
+(PCONFIGURATION_COMPONENT_DATA ParentKey,
+ char *name,
+ int innode,
+ ULONG *BusNumber,
+ ULONG *DiskController,
+ ULONG *DiskNumber)
{
int proplen = 0, node = innode;
- char *prev_name, cur_name[64], data[256], *slash;
+ char *prev_name, cur_name[64], data[256], *slash, devtype[64];
+ wchar_t wide_name[64];
+ PCONFIGURATION_COMPONENT_DATA NewKey;
+
+ NarrowToWide(wide_name, name);
+
+ /* Create a key for this device */
+ FldrCreateComponentKey
+ (ParentKey,
+ wide_name,
+ 0,
+ AdapterClass,
+ MultiFunctionAdapter,
+ &NewKey);
+
+ FldrSetComponentInformation(NewKey, 0, 0, (ULONG)-1);
/* Add properties */
for (prev_name = ""; ofw_nextprop(node, prev_name, cur_name) == 1; )
@@ -505,10 +408,32 @@
continue;
}
ofw_getprop(node, cur_name, data, sizeof(data));
- PpcDevTreeAddProperty(tree, 0, cur_name, data, proplen);
+
+ /* Get device type so we can examine it */
+ if (!strcmp(cur_name, "device_type"))
+ strcpy(devtype, (char *)data);
+
+ NarrowToWide(wide_name, cur_name);
+ //RegSetValue(NewKey, wide_name, REG_BINARY, data, proplen);
+
strcpy(data, cur_name);
prev_name = data;
}
+
+#if 0
+ /* Special device handling */
+ if (!strcmp(devtype, "ata"))
+ {
+ OfwHandleDiskController(NewKey, node, *DiskController);
+ (*DiskController)++;
+ *DiskNumber = 0;
+ }
+ else if (!strcmp(devtype, "disk"))
+ {
+ OfwHandleDiskObject(NewKey, node, *DiskController, *DiskNumber);
+ (*DiskNumber)++;
+ }
+#endif
/* Subdevices */
for (node = ofw_child(node); node; node = ofw_peer(node))
@@ -516,29 +441,21 @@
ofw_package_to_path(node, data, sizeof(data));
slash = strrchr(data, '/');
if (slash) slash++; else continue;
- PpcDevTreeAddDevice(tree, 0, slash);
- OfwCopyDeviceTree(tree, node);
- PpcDevTreeCloseDevice(tree);
+ OfwCopyDeviceTree
+ (NewKey, slash, node, BusNumber, DiskController, DiskNumber);
}
}
VOID PpcHwDetect() {
- PPC_DEVICE_TREE tree;
+ PCONFIGURATION_COMPONENT_DATA RootKey;
+ ULONG BusNumber = 0, DiskController = 0, DiskNumber = 0;
int node = ofw_finddevice("/");
- /* Start the tree */
- if(!PpcDevTreeInitialize
- (&tree,
- PAGE_SIZE, sizeof(long long),
- (PPC_DEVICE_ALLOC)MmAllocateMemory,
- (PPC_DEVICE_FREE)MmFreeMemory))
- return;
-
- OfwCopyDeviceTree(&tree,node);
-
- PpcDevTreeCloseDevice(&tree);
-
- BootInfo.machine = tree.head;
+ FldrCreateSystemKey(&RootKey);
+
+ FldrSetComponentInformation(RootKey, 0, 0, (ULONG)-1);
+
+
OfwCopyDeviceTree(RootKey,"/",node,&BusNumber,&DiskController,&DiskNumber);
}
BOOLEAN PpcDiskNormalizeSystemPath(char *SystemPath, unsigned Size) {
@@ -579,8 +496,9 @@
return TRUE;
}
-extern int _bss;
-//typedef unsigned int uint32_t;
+/* Compatibility functions that don't do much */
+VOID PpcVideoPrepareForReactOS(BOOLEAN Setup) {
+}
void PpcDefaultMachVtbl()
{
@@ -637,6 +555,7 @@
if(!strncmp(CmdLine, "bootprep", 8))
{
printf("Going to PREP init...\n");
+ ofproxy = NULL;
PpcPrepInit();
return;
}
@@ -669,11 +588,6 @@
sep = strchr(BootPart, ',');
if( sep )
*sep = 0;
- while(CmdLine[i] && CmdLine[i]!=',') i++;
- }
- if( strncmp(CmdLine + i, "mem=", 4) == 0) {
- kernel_mem = atoi(CmdLine+i+4);
- printf("Allocate %dk kernel memory\n", kernel_mem);
while(CmdLine[i] && CmdLine[i]!=',') i++;
}
}
@@ -699,7 +613,6 @@
printf( "FreeLDR starting (boot partition: %s)\n", BootPart );
}
-/* Compatibility functions that don't do much */
void beep() {
}
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c Sun Jan 6 17:52:00 2008
@@ -21,17 +21,17 @@
#include <freeldr.h>
#include <elf/elf.h>
#include <elf/reactos.h>
-#include <of_call.h>
-#include "ppcboot.h"
+#include <of.h>
#include "ppcmmu/mmu.h"
#include "compat.h"
-#include "ppcfont.h"
#define NDEBUG
#include <debug.h>
+/* We'll check this to see if we're in OFW land */
+extern of_proxy ofproxy;
+
PVOID KernelMemory = 0;
-extern boot_infos_t BootInfo;
/* Bits to shift to convert a Virtual Address into an Offset in the Page Table */
#define PFN_SHIFT 12
@@ -51,13 +51,6 @@
#define HyperspacePageTableIndex (HYPERSPACE_BASE >> 22)
#define KpcrPageTableIndex (KPCR_BASE >> 22)
#define ApicPageTableIndex (APIC_BASE >> 22)
-
-#define LowMemPageTableIndexPae 0
-#define StartupPageTableIndexPae (STARTUP_BASE >> 21)
-#define HyperspacePageTableIndexPae (HYPERSPACE_PAE_BASE >> 21)
-#define KpcrPageTableIndexPae (KPCR_BASE >> 21)
-#define ApicPageTableIndexPae (APIC_BASE >> 21)
-
#define BAT_GRANULARITY (64 * 1024)
#define KernelMemorySize (8 * 1024 * 1024)
@@ -129,16 +122,43 @@
ppc_map_info_t *info;
} ppc_map_set_t;
+extern int mmu_handle;
+paddr_t MmuTranslate(paddr_t possibly_virtual)
+{
+ if (ofproxy)
+ {
+ /* Openfirmware takes liberties with boot-time memory.
+ * if you're in a unitary kernel, it's not as difficult, but since
+ * we rely on loading things into virtual space from here, we need
+ * to detect the mappings so far.
+ */
+ int args[2];
+ args[0] = possibly_virtual;
+ args[1] = 1; /* Marker to tell we want a physical addr */
+ return (paddr_t)ofw_callmethod_ret("translate", mmu_handle, 2, args,
3);
+ }
+ else
+ {
+ /* Other booters don't remap ram */
+ return possibly_virtual;
+ }
+}
+
VOID
NTAPI
FrLdrAddPageMapping(ppc_map_set_t *set, int proc, paddr_t phys, vaddr_t virt)
{
int j;
paddr_t page = ROUND_DOWN(phys, (1<<PFN_SHIFT));
+
if (virt == 0)
- virt = page;
+ virt = ROUND_DOWN(page, (1<<PFN_SHIFT));
else
virt = ROUND_DOWN(virt, (1<<PFN_SHIFT));
+
+ page = MmuTranslate(page);
+
+ //printf("Mapping virt [%x] to phys [%x (from) %x]\n", virt, page, phys);
for( j = 0; j < set->usecount; j++ )
{
@@ -166,87 +186,110 @@
set->usecount++;
}
+extern int _start[], _end[];
+
VOID
NTAPI
FrLdrStartup(ULONG Magic)
{
- ULONG_PTR i, tmp;
+ ULONG_PTR i, tmp, OldModCount = 0;
PCHAR ModHeader;
- boot_infos_t *LocalBootInfo = &BootInfo;
- LocalBootInfo->dispFont = (font_char *)&LocalBootInfo[1];
- LoaderBlock.ArchExtra = (ULONG)LocalBootInfo;
+ CHAR ModulesTreated[64] = { 0 };
+ ULONG NumberOfEntries = 0, UsedEntries = 0;
+ PPAGE_LOOKUP_TABLE_ITEM FreeLdrMap = MmGetMemoryMap(&NumberOfEntries);
ppc_map_set_t memmap = { };
- for(i = 0; i < LoaderBlock.ModsCount; i++)
- {
- ModHeader = ((PCHAR)reactos_modules[i].ModStart);
- if(ModHeader[0] == 'M' && ModHeader[1] == 'Z')
- LdrPEFixupImports
- ((PVOID)reactos_modules[i].ModStart,
- (PCHAR)reactos_modules[i].String);
- else /* Make RVA */
+ printf("FrLdrStartup\n");
+
+ /* Disable EE */
+ __asm__("mfmsr %0" : "=r" (tmp));
+ tmp &= 0x7fff;
+ __asm__("mtmsr %0" : : "r" (tmp));
+
+ while(OldModCount != LoaderBlock.ModsCount)
+ {
+ printf("Added %d modules last pass\n",
+ LoaderBlock.ModsCount - OldModCount);
+
+ OldModCount = LoaderBlock.ModsCount;
+
+ for(i = 0; i < LoaderBlock.ModsCount; i++)
{
- reactos_modules[i].ModStart -= (ULONG_PTR)KernelMemory;
- reactos_modules[i].ModEnd -= (ULONG_PTR)KernelMemory;
+ if (!ModulesTreated[i])
+ {
+ ModulesTreated[i] = 1;
+ ModHeader = ((PCHAR)reactos_modules[i].ModStart);
+ if(ModHeader[0] == 'M' && ModHeader[1] == 'Z')
+ LdrPEFixupImports
+ ((PVOID)reactos_modules[i].ModStart,
+ (PCHAR)reactos_modules[i].String);
+ else
+ {
+ printf("Module header for %s was [%x:%x]\n",
+ reactos_modules[i].String,
+ reactos_modules[i].ModStart,
+ reactos_modules[i].ModEnd);
+ reactos_modules[i].ModStart +=
+ (KernelBase & 0xffffff) - (ULONG_PTR)KernelMemory;
+ reactos_modules[i].ModEnd +=
+ (KernelBase & 0xffffff) - (ULONG_PTR)KernelMemory;
+ printf("Module header for %s now [%x:%x]\n",
+ reactos_modules[i].String,
+ reactos_modules[i].ModStart,
+ reactos_modules[i].ModEnd);
+ }
+ }
}
}
- /* We don't use long longs, but longs for the addresses in the
- * ADDRESS_RANGE structure. Swap the quad halves of our memory
- * map.
- */
- for( i = 0;
- i < reactos_memory_map_descriptor_size / sizeof(reactos_memory_map[0]);
- i++ )
- {
- tmp = reactos_memory_map[i].base_addr_high;
- reactos_memory_map[i].base_addr_high = reactos_memory_map[i].base_addr_low;
- reactos_memory_map[i].base_addr_low = tmp;
- tmp = reactos_memory_map[i].length_high;
- reactos_memory_map[i].length_high = reactos_memory_map[i].length_low;
- reactos_memory_map[i].length_low = tmp;
- }
-
- printf("PpcInitializeMmu\n");
+ printf("Starting mmu\n");
+
PpcInitializeMmu(0);
- printf("PpcInitializeMmu done\n");
-
+
+ printf("Allocating vsid 0 (kernel)\n");
+ MmuAllocVsid(0, 0xff00);
+
/* We'll use vsid 1 for freeldr (expendable) */
+ printf("Allocating vsid 1 (freeldr)\n");
MmuAllocVsid(1, 0xff);
+
+ printf("Mapping Freeldr Code (%x-%x)\n", _start, _end);
+
+ /* Map memory zones */
+ /* Freeldr itself */
+ for( i = (int)_start;
+ i < (int)_end;
+ i += (1<<PFN_SHIFT) ) {
+ FrLdrAddPageMapping(&memmap, 1, i, 0);
+ }
+
+ printf("Mapping %d Heap Pages\n", i);
+
+ /* Heap pages -- this gets the entire freeldr heap */
+ for( i = 0; i < NumberOfEntries; i++ ) {
+ tmp = i<<PFN_SHIFT;
+ if (FreeLdrMap[i].PageAllocated == LoaderSystemCode) {
+ UsedEntries++;
+ if (tmp >= (ULONG)KernelMemory &&
+ tmp < (ULONG)KernelMemory + KernelMemorySize) {
+ FrLdrAddPageMapping(&memmap, 0, tmp, KernelBase + tmp -
(ULONG)KernelMemory);
+ } else {
+ FrLdrAddPageMapping(&memmap, 1, tmp, 0);
+ }
+ }
+ }
+
+ MmuMapPage(memmap.info, memmap.usecount);
+
+ printf("Finished Mapping the Freeldr Heap (used %d pages)\n",
UsedEntries);
+
+ printf("Setting initial segments\n");
MmuSetVsid(0, 8, 1);
-
- MmuAllocVsid(0, 0xff00);
MmuSetVsid(8, 16, 0);
- /* Map kernel space 0x80000000 ... */
- for( i = (ULONG)KernelMemory;
- i < (ULONG)KernelMemory + KernelMemorySize;
- i += (1<<PFN_SHIFT) ) {
-
- FrLdrAddPageMapping(&memmap, 0, i, KernelBase + i - (ULONG)KernelMemory);
- }
-
- /* Map device data */
- for (i = (ULONG)BootInfo.machine;
- i < (ULONG)PpcDevTreeSiblingNode(BootInfo.machine);
- i += (1<<PFN_SHIFT) )
- {
- FrLdrAddPageMapping(&memmap, 0, i, 0);
- }
-
- /* Map module name strings */
- for( i = 0; i < LoaderBlock.ModsCount; i++ )
- {
- FrLdrAddPageMapping(&memmap, 1, (ULONG)reactos_modules[i].String, 0);
- }
-
- /* Map memory zones */
- FrLdrAddPageMapping(&memmap, 1, (vaddr_t)&reactos_memory_map_descriptor_size,
0);
- FrLdrAddPageMapping(&memmap, 1, (vaddr_t)&LoaderBlock, 0);
-
- MmuMapPage(memmap.info, memmap.usecount);
-
- MmuTurnOn((KernelEntryFn)KernelEntryPoint, (void*)&LoaderBlock);
+ printf("Segments set!\n");
+
+ MmuTurnOn((KernelEntryFn)KernelEntryPoint, &LoaderBlock);
/* Nothing more */
while(1);
@@ -298,10 +341,10 @@
PCHAR p;
/* Default kernel base at 2GB */
- KernelBase = 0x80000000;
+ KernelBase = 0x80800000;
/* Set KernelBase */
- LoaderBlock.KernelBase = KernelBase;
+ LoaderBlock.KernelBase = 0x80000000;
/* Read Command Line */
p = (PCHAR)LoaderBlock.CommandLine;
@@ -626,13 +669,11 @@
ModuleData->ModEnd = NextModuleBase;
ModuleData->String = (ULONG)MmAllocateMemory(strlen(ImageName)+1);
strcpy((PCHAR)ModuleData->String, ImageName);
-#if 0
printf("Module %s (%x-%x) next at %x\n",
ModuleData->String,
ModuleData->ModStart,
ModuleData->ModEnd,
NextModuleBase);
-#endif
LoaderBlock.ModsCount++;
/* Return Success */
@@ -720,6 +761,12 @@
*ModuleSize = LocalModuleSize;
}
+ printf("Module %s (%x-%x) next at %x\n",
+ ModuleData->String,
+ ModuleData->ModStart,
+ ModuleData->ModEnd,
+ NextModuleBase);
+
return ThisModuleBase;
}
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c Sun Jan 6 17:52:00 2008
@@ -1,11 +1,10 @@
#include "freeldr.h"
#include "machine.h"
-#include "ppcboot.h"
#include "ppcmmu/mmu.h"
#include "prep.h"
-extern boot_infos_t BootInfo;
int prep_serial = 0x800003f8;
+extern int mem_range_end;
void sync() { __asm__("eieio\n\tsync"); }
@@ -83,7 +82,7 @@
// Find the last ram address in physical space ... this bypasses mapping
// but could run into non-ram objects right above ram. Usually systems
// aren't designed like that though.
- for (physAddr = 0x30000, change = newStore;
+ for (physAddr = 0x40000, change = newStore;
(physAddr < 0x80000000) && (change == newStore);
physAddr += 1 << 12)
{
@@ -101,86 +100,27 @@
__asm__("mtmsr %0\n" : : "r" (oldmsr));
+ mem_range_end = physAddr;
+
printf("Actual RAM: %d Mb\n", physAddr >> 20);
- PpcInitializeMmu(BiosMemoryMap[0].BaseAddress + BiosMemoryMap[0].Length);
return 1;
}
/* Most PReP hardware is in standard locations, based on the corresponding
* hardware on PCs. */
VOID PpcPrepHwDetect() {
- PPC_DEVICE_TREE tree;
- PPC_DEVICE_RANGE range;
- int interrupt;
+ PCONFIGURATION_COMPONENT_DATA SystemKey;
- /* Start the tree */
- if(!PpcDevTreeInitialize
- (&tree,
- PAGE_SIZE, sizeof(long long),
- (PPC_DEVICE_ALLOC)MmAllocateMemory,
- (PPC_DEVICE_FREE)MmFreeMemory))
- return;
+ /* Create the 'System' key */
+ FldrCreateSystemKey(&SystemKey);
- /* PCI Bus */
- PpcDevTreeAddDevice(&tree, PPC_DEVICE_PCI_EAGLE, "pci");
-
- /* Check out the devices on the bus */
- pci_setup(&tree, &pci1_desc);
-
- /* End PCI Bus */
- PpcDevTreeCloseDevice(&tree);
-
- /* ISA Bus */
- PpcDevTreeAddDevice(&tree, PPC_DEVICE_ISA_BUS, "isa");
-
- /* Serial port */
- PpcDevTreeAddDevice(&tree, PPC_DEVICE_SERIAL_8250, "com1");
- range.start = (PVOID)0x800003f8;
- range.len = 8;
- range.type = PPC_DEVICE_IO_RANGE;
- interrupt = 4;
- PpcDevTreeAddProperty
- (&tree, PPC_DEVICE_SPACE_RANGE, "reg", (char *)&range,
sizeof(range));
- PpcDevTreeAddProperty
- (&tree, PPC_DEVICE_INTERRUPT, "interrupt",
- (char *)&interrupt, sizeof(interrupt));
- PpcDevTreeCloseDevice(&tree);
-
- /* We probably have an ISA IDE controller */
- PpcDevTreeAddDevice(&tree, PPC_DEVICE_IDE_DISK, "ide0");
- range.start = (PVOID)0x800001f8;
- range.len = 8;
- range.type = PPC_DEVICE_IO_RANGE;
- interrupt = 14;
- PpcDevTreeAddProperty
- (&tree, PPC_DEVICE_SPACE_RANGE, "reg", (char *)&range,
sizeof(range));
- PpcDevTreeAddProperty
- (&tree, PPC_DEVICE_INTERRUPT, "interrupt",
- (char *)&interrupt, sizeof(interrupt));
- PpcDevTreeCloseDevice(&tree);
-
- /* Describe VGA */
- PpcDevTreeAddDevice(&tree, PPC_DEVICE_VGA, "vga");
- range.start = (PVOID)0x800003c0;
- range.len = 0x20;
- range.type = PPC_DEVICE_IO_RANGE;
- PpcDevTreeAddProperty
- (&tree, PPC_DEVICE_SPACE_RANGE, "reg", (char *)&range,
sizeof(range));
- range.start = BootInfo.dispDeviceBase;
- range.len = BootInfo.dispDeviceRowBytes * BootInfo.dispDeviceRect[3];
- range.type = PPC_DEVICE_MEM_RANGE;
- PpcDevTreeAddProperty
- (&tree, PPC_DEVICE_SPACE_RANGE, "mem", (char *)&range,
sizeof(range));
- PpcDevTreeCloseDevice(&tree);
-
- /* End ISA Bus */
- PpcDevTreeCloseDevice(&tree);
-
- /* And finish by closing the root node */
- PpcDevTreeCloseDevice(&tree);
-
- /* Now fish out the root node. The dev tree is a slab of memory */
- BootInfo.machine = PpcDevTreeGetRootNode(&tree);
+ /* Set empty component information */
+ FldrSetComponentInformation(SystemKey,
+ 0x0,
+ 0x0,
+ 0xFFFFFFFF);
+
+ printf("DetectHardware() Done\n");
}
void PpcPrepInit()
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h Sun Jan 6 17:52:00 2008
@@ -1,7 +1,5 @@
#ifndef FREELDR_ARCH_POWERPC_PREP_H
#define FREELDR_ARCH_POWERPC_PREP_H
-
-#include "ppcboot.h"
extern struct _pci_desc pci1_desc;
extern struct _idectl_desc ide1_desc;
@@ -17,11 +15,17 @@
void ide_setup( void *extension );
void print_bar( struct _pci_bar *bar );
-void pci_setup( PPC_DEVICE_TREE *tree, struct _pci_desc *pci_desc );
-void pci_read_bar( struct _pci_desc *pci_desc, int bus, int dev, int fn, int bar, struct
_pci_bar *bar_data );
+void pci_setup
+( PCONFIGURATION_COMPONENT_DATA pci_bus,
+ struct _pci_desc *pci_desc );
+void pci_read_bar
+( struct _pci_desc *pci_desc,
+ int bus, int dev, int fn, int bar,
+ struct _pci_bar *bar_data );
-void vga_setup( PPC_DEVICE_TREE *tree,
- struct _pci_desc *pci_desc, struct _vga_desc *vga_desc,
- int bus, int dev, int fn );
+void vga_setup
+( PCONFIGURATION_COMPONENT_DATA pci_bus,
+ struct _pci_desc *pci_desc, struct _vga_desc *vga_desc,
+ int bus, int dev, int fn );
#endif//FREELDR_ARCH_POWERPC_PREP_H
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_pci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_pci.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_pci.c Sun Jan 6 17:52:00 2008
@@ -93,7 +93,7 @@
#define PCI_HEADER_TYPE 0xe
#define PCI_BASECLASS 0xb
-void pci_setup( PPC_DEVICE_TREE *tree, pci_desc *desc ) {
+void pci_setup( PCONFIGURATION_COMPONENT_DATA pcibus, pci_desc *desc ) {
unsigned char type;
unsigned short vendor, device, devclass;
int funcs, bus, dev, fn;
@@ -117,7 +117,7 @@
if( devclass == 3 ) {
printf("Setting up vga...\n");
- vga_setup(tree,desc,&vga1_desc,bus,dev,fn);
+ vga_setup(pcibus,desc,&vga1_desc,bus,dev,fn);
printf("Done with vga\n");
}
}
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c Sun Jan 6 17:52:00 2008
@@ -1,8 +1,5 @@
#include <freeldr.h>
#include "prep.h"
-#include "ppcboot.h"
-
-extern boot_infos_t BootInfo;
struct _vga_desc {
char *port;
@@ -13,7 +10,7 @@
#define VGA_HEIGHT 768
struct _vga_desc vga1_desc = { (char *)0x800003c0 };
-void vga_setup( PPC_DEVICE_TREE *tree,
+void vga_setup( PCONFIGURATION_COMPONENT_DATA pcibus,
struct _pci_desc *desc, struct _vga_desc *vga_desc,
int bus, int dev, int fn ) {
struct _pci_bar bar_data;
@@ -24,7 +21,7 @@
print_bar( &bar_data );
if( (bar_data.data > 0x10000) || ((bar_data.data&1) == 1) ) {
vga_desc->addr = (char *)(0xc0000000 + (bar_data.data & ~0x7ff));
- BootInfo.dispDeviceBase = vga_desc->addr;
+// BootInfo.dispDeviceBase = vga_desc->addr;
break;
}
}
Modified: trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freel…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild (original)
+++ trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild Sun Jan 6 17:52:00 2008
@@ -63,6 +63,8 @@
<file>ofw.c</file>
<file>ofw_util.s</file>
<file>ofw_calls.s</file>
+ <file>ofwdisk.c</file>
+ <file>ofw_method.c</file>
<file>prep.c</file>
<file>prep_ide.c</file>
<file>prep_pci.c</file>
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h Sun Jan 6 17:52:00
2008
@@ -74,7 +74,7 @@
NTAPI
FldrSetConfigurationData(
IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
- IN PVOID ConfigurationData,
+ IN PCM_PARTIAL_RESOURCE_LIST ResourceList,
IN ULONG Size
);
Modified: trunk/reactos/boot/freeldr/freeldr/include/of.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/of.h (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/of.h Sun Jan 6 17:52:00 2008
@@ -14,5 +14,6 @@
int setjmp( jmp_buf buf );
int longjmp( jmp_buf buf, int retval );
+int ofw_callmethod_ret(const char *method, int handle, int nargs, int *args, int ret);
#endif/*FREELDR_OF_H*/
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c Sun Jan 6 17:52:00 2008
@@ -608,15 +608,31 @@
LoaderBlock.MmapLength = (unsigned
long)MachGetMemoryMap((PBIOS_MEMORY_MAP)reactos_memory_map, 32) * sizeof(memory_map_t);
if (LoaderBlock.MmapLength)
{
-#ifdef _M_IX86
ULONG i;
-#endif
LoaderBlock.Flags |= MB_FLAGS_MEM_INFO | MB_FLAGS_MMAP_INFO;
LoaderBlock.MmapAddr = (unsigned long)&reactos_memory_map;
reactos_memory_map_descriptor_size = sizeof(memory_map_t); // GetBiosMemoryMap
uses a fixed value of 24
-#ifdef _M_IX86
for (i=0; i<(LoaderBlock.MmapLength/sizeof(memory_map_t)); i++)
{
+#ifdef _M_PPC
+ ULONG tmp;
+ /* Also swap from long long to high/low
+ * We also have unusable memory that will be available to kernel
+ * land. Mark it here.
+ */
+ if (BiosMemoryAcpiReclaim == reactos_memory_map[i].type)
+ {
+ reactos_memory_map[i].type = BiosMemoryUsable;
+ }
+
+ tmp = reactos_memory_map[i].base_addr_low;
+ reactos_memory_map[i].base_addr_low = reactos_memory_map[i].base_addr_high;
+ reactos_memory_map[i].base_addr_high = tmp;
+ tmp = reactos_memory_map[i].length_low;
+ reactos_memory_map[i].length_low = reactos_memory_map[i].length_high;
+ reactos_memory_map[i].length_high = tmp;
+#endif
+
if (BiosMemoryUsable == reactos_memory_map[i].type &&
0 == reactos_memory_map[i].base_addr_low)
{
@@ -633,7 +649,6 @@
LoaderBlock.MemHigher = (reactos_memory_map[i].base_addr_low +
reactos_memory_map[i].length_low) / 1024 - 1024;
}
}
-#endif
}
/*
Modified: trunk/reactos/drivers/base/kdcom/kdbg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kdbg.c?…
==============================================================================
--- trunk/reactos/drivers/base/kdcom/kdbg.c (original)
+++ trunk/reactos/drivers/base/kdcom/kdbg.c Sun Jan 6 17:52:00 2008
@@ -56,9 +56,9 @@
#ifdef _M_IX86
const ULONG BaseArray[5] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8};
#elif defined(_M_PPC)
-const ULONG BaseArray[5] = {0, 0x800003f8};
+const ULONG BaseArray[2] = {0, 0x800003f8};
#elif defined(_M_MIPS)
-const ULONG BaseArray[5] = {0, 0x80006000, 0x80007000};
+const ULONG BaseArray[3] = {0, 0x80006000, 0x80007000};
#else
#error Unknown architecture
#endif
Modified: trunk/reactos/include/psdk/intrin_ppc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/intrin_ppc.h?…
==============================================================================
--- trunk/reactos/include/psdk/intrin_ppc.h (original)
+++ trunk/reactos/include/psdk/intrin_ppc.h Sun Jan 6 17:52:00 2008
@@ -197,36 +197,7 @@
PPC_QUAL long long _InterlockedCompareExchange64(volatile long long * const Destination,
const long long Exchange, const long long Comperand)
{
- unsigned long lo32Retval = (unsigned long)((Comperand >> 0) & 0xFFFFFFFF);
- long hi32Retval = (unsigned long)((Comperand >> 32) & 0xFFFFFFFF);
-
- unsigned long lo32Exchange = (unsigned long)((Exchange >> 0) & 0xFFFFFFFF);
- long hi32Exchange = (unsigned long)((Exchange >> 32) & 0xFFFFFFFF);
-
-#if 0
- __asm__
- (
- "cmpxchg8b %[Destination]" :
- "a" (lo32Retval), "d" (hi32Retval) :
- [Destination] "rm" (Destination), "b" (lo32Exchange), "c"
(hi32Exchange) :
- "memory"
- );
-#endif
- {
- union u_
- {
- long long ll;
- struct s_
- {
- unsigned long lo32;
- long hi32;
- }
- s;
- }
- u = { s : { lo32 : lo32Retval, hi32 : hi32Retval } };
-
- return u.ll;
- }
+ return 0;
}
PPC_QUAL void * _InterlockedCompareExchangePointer(void * volatile * const Destination,
void * const Exchange, void * const Comperand)
@@ -716,7 +687,7 @@
/*** Port I/O ***/
-PPC_QUAL unsigned char __inbyte(const unsigned short Port)
+PPC_QUAL unsigned char __inbyte(const unsigned long Port)
{
int ret;
__asm__(
@@ -731,7 +702,7 @@
return ret;
}
-PPC_QUAL unsigned short __inword(const unsigned short Port)
+PPC_QUAL unsigned short __inword(const unsigned long Port)
{
int ret;
__asm__(
@@ -746,7 +717,7 @@
return ret;
}
-PPC_QUAL unsigned long __indword(const unsigned short Port)
+PPC_QUAL unsigned long __indword(const unsigned long Port)
{
int ret;
__asm__(
@@ -761,28 +732,28 @@
return ret;
}
-PPC_QUAL void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long
Count)
+PPC_QUAL void __inbytestring(unsigned long Port, unsigned char * Buffer, unsigned long
Count)
{
while(Count--) {
*Buffer++ = __inbyte(Port);
}
}
-PPC_QUAL void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long
Count)
+PPC_QUAL void __inwordstring(unsigned long Port, unsigned short * Buffer, unsigned long
Count)
{
while(Count--) {
*Buffer++ = __inword(Port);
}
}
-PPC_QUAL void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long
Count)
+PPC_QUAL void __indwordstring(unsigned long Port, unsigned long * Buffer, unsigned long
Count)
{
while(Count--) {
*Buffer++ = __indword(Port);
}
}
-PPC_QUAL void __outbyte(unsigned short const Port, const unsigned char Data)
+PPC_QUAL void __outbyte(unsigned long const Port, const unsigned char Data)
{
__asm__(
"mfmsr 5\n\t"
@@ -798,7 +769,7 @@
);
}
-PPC_QUAL void __outword(unsigned short const Port, const unsigned short Data)
+PPC_QUAL void __outword(unsigned long const Port, const unsigned short Data)
{
__asm__(
"mfmsr 5\n\t"
@@ -814,7 +785,7 @@
);
}
-PPC_QUAL void __outdword(unsigned short const Port, const unsigned long Data)
+PPC_QUAL void __outdword(unsigned long const Port, const unsigned long Data)
{
__asm__(
"mfmsr 5\n\t"
@@ -830,7 +801,7 @@
);
}
-PPC_QUAL void __outbytestring(unsigned short const Port, const unsigned char * const
Buffer, const unsigned long Count)
+PPC_QUAL void __outbytestring(unsigned long const Port, const unsigned char * const
Buffer, const unsigned long Count)
{
unsigned long count = Count;
const unsigned char *buffer = Buffer;
@@ -839,7 +810,7 @@
}
}
-PPC_QUAL void __outwordstring(unsigned short const Port, const unsigned short * const
Buffer, const unsigned long Count)
+PPC_QUAL void __outwordstring(unsigned long const Port, const unsigned short * const
Buffer, const unsigned long Count)
{
unsigned long count = Count;
const unsigned short *buffer = Buffer;
@@ -848,7 +819,7 @@
}
}
-PPC_QUAL void __outdwordstring(unsigned short const Port, const unsigned long * const
Buffer, const unsigned long Count)
+PPC_QUAL void __outdwordstring(unsigned long const Port, const unsigned long * const
Buffer, const unsigned long Count)
{
unsigned long count = Count;
const unsigned long *buffer = Buffer;
@@ -897,10 +868,9 @@
PPC_QUAL void _enable(void)
{
- __asm__ __volatile__("mfmsr 0\n\t" \
- "lis 8,0x8000@ha\n\t" \
- "or 0,8,0\n\t" \
- "mtmsr 0\n\t");
+ __asm__ __volatile__("mfmsr 8\n\t" \
+ "ori 8,8,0x8000\n\t" \
+ "mtmsr 8\n\t");
}
/*** Protected memory management ***/
Modified: trunk/reactos/include/reactos/idl/idl.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/idl.rb…
==============================================================================
--- trunk/reactos/include/reactos/idl/idl.rbuild (original)
+++ trunk/reactos/include/reactos/idl/idl.rbuild Sun Jan 6 17:52:00 2008
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
<group>
-<module name="pnp_server" type="rpcserver">
+<module name="pnp_server" type="rpcserver"
allowwarnings="true">
<include base="ReactOS">.</include>
<include base="ReactOS">w32api/include</include>
<file>pnp.idl</file>
@@ -21,7 +21,7 @@
<include base="ReactOS">w32api/include</include>
<file switches="--oldnames">svcctl.idl</file>
</module>
-<module name="eventlog_server" type="rpcserver">
+<module name="eventlog_server" type="rpcserver"
allowwarnings="true">
<include base="ReactOS">.</include>
<include base="ReactOS">w32api/include</include>
<file switches="--oldnames">eventlogrpc.idl</file>
Modified: trunk/reactos/include/reactos/libs/ppcmmu/mmu.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/ppcmm…
==============================================================================
--- trunk/reactos/include/reactos/libs/ppcmmu/mmu.h (original)
+++ trunk/reactos/include/reactos/libs/ppcmmu/mmu.h Sun Jan 6 17:52:00 2008
@@ -116,32 +116,40 @@
static inline int PPCMMU(int action, void *arg1, void *arg2, void *arg3)
{
/* Set Bat0 to mmu object address */
- int i, batu, batl, oldbat[8], usebat[2] = { 0, 1 }, gotbat = 0, pc, mask;
+ int i, batu, batl, usebat[2] = { 0, 1 }, gotbat = 0, pc, mask;
volatile int ret;
int (*mmumain)(int action, void *arg1, void *arg2, void *arg3) = (void *)MMUCODE;
__asm__("bl 1f\n\t"
"\n1:\n\t"
"mflr %0\n\t" : "=r" (pc));
- for(i = 0, gotbat = 0; i < 4 && gotbat < 2; i++)
+ for(i = 0, gotbat = 0; i < 4; i++)
{
+ /* Use the space above the trap handlers to store the old bats */
+ GetBat(i, 0, &batu, &batl);
+
+ SetPhys(0xf000 + i * 16, batu);
+ SetPhys(0xf004 + i * 16, batl);
+
GetBat(i, 1, &batu, &batl);
- if(batu & 0xffc)
- {
- mask = ~(0x1ffff | ((batu & 0xffc)>>2)<<17);
- if(!(batu & 2) || ((batu & mask) != (pc & mask)))
- usebat[gotbat++] = i;
- } else {
- mask = ~(0x1ffff | (batl << 17));
- if(!(batl & 0x40) || ((batu & mask) != (pc & mask)))
- usebat[gotbat++] = i;
- }
+
+ SetPhys(0xf008 + i * 16, batu);
+ SetPhys(0xf00c + i * 16, batl);
+
+ if (gotbat < 2)
+ {
+ if(batu & 0xffc)
+ {
+ mask = ~(0x1ffff | ((batu & 0xffc)>>2)<<17);
+ if(!(batu & 2) || ((batu & mask) != (pc & mask)))
+ usebat[gotbat++] = i;
+ } else {
+ mask = ~(0x1ffff | (batl << 17));
+ if(!(batl & 0x40) || ((batu & mask) != (pc & mask)))
+ usebat[gotbat++] = i;
+ }
+ }
}
-
- GetBat(usebat[0], 0, &oldbat[0], &oldbat[1]);
- GetBat(usebat[0], 1, &oldbat[2], &oldbat[3]);
- GetBat(usebat[1], 0, &oldbat[4], &oldbat[5]);
- GetBat(usebat[1], 1, &oldbat[6], &oldbat[7]);
batu = 0xff;
batl = 0x7f;
@@ -153,12 +161,6 @@
SetBat(usebat[1], 1, batu, batl);
ret = mmumain(action, arg1, arg2, arg3);
-
- /* Ok done ... Whatever happened probably worked */
- SetBat(usebat[0], 0, oldbat[0], oldbat[1]);
- SetBat(usebat[0], 1, oldbat[2], oldbat[3]);
- SetBat(usebat[1], 0, oldbat[4], oldbat[5]);
- SetBat(usebat[1], 1, oldbat[6], oldbat[7]);
return ret;
}
Removed: trunk/reactos/include/reactos/ppcboot.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/ppcboot.h?…
==============================================================================
--- trunk/reactos/include/reactos/ppcboot.h (original)
+++ trunk/reactos/include/reactos/ppcboot.h (removed)
@@ -1,83 +1,0 @@
-#ifndef REACTOS_PPCBOOT_H
-#define REACTOS_PPCBOOT_H
-
-typedef enum _PPC_DT_BOOLEAN
-{
- PPC_DT_FALSE, PPC_DT_TRUE
-} PPC_DT_BOOLEAN;
-
-#ifndef NULL
-#define NULL ((void *)0)
-#endif
-
-typedef void * (*PPC_DEVICE_ALLOC)(int bytes);
-typedef void (*PPC_DEVICE_FREE)(void *data);
-
-typedef struct _PPC_DEVICE_NODE
-{
- int type;
- int parent;
- short this_size, total_size;
- short value_offset, value_size;
- char name[1];
-} PPC_DEVICE_NODE, *PPPC_DEVICE_NODE;
-
-typedef struct _PPC_DEVICE_TREE
-{
- int alloc_size, alloc_step, align, used_bytes;
- PPC_DEVICE_ALLOC allocFn;
- PPC_DEVICE_FREE freeFn;
- PPPC_DEVICE_NODE head, active;
-} PPC_DEVICE_TREE, *PPPC_DEVICE_TREE;
-
-typedef struct _PPC_DEVICE_RANGE
-{
- int type;
- void *start;
- int len;
-} PPC_DEVICE_RANGE, *PPPC_DEVICE_RANGE;
-
-typedef char font_char[57];
-typedef struct _boot_infos_t {
- void *loaderBlock;
- PPPC_DEVICE_NODE machine;
- int dispDeviceRect[4];
- int dispDeviceRowBytes;
- int dispDeviceDepth;
- void *dispDeviceBase;
- font_char *dispFont;
-} boot_infos_t;
-
-PPC_DT_BOOLEAN PpcDevTreeInitialize
-(PPPC_DEVICE_TREE tree, int alloc_step, int align,
- PPC_DEVICE_ALLOC allocFn, PPC_DEVICE_FREE freeFn);
-PPPC_DEVICE_NODE PpcDevTreeGetRootNode(PPPC_DEVICE_TREE tree);
-PPC_DT_BOOLEAN PpcDevTreeNodeIsChild
-(PPPC_DEVICE_NODE parent, PPPC_DEVICE_NODE child);
-PPPC_DEVICE_NODE PpcDevTreeChildNode(PPPC_DEVICE_NODE parent);
-PPPC_DEVICE_NODE PpcDevTreeParentNode(PPPC_DEVICE_NODE child);
-PPPC_DEVICE_NODE PpcDevTreeSiblingNode(PPPC_DEVICE_NODE this_entry);
-PPC_DT_BOOLEAN PpcDevTreeAddProperty
-(PPPC_DEVICE_TREE tree, int type, char *propname, char *propval, int proplen);
-PPC_DT_BOOLEAN PpcDevTreeAddDevice
-(PPPC_DEVICE_TREE tree, int type, char *name);
-PPC_DT_BOOLEAN PpcDevTreeCloseDevice(PPPC_DEVICE_TREE tree);
-PPPC_DEVICE_NODE PpcDevTreeFindDevice
-(PPPC_DEVICE_NODE root, int type, char *name);
-char *PpcDevTreeFindProperty
-(PPPC_DEVICE_NODE root, int type, char *name, int *len);
-
-#define PPC_DT_FOURCC(w,x,y,z) (((w) << 24) | ((x) << 16) | ((y) << 8)
| (z))
-#define PPC_DEVICE_SERIAL_8250
PPC_DT_FOURCC('8','2','5','0')
-#define PPC_DEVICE_PCI_EAGLE
PPC_DT_FOURCC('E','g','l','e')
-#define PPC_DEVICE_ISA_BUS
PPC_DT_FOURCC('I','S','A','b')
-#define PPC_DEVICE_IDE_DISK
PPC_DT_FOURCC('I','D','E','c')
-#define PPC_DEVICE_VGA
PPC_DT_FOURCC('V','G','A','c')
-
-#define PPC_DEVICE_IO_RANGE
PPC_DT_FOURCC('I','O','r','g')
-#define PPC_DEVICE_MEM_RANGE
PPC_DT_FOURCC('M','E','M','r')
-#define PPC_DEVICE_VADDR
PPC_DT_FOURCC('v','a','d','r')
-#define PPC_DEVICE_SPACE_RANGE
PPC_DT_FOURCC('r','a','n','g')
-#define PPC_DEVICE_INTERRUPT
PPC_DT_FOURCC('I','n','t','r')
-
-#endif/*REACTOS_PPCBOOT_H*/
Removed: trunk/reactos/include/reactos/ppcdebug.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/ppcdebug.h…
==============================================================================
--- trunk/reactos/include/reactos/ppcdebug.h (original)
+++ trunk/reactos/include/reactos/ppcdebug.h (removed)
@@ -1,20 +1,0 @@
-#ifndef _PPCDEBUG_H
-#define _PPCDEBUG_H
-
-#include "ppcboot.h"
-
-extern struct _boot_infos_t *BootInfo;
-extern void DrawNumber(struct _boot_infos_t *, unsigned long, int, int);
-extern void DrawString(struct _boot_infos_t *, const char *, int, int);
-#define TRACEXY(x,y) do { \
- unsigned long _x_ = (unsigned long)(x), _y_ = (unsigned long)(y); \
- __asm__("ori 0,0,0"); \
- DrawNumber(BootInfo, __LINE__, 10, 160); \
- DrawString(BootInfo, __FILE__, 100, 160); \
- DrawNumber(BootInfo, _x_, 400, 160); \
- DrawNumber(BootInfo, _y_, 490, 160); \
-} while(0)
-#define TRACEX(x) TRACEXY(x,0)
-#define TRACE TRACEX(0)
-
-#endif//_PPCDEBUG_H
Removed: trunk/reactos/include/reactos/ppcfont.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/ppcfont.h?…
==============================================================================
--- trunk/reactos/include/reactos/ppcfont.h (original)
+++ trunk/reactos/include/reactos/ppcfont.h (removed)
@@ -1,259 +1,0 @@
-#ifndef _ARCH_POWERPC_FONT_H
-#define _ARCH_POWERPC_FONT_H
-
-font_char BootDigits[37] = {
- " XXXXX "
- "X X "
- "X x X "
- "X X X "
- "X X "
- " XXXXX "
- " ",
- " XX "
- " XXX "
- " XX "
- " XX "
- " XX "
- " XX "
- " ",
- " XXXX "
- " X X "
- " XX "
- " XX "
- " XX "
- " XXXXXX "
- " ",
- " XXXX "
- " X X "
- " XX "
- " X "
- " X X "
- " XXXX "
- " ",
- " X X "
- " X X "
- " XXXXXX "
- " X "
- " X "
- " X "
- " ",
- " XXXXXX "
- " X "
- " XXXXX "
- " X "
- " X "
- " XXXXX "
- " ",
- " XXXXX "
- " X "
- " XXXXX "
- " X X "
- " X X "
- " XXXX "
- " ",
- " XXXXXX "
- " XX "
- " XX "
- " XXXXX "
- " XX "
- " XX "
- " ",
- " XXXX "
- " X X "
- " XXXX "
- " X X "
- " X X "
- " XXXX "
- " ",
- " XXXX "
- " X X "
- " X X "
- " XXXXX "
- " X "
- " XXXX "
- " ",
- " XXXX "
- " X X "
- " XXXXXX "
- " X X "
- " X X "
- " X X "
- " ",
- " XXXXX "
- " X X "
- " XXXXX "
- " X X "
- " X X "
- " XXXXX "
- " ",
- " XXXX "
- " X X "
- " X "
- " X "
- " X X "
- " XXXX "
- " ",
- " XXXXX "
- " X X "
- " X X "
- " X X "
- " X X "
- " XXXXX "
- " ",
- " XXXXXX "
- " X "
- " XXXX "
- " X "
- " X "
- " XXXXXX "
- " ",
- " XXXXXX "
- " X "
- " XXXX "
- " X "
- " X "
- " X "
- " ",
- " XXXX "
- " X X "
- " X "
- " X XX "
- " X X "
- " XXXXX "
- " ",
- " X X "
- " X X "
- " XXXXXX "
- " X X "
- " X X "
- " X X "
- " ",
- " XXXX "
- " XX "
- " XX "
- " XX "
- " XX "
- " XXXX "
- " ",
- " X "
- " X "
- " X "
- " X "
- " X X "
- " XXXX "
- " ",
- " X X "
- " X X "
- " X X "
- " XXXX "
- " X X "
- " X X "
- " ",
- " X "
- " X "
- " X "
- " X "
- " X "
- " XXXXXX "
- " ",
- " X X "
- " X XX X "
- " X XX X "
- " X X "
- " X X "
- " X X "
- " ",
- " X X "
- " XX X "
- " X X X "
- " X X X "
- " X XX "
- " X X "
- " ",
- " XXXX "
- " X X "
- " X X "
- " X X "
- " X X "
- " XXXX "
- " ",
- " XXXXX "
- " X X "
- " X X "
- " XXXXX "
- " X "
- " X "
- " ",
- " XXXX "
- " X X "
- " X X "
- " X X X "
- " X XXX "
- " XXXXX "
- " ",
- " XXXXX "
- " X X "
- " X X "
- " XXXXX "
- " X X "
- " X X "
- " ",
- " XXXXX "
- " X "
- " XXXX "
- " X "
- " X "
- " XXXXX "
- " ",
- " XXXXXX "
- " XX "
- " XX "
- " XX "
- " XX "
- " XX "
- " ",
- " X X "
- " X X "
- " X X "
- " X X "
- " X X "
- " XXXX "
- " ",
- " X X "
- " X X "
- " X X "
- " X X "
- " X X "
- " XX "
- " ",
- " X X "
- " X X "
- " X X "
- " X XX X "
- " X XX X "
- " X X "
- " ",
- " X X "
- " X X "
- " XX "
- " X X "
- " X X "
- " X X "
- " ",
- " X X "
- " X X "
- " X X "
- " XX "
- " XX "
- " XX "
- " ",
- " XXXXXX "
- " X "
- " X "
- " X "
- " X "
- " XXXXXX "
- " "
-};
-
-#endif/*_ARCH_POWERPC_FONT_H*/
Modified: trunk/reactos/include/reactos/wine/port.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/port.…
==============================================================================
--- trunk/reactos/include/reactos/wine/port.h (original)
+++ trunk/reactos/include/reactos/wine/port.h Sun Jan 6 17:52:00 2008
@@ -315,7 +315,7 @@
/* Interlocked functions */
-#if defined(__i386__) && defined(__GNUC__)
+#if defined(__i386__) && defined(__GNUC__) &&
!defined(WINE_PORT_NO_INTERLOCKED)
extern inline long interlocked_cmpxchg( long *dest, long xchg, long compare )
{
Modified: trunk/reactos/lib/ppcmmu/devint.s
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/ppcmmu/devint.s?rev=31…
==============================================================================
--- trunk/reactos/lib/ppcmmu/devint.s (original)
+++ trunk/reactos/lib/ppcmmu/devint.s Sun Jan 6 17:52:00 2008
@@ -94,13 +94,13 @@
lwz 0,392(1)
mtcr 0
lwz 0,396(1)
- mtlr 0
+ mtsrr0 0
lwz 0,400(1)
mtctr 0
lwz 0,388(1) /* Copy out new MSR bits if needed */
lwz 1,4(1)
- mtmsr 0
- blr
+ mtsrr1 0
+ rfi
.globl trap_start
.globl trap_end
Modified: trunk/reactos/lib/ppcmmu/mmuobject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/ppcmmu/mmuobject.c?rev…
==============================================================================
--- trunk/reactos/lib/ppcmmu/mmuobject.c (original)
+++ trunk/reactos/lib/ppcmmu/mmuobject.c Sun Jan 6 17:52:00 2008
@@ -74,7 +74,7 @@
int _mmumain(int action, void *arg1, void *arg2, void *arg3, void *tf)
{
ppc_trap_frame_t *trap_frame = (action >= 0x100) ? tf : arg1;
- int ret = 0;
+ int ret = 0, tmp;
switch(action)
{
@@ -165,6 +165,26 @@
while(1);
}
+ /* Restore bats when we were called voluntarily. We may not get a chance
+ * to do this after returning.
+ *
+ * At this point, we're in address space that matches physical space.
+ * We turn off mapping, restore bats, then let rfi switch us back to where
+ * we came.
+ */
+ if (action >= 0x100) {
+ int i;
+
+ __asm__("mfmsr %0" : "=r" (tmp));
+ tmp &= ~0x30;
+ __asm__("mtmsr %0" : : "r" (tmp));
+
+ for(i = 0; i < 4; i++) {
+ SetBat(i, 0, GetPhys(0xf000 + i * 16), GetPhys(0xf004 + i * 16));
+ SetBat(i, 1, GetPhys(0xf008 + i * 16), GetPhys(0xf00c + i * 16));
+ }
+ }
+
return ret;
}
@@ -275,7 +295,7 @@
/* Default to hang on unknown exception */
for(i = 0; i < 30; i++)
{
- callback[i] = TakeException;
+ callback[i] = (MmuTrapHandler)TakeException;
if (i != 1) /* Preserve reset handler */
copy_trap_handler(i);
}
@@ -284,7 +304,7 @@
callback[5] = SerialInterrupt;
/* Program Exception */
- callback[6] = TakeException;
+ callback[6] = (MmuTrapHandler)TakeException;
/* Floating point exception */
callback[8] = fpenable;
@@ -293,14 +313,14 @@
callback[9] = ignore;
/* Single Step */
- callback[0x20] = TakeException;
+ callback[0x20] = (MmuTrapHandler)TakeException;
}
ppc_map_t *allocpage()
{
MmuFreePage *FreePage = 0;
- if(NextPage < PPC_PAGE_NUMBER(RamSize)) {
+ while(NextPage < PPC_PAGE_NUMBER(RamSize) && ) {
return &PpcPageTable[NextPage++];
} else {
FreePage = FreeList;
@@ -472,7 +492,7 @@
(((addr >> 22) & 63) == api_pte);
}
-ppc_map_t *mmuvirtmap(vaddr_t addr, int vsid)
+ppc_map_t *mmuvirtmap(vaddr_t addr)
{
int seg = (addr >> 28) & 15;
MmuVsidInfo *seginfo = Segs[seg];
@@ -501,7 +521,7 @@
}
else
{
- PagePtr = mmuvirtmap(info[i].proc, info[i].addr);
+ PagePtr = mmuvirtmap(info[i].addr);
ipa = PPC_PAGE_ADDR(PagePtr - PpcPageTable);
}
@@ -539,7 +559,7 @@
} else {
vaddr_t addr = info[i].addr;
int vsid = ((addr >> 28) & 15) | (info[i].proc << 4);
- PagePtr = mmuvirtmap(info[i].addr, vsid);
+ PagePtr = mmuvirtmap(info[i].addr);
if(!PagePtr)
info[i].phys = 0;
else
@@ -551,6 +571,10 @@
}
}
+int mmupagefree(paddr_t page)
+{
+}
+
void mmusetvsid(int start, int end, int vsid)
{
int i, sr, s_vsid;
@@ -568,8 +592,7 @@
int ptegreload(ppc_trap_frame_t *frame, vaddr_t addr)
{
int hfun = (Clock >> 3) & 1, ptegnum = PtegNumber(addr, hfun);
- int vsid = GetSR((addr >> 28) & 15) & PPC_VSID_MASK;
- ppc_map_t *map = mmuvirtmap(addr, vsid);
+ ppc_map_t *map = mmuvirtmap(addr);
if(!map) return 0;
map->pte.pteh = (map->pte.pteh & ~64) | (hfun << 6);
PpcHashedPTE[ptegnum].block[Clock & 7] = map->pte;
Modified: trunk/reactos/ntoskrnl/include/internal/ke_x.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ke_x.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ke_x.h Sun Jan 6 17:52:00 2008
@@ -1528,11 +1528,12 @@
FORCEINLINE
KeGetCurrentThread(VOID)
{
+#ifdef _M_IX86
/* Return the current thread */
-#ifdef _M_PPC
- return ((PKIPCR)KeGetPcr())->PrcbData->CurrentThread;
+ return ((PKIPCR)KeGetPcr())->PrcbData.CurrentThread;
#else
- return ((PKIPCR)KeGetPcr())->PrcbData.CurrentThread;
+ PKPRCB Prcb = KeGetCurrentPrcb();
+ return Prcb->CurrentThread;
#endif
}
Modified: trunk/reactos/ntoskrnl/ke/freeldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/freeldr.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/freeldr.c (original)
+++ trunk/reactos/ntoskrnl/ke/freeldr.c Sun Jan 6 17:52:00 2008
@@ -11,6 +11,10 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
+
+#ifdef _M_PPC
+#include <ppcmmu/mmu.h>
+#endif
typedef struct _BIOS_MEMORY_DESCRIPTOR
{
@@ -459,6 +463,7 @@
/* If anything failed until now, return error code */
if (Status != STATUS_SUCCESS) return Status;
+#ifdef _M_IX86
/* Set the top 16MB region as reserved */
Status = KiRosConfigureArcDescriptor(0xFC0, 0x1000, MemorySpecialMemory);
if (Status != STATUS_SUCCESS) return Status;
@@ -470,6 +475,7 @@
/* Build an entry for the IVT */
Status = KiRosAllocateArcDescriptor(0, 1, MemoryFirmwarePermanent);
if (Status != STATUS_SUCCESS) return Status;
+#endif
/* Build an entry for the KPCR and KUSER_SHARED_DATA */
Status = KiRosAllocateArcDescriptor(1, 3, LoaderMemoryData);
@@ -762,6 +768,7 @@
/* Find a descriptor that already contains our base address */
MdBlock = KiRosFindNtDescriptor(BasePage);
+
if (MdBlock)
{
/* If it contains our limit as well, break out early */
@@ -908,6 +915,9 @@
WCHAR PathSetup[] = L"\\SystemRoot\\";
CHAR DriverNameLow[256];
ULONG Base;
+#ifdef _M_PPC
+ ULONG KernelBase = RosLoaderBlock->ModsAddr[0].ModStart;
+#endif
/* First get some kernel-loader globals */
AcpiTableDetected = (RosLoaderBlock->Flags & MB_FLAGS_ACPI_TABLE) ? TRUE :
FALSE;
@@ -940,8 +950,10 @@
/* Build entries for ReactOS memory ranges, which uses ARC Descriptors */
KiRosBuildOsMemoryMap();
+#ifdef _M_IX86
/* Build entries for the reserved map, which uses ARC Descriptors */
KiRosBuildReservedMemoryMap();
+#endif
/* Now convert the BIOS and ARC Descriptors into NT Memory Descirptors */
KiRosBuildArcMemoryList();
@@ -1069,6 +1081,10 @@
&Base);
}
+#ifdef _M_PPC
+ ModStart = (PVOID)((ULONG)ModStart + 0x80800000 - KernelBase);
+#endif
+
/* Lowercase the drivername so we can check its extension later */
strcpy(DriverNameLow, DriverName);
_strlwr(DriverNameLow);
@@ -1213,7 +1229,7 @@
InsertTailList(&LoaderBlock->ArcDiskInformation->DiskSignatureListHead,
&ArcDiskInfo->ListEntry);
}
-
+
/* Copy the ARC Hardware Tree */
RtlCopyMemory(BldrArcHwBuffer, (PVOID)RosLoaderBlock->ArchExtra, 16 * 1024);
LoaderBlock->ConfigurationRoot = (PVOID)BldrArcHwBuffer;
@@ -1234,7 +1250,7 @@
IN PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
{
PLOADER_PARAMETER_BLOCK NtLoaderBlock;
- ULONG size, i;
+ ULONG size, i = 0, *ent;
#if defined(_M_IX86)
PKTSS Tss;
PKGDTENTRY TssEntry;
@@ -1255,7 +1271,15 @@
#endif
#if defined(_M_PPC)
+ // Zero bats. We might have residual bats set that will interfere with
+ // our mapping of ofwldr.
+ for (i = 0; i < 4; i++)
+ {
+ SetBat(i, 0, 0, 0); SetBat(i, 1, 0, 0);
+ }
KiSetupSyscallHandler();
+ DbgPrint("Kernel Power (%08x)\n", LoaderBlock);
+ DbgPrint("ArchExtra (%08x)!\n", LoaderBlock->ArchExtra);
#endif
/* Save pointer to ROS Block */
@@ -1264,16 +1288,25 @@
ModsAddr[KeRosLoaderBlock->
ModsCount - 1].
ModEnd);
+#if defined(_M_PPC)
+ MmFreeLdrFirstKrnlPhysAddr = KeRosLoaderBlock->ModsAddr[0].ModStart;
+ MmFreeLdrLastKrnlPhysAddr = MmFreeLdrLastKernelAddress;
+ DbgPrint("kernel phys = %08x-%08x\n",
+ MmFreeLdrFirstKrnlPhysAddr,
+ MmFreeLdrLastKrnlPhysAddr);
+#else
MmFreeLdrFirstKrnlPhysAddr = KeRosLoaderBlock->ModsAddr[0].ModStart -
KSEG0_BASE;
MmFreeLdrLastKrnlPhysAddr = MmFreeLdrLastKernelAddress - KSEG0_BASE;
+#endif
/* Save memory manager data */
KeMemoryMapRangeCount = 0;
if (LoaderBlock->Flags & MB_FLAGS_MMAP_INFO)
{
/* We have a memory map from the nice BIOS */
- size = *((PULONG)(LoaderBlock->MmapAddr - sizeof(ULONG)));
+ ent = ((PULONG)(LoaderBlock->MmapAddr - sizeof(ULONG)));
+ size = *ent;
i = 0;
/* Map it until we run out of size */
@@ -1310,6 +1343,10 @@
/* Convert the loader block */
KiRosFrldrLpbToNtLpb(KeRosLoaderBlock, &NtLoaderBlock);
+#if defined(_M_PPC)
+ DbgPrint("Finished KiRosFrldrLpbToNtLpb\n");
+#endif
+
/* Do general System Startup */
KiSystemStartup(NtLoaderBlock);
}
Modified: trunk/reactos/ntoskrnl/ke/powerpc/kiinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/powerpc/kiinit…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/powerpc/kiinit.c (original)
+++ trunk/reactos/ntoskrnl/ke/powerpc/kiinit.c Sun Jan 6 17:52:00 2008
@@ -10,11 +10,9 @@
/* INCLUDES *****************************************************************/
#include <ntoskrnl.h>
-#include <reactos/ppcboot.h>
#define NDEBUG
#include <debug.h>
-#include <ppcdebug.h>
#include "ppcmmu/mmu.h"
/* GLOBALS *******************************************************************/
@@ -27,6 +25,9 @@
extern ULONG KeLoaderModuleCount;
extern ULONG_PTR MmFreeLdrLastKernelAddress;
KPRCB PrcbData[MAXIMUM_PROCESSORS];
+/* BIOS Memory Map. Not NTLDR-compliant yet */
+extern ULONG KeMemoryMapRangeCount;
+extern ADDRESS_RANGE KeMemoryMap[64];
/* FUNCTIONS *****************************************************************/
@@ -124,17 +125,11 @@
IN PVOID IdleStack,
IN PKPRCB Prcb,
IN CCHAR Number,
- IN PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
+ IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
ULONG FeatureBits;
LARGE_INTEGER PageDirectory;
PVOID DpcStack;
- boot_infos_t *BootInfo = ((boot_infos_t *)LoaderBlock->ArchExtra);
-
-#ifdef _M_PPC
- /* Set the machine type in LoaderBlock for HAL */
- KeLoaderBlock->u.PowerPC.MachineType = BootInfo->machineType;
-#endif
/* Detect and set the CPU Type */
KiSetProcessorType();
@@ -207,28 +202,44 @@
InitThread->Affinity = 1 << Number;
InitThread->WaitIrql = DISPATCH_LEVEL;
InitProcess->ActiveProcessors = 1 << Number;
+
+ /* HACK for MmUpdatePageDir */
+ ((PETHREAD)InitThread)->ThreadsProcess = (PEPROCESS)InitProcess;
/* Set up the thread-related fields in the PRCB */
- //Prcb->CurrentThread = InitThread;
+ Prcb->CurrentThread = InitThread;
Prcb->NextThread = NULL;
- //Prcb->IdleThread = InitThread;
-
+ Prcb->IdleThread = InitThread;
+
+ /* Initialize Kernel Memory Address Space */
+ MmInit1(MmFreeLdrFirstKrnlPhysAddr,
+ MmFreeLdrLastKrnlPhysAddr,
+ MmFreeLdrLastKernelAddress,
+ KeMemoryMap,
+ KeMemoryMapRangeCount,
+ 4096);
+
+ DPRINT1("\n");
/* Initialize the Kernel Executive */
- ExpInitializeExecutive(0, (PLOADER_PARAMETER_BLOCK)LoaderBlock);
-
+ ExpInitializeExecutive(0, LoaderBlock);
+
+ DPRINT1("\n");
/* Only do this on the boot CPU */
if (!Number)
{
+ DPRINT1("\n");
/* Calculate the time reciprocal */
KiTimeIncrementReciprocal =
KiComputeReciprocal(KeMaximumIncrement,
&KiTimeIncrementShiftCount);
+ DPRINT1("\n");
/* Update DPC Values in case they got updated by the executive */
Prcb->MaximumDpcQueueDepth = KiMaximumDpcQueueDepth;
Prcb->MinimumDpcRate = KiMinimumDpcRate;
Prcb->AdjustDpcThreshold = KiAdjustDpcThreshold;
+ DPRINT1("\n");
/* Allocate the DPC Stack */
DpcStack = MmCreateKernelStack(FALSE, 0);
if (!DpcStack) KeBugCheckEx(NO_PAGES_AVAILABLE, 1, 0, 0, 0);
@@ -238,13 +249,16 @@
/* Free Initial Memory */
// MiFreeInitMemory();
+ DPRINT1("\n");
/* Setup decrementer exception */
KiSetupDecrementerTrap();
+ DPRINT1("\n");
while (1)
{
LARGE_INTEGER Timeout;
Timeout.QuadPart = 0x7fffffffffffffffLL;
+ DPRINT1("\n");
KeDelayExecutionThread(KernelMode, FALSE, &Timeout);
}
}
@@ -299,7 +313,7 @@
/* Skip initial setup if this isn't the Boot CPU */
if (Cpu) goto AppCpuInit;
-
+
/* Initialize the PCR */
RtlZeroMemory(Pcr, PAGE_SIZE);
KiInitializePcr(Cpu,
Modified: trunk/reactos/ntoskrnl/ke/powerpc/main_asm.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/powerpc/main_a…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/powerpc/main_asm.S (original)
+++ trunk/reactos/ntoskrnl/ke/powerpc/main_asm.S Sun Jan 6 17:52:00 2008
@@ -39,16 +39,11 @@
.globl DrawNumber
NtProcessStartup:
- lis 30,AP_MAGIC@ha
- ori 30,30,AP_MAGIC@l
- cmpw 0,30,3
- bne .m1
-
/*
* Set a normal MSR value
*/
xor 0,0,0
- ori 30,0,0x3031
+ ori 30,0,0x3030
mtmsr 30
/*
@@ -58,16 +53,13 @@
/* Bye bye asm land! */
mr 4,3
- bl KiRosPrepareForSystemStartup
-.m1:
/* Load the initial kernel stack */
lis 1,_kernel_stack_top@ha
ori 1,1,_kernel_stack_top@l
addi 1,1,-SIZEOF_FX_SAVE_AREA
/* Call the main kernel initialization */
- mr 4,3
bl KiRosPrepareForSystemStartup
.global NtCurrentTeb
@@ -79,3 +71,8 @@
KeSynchronizeExecution:
blr
+
+ .globl PearPCDebug
+PearPCDebug:
+// .long 0x00333303
+ blr
Modified: trunk/reactos/ntoskrnl/ke/powerpc/ppc_irq.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/powerpc/ppc_ir…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/powerpc/ppc_irq.c (original)
+++ trunk/reactos/ntoskrnl/ke/powerpc/ppc_irq.c Sun Jan 6 17:52:00 2008
@@ -32,6 +32,8 @@
extern ULONG KeMaximumIncrement;
extern ULONG KeMinimumIncrement;
extern ULONG KeTimeAdjustment;
+
+extern void PearPCDebug(int ch);
/* GLOBALS *****************************************************************/
@@ -470,11 +472,6 @@
CurrentThread = KeGetCurrentThread();
if (CurrentThread!=NULL && CurrentThread->ApcState.UserApcPending)
{
- DPRINT("PID: %d, TID: %d CS %04x/%04x\n",
- ((PETHREAD)CurrentThread)->ThreadsProcess->UniqueProcessId,
- ((PETHREAD)CurrentThread)->Cid.UniqueThread,
- Trapframe->Cs,
- CurrentThread->TrapFrame ? CurrentThread->TrapFrame->Cs : 0);
if (CurrentThread->TrapFrame == NULL)
{
OldTrapFrame = CurrentThread->TrapFrame;
@@ -765,8 +762,10 @@
{
case 0x10000: /* DebugService */
for( i = 0; i < trap_frame->gpr[5]; i++ )
- SetPhysByte(0x800003f8, ((PCHAR)trap_frame->gpr[4])[i]);
-
+ {
+ PearPCDebug(((PCHAR)trap_frame->gpr[4])[i]);
+ WRITE_PORT_UCHAR((PVOID)0x800003f8, ((PCHAR)trap_frame->gpr[4])[i]);
+ }
trap_frame->gpr[3] = KdpServiceDispatcher
(trap_frame->gpr[3],
(PCHAR)trap_frame->gpr[4],
Modified: trunk/reactos/ntoskrnl/ke/powerpc/systimer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/powerpc/systim…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/powerpc/systimer.c (original)
+++ trunk/reactos/ntoskrnl/ke/powerpc/systimer.c Sun Jan 6 17:52:00 2008
@@ -11,7 +11,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
-#include <ppcdebug.h>
ULONG
NTAPI
Added: trunk/reactos/ntoskrnl/ke/powerpc/thrdini.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/powerpc/thrdin…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/powerpc/thrdini.c (added)
+++ trunk/reactos/ntoskrnl/ke/powerpc/thrdini.c Sun Jan 6 17:52:00 2008
@@ -1,0 +1,152 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS kernel
+ * FILE: ntoskrnl/ke/powerpc/thread.c
+ * PURPOSE: i386 Thread Context Creation
+ * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net)
+ * arty (ppc adaptation)
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <ntoskrnl.h>
+#define NDEBUG
+#include <debug.h>
+#include <ndk/powerpc/ketypes.h>
+
+typedef struct _KSWITCHFRAME
+{
+ PVOID ExceptionList;
+ BOOLEAN ApcBypassDisable;
+ PVOID RetAddr;
+} KSWITCHFRAME, *PKSWITCHFRAME;
+
+typedef struct _KSTART_FRAME
+{
+ PKSYSTEM_ROUTINE SystemRoutine;
+ PKSTART_ROUTINE StartRoutine;
+ PVOID StartContext;
+ BOOLEAN UserThread;
+} KSTART_FRAME, *PKSTART_FRAME;
+
+typedef struct _KUINIT_FRAME
+{
+ KSWITCHFRAME CtxSwitchFrame;
+ KSTART_FRAME StartFrame;
+ KTRAP_FRAME TrapFrame;
+ FX_SAVE_AREA FxSaveArea;
+} KUINIT_FRAME, *PKUINIT_FRAME;
+
+typedef struct _KKINIT_FRAME
+{
+ KSWITCHFRAME CtxSwitchFrame;
+ KSTART_FRAME StartFrame;
+ FX_SAVE_AREA FxSaveArea;
+} KKINIT_FRAME, *PKKINIT_FRAME;
+
+/* FUNCTIONS *****************************************************************/
+
+VOID
+NTAPI
+KePPCInitThreadWithContext(IN PKTHREAD Thread,
+ IN PKSYSTEM_ROUTINE SystemRoutine,
+ IN PKSTART_ROUTINE StartRoutine,
+ IN PVOID StartContext,
+ IN PCONTEXT ContextPointer)
+{
+ PFX_SAVE_AREA FxSaveArea;
+ PKSTART_FRAME StartFrame;
+ PKSWITCHFRAME CtxSwitchFrame;
+ PKTRAP_FRAME TrapFrame;
+ CONTEXT LocalContext;
+ PCONTEXT Context = NULL;
+ ULONG ContextFlags;
+
+ /* Check if this is a With-Context Thread */
+ if (ContextPointer)
+ {
+ /* Set up the Initial Frame */
+ PKUINIT_FRAME InitFrame;
+ InitFrame = (PKUINIT_FRAME)((ULONG_PTR)Thread->InitialStack -
+ sizeof(KUINIT_FRAME));
+
+ /* Copy over the context we got */
+ RtlCopyMemory(&LocalContext, ContextPointer, sizeof(CONTEXT));
+ Context = &LocalContext;
+ ContextFlags = CONTEXT_CONTROL;
+
+ /* Zero out the trap frame and save area */
+ RtlZeroMemory(&InitFrame->TrapFrame,
+ KTRAP_FRAME_LENGTH + sizeof(FX_SAVE_AREA));
+
+ /* Setup the Fx Area */
+ FxSaveArea = &InitFrame->FxSaveArea;
+
+ /* Disable any debug regiseters */
+ Context->ContextFlags &= ~CONTEXT_DEBUG_REGISTERS;
+
+ /* Setup the Trap Frame */
+ TrapFrame = &InitFrame->TrapFrame;
+
+ /* Set up a trap frame from the context. */
+ KeContextToTrapFrame(Context,
+ NULL,
+ TrapFrame,
+ Context->ContextFlags | ContextFlags,
+ UserMode);
+
+ /* Set the previous mode as user */
+ TrapFrame->PreviousMode = UserMode;
+
+ /* Terminate the Exception Handler List */
+ RtlZeroMemory(TrapFrame->ExceptionRecord,
sizeof(TrapFrame->ExceptionRecord));
+
+ /* Setup the Stack for KiThreadStartup and Context Switching */
+ StartFrame = &InitFrame->StartFrame;
+ CtxSwitchFrame = &InitFrame->CtxSwitchFrame;
+
+ /* Tell the thread it will run in User Mode */
+ Thread->PreviousMode = UserMode;
+
+ /* Tell KiThreadStartup of that too */
+ StartFrame->UserThread = TRUE;
+ }
+ else
+ {
+ /* Set up the Initial Frame for the system thread */
+ PKKINIT_FRAME InitFrame;
+ InitFrame = (PKKINIT_FRAME)((ULONG_PTR)Thread->InitialStack -
+ sizeof(KKINIT_FRAME));
+
+ /* Setup the Fx Area */
+ FxSaveArea = &InitFrame->FxSaveArea;
+ RtlZeroMemory(FxSaveArea, sizeof(FX_SAVE_AREA));
+
+ /* Setup the Stack for KiThreadStartup and Context Switching */
+ StartFrame = &InitFrame->StartFrame;
+ CtxSwitchFrame = &InitFrame->CtxSwitchFrame;
+
+ /* Tell the thread it will run in Kernel Mode */
+ Thread->PreviousMode = KernelMode;
+
+ /* Tell KiThreadStartup of that too */
+ StartFrame->UserThread = FALSE;
+ }
+
+ /* Now setup the remaining data for KiThreadStartup */
+ StartFrame->StartContext = StartContext;
+ StartFrame->StartRoutine = StartRoutine;
+ StartFrame->SystemRoutine = SystemRoutine;
+
+ /* And set up the Context Switch Frame */
+ CtxSwitchFrame->RetAddr = KiThreadStartup;
+ CtxSwitchFrame->ApcBypassDisable = TRUE;
+ CtxSwitchFrame->ExceptionList = EXCEPTION_CHAIN_END;;
+
+ /* Save back the new value of the kernel stack. */
+ Thread->KernelStack = (PVOID)CtxSwitchFrame;
+}
+
+/* EOF */
+
+
Propchange: trunk/reactos/ntoskrnl/ke/powerpc/thrdini.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/ntoskrnl/mm/mminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=3…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mminit.c (original)
+++ trunk/reactos/ntoskrnl/mm/mminit.c Sun Jan 6 17:52:00 2008
@@ -11,7 +11,7 @@
/* INCLUDES *****************************************************************/
#include <ntoskrnl.h>
-#define NDEBUG
+//#define NDEBUG
#include <internal/debug.h>
/* GLOBALS *****************************************************************/
@@ -277,6 +277,7 @@
}
/* Set the page directory */
+ DPRINT("CurrentProcess: %x\n", PsGetCurrentProcess());
PsGetCurrentProcess()->Pcb.DirectoryTableBase.LowPart =
(ULONG)MmGetPageDirectory();
if ((BIOSMemoryMap != NULL) && (AddressRangeCount > 0))
@@ -322,6 +323,9 @@
MmSystemRangeStart = (PVOID)KSEG0_BASE;
MmUserProbeAddress = (ULONG_PTR)MmSystemRangeStart - 0x10000;
MmHighestUserAddress = (PVOID)(MmUserProbeAddress - 1);
+ DPRINT("MmSystemRangeStart: %08x\n", MmSystemRangeStart);
+ DPRINT("MmUserProbeAddress: %08x\n", MmUserProbeAddress);
+ DPRINT("MmHighestUserAddress:%08x\n", MmHighestUserAddress);
/*
* Initialize memory managment statistics
Modified: trunk/reactos/tools/ofw_interface/calls.ofw
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/ofw_interface/calls.…
==============================================================================
--- trunk/reactos/tools/ofw_interface/calls.ofw (original)
+++ trunk/reactos/tools/ofw_interface/calls.ofw Sun Jan 6 17:52:00 2008
@@ -3,6 +3,8 @@
finddevice 1 1 char* int
open 1 1 char* int
getprop 4 1 int char* char*:arg3 int int
+nextprop 3 1 int char* char* int
+getproplen 2 1 int char* int
write 3 1 int char*:arg2 int int
read 3 1 int char*:arg2 int int
exit 0 0
@@ -10,16 +12,5 @@
peer 1 1 int int
parent 1 1 int int
seek 3 1 int int int int
-# MMU methods
-# claim (virt size align -- base)
-claim 3 1 int int int int
-# claim-mem (size align -- base)
-claim-mem 2 1 int int int
-# release (virt size --)
-release 2 0 int int
package-to-path 3 1 int char*:arg2 int int
-# Declare the call-method BE function
-+call-method 0 0
-# MMU Methods
-@phys2virt!translate 4 1 int int int int&0 int
-@virt2phys!translate 2 1 int int&1 int
+claim 3 1 int int int int