Fixing to get x86_64 build to compile after threading overhaul
authorJohn Hodge <[email protected]>
Mon, 11 Oct 2010 02:19:32 +0000 (10:19 +0800)
committerJohn Hodge <[email protected]>
Mon, 11 Oct 2010 02:19:32 +0000 (10:19 +0800)
Kernel/Makefile
Kernel/arch/x86_64/Makefile
Kernel/arch/x86_64/include/arch.h
Kernel/arch/x86_64/link.ld
Kernel/arch/x86_64/mm_phys.c
Kernel/arch/x86_64/proc.c

index ec92572..2d558fc 100644 (file)
@@ -52,7 +52,7 @@ all: $(BIN)
 clean:
        @$(RM) $(BIN) ../Acess2.$(ARCH).gz $(BIN).dsm ../Map.$(ARCH).txt LineCounts.$(ARCH).txt $(OBJ) $(DEPFILES)
 
-install: $(BIN)
+install: $(BIN) 
        gzip -c $(BIN) > ../Acess2.$(ARCH).gz
        $(xCP) ../Acess2.$(ARCH).gz $(DISTROOT)
 
@@ -65,6 +65,7 @@ $(BIN): $(OBJ) $(MODS) arch/$(ARCHDIR)/link.ld Makefile
        $(DISASM) -S $(BIN) > $(BIN).dsm
        @wc -l $(SRCFILES) include/*.h > LineCounts.$(ARCH).txt
        @echo BUILD_NUM = $$(( $(BUILD_NUM) + 1 )) > Makefile.BuildNum.$(ARCH)
+       $(POSTBUILD)
        @$(STRIP) $(BIN)
 
 %.ao.$(ARCH): %.asm Makefile
index 22ad8c9..e30bf8d 100644 (file)
@@ -24,3 +24,5 @@ endif
 A_OBJ  = start32.ao start64.ao desctab.ao
 A_OBJ += main.o lib.o proc.o mm_virt.o mm_phys.o vm8086.o
 A_OBJ += kernelpanic.o errors.o
+
+POSTBUILD = objcopy $(BIN) -F elf32 $(BIN)
index 6b75a7d..3993fe9 100644 (file)
@@ -34,6 +34,7 @@ typedef Uint64        tPAddr;
 typedef Uint64 tVAddr;
 
 typedef Uint64 size_t;
+typedef char   BOOL;
 
 #define __ASM__        __asm__ __volatile__
 
index ce537f9..8f75ddb 100644 (file)
@@ -7,8 +7,11 @@
 /* -2 GiB */
 _kernel_base = 0xFFFFFFFF80000000;
 
+/*
 OUTPUT_FORMAT(elf32-i386)
 OUTPUT_ARCH(i386:x86-64)
+*/
+OUTPUT_FORMAT(elf64)
 ENTRY(start)
 
 SECTIONS {
index 0130773..f3cdceb 100644 (file)
@@ -390,7 +390,7 @@ tPAddr MM_AllocPhysRange(int Pages, int MaxBits)
                        nFree ++;
                        addr ++;
                        LOG("nFree(%i) == %i (0x%x)", nFree, Pages, addr);
-                       if(nFree == Num)
+                       if(nFree == Pages)
                                break;
                }
                LOG("nFree = %i", nFree);
@@ -409,10 +409,10 @@ tPAddr MM_AllocPhysRange(int Pages, int MaxBits)
                Mutex_Release(&glPhysicalPages);
                // TODO: Page out
                // ATM. Just Warning
-               Warning(" MM_AllocPhysRange: Out of memory (unable to fulfil request for %i pages)", Num);
+               Warning(" MM_AllocPhysRange: Out of memory (unable to fulfil request for %i pages)", Pages);
                Log_Warning("Arch",
                        "Out of memory (unable to fulfil request for %i pages)",
-                       Num
+                       Pages   
                        );
                LEAVE('i', 0);
                return 0;
index c5c0c18..1d1513b 100644 (file)
@@ -387,7 +387,7 @@ void Proc_Start(void)
        {
                gaCPUs[0].IdleThread = Proc_GetCurThread();
                gaCPUs[0].IdleThread->ThreadName = "Idle Thread";
-               gaCPUs[0].IdleThread->NumTickets = 0;   // Never called randomly
+               Threads_SetPriority( gaCPUs[0].IdleThread, -1 );        // Never called randomly
                gaCPUs[0].IdleThread->Quantum = 1;      // 1 slice quantum
                for(;;) HALT(); // Just yeilds
        }

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