Build - Restructured configuration
authorJohn Hodge <[email protected]>
Wed, 30 Nov 2011 04:09:54 +0000 (12:09 +0800)
committerJohn Hodge <[email protected]>
Wed, 30 Nov 2011 04:09:54 +0000 (12:09 +0800)
- Allows different configurations in each architecture
 > E.g. Allow different ARM SOCs to be supported nicely
- Also fixed a compile error in workqueue with ARM
- Added USB mouse to RunQemu

21 files changed:
BuildConf/armv7/Makefile.cfg [new file with mode: 0644]
BuildConf/armv7/default.mk [new file with mode: 0644]
BuildConf/armv7/realview_pb.mk [new file with mode: 0644]
BuildConf/host/Makefile.host.cfg [new file with mode: 0644]
BuildConf/x86/Makefile.cfg [new file with mode: 0644]
BuildConf/x86/default.mk [new file with mode: 0644]
BuildConf/x86_64/Makefile.cfg [new file with mode: 0644]
BuildConf/x86_64/default.mk [new file with mode: 0644]
BuildConf/x86_smp [new symlink]
Kernel/arch/armv7/Makefile
Kernel/arch/armv7/include/options.h
Kernel/workqueue.c
Makefile.armv7.cfg [deleted file]
Makefile.cfg
Makefile.host.cfg [deleted file]
Makefile.x86.cfg [deleted file]
Makefile.x86_64.cfg [deleted file]
Makefile.x86_smp.cfg [deleted symlink]
Modules/Display/PL110/main.c
Modules/armv7/GIC/gic.c
RunQemu

