OSDN Git Service

update jelly sample (MIPS) master
authorRyuji Fuchikami <ryuz@users.sourceforge.jp>
Sun, 8 Jun 2014 00:57:12 +0000 (09:57 +0900)
committerRyuji Fuchikami <ryuz@users.sourceforge.jp>
Sun, 8 Jun 2014 00:57:12 +0000 (09:57 +0900)
aplfw/sample/mips/jelly/boot.c
aplfw/sample/mips/jelly/gcc/Makefile
aplfw/sample/mips/jelly/gcc/ram.lds
aplfw/sample/mips/jelly/gcc/rom.lds
aplfw/sample/mips/jelly/ostimer.c
aplfw/sample/mips/jelly/system.cfg
sample/mips/jelly/gcc/Makefile
sample/mips/jelly/ostimer.c
sample/mips/jelly/uart.c

index 0708a4d..ac0f2d8 100755 (executable)
 #include "system/file/console.h"
 #include "system/process/process.h"
 #include "system/command/command.h"
-#include "driver/serial/xilinxuartdrv/xilinxuartdrv.h"
+#include "driver/i2c/jelly/jellyi2cdrv.h"
+#include "driver/serial/jelly/jellyuartdrv.h"
 #include "driver/console/vt100/vt100drv.h"
-#include "application//syscmd/shell/shell.h"
-#include "application//syscmd/commandlist/commandlist.h"
-#include "application//syscmd/processlist/processlist.h"
+#include "driver/volume/fat/fatvol.h"
+#include "application/syscmd/shell/shell.h"
+#include "application/syscmd/commandlist/commandlist.h"
+#include "application/syscmd/processlist/processlist.h"
+#include "application/filecmd/filelist/filelist.h"
+#include "application/filecmd/filecopy/filecopy.h"
 #include "application/utility/timecmd/timecmd.h"
 #include "application/utility/memdump/memdump.h"
 #include "application/utility/memwrite/memwrite.h"
 #include "ostimer.h"
 
 
+int dhrystone_main(int argc, char *argv[]);
 
-#define SYSTEM_HEAP_ADDR       ((void *)0xc0000000)
+
+#if 0
+
+long   g_SystemHeap[128 * 1024 / sizeof(long)];
+#define SYSTEM_HEAP_ADDR       ((void *)g_SystemHeap)
+#define SYSTEM_HEAP_SIZE       sizeof(g_SystemHeap)
+
+#else
+
+#define SYSTEM_HEAP_ADDR       ((void *)0x01300000)
 #define SYSTEM_HEAP_SIZE       0x00100000
 
+#endif
 
 
 extern SYSTIM_CPUTIME          SysTim_TimeCounter;             /* デフォルトのタイマカウンタ */
@@ -87,8 +102,8 @@ int Boot_Process(VPARAM Param)
        /* タイマ初期化 */        
        OsTimer_Initialize();
        
-       /* UART デバドラ生成 (/dev/com0 に登録) */
-       hDriver = XilinxUartDrv_Create((void *)0x40600000, 1, 64);
+       /* Jelly UART デバドラ生成 (/dev/com0 に登録) */
+       hDriver = JellyUartDrv_Create((void *)0xfffff200, 1, 2, 256);
        File_AddDevice("com0", hDriver);
        
        /* シリアルを開く */
@@ -102,6 +117,7 @@ int Boot_Process(VPARAM Param)
        hCon = File_Open("/dev/con0", FILE_OPEN_READ | FILE_OPEN_WRITE);
        
        
+       
        /*************************/
        /*     標準入出力設定    */
        /*************************/
@@ -126,17 +142,21 @@ int Boot_Process(VPARAM Param)
        Command_AddCommand("memtest",  MemTest_Main);
        Command_AddCommand("keytest",  KeyTest_Main);
        Command_AddCommand("hello",    Hello_Main);
+       Command_AddCommand("ls",       FileList_Main);
+       Command_AddCommand("cp",       FileCopy_Main);
+       
        
        
        /*************************/
        /*    起動メッセージ     */
        /*************************/
+
        StdIo_PutString(
                        "\n\n"
                        "================================================================\n"
                        " Hyper Operating System  Application Framework\n"
                        "\n"
-                       "                          Copyright (C) 1998-2011 by Project HOS\n"
+                       "                          Copyright (C) 1998-2014 by Project HOS\n"
                        "                          http://sourceforge.jp/projects/hos/\n"
                        "================================================================\n"
                        "\n");
@@ -148,7 +168,7 @@ int Boot_Process(VPARAM Param)
        
        /* プロセスの生成*/
        ProcInf.pszCommandLine = "sh -i";                                                               /* 実行コマンド */
