Index: /trunk/softs/tsar_boot/Makefile
===================================================================
--- /trunk/softs/tsar_boot/Makefile	(revision 758)
+++ /trunk/softs/tsar_boot/Makefile	(revision 759)
@@ -1,3 +1,3 @@
-# let the user have a default configuration (ie for PLATFORM_DIR)
+# let the user have a default configuration (ie for HARD_CONFIG_PATH)
 -include ./build.mk
 
@@ -8,8 +8,8 @@
 
 ifneq ($(MAKECMDGOALS),$(filter $(MAKECMDGOALS),clean distclean clean-doc doc))
-  ifndef PLATFORM_DIR
-    $(error please define PLATFORM_DIR 'make PLATFORM_DIR=foo')
+  ifndef HARD_CONFIG_PATH
+    $(error please define HARD_CONFIG_PATH 'make HARD_CONFIG_PATH=foo')
   else
-    $(info Make for $(PLATFORM_DIR))
+    $(info Make for $(HARD_CONFIG_PATH))
   endif
 endif
@@ -26,4 +26,5 @@
 AR         := mipsel-unknown-elf-ar
 RM         := rm -rf
+SED        := sed
 ECHO       := @echo
 MKDIR      := mkdir
@@ -38,5 +39,5 @@
 # =============================================================================
 
-INCLUDE    += -I. -Iinclude -Idrivers -I$(PLATFORM_DIR)
+INCLUDE    += -I. -Iinclude -Idrivers -I$(HARD_CONFIG_PATH)
 
 # =============================================================================
@@ -108,7 +109,11 @@
 	./version.sh > $@
 
-$(TARGET): $(BUILD_DIR) $(OBJS) $(PLATFORM_DIR)/ldscript $(BUILD_DIR)/platform.ld $(BUILD_DIR)/$(DRV_LIB)
+$(BUILD_DIR)/preloader.ld: preloader.ld.in
+	$(ECHO) "[   CC    ]     $(notdir $<)"
+	$(CC) -x c $(INCLUDE) -E $< | $(SED) -e '/#/d' -e '/^[\s\t]*$$/d' > $@
+
+$(TARGET): $(BUILD_DIR) $(OBJS) $(BUILD_DIR)/preloader.ld $(BUILD_DIR)/platform.ld $(BUILD_DIR)/$(DRV_LIB)
 	$(ECHO) "[   LD    ]     $@"
-	$(LD) -o $@ -T $(PLATFORM_DIR)/ldscript $(OBJS) -L$(BUILD_DIR) -ldrivers
+	$(LD) -o $@ -T $(BUILD_DIR)/preloader.ld $(OBJS) -L$(BUILD_DIR) -ldrivers
 	$(DU) -D $@ > $@.txt
 
@@ -123,5 +128,5 @@
 endif
 
-$(BUILD_DIR)/platform.dtb: $(PLATFORM_DIR)/$(DTS)
+$(BUILD_DIR)/platform.dtb: $(HARD_CONFIG_PATH)/$(DTS)
 	$(ECHO) "[   DTC   ]     $(notdir $<)"
 	${DTC} -O dtb -o $@ $< &> /dev/null
Index: /trunk/softs/tsar_boot/README
===================================================================
--- /trunk/softs/tsar_boot/README	(revision 758)
+++ /trunk/softs/tsar_boot/README	(revision 759)
@@ -12,5 +12,5 @@
 driver/     Drivers source files and headers
 
-conf/       Platform specific files and ldscript
+conf/       Platform specific files
             For each platform, we must define a new directory.
             Mandatory files:
@@ -18,5 +18,8 @@
               - hard_config.h (can be generated using giet-vm genmap tool)
 
-              - ldscript
+                This file contains all physical segments addresses and sizes of the
+                hardware platform. It also contains other configuration definitions
+                as the disk controller type, mesh size, etc. Examples can be found
+                in the conf/ directory.
 
             Optional files:
@@ -27,8 +30,7 @@
             Mandatory arguments:
 
-              - PLATFORM_DIR=<platform_dir>
+              - HARD_CONFIG_PATH=<platform_dir>
 
-                Defines the directory where to find the plateform specific
-                files
+                Defines the directory where to find the hard_config.h file
 
            Optional arguments:
@@ -48,16 +50,31 @@
                 Platform device tree (by default is platform.dts)
 
+Important characteristics of this preloader:
+
+  - Processor 0 performs loading of Operating System Boot Loader which must
+    be an ELF file located at the third block of the disk.
+
+  - Other processors wait to be waken up through an interruption generated
+    from a XICU mailbox. Each processor other than 0 has its own mailbox
+    in the local XICU.
+
+  - Stack allocation is only made for processor 0. The loaded Operating System
+    boot loader or kernel must perform stack allocation for other processors.
+
+  - Stack for processor 0 is allocated at the end of RAM segment in the
+    cluster (0,0).
+
 Examples:
 
