From: John Hodge Date: Mon, 21 Sep 2009 10:27:59 +0000 (+0800) Subject: Disabled debug in ld-acess.so/loadlib X-Git-Tag: rel0.06~555 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=05e8ae6b8fd960b2d9d3dafb34263fe7bd1cb90b;p=tpg%2Facess2.git Disabled debug in ld-acess.so/loadlib Added COW support to MM_SetFlags --- diff --git a/Kernel/arch/x86/mm_virt.c b/Kernel/arch/x86/mm_virt.c index b4fd2225..6fa491b8 100644 --- a/Kernel/arch/x86/mm_virt.c +++ b/Kernel/arch/x86/mm_virt.c @@ -524,6 +524,19 @@ void MM_SetFlags(Uint VAddr, Uint Flags, Uint Mask) if( Flags & MM_PFLAG_KERNEL ) *ent &= ~PF_USER; else *ent |= PF_USER; } + + // Copy-On-Write + if( Mask & MM_PFLAG_COW ) + { + if( Flags & MM_PFLAG_COW ) { + *ent &= ~PF_WRITE; + *ent |= PF_COW; + } + else { + *ent &= ~PF_COW; + *ent |= PF_WRITE; + } + } } /** diff --git a/Usermode/Libraries/ld-acess.so_src/elf.c b/Usermode/Libraries/ld-acess.so_src/elf.c index 56f75e2b..b399f49b 100644 --- a/Usermode/Libraries/ld-acess.so_src/elf.c +++ b/Usermode/Libraries/ld-acess.so_src/elf.c @@ -1,7 +1,7 @@ /* - AcessOS 1 - Dynamic Loader - By thePowersGang -*/ + * AcessOS 1 - Dynamic Loader + * By thePowersGang + */ #include "common.h" #include "elf32.h" diff --git a/Usermode/Libraries/ld-acess.so_src/lib.c b/Usermode/Libraries/ld-acess.so_src/lib.c index d327213f..0d01dc2a 100644 --- a/Usermode/Libraries/ld-acess.so_src/lib.c +++ b/Usermode/Libraries/ld-acess.so_src/lib.c @@ -17,7 +17,7 @@ void strcpy(char *dest, char *src) int strcmp(char *s1, char *s2) { - while(*s1 == *s2 && *s1 != 0) s1++,s2++; + while(*s1 && *s1 == *s2) s1++,s2++; return *s1-*s2; } diff --git a/Usermode/Libraries/ld-acess.so_src/loadlib.c b/Usermode/Libraries/ld-acess.so_src/loadlib.c index 54d4c475..25fcc1a4 100644 --- a/Usermode/Libraries/ld-acess.so_src/loadlib.c +++ b/Usermode/Libraries/ld-acess.so_src/loadlib.c @@ -70,16 +70,17 @@ Uint LoadLibrary(char *filename, char *SearchDir, char **envp) Uint IsFileLoaded(char *file) { int i; - DEBUGS("IsFileLoaded: (file='%s')\n", file); + DEBUGS("IsFileLoaded: (file='%s')", file); for( i = 0; i < MAX_LOADED_LIBRARIES; i++ ) { if(gLoadedLibraries[i].Base == 0) break; // Last entry has Base set to NULL + DEBUGS(" strcmp('%s', '%s')", gLoadedLibraries[i].Name, file); if(strcmp(gLoadedLibraries[i].Name, file) == 0) { - DEBUGS("IsFileLoaded: Found %i (0x%x)\n", i, gLoadedLibraries[i].Base); + DEBUGS("IsFileLoaded: Found %i (0x%x)", i, gLoadedLibraries[i].Base); return gLoadedLibraries[i].Base; } } - DEBUGS("IsFileLoaded: Not Found\n"); + DEBUGS("IsFileLoaded: Not Found"); return 0; }