Disabled debug in ld-acess.so/loadlib
authorJohn Hodge <tpg@portege.(none)>
Mon, 21 Sep 2009 10:27:59 +0000 (18:27 +0800)
committerJohn Hodge <tpg@portege.(none)>
Mon, 21 Sep 2009 10:27:59 +0000 (18:27 +0800)
Added COW support to MM_SetFlags

Kernel/arch/x86/mm_virt.c
Usermode/Libraries/ld-acess.so_src/elf.c
Usermode/Libraries/ld-acess.so_src/lib.c
Usermode/Libraries/ld-acess.so_src/loadlib.c

index b4fd222..6fa491b 100644 (file)
@@ -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;
+               }
+       }
 }
 
 /**
index 56f75e2..b399f49 100644 (file)
@@ -1,7 +1,7 @@
 /*\r
- AcessOS 1 - Dynamic Loader\r
- By thePowersGang\r
-*/\r
AcessOS 1 - Dynamic Loader\r
By thePowersGang\r
+ */\r
 #include "common.h"\r
 #include "elf32.h"\r
 
index d327213..0d01dc2 100644 (file)
@@ -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;
 }\r
 \r
index 54d4c47..25fcc1a 100644 (file)
@@ -70,16 +70,17 @@ Uint LoadLibrary(char *filename, char *SearchDir, char **envp)
 Uint IsFileLoaded(char *file)\r
 {\r
         int    i;\r
-       DEBUGS("IsFileLoaded: (file='%s')\n", file);\r
+       DEBUGS("IsFileLoaded: (file='%s')", file);\r
        for( i = 0; i < MAX_LOADED_LIBRARIES; i++ )\r
        {\r
                if(gLoadedLibraries[i].Base == 0)       break;  // Last entry has Base set to NULL\r
+               DEBUGS(" strcmp('%s', '%s')", gLoadedLibraries[i].Name, file);\r
                if(strcmp(gLoadedLibraries[i].Name, file) == 0) {\r
-                       DEBUGS("IsFileLoaded: Found %i (0x%x)\n", i, gLoadedLibraries[i].Base);\r
+                       DEBUGS("IsFileLoaded: Found %i (0x%x)", i, gLoadedLibraries[i].Base);\r
                        return gLoadedLibraries[i].Base;\r
                }\r
        }\r
-       DEBUGS("IsFileLoaded: Not Found\n");\r
+       DEBUGS("IsFileLoaded: Not Found");\r
        return 0;\r
 }\r
 \r

UCC git Repository :: git.ucc.asn.au