diff --git a/BuildConf/armv7/Makefile.cfg b/BuildConf/armv7/Makefile.cfg
new file mode 100644 (file)
index 0000000..f5fa261
--- /dev/null
@@ -0,0 +1,13 @@
+
+CC = arm-elf-gcc
+AS = arm-elf-gcc -c
+LD = arm-elf-ld
+OBJDUMP = arm-elf-objdump
+DISASM = $(OBJDUMP) -d -S
+ARCHDIR = armv7
+STRIP = arm-elf-strip
+
+ASSUFFIX = S
+
+CONFIG=realview_pb
+
diff --git a/BuildConf/armv7/default.mk b/BuildConf/armv7/default.mk
new file mode 100644 (file)
index 0000000..0a85c92
--- /dev/null
@@ -0,0 +1,7 @@
+
+ifeq ($(CONFIG),default)
+       $(error Please select a configuration)
+endif
+
+MODULES += armv7/GIC
+MODULES += Filesystems/InitRD
diff --git a/BuildConf/armv7/realview_pb.mk b/BuildConf/armv7/realview_pb.mk
new file mode 100644 (file)
index 0000000..4b284ee
--- /dev/null
@@ -0,0 +1,5 @@
+
+include $(ACESSDIR)/BuildConf/armv7/default.mk
+
+MODULES += Input/PS2KbMouse
+MODULES += Display/PL110
diff --git a/BuildConf/host/Makefile.host.cfg b/BuildConf/host/Makefile.host.cfg
new file mode 100644 (file)
index 0000000..dee50de
--- /dev/null
@@ -0,0 +1,15 @@
+#
+# Acess2 Host Native makefile
+# - Used for forcing the architecture
+#
+
+SAVED_CC_ := $(CC)
+SAVED_LD_ := $(LD)
+
+include $(ACESSDIR)/Makefile.x86_64.cfg
+
+OBJDUMP := objdump -S
+
+CC := $(SAVED_CC_)
+LD := $(SAVED_LD_)
+
diff --git a/BuildConf/x86/Makefile.cfg b/BuildConf/x86/Makefile.cfg
new file mode 100644 (file)
index 0000000..7b3d8a9
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Acess2 Build Configuration
+#
+
+CC = i586-elf-gcc
+LD = i586-elf-ld
+AS = nasm
+OBJDUMP = i586-elf-objdump
+RM = @rm -f
+STRIP = strip
+
+ARCHDIR = x86
+
+DYNMOD_FLAGS := -mcmodel=small -fPIC
+
+
+ASFLAGS = -felf
diff --git a/BuildConf/x86/default.mk b/BuildConf/x86/default.mk
new file mode 100644 (file)
index 0000000..ec21227
--- /dev/null
@@ -0,0 +1,10 @@
+
+MODULES += Storage/ATA
+MODULES += Storage/FDDv2
+MODULES += Network/NE2000 Network/RTL8139
+MODULES += Display/VESA
+MODULES += Display/BochsGA
+MODULES += Input/PS2KbMouse
+MODULES += x86/ISADMA x86/VGAText
+MODULES += USB/Core USB/UHCI
+#MODULES += Interfaces/UDI
diff --git a/BuildConf/x86_64/Makefile.cfg b/BuildConf/x86_64/Makefile.cfg
new file mode 100644 (file)
index 0000000..54bbf51
--- /dev/null
@@ -0,0 +1,12 @@
+
+CC = x86_64-none-elf-gcc
+LD = x86_64-none-elf-ld
+DISASM = x86_64-none-elf-objdump -d -M x86-64 -S
+
+KERNEL_CFLAGS := -mcmodel=kernel -nostdlib -mno-red-zone -Wall -Werror
+DYNMOD_CFLAGS := -mcmodel=small -fPIC -mno-red-zone
+
+ARCHDIR = x86_64
+
+ASFLAGS = -felf64
+
diff --git a/BuildConf/x86_64/default.mk b/BuildConf/x86_64/default.mk
new file mode 100644 (file)
index 0000000..2afabe8
--- /dev/null
@@ -0,0 +1,8 @@
+
+MODULES += Storage/ATA
+MODULES += Storage/FDDv2
+MODULES += Network/NE2000 Network/RTL8139
+MODULES += Display/BochsGA
+MODULES += Interfaces/UDI
+MODULES += Input/PS2KbMouse
+MODULES += x86/ISADMA x86/VGAText
diff --git a/BuildConf/x86_smp b/BuildConf/x86_smp
new file mode 120000 (symlink)
index 0000000..ef2bea7
--- /dev/null
@@ -0,0 +1 @@
+x86/
\ No newline at end of file
index 83fd17c..67bea82 100644 (file)
@@ -16,8 +16,8 @@ endif
 
 
 
-#ASFLAGS += -D USE_MP=$(USE_MP) -D USE_PAE=$(USE_PAE)
-CPPFLAGS += -DMMU_PRESENT=$(MMU_PRESENT) -DPCI_ADDRESS=$(PCI_ADDRESS)
+ASFLAGS += -DCONFIG_is_$(CONFIG)=1
+CPPFLAGS += -DMMU_PRESENT=$(MMU_PRESENT) -DPCI_ADDRESS=$(PCI_ADDRESS) -DCONFIG_is_$(CONFIG)=1
 LDFLAGS += `$(CC) --print-libgcc-file-name`
 
 A_OBJ  = start.ao main.o lib.o lib.ao time.o pci.o debug.o
index 0fbec5f..fad529e 100644 (file)
 #define KERNEL_BASE    0x80000000
 
 //#define PCI_PADDR    0x60000000      // Realview (Non-PB)
-#define UART0_PADDR    0x10009000      // Realview
+
+#if CONFIG_is_realview_pb
+# define UART0_PADDR   0x10009000      // Realview
+# define GICI_PADDR    0x1e000000
+# define GICD_PADDR    0x1e001000
+# define PL110_BASE    0x10020000      // Integrator
+
+#endif
+
+#if CONFIG_is_trimslice        // Tegra2
+# define UART0_PADDR   0x70006000
+# define GICD_PADDR    0x50041000
+# define GICI_PADDR    0x60004000      // TODO: Is this actually a GIC-I?
+//# define PL110_BASE  0x10020000      // Integrator
+#endif
 
 #define MM_KSTACK_SIZE 0x2000  // 2 Pages
 
