git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel/acpica - Disable debug
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
arch
/
x86
/
mboot.c
diff --git
a/KernelLand/Kernel/arch/x86/mboot.c
b/KernelLand/Kernel/arch/x86/mboot.c
index
897c9bb
..
08331a1
100644
(file)
--- a/
KernelLand/Kernel/arch/x86/mboot.c
+++ b/
KernelLand/Kernel/arch/x86/mboot.c
@@
-13,8
+13,6
@@
int Multiboot_LoadMemoryMap(tMBoot_Info *MBInfo, tVAddr MapOffset, tPMemMapEnt *Map, const int MapSize, tPAddr KStart, tPAddr KEnd)
{
int nPMemMapEnts = 0;
int Multiboot_LoadMemoryMap(tMBoot_Info *MBInfo, tVAddr MapOffset, tPMemMapEnt *Map, const int MapSize, tPAddr KStart, tPAddr KEnd)
{
int nPMemMapEnts = 0;
- tMBoot_MMapEnt *ent = (void*)((tVAddr)MBInfo->MMapAddr + MapOffset);
- tMBoot_MMapEnt *last = (void*)((tVAddr)ent + MBInfo->MMapLength);
ENTER("pMBInfo pMapOffset pMap iMapSize PKStart PKEnd",
MBInfo, MapOffset, Map, MapSize, KStart, KEnd);
ENTER("pMBInfo pMapOffset pMap iMapSize PKStart PKEnd",
MBInfo, MapOffset, Map, MapSize, KStart, KEnd);
@@
-22,6
+20,8
@@
int Multiboot_LoadMemoryMap(tMBoot_Info *MBInfo, tVAddr MapOffset, tPMemMapEnt *
// Check that the memory map is present
if( MBInfo->Flags & (1 << 6) )
{
// Check that the memory map is present
if( MBInfo->Flags & (1 << 6) )
{
+ tMBoot_MMapEnt *ent = (void*)((tVAddr)MBInfo->MMapAddr + MapOffset);
+ tMBoot_MMapEnt *last = (void*)((tVAddr)ent + MBInfo->MMapLength);
// Build up memory map
nPMemMapEnts = 0;
while( ent < last && nPMemMapEnts < MapSize )
// Build up memory map
nPMemMapEnts = 0;
while( ent < last && nPMemMapEnts < MapSize )
@@
-30,6
+30,7
@@
int Multiboot_LoadMemoryMap(tMBoot_Info *MBInfo, tVAddr MapOffset, tPMemMapEnt *
if( !MM_GetPhysAddr(ent) )
Log_KernelPanic("MBoot", "MBoot Map entry %i addres bad (%p)",
nPMemMapEnts, ent);
if( !MM_GetPhysAddr(ent) )
Log_KernelPanic("MBoot", "MBoot Map entry %i addres bad (%p)",
nPMemMapEnts, ent);
+ LOG("%llx+%llx", ent->Base, ent->Length);
nent->Start = ent->Base;
nent->Length = ent->Length;
nent->Start = ent->Base;
nent->Length = ent->Length;
@@
-47,10
+48,16
@@
int Multiboot_LoadMemoryMap(tMBoot_Info *MBInfo, tVAddr MapOffset, tPMemMapEnt *
nPMemMapEnts ++;
ent = (void*)( (tVAddr)ent + ent->Size + 4 );
}
nPMemMapEnts ++;
ent = (void*)( (tVAddr)ent + ent->Size + 4 );
}
+ if( ent < last )
+ {
+ Log_Warning("MBoot", "Memory map has >%i entries, internal version is truncated",
+ MapSize);
+ }
}
else if( MBInfo->Flags & (1 << 0) )
{
Log_Warning("MBoot", "No memory map passed, using mem_lower and mem_upper");
}
else if( MBInfo->Flags & (1 << 0) )
{
Log_Warning("MBoot", "No memory map passed, using mem_lower and mem_upper");
+ ASSERT(MapSize >= 2);
nPMemMapEnts = 2;
Map[0].Start = 0;
Map[0].Length = MBInfo->LowMem * 1024;
nPMemMapEnts = 2;
Map[0].Start = 0;
Map[0].Length = MBInfo->LowMem * 1024;
@@
-68,15
+75,18
@@
int Multiboot_LoadMemoryMap(tMBoot_Info *MBInfo, tVAddr MapOffset, tPMemMapEnt *
}
// Ensure it's valid
}
// Ensure it's valid
+ LOG("Validating");
nPMemMapEnts = PMemMap_ValidateMap(Map, nPMemMapEnts, MapSize);
// TODO: Error handling
// Replace kernel with PMEMTYPE_USED
nPMemMapEnts = PMemMap_ValidateMap(Map, nPMemMapEnts, MapSize);
// TODO: Error handling
// Replace kernel with PMEMTYPE_USED
+ LOG("Marking kernel");
nPMemMapEnts = PMemMap_MarkRangeUsed(
Map, nPMemMapEnts, MapSize,
KStart, KEnd - KStart
);
nPMemMapEnts = PMemMap_MarkRangeUsed(
Map, nPMemMapEnts, MapSize,
KStart, KEnd - KStart
);
+ LOG("Dumping");
PMemMap_DumpBlocks(Map, nPMemMapEnts);
// Check if boot modules were passed
PMemMap_DumpBlocks(Map, nPMemMapEnts);
// Check if boot modules were passed
UCC
git Repository :: git.ucc.asn.au