Bugfixes upon chaning GCC versions
authorJohn Hodge <tpg@prelude.(none)>
Mon, 28 Dec 2009 09:48:44 +0000 (17:48 +0800)
committerJohn Hodge <tpg@prelude.(none)>
Mon, 28 Dec 2009 09:48:44 +0000 (17:48 +0800)
- Also updating my config to be correct for my new machine

Kernel/Makefile.BuildNum
Kernel/drv/dma.c
Kernel/vfs/nodecache.c
Makefile.cfg
README
Usermode/Applications/Makefile.cfg
Usermode/Filesystem/Conf/BootConf.cfg [changed mode: 0755->0644]
Usermode/Libraries/acess.ld

index 188cc18..65deeab 100644 (file)
@@ -1 +1 @@
-BUILD_NUM = 1080
+BUILD_NUM = 1084
index 0fae172..246ab46 100644 (file)
@@ -32,7 +32,7 @@ t_dmaChannel  dma_channels[8];
  */\r
 void DMA_Install()\r
 {\r
  */\r
 void DMA_Install()\r
 {\r
-       int i;\r
+       Uint    i;\r
        for(i=8;i--;)\r
        {\r
                outb( cMASKPORT[i], 0x04 | (i & 0x3) ); // mask channel\r
        for(i=8;i--;)\r
        {\r
                outb( cMASKPORT[i], 0x04 | (i & 0x3) ); // mask channel\r
@@ -49,32 +49,32 @@ void DMA_Install()
                \r
                dma_channels[i].mode = 0;\r
                dma_addresses[i] = (char*)DMA_ADDRESS(i);\r
                \r
                dma_channels[i].mode = 0;\r
                dma_addresses[i] = (char*)DMA_ADDRESS(i);\r
-               dma_addresses[i] += 0xC0000000;\r
+               dma_addresses[i] += KERNEL_BASE;\r
        }\r
 }\r
 \r
 /**\r
        }\r
 }\r
 \r
 /**\r
- * \fn void DMA_SetChannel(int channel, int length, int read)\r
+ * \fn void DMA_SetChannel(int Channel, int length, int read)\r
  * \brief Set DMA Channel Length and RW\r
  */\r
  * \brief Set DMA Channel Length and RW\r
  */\r
-void DMA_SetChannel(int channel, int length, int read)\r
+void DMA_SetChannel(int Channel, int length, int read)\r
 {\r
 {\r
-       channel &= 7;\r
-       read = read && 1;\r
+       Uint    chan = Channel & 7;\r
+       read = !!read;\r
        if(length > DMA_SIZE)   length = DMA_SIZE;\r
        length --;      //Adjust for DMA\r
        //__asm__ __volatile__ ("cli");\r
        if(length > DMA_SIZE)   length = DMA_SIZE;\r
        length --;      //Adjust for DMA\r
        //__asm__ __volatile__ ("cli");\r
-       outb( cMASKPORT[channel], 0x04 | (channel & 0x3) );             // mask channel\r
-       outb( cCLEARPORT[channel], 0x00 );\r
-       outb( cMODEPORT[channel], (0x44 + (!read)*4) | (channel & 0x3) );\r
-       outb( cADDRPORT[channel], LOWB(DMA_ADDRESS(channel)) );         // send address\r
-       outb( cADDRPORT[channel], HIB(DMA_ADDRESS(channel)) );          // send address\r
-       outb( cPAGEPORT[channel], HIW(DMA_ADDRESS(channel)) );          // send page\r
-       outb( cCOUNTPORT[channel], LOWB(length) );      // send size\r
-       outb( cCOUNTPORT[channel], HIB(length) );       // send size\r
-       outb( cMASKPORT[channel], channel & 0x3 );              // unmask channel\r
-       dma_addresses[channel] = (char*)DMA_ADDRESS(channel);\r
-       dma_addresses[channel] += 0xC0000000;\r
+       outb( cMASKPORT[chan], 0x04 | (chan & 0x3) );           // mask channel\r
+       outb( cCLEARPORT[chan], 0x00 );\r
+       outb( cMODEPORT[chan], (0x44 + (!read)*4) | (chan & 0x3) );\r
+       outb( cADDRPORT[chan], LOWB(DMA_ADDRESS(chan)) );               // send address\r
+       outb( cADDRPORT[chan], HIB(DMA_ADDRESS(chan)) );                // send address\r
+       outb( cPAGEPORT[chan], HIW(DMA_ADDRESS(chan)) );                // send page\r
+       outb( cCOUNTPORT[chan], LOWB(length) );      // send size\r
+       outb( cCOUNTPORT[chan], HIB(length) );       // send size\r
+       outb( cMASKPORT[chan], chan & 0x3 );              // unmask channel\r
+       dma_addresses[chan] = (char*)DMA_ADDRESS(chan);\r
+       dma_addresses[chan] += KERNEL_BASE;\r
        //__asm__ __volatile__ ("sti");\r
 }\r
 \r
        //__asm__ __volatile__ ("sti");\r
 }\r
 \r
index c503e9c..b1b1b61 100644 (file)
@@ -158,7 +158,7 @@ void Inode_UncacheNode(int Handle, Uint64 Inode)
 void Inode_ClearCache(int Handle)
 {
        tInodeCache     *cache;
 void Inode_ClearCache(int Handle)
 {
        tInodeCache     *cache;
-       tInodeCache     *prev = (tInodeCache*) &gVFS_InodeCache;
+       tInodeCache     *prev = NULL;
        tCachedInode    *ent, *next;
        
        // Find the cache
        tCachedInode    *ent, *next;
        
        // Find the cache
@@ -184,7 +184,10 @@ void Inode_ClearCache(int Handle)
        }
        
        // Free Cache
        }
        
        // Free Cache
-       prev->Next = cache->Next;
+       if(prev == NULL)
+               gVFS_InodeCache = cache->Next;
+       else
+               prev->Next = cache->Next;
        free(cache);
 }
 
        free(cache);
 }
 