-       ProcInf.pszCurrentDir  = "";                                                                    /* 起動ディレクトリ */
+       ProcInf.pszCurrentDir  = "/";                                                                   /* 起動ディレクトリ */
        ProcInf.pfncEntry      = NULL;                                                                  /* 起動アドレス */
        ProcInf.Param          = 0;                                                                             /* ユーザーパラメータ */
        ProcInf.StackSize      = 2048;                                                                  /* スタックサイズ */
index df99333..674b9fe 100755 (executable)
@@ -24,7 +24,7 @@ CMD_OBJCNV   ?= $(GCC_ARCH)objcopy
 
 
 # %jp{ディレクトリ定義}%en{directories}
-TOP_DIR           = ../../../../..
+TOP_DIR           = $(HOME)/hos-v4a
 KERNEL_DIR        = $(TOP_DIR)/kernel
 KERNEL_CFGRTR_DIR = $(TOP_DIR)/cfgrtr/build/gcc
 KERNEL_MAKINC_DIR = $(KERNEL_DIR)/build/common/gmake
@@ -59,15 +59,18 @@ endif
 
 
 # %jp{メモリマップ}
-ifeq ($(MEMMAP),ram)
-# %jp{内蔵RAM}
-TARGET       := $(TARGET)_ram
-LINK_SCRIPT = ram.lds
-else
+ifeq ($(MEMMAP),rom)
 # %jp{内蔵ROM}
+TARGET       := $(TARGET)_rom
 LINK_SCRIPT = rom.lds
+else
+# %jp{内蔵RAM}
+LINK_SCRIPT = ram.lds
 endif
 
+# loader COM port
+COMPORT ?= 1
+
 
 # %jp{フラグ設定}
 CFLAGS  = -march=mips1 -msoft-float -G 0
@@ -123,7 +126,7 @@ all: kernel_make make_subprj makeexe_all $(TARGET_EXE) $(TARGET_MOT) $(TARGET_HE
 
 .PHONY : run
 run: $(TARGET_BIN)
-       jelly_loader -r $(TARGET_BIN)
+       jelly_loader -c $(COMPORT) -r $(TARGET_BIN)
 
 
 .PHONY : make_subprj
index 2ee0a97..5ce94a8 100755 (executable)
@@ -3,8 +3,8 @@ ENTRY(_reset_handler)
 
 MEMORY
 {
-       ro    : o = 0x00000000, l = 0x00020000
-       rw    : o = 0x00020000, l = 0x000e0000
+       rom    : o = 0x00000000, l = 0x00100000
+       ram    : o = 0x00100000, l = 0x00100000
 }
 
 SECTIONS
@@ -18,7 +18,7 @@ SECTIONS
                *(.rodata*)
                *(.glue*)
                 ___text_end = . ; 
-       }  > ro
+       }  > rom
        .tors :
        {
                . = ALIGN(4);
@@ -28,7 +28,7 @@ SECTIONS
                ___dtors = . ;
                *(.dtors)
                ___dtors_end = . ;
-       } > ro
+       } > rom
        data : AT (ADDR(.tors) + SIZEOF(.tors))
        {
            ___data_rom = ADDR(.tors) + SIZEOF(.tors);
@@ -38,7 +38,7 @@ SECTIONS
                *(.sdata)
                *(.eh_frame)
                ___data_end = . ;
-       } > rw
+       } > ram
        .bss :
        {
                ___bss = . ;
@@ -47,6 +47,6 @@ SECTIONS
                *(COMMON)
                *(.scommon)
                ___bss_end = . ;  
-       } > rw
+       } > ram
 }
 
index cfca258..c20b8c5 100755 (executable)
@@ -3,8 +3,8 @@ ENTRY(_reset_handler)
 
 MEMORY
 {
-       ro    : o = 0x00000000, l = 0x00010000
-       ra    : o = 0x01000000, l = 0x00100000
+       rom    : o = 0x00000000, l = 0x00100000
+       ram    : o = 0x10000000, l = 0x00100000
 }
 
 SECTIONS
@@ -18,7 +18,7 @@ SECTIONS
                *(.rodata*)
                *(.glue*)
                 ___text_end = . ; 
-       } > ro
+       }  > rom
        .tors :
        {
                . = ALIGN(4);
@@ -28,7 +28,7 @@ SECTIONS
                ___dtors = . ;
                *(.dtors)
                ___dtors_end = . ;
-       } > ro
+       } > rom
        data : AT (ADDR(.tors) + SIZEOF(.tors))
        {
            ___data_rom = ADDR(.tors) + SIZEOF(.tors);
@@ -38,7 +38,7 @@ SECTIONS
                *(.sdata)
                *(.eh_frame)
                ___data_end = . ;
-       } > rw
+       } > ram
        .bss :
        {
                ___bss = . ;
@@ -47,6 +47,6 @@ SECTIONS
                *(COMMON)
                *(.scommon)
                ___bss_end = . ;  
-       } > rw
+       }  >ram
 }
 
