git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4c76c23
)
Kernel - Fixing bugs exposed with `qemu -nographic`
author
John Hodge
<
[email protected]
>
Tue, 17 Jul 2012 08:05:29 +0000
(16:05 +0800)
committer
John Hodge
<
[email protected]
>
Tue, 17 Jul 2012 08:05:29 +0000
(16:05 +0800)
KernelLand/Kernel/arch/x86/main.c
patch
|
blob
|
history
KernelLand/Kernel/arch/x86/mm_phys.c
patch
|
blob
|
history
KernelLand/Kernel/arch/x86/proc.c
patch
|
blob
|
history
KernelLand/Kernel/modules.c
patch
|
blob
|
history
KernelLand/Modules/Input/Keyboard/main.c
patch
|
blob
|
history
diff --git
a/KernelLand/Kernel/arch/x86/main.c
b/KernelLand/Kernel/arch/x86/main.c
index
75db374
..
92fef22
100644
(file)
--- a/
KernelLand/Kernel/arch/x86/main.c
+++ b/
KernelLand/Kernel/arch/x86/main.c
@@
-48,8
+48,6
@@
int kmain(Uint MbMagic, void *MbInfoPtr)
LogF("Acess2 x86-"PLATFORM" v"EXPAND_STR(KERNEL_VERSION)"\r\n");
LogF(" Build %i, Git Hash %s\r\n", BUILD_NUM, gsGitHash);
LogF("Acess2 x86-"PLATFORM" v"EXPAND_STR(KERNEL_VERSION)"\r\n");
LogF(" Build %i, Git Hash %s\r\n", BUILD_NUM, gsGitHash);
- Log("MbMagic = %08x, MbInfoPtr = %p", MbMagic, MbInfoPtr);
-
// Set up non-boot info dependent stuff
Desctab_Install(); // Set up GDT and IDT
MM_PreinitVirtual(); // Initialise virtual mappings
// Set up non-boot info dependent stuff
Desctab_Install(); // Set up GDT and IDT
MM_PreinitVirtual(); // Initialise virtual mappings
@@
-121,6
+119,7
@@
int kmain(Uint MbMagic, void *MbInfoPtr)
}
else
gaArch_BootModules[i].ArgString = (char *)mods[i].String + KERNEL_BASE;
}
else
gaArch_BootModules[i].ArgString = (char *)mods[i].String + KERNEL_BASE;
+ Log_Log("Arch", " - %s", gaArch_BootModules[i].ArgString);
}
// Pass on to Independent Loader
}
// Pass on to Independent Loader
diff --git
a/KernelLand/Kernel/arch/x86/mm_phys.c
b/KernelLand/Kernel/arch/x86/mm_phys.c
index
49d7a1a
..
bd1cafc
100644
(file)
--- a/
KernelLand/Kernel/arch/x86/mm_phys.c
+++ b/
KernelLand/Kernel/arch/x86/mm_phys.c
@@
-118,7
+118,7
@@
void MM_Install(tMBoot_Info *MBoot)
gaPageReferences = (void*)MM_REFCOUNT_BASE;
Log_Log("PMem", "Physical memory set up (%lli pages of ~%lli MiB used)",
gaPageReferences = (void*)MM_REFCOUNT_BASE;
Log_Log("PMem", "Physical memory set up (%lli pages of ~%lli MiB used)",
- giPhysAlloc, (giTotalMemorySize*
4)/1024
+ giPhysAlloc, (giTotalMemorySize*
PAGE_SIZE)/(1024*1024)
);
}
);
}
diff --git
a/KernelLand/Kernel/arch/x86/proc.c
b/KernelLand/Kernel/arch/x86/proc.c
index
281b628
..
cd5316e
100644
(file)
--- a/
KernelLand/Kernel/arch/x86/proc.c
+++ b/
KernelLand/Kernel/arch/x86/proc.c
@@
-863,6
+863,10
@@
void Proc_DumpThreadCPUState(tThread *Thread)
__asm__ __volatile__ ("mov %%ebp, %0" : "=r" (stack));
while( maxBacktraceDistance -- )
{
__asm__ __volatile__ ("mov %%ebp, %0" : "=r" (stack));
while( maxBacktraceDistance -- )
{
+ if( !CheckMem(stack, 8) ) {
+ regs = NULL;
+ break;
+ }
// [ebp] = oldEbp
// [ebp+4] = retaddr
// [ebp] = oldEbp
// [ebp+4] = retaddr
diff --git
a/KernelLand/Kernel/modules.c
b/KernelLand/Kernel/modules.c
index
8202b08
..
dd8a3ae
100644
(file)
--- a/
KernelLand/Kernel/modules.c
+++ b/
KernelLand/Kernel/modules.c
@@
-8,6
+8,7
@@
#define USE_EDI 0
#define USE_UDI 0
#define USE_EDI 0
#define USE_UDI 0
+#define MODULE_FLAG_LOADERROR 0x1
// === PROTOTYPES ===
int Module_int_Initialise(tModule *Module, const char *ArgString);
// === PROTOTYPES ===
int Module_int_Initialise(tModule *Module, const char *ArgString);
@@
-80,6
+81,15
@@
int Module_int_Initialise(tModule *Module, const char *ArgString)
"Module %p (%s) is for another architecture (%i)",
Module, Module->Name, Module->Arch
);
"Module %p (%s) is for another architecture (%i)",
Module, Module->Name, Module->Arch
);
+ LEAVE('i', MODULE_ERR_BADMODULE);
+ return MODULE_ERR_BADMODULE;
+ }
+
+ LOG("Module->Flags = %x", Module->Flags);
+ if(Module->Flags & MODULE_FLAG_LOADERROR ) {
+ Log_Warning("Module", "%s has already attempted to load and encountered errors", Module->Name);
+ LEAVE('i', MODULE_ERR_MISC);
+ return MODULE_ERR_MISC;
}
deps = Module->Dependencies;
}
deps = Module->Dependencies;
@@
-168,7
+178,7
@@
int Module_int_Initialise(tModule *Module, const char *ArgString)
Log_Warning("Module", "Unable to load, reason: Miscelanious");
break;
case MODULE_ERR_NOTNEEDED:
Log_Warning("Module", "Unable to load, reason: Miscelanious");
break;
case MODULE_ERR_NOTNEEDED:
-
//
Log_Debug("Module", "Unable to load, reason: Module not needed");
+
Log_Debug("Module", "Unable to load, reason: Module not needed");
break;
case MODULE_ERR_MALLOC:
Log_Warning("Module", "Unable to load, reason: Error in malloc/realloc/calloc, probably not good");
break;
case MODULE_ERR_MALLOC:
Log_Warning("Module", "Unable to load, reason: Error in malloc/realloc/calloc, probably not good");
@@
-177,6
+187,7
@@
int Module_int_Initialise(tModule *Module, const char *ArgString)
Log_Warning("Module", "Unable to load reason - Unknown code %i", ret);
break;
}
Log_Warning("Module", "Unable to load reason - Unknown code %i", ret);
break;
}
+ Module->Flags |= MODULE_FLAG_LOADERROR;
LEAVE_RET('i', ret);
return ret;
}
LEAVE_RET('i', ret);
return ret;
}
diff --git
a/KernelLand/Modules/Input/Keyboard/main.c
b/KernelLand/Modules/Input/Keyboard/main.c
index
f49d8ea
..
9c2e20e
100644
(file)
--- a/
KernelLand/Modules/Input/Keyboard/main.c
+++ b/
KernelLand/Modules/Input/Keyboard/main.c
@@
-164,6
+164,15
@@
void Keyboard_HandleKey(tKeyboard *Source, Uint32 HIDKeySym)
Uint32 flag;
Uint8 layer;
Uint32 flag;
Uint8 layer;
+ if( !Source ) {
+ Log_Error("Keyboard", "Passed NULL handle");
+ return ;
+ }
+ if( !Source->Node ) {
+ Log_Error("Keyboard", "Passed handle with NULL node");
+ return ;
+ }
+
bPressed = !(HIDKeySym & (1 << 31));
HIDKeySym &= 0x7FFFFFFF;
bPressed = !(HIDKeySym & (1 << 31));
HIDKeySym &= 0x7FFFFFFF;
UCC
git Repository :: git.ucc.asn.au