From: John Hodge Date: Sun, 31 Oct 2010 04:28:59 +0000 (+0800) Subject: Fiddling with x86_64 and i486 builds X-Git-Tag: rel0.06~2 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=25f7e9ab0f31ca486c0c981a406d381e160637a4;p=tpg%2Facess2.git Fiddling with x86_64 and i486 builds - Also repaired LFN ReadDir --- diff --git a/Kernel/Makefile b/Kernel/Makefile index 2d558fca..7c23b103 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -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 diff --git a/Kernel/Makefile.BuildNum.x86_64 b/Kernel/Makefile.BuildNum.x86_64 index 1775ddde..9c07d1bc 100644 --- a/Kernel/Makefile.BuildNum.x86_64 +++ b/Kernel/Makefile.BuildNum.x86_64 @@ -1 +1 @@ -BUILD_NUM = 221 +BUILD_NUM = 223 diff --git a/Kernel/arch/x86/proc.c b/Kernel/arch/x86/proc.c index 6d84f014..5e9d1bbc 100644 --- a/Kernel/arch/x86/proc.c +++ b/Kernel/arch/x86/proc.c @@ -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 diff --git a/Kernel/arch/x86_64/include/arch.h b/Kernel/arch/x86_64/include/arch.h index 0e5cb611..78b2acce 100644 --- a/Kernel/arch/x86_64/include/arch.h +++ b/Kernel/arch/x86_64/include/arch.h @@ -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) */ diff --git a/Kernel/arch/x86_64/proc.c b/Kernel/arch/x86_64/proc.c index 9abcc633..57394702 100644 --- a/Kernel/arch/x86_64/proc.c +++ b/Kernel/arch/x86_64/proc.c @@ -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; diff --git a/Kernel/threads.c b/Kernel/threads.c index cfc06397..dd4f0d2b 100644 --- a/Kernel/threads.c +++ b/Kernel/threads.c @@ -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); diff --git a/Modules/Filesystems/FAT/fat.c b/Modules/Filesystems/FAT/fat.c index 381a7ecf..5502b5a0 100644 --- a/Modules/Filesystems/FAT/fat.c +++ b/Modules/Filesystems/FAT/fat.c @@ -1262,7 +1262,8 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID) // Bit 6 indicates the start of an entry if(lfnInfo->id & 0x40) memset(lfn, 0, 256); - a = (lfnInfo->id & 0x3F) * 13; + a = ((lfnInfo->id & 0x3F) - 1) * 13; + //Log_Debug("FAT", "ID = 0x%02x, a = %i", lfnInfo->id, a); // Sanity Check (FAT implementations should not allow >255 character names) if(a > 255) return VFS_SKIP; @@ -1276,6 +1277,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID) lfn[a+ 9] = lfnInfo->name2[4]; lfn[a+10] = lfnInfo->name2[5]; lfn[a+11] = lfnInfo->name3[0]; lfn[a+12] = lfnInfo->name3[1]; LOG("lfn = '%s'", lfn); + //Log_Debug("FAT", "lfn = '%s'", lfn); LEAVE('p', VFS_SKIP); return VFS_SKIP; } @@ -1304,6 +1306,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID) #if USE_LFN lfn = FAT_int_GetLFN(Node, ID); + //Log_Debug("FAT", "lfn = %p'%s'", lfn, lfn); ret = FAT_int_CreateName(&fileinfo[a], lfn); #else ret = FAT_int_CreateName(&fileinfo[a], NULL);