index 9fc0023..2357f90 100755 (executable)
@@ -14,9 +14,9 @@
 #include "ostimer.h"
 
 
-#define TIMER0_CONTROL ((volatile unsigned long *)0xf1000000)
-#define TIMER0_COMPARE ((volatile unsigned long *)0xf1000004)
-#define TIMER0_COUNTER ((volatile unsigned long *)0xf100000c)
+#define TIMER0_CONTROL ((volatile unsigned long *)0xfffff100)
+#define TIMER0_COMPARE ((volatile unsigned long *)0xfffff104)
+#define TIMER0_COUNTER ((volatile unsigned long *)0xfffff10c)
 
 #define INTNO_TIMER0   0
 
index 695d3f6..e5b7574 100755 (executable)
 
 /* %jp{カーネル独自の設定}%en{kernel} */
 /* KERNEL_HEP_MEM(65536, NULL); */
-KERNEL_HEP_MEM(0x100000, 0x100000);
+KERNEL_HEP_MEM(0x100000, 0x01200000);
 KERNEL_INT_STK(2048, NULL);
 KERNEL_SYS_STK(2048, NULL);
 KERNEL_MAX_TSKID(32);
 KERNEL_MAX_SEMID(32);
 KERNEL_MAX_FLGID(32);
-KERNEL_MAX_MBXID(32);
 KERNEL_MAX_MTXID(32);
+KERNEL_MAX_MBXID(32);
 KERNEL_MAX_MPFID(32);
 KERNEL_MAX_ISRID(32);
 
index 7d41172..de7eac7 100755 (executable)
@@ -16,12 +16,12 @@ TARGET ?= sample
 
 
 # %jp{ツール定義}%en{tools}
-GCC_ARCH   ?= mips-elf-
-CMD_CC     ?= $(GCC_ARCH)gcc
-CMD_ASM    ?= $(GCC_ARCH)gcc
-CMD_LINK   ?= $(GCC_ARCH)gcc
-CMD_OBJCNV ?= $(GCC_ARCH)objcopy
-
+GCC_ARCH    ?= mips-elf-
+CMD_CC      ?= $(GCC_ARCH)gcc
+CMD_ASM     ?= $(GCC_ARCH)gcc
+CMD_LINK    ?= $(GCC_ARCH)gcc
+CMD_OBJCNV  ?= $(GCC_ARCH)objcopy
+CMD_OBJDUMP ?= $(GCC_ARCH)objdump
 
 # %jp{アーキテクチャ定義}%en{architecture}
 ARCH_NAME ?= jelly
@@ -106,10 +106,11 @@ CSRCS += ../ostimer.c
 # %jp{ALL}%en{all}
 .PHONY : all
 all: kernel_make makeexe_all $(TARGET_EXE) $(TARGET_MOT) $(TARGET_HEX) $(TARGET_BIN)
+       $(CMD_OBJDUMP) -D $(TARGET_EXE) > $(TARGET)_disas.txt
 
 .PHONY : run
 run: $(TARGET_BIN)
-       jelly_loader -r $(TARGET_BIN)
+       jelly_loader -c 4 -r $(TARGET_BIN)
 
 # %jp{クリーン}%en{clean}
 .PHONY : clean
index 73fe16b..468018b 100755 (executable)
@@ -13,9 +13,9 @@
 #include "ostimer.h"
 
 
-#define TIMER0_CONTROL ((volatile UW *)0xf1000000)
-#define TIMER0_COMPARE ((volatile UW *)0xf1000004)
-#define TIMER0_COUNTER ((volatile UW *)0xf100000c)
+#define TIMER0_CONTROL ((volatile UW *)0xfffff100)
+#define TIMER0_COMPARE ((volatile UW *)0xfffff104)
+#define TIMER0_COUNTER ((volatile UW *)0xfffff10c)
 
 #define INTNO_TIMER0   0
 
index 5ace80a..f2f37a3 100755 (executable)
@@ -12,8 +12,8 @@
 #include "kernel.h"
 
 
-#define UART0_DATA     ((volatile UW *)0xf2000000)
-#define UART0_STAT     ((volatile UW *)0xf2000004)
+#define UART0_DATA     ((volatile UW *)0xfffff200)
+#define UART0_STAT     ((volatile UW *)0xfffff204)