index 38bf932..cfdf428 100644 (file)
@@ -27,7 +27,7 @@ void *Workqueue_GetWork(tWorkqueue *Queue)
                if(Queue->Head)
                {
                        void *ret = Queue->Head;
-                       Queue->Head = *(void**)( (char*)ret + Queue->NextOffset );
+                       Queue->Head = *( (void**)ret + Queue->NextOffset/sizeof(void*) );
                        if(Queue->Tail == ret)
                                Queue->Tail = NULL;
                        SHORTREL(&Queue->Protector);    
@@ -58,7 +58,7 @@ void Workqueue_AddWork(tWorkqueue *Queue, void *Ptr)
        SHORTLOCK(&Queue->Protector);
 
        if( Queue->Tail )
-               *(void**)( (char*)Queue->Tail + Queue->NextOffset ) = Ptr;
+               *( (void**)Queue->Tail + Queue->NextOffset/sizeof(void*) ) = Ptr;
        else
                Queue->Head = Ptr;
        Queue->Tail = Ptr;
diff --git a/Makefile.armv7.cfg b/Makefile.armv7.cfg
deleted file mode 100644 (file)
index 98d95c8..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-
-CC = arm-elf-gcc
-AS = arm-elf-gcc -c
-LD = arm-elf-ld
-OBJDUMP = arm-elf-objdump
-DISASM = $(OBJDUMP) -d -S
-ARCHDIR = armv7
-STRIP = arm-elf-strip
-
-ASSUFFIX = S
index d36dca5..716eb5f 100644 (file)
@@ -29,53 +29,33 @@ ASSUFFIX = asm
 ifeq ($(ARCH),)
        ARCH := x86
 endif
-include $(ACESSDIR)/Makefile.$(ARCH).cfg
+include $(ACESSDIR)/BuildConf/$(ARCH)/Makefile.cfg
 ifeq ($(ARCHDIR),)
        ARCHDIR := x86
 endif
+
 ifneq ($(ARCH),host)
-include $(ACESSDIR)/Makefile.$(ARCHDIR).cfg
+ ifneq ($(ARCHDIR),$(ARCH))
+  include $(ACESSDIR)/BuildConf/$(ARCHDIR)/Makefile.cfg
+ endif
+endif
+
+ifeq ($(CONFIG),)
+       CONFIG := default
 endif
 
 # Makefile.user.cfg is not part of the Acess git repo,
 # It is for overriding the options in this file
 -include $(ACESSDIR)/Makefile.user.cfg
 
-FILESYSTEMS := 
 DRIVERS := 
 MODULES :=
+
 MODULES += Filesystems/Ext2
 MODULES += Filesystems/FAT
 MODULES += Filesystems/NTFS
 
-ifeq ($(ARCHDIR),x86)
-MODULES += Storage/ATA
-MODULES += Storage/FDDv2
-MODULES += Network/NE2000 Network/RTL8139
-MODULES += Display/VESA
-MODULES += Display/BochsGA
-MODULES += Input/PS2KbMouse
-MODULES += x86/ISADMA x86/VGAText
-MODULES += USB/Core USB/UHCI
-#MODULES += Interfaces/UDI
-endif
-
-ifeq ($(ARCHDIR),x86_64)
-MODULES += Storage/ATA
-MODULES += Storage/FDDv2
-MODULES += Network/NE2000 Network/RTL8139
-MODULES += Display/BochsGA
-MODULES += Interfaces/UDI
-MODULES += Input/PS2KbMouse
-MODULES += x86/ISADMA x86/VGAText
-endif
-
-ifeq ($(ARCHDIR),armv7)
-MODULES += Input/PS2KbMouse
-MODULES += armv7/GIC
-MODULES += Filesystems/InitRD
-MODULES += Display/PL110
-endif
+include $(ACESSDIR)/BuildConf/$(ARCH)/$(CONFIG).mk
 
 MODULES += IPStack     # So the other modules are loaded before it
 #DYNMODS := USB/Core
diff --git a/Makefile.host.cfg b/Makefile.host.cfg
deleted file mode 100644 (file)
index dee50de..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Acess2 Host Native makefile
-# - Used for forcing the architecture
-#
-
-SAVED_CC_ := $(CC)
-SAVED_LD_ := $(LD)
-
-include $(ACESSDIR)/Makefile.x86_64.cfg
-
-OBJDUMP := objdump -S
-
-CC := $(SAVED_CC_)
-LD := $(SAVED_LD_)
-
diff --git a/Makefile.x86.cfg b/Makefile.x86.cfg
deleted file mode 100644 (file)
index 7b3d8a9..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Acess2 Build Configuration
-#
-
-CC = i586-elf-gcc
-LD = i586-elf-ld
-AS = nasm
-OBJDUMP = i586-elf-objdump
-RM = @rm -f
-STRIP = strip
-
-ARCHDIR = x86
-
-DYNMOD_FLAGS := -mcmodel=small -fPIC
-
-
-ASFLAGS = -felf
diff --git a/Makefile.x86_64.cfg b/Makefile.x86_64.cfg
deleted file mode 100644 (file)
index 54bbf51..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-
-CC = x86_64-none-elf-gcc
-LD = x86_64-none-elf-ld
-DISASM = x86_64-none-elf-objdump -d -M x86-64 -S
-
-KERNEL_CFLAGS := -mcmodel=kernel -nostdlib -mno-red-zone -Wall -Werror
-DYNMOD_CFLAGS := -mcmodel=small -fPIC -mno-red-zone
-
-ARCHDIR = x86_64
-
-ASFLAGS = -felf64
-
diff --git a/Makefile.x86_smp.cfg b/Makefile.x86_smp.cfg
deleted file mode 120000 (symlink)
index b2fd659..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Makefile.x86.cfg
\ No newline at end of file
index 285cec4..4d7b938 100644 (file)
@@ -19,6 +19,7 @@
 #include <drv_pci.h>\r
 #include <api_drv_video.h>\r
 #include <lib/keyvalue.h>\r
+#include <options.h>   // ARM Arch\r
 \r
 #define ABS(a) ((a)>0?(a):-(a))\r
 \r
@@ -43,9 +44,11 @@ struct sPL110
        Uint32  LCDLPCurr;\r
 };\r
 \r
-// === CONSTANTS ===\r
+#ifndef PL110_BASE\r
 #define PL110_BASE     0x10020000      // Integrator\r
+#endif\r
 \r
+// === CONSTANTS ===\r
 const struct {\r
        short W, H;\r
 }      caPL110_Modes[] = {\r
index 9eb720f..8dbab3a 100644 (file)
@@ -10,6 +10,7 @@
 #include <acess.h>
 #include <modules.h>
 #include "gic.h"
+#include <options.h>
 
 #define N_IRQS 1024
 
diff --git a/RunQemu b/RunQemu
index cf21f55..a07a91b 100755 (executable)
--- a/RunQemu
+++ b/RunQemu
@@ -13,6 +13,7 @@ QEMU_PARAMS=$QEMU_PARAMS" -net nic"
 QEMU_PARAMS=$QEMU_PARAMS" -usb"
 QEMU_PARAMS=$QEMU_PARAMS" -drive id=test_usb_image,file=USB_Test_Image.img,if=none"
 QEMU_PARAMS=$QEMU_PARAMS" -device usb-storage,drive=test_usb_image"
+QEMU_PARAMS=$QEMU_PARAMS" -usbdevice mouse"
 _NETTYPE="user"
 
 while [ $# -ne 0 ]; do

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