Fiddling with x86_64 and i486 builds
authorJohn Hodge <[email protected]>
Sun, 31 Oct 2010 04:28:59 +0000 (12:28 +0800)
committerJohn Hodge <[email protected]>
Sun, 31 Oct 2010 04:28:59 +0000 (12:28 +0800)
- Also repaired LFN ReadDir

Kernel/Makefile
Kernel/Makefile.BuildNum.x86_64
Kernel/arch/x86/proc.c
Kernel/arch/x86_64/include/arch.h
Kernel/arch/x86_64/proc.c
Kernel/threads.c
Modules/Filesystems/FAT/fat.c

index 2d558fc..7c23b10 100644 (file)
@@ -29,7 +29,7 @@ OBJ := $(addprefix arch/$(ARCHDIR)/,$(A_OBJ))
 OBJ += heap.o drvutil.o logging.o debug.o lib.o adt.o time.o
 OBJ += messages.o modules.o syscalls.o system.o threads.o
 OBJ += $(addprefix vfs/fs/, $(addsuffix .o,$(FILESYSTEMS)))
-OBJ += drv/vterm.o drv/proc.o drv/fifo.o drv/iocache.o drv/dma.o drv/pci.o drv/kb.o drv/vga.o
+OBJ += drv/kb.o drv/vterm.o drv/proc.o drv/fifo.o drv/iocache.o drv/dma.o drv/pci.o drv/vga.o
 OBJ += binary.o bin/elf.o bin/pe.o
 OBJ += vfs/main.o vfs/open.o vfs/acls.o vfs/dir.o vfs/io.o vfs/mount.o vfs/memfile.o vfs/nodecache.o
 OBJ += vfs/fs/root.o vfs/fs/devfs.o
index 6d84f01..5e9d1bb 100644 (file)
@@ -445,7 +445,7 @@ void Proc_Start(void)
                }
                gaCPUs[i].IdleThread = Threads_GetThread(tid);
                gaCPUs[i].IdleThread->ThreadName = "Idle Thread";
-               Threads_SetTickets( gaCPUs[i].IdleThread, 0 );  // Never called randomly
+               Threads_SetPriority( gaCPUs[i].IdleThread, -1 );        // Never called randomly
                gaCPUs[i].IdleThread->Quantum = 1;      // 1 slice quantum
                
                
index 0e5cb61..78b2acc 100644 (file)
@@ -45,7 +45,7 @@ typedef char  BOOL;
 /**
  * \brief Halt the CPU
  */
-#define        HALT()  __asm__ __volatile__ ("hlt")
+#define        HALT()  __asm__ __volatile__ ("sti;\n\thlt")
 /**
  * \brief Fire a magic breakpoint (bochs)
  */
index 9abcc63..5739470 100644 (file)
@@ -736,8 +736,6 @@ void Proc_Scheduler(int CPU)
        // If the spinlock is set, let it complete
        if(IS_LOCKED(&glThreadListLock))        return;
        
-       //LogF("Scheduler: CPU = %i\n", CPU);
-       
        // Get current thread
        thread = gaCPUs[CPU].Current;
        
@@ -776,6 +774,9 @@ void Proc_Scheduler(int CPU)
                );
        #endif
        
+       
+       if(CPU > MAX_CPUS)
+               LogF("CPU = %i", CPU);
        // Set current thread
        gaCPUs[CPU].Current = thread;
        
index cfc0639..dd4f0d2 100644 (file)
@@ -40,7 +40,7 @@ extern void   Proc_CallFaultHandler(tThread *Thread);
 void   Threads_Init(void);
  int   Threads_SetName(char *NewName);
 char   *Threads_GetName(int ID);
-void   Threads_SetTickets(tThread *Thread, int Num);
+void   Threads_SetPriority(tThread *Thread, int Pri);
 tThread        *Threads_CloneTCB(Uint *Err, Uint Flags);
  int   Threads_WaitTID(int TID, int *status);
 tThread        *Threads_GetThread(Uint TID);
index 381a7ec..5502b5a 100644 (file)
@@ -1262,7 +1262,8 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
                // Bit 6 indicates the start of an entry\r
                if(lfnInfo->id & 0x40)  memset(lfn, 0, 256);\r
                \r
-               a = (lfnInfo->id & 0x3F) * 13;\r
+               a = ((lfnInfo->id & 0x3F) - 1) * 13;\r
+               //Log_Debug("FAT", "ID = 0x%02x, a = %i", lfnInfo->id, a);\r
                \r
                // Sanity Check (FAT implementations should not allow >255 character names)\r
                if(a > 255)     return VFS_SKIP;\r
@@ -1276,6 +1277,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
                lfn[a+ 9] = lfnInfo->name2[4];  lfn[a+10] = lfnInfo->name2[5];\r
                lfn[a+11] = lfnInfo->name3[0];  lfn[a+12] = lfnInfo->name3[1];\r
                LOG("lfn = '%s'", lfn);\r
+               //Log_Debug("FAT", "lfn = '%s'", lfn);\r
                LEAVE('p', VFS_SKIP);\r
                return VFS_SKIP;\r
        }\r
@@ -1304,6 +1306,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
        \r
        #if USE_LFN\r
        lfn = FAT_int_GetLFN(Node, ID);\r
+       //Log_Debug("FAT", "lfn = %p'%s'", lfn, lfn);\r
        ret = FAT_int_CreateName(&fileinfo[a], lfn);\r
        #else\r
        ret = FAT_int_CreateName(&fileinfo[a], NULL);\r

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