index 3875828..3f06360 100644 (file)
@@ -26,4 +26,4 @@ MODULES = UDI FS_Ext2 FDD NE2000 BochsGA
 #DISTROOT = /mnt/AcessHDD/Acess2
 #DISTROOT = ~/Projects/Acess2/Filesystem
 DISTROOT = a:/Acess2
 #DISTROOT = /mnt/AcessHDD/Acess2
 #DISTROOT = ~/Projects/Acess2/Filesystem
 DISTROOT = a:/Acess2
-ACESSDIR = /home/hodgeja/Projects/Acess2
+ACESSDIR = /home/tpg/Projects/Acess2
diff --git a/README b/README
index fa3fd3e..4fb8be1 100644 (file)
--- a/README
+++ b/README
@@ -42,6 +42,8 @@ MODULES defines what modules should be statically linked with the kernel
 
 Set the source root directory (ACESSDIR) and the destination  directory
  (DISTROOT).
 
 Set the source root directory (ACESSDIR) and the destination  directory
  (DISTROOT).
+To be able to build usermode programs, Usermode/Libraries/acess.ld needs
+ to be edited to change the SEARCH_DIR directive to the correct path.
 You may also want to edit Usermode/Filesystem/Conf/BootConf.cfg before
  installing.
 
 You may also want to edit Usermode/Filesystem/Conf/BootConf.cfg before
  installing.
 
index 146177d..fd8bc45 100644 (file)
@@ -6,9 +6,9 @@
 if $(ACESSDIR) == "" then
        -include ../../../../Makefile.cfg
 #endif
 if $(ACESSDIR) == "" then
        -include ../../../../Makefile.cfg
 #endif
-ACESSDIR := $(ACESSDIR)/Usermode
+ACESSUSERDIR := $(ACESSDIR)/Usermode
 
 ASFLAGS = -felf
 
 ASFLAGS = -felf
-CPPFLAGS = -I$(ACESSDIR)/include/
+CPPFLAGS = -I$(ACESSUSERDIR)/include/
 CFLAGS   = -fno-stack-protector $(CPPFLAGS)
 CFLAGS   = -fno-stack-protector $(CPPFLAGS)
-LDFLAGS  = -T $(ACESSDIR)/Libraries/acess.ld -L $(ACESSDIR)/Libraries -I /Acess/Libs/ld-acess.so -lc
+LDFLAGS  = -T $(ACESSUSERDIR)/Libraries/acess.ld -L $(ACESSUSERDIR)/Libraries -I /Acess/Libs/ld-acess.so -lc
old mode 100755 (executable)
new mode 100644 (file)
index adf7b2a..aa2edd3 100644 (file)
@@ -1,7 +1,7 @@
 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")\r
 OUTPUT_ARCH(i386)\r
 ENTRY(start)\r
 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")\r
 OUTPUT_ARCH(i386)\r
 ENTRY(start)\r
-SEARCH_DIR(/home/hodgeja/Projects/Acess2/Usermode/Libraries)\r
+SEARCH_DIR(/home/tpg/Projects/Acess2/Usermode/Libraries)\r
 INPUT(-lacess crt0.o)\r
 SECTIONS\r
 {\r
 INPUT(-lacess crt0.o)\r
 SECTIONS\r
 {\r

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