-    make PLATFORM_DIR=<platform_dir> USE_DT=0
+    make HARD_CONFIG_PATH=<platform_dir> USE_DT=0
 
         Compile for <platform_dir> and do not compile device tree file
 
-    make PLATFORM_DIR=<platform_dir> DTS=platform_fpga.dts SYSTEM_CLK=25000
+    make HARD_CONFIG_PATH=<platform_dir> DTS=platform_fpga.dts SYSTEM_CLK=25000
 
         Compile for <platform_dir> and compile the 'platform_dpga.dts'
         device tree file. System clock frequency is 25 MHz
 
-    make PLATFORM_DIR=<platform_conf> SYSTEM_CLK=25000
+    make HARD_CONFIG_PATH=<platform_conf> SYSTEM_CLK=25000
 
         Compile for <platform_dir> and compile the 'platform.dts'
Index: unk/softs/tsar_boot/conf/platform_de2_115_fpga/ldscript
===================================================================
--- /trunk/softs/tsar_boot/conf/platform_de2_115_fpga/ldscript	(revision 758)
+++ 	(revision )
@@ -1,35 +1,0 @@
-/**********************************************************
-  File   : ldscript
-  Author : Cesar Fuguet
-  Date   : June 2011
-**********************************************************/
-
-/* Definition of the base address for segments */
-
-seg_code_base = 0xFF000000;
-seg_data_base = 0x03F00000;
-
-/* Grouping sections into segments */
-
-ENTRY(reset)
-
-SECTIONS
-{
-    . = seg_code_base;
-    .text :
-    {
-        *(.reset)
-        *(.rodata)
-        *(.rodata.*)
-        . = ALIGN(0x4);
-        dtb_addr = .;
-        INCLUDE "build/platform.ld";
-    }
-
-    . = seg_data_base;
-    .bss ALIGN(0x4) (NOLOAD) :
-    {
-        *(.data)
-        *(.bss)
-    }
-}
Index: unk/softs/tsar_boot/conf/platform_tsar_generic_iob/ldscript
===================================================================
--- /trunk/softs/tsar_boot/conf/platform_tsar_generic_iob/ldscript	(revision 758)
+++ 	(revision )
@@ -1,35 +1,0 @@
-/**********************************************************
-  File   : ldscript
-  Author : Cesar Fuguet
-  Date   : June 2011
-**********************************************************/
-
-/* Definition of the base address for segments */
-
-seg_code_base = 0xBFC00000;
-seg_data_base = 0x000D0000;
-
-/* Grouping sections into segments */
-
-ENTRY(reset)
-
-SECTIONS
-{
-    . = seg_code_base;
-    .text :
-    {
-        *(.reset)
-        *(.rodata)
-        *(.rodata.*)
-        . = ALIGN(0x4);
-        dtb_addr = .;
-        INCLUDE "build/platform.ld";
-    }
-
-    . = seg_data_base;
-    .bss ALIGN(0x4) (NOLOAD) :
-    {
-        *(.data)
-        *(.bss)
-    }
-}
Index: /trunk/softs/tsar_boot/preloader.ld.in
===================================================================
--- /trunk/softs/tsar_boot/preloader.ld.in	(revision 759)
+++ /trunk/softs/tsar_boot/preloader.ld.in	(revision 759)
@@ -0,0 +1,40 @@
+/**
+ * \file   : preloader.ld.in
+ * \author : Cesar Fuguet
+ * \date   : July 24, 2014
+ *
+ * \brief  : preloader ldscript template
+ * \note   : must be compiled with gcc to generate an instance
+ */
+
+#include <defs.h>
+
+/* Definition of the base address for code segment */
+
+seg_code_base = SEG_ROM_BASE;
+seg_data_base = SEG_RAM_BASE + SEG_RAM_SIZE - RESET_STACK_SIZE - 0x4000;
+
+/* Grouping sections into segments */
+
+ENTRY(reset)
+
+SECTIONS
+{
+    . = seg_code_base;
+    .text :
+    {
+        *(.reset)
+        *(.rodata)
+        *(.rodata.*)
+        . = ALIGN(0x4);
+        dtb_addr = .;
+        INCLUDE "build/platform.ld";
+    }
+
+    . = seg_data_base;
+    .bss ALIGN(0x4) (NOLOAD) :
+    {
+        *(.data)
+        *(.bss)
+    }
+}
