• R/O
  • HTTP
  • SSH
  • HTTPS

hos-v4a: コミット

HOS-V4 Advance の開発リポジトリ


コミットメタ情報

リビジョンc8290bce27788e07657cd30e9579b219a5faa9c4 (tree)
日時2014-06-08 09:57:12
作者Ryuji Fuchikami <ryuz@user...>
コミッターRyuji Fuchikami

ログメッセージ

update jelly sample (MIPS)

変更サマリ

差分

--- a/aplfw/sample/mips/jelly/boot.c
+++ b/aplfw/sample/mips/jelly/boot.c
@@ -19,11 +19,15 @@
1919 #include "system/file/console.h"
2020 #include "system/process/process.h"
2121 #include "system/command/command.h"
22-#include "driver/serial/xilinxuartdrv/xilinxuartdrv.h"
22+#include "driver/i2c/jelly/jellyi2cdrv.h"
23+#include "driver/serial/jelly/jellyuartdrv.h"
2324 #include "driver/console/vt100/vt100drv.h"
24-#include "application//syscmd/shell/shell.h"
25-#include "application//syscmd/commandlist/commandlist.h"
26-#include "application//syscmd/processlist/processlist.h"
25+#include "driver/volume/fat/fatvol.h"
26+#include "application/syscmd/shell/shell.h"
27+#include "application/syscmd/commandlist/commandlist.h"
28+#include "application/syscmd/processlist/processlist.h"
29+#include "application/filecmd/filelist/filelist.h"
30+#include "application/filecmd/filecopy/filecopy.h"
2731 #include "application/utility/timecmd/timecmd.h"
2832 #include "application/utility/memdump/memdump.h"
2933 #include "application/utility/memwrite/memwrite.h"
@@ -34,10 +38,21 @@
3438 #include "ostimer.h"
3539
3640
41+int dhrystone_main(int argc, char *argv[]);
3742
38-#define SYSTEM_HEAP_ADDR ((void *)0xc0000000)
43+
44+#if 0
45+
46+long g_SystemHeap[128 * 1024 / sizeof(long)];
47+#define SYSTEM_HEAP_ADDR ((void *)g_SystemHeap)
48+#define SYSTEM_HEAP_SIZE sizeof(g_SystemHeap)
49+
50+#else
51+
52+#define SYSTEM_HEAP_ADDR ((void *)0x01300000)
3953 #define SYSTEM_HEAP_SIZE 0x00100000
4054
55+#endif
4156
4257
4358 extern SYSTIM_CPUTIME SysTim_TimeCounter; /* デフォルトのタイマカウンタ */
@@ -87,8 +102,8 @@ int Boot_Process(VPARAM Param)
87102 /* タイマ初期化 */
88103 OsTimer_Initialize();
89104
90- /* UART デバドラ生成 (/dev/com0 に登録) */
91- hDriver = XilinxUartDrv_Create((void *)0x40600000, 1, 64);
105+ /* Jelly UART デバドラ生成 (/dev/com0 に登録) */
106+ hDriver = JellyUartDrv_Create((void *)0xfffff200, 1, 2, 256);
92107 File_AddDevice("com0", hDriver);
93108
94109 /* シリアルを開く */
@@ -102,6 +117,7 @@ int Boot_Process(VPARAM Param)
102117 hCon = File_Open("/dev/con0", FILE_OPEN_READ | FILE_OPEN_WRITE);
103118
104119
120+
105121 /*************************/
106122 /* 標準入出力設定 */
107123 /*************************/
@@ -126,17 +142,21 @@ int Boot_Process(VPARAM Param)
126142 Command_AddCommand("memtest", MemTest_Main);
127143 Command_AddCommand("keytest", KeyTest_Main);
128144 Command_AddCommand("hello", Hello_Main);
145+ Command_AddCommand("ls", FileList_Main);
146+ Command_AddCommand("cp", FileCopy_Main);
147+
129148
130149
131150 /*************************/
132151 /* 起動メッセージ */
133152 /*************************/
153+
134154 StdIo_PutString(
135155 "\n\n"
136156 "================================================================\n"
137157 " Hyper Operating System Application Framework\n"
138158 "\n"
139- " Copyright (C) 1998-2011 by Project HOS\n"
159+ " Copyright (C) 1998-2014 by Project HOS\n"
140160 " http://sourceforge.jp/projects/hos/\n"
141161 "================================================================\n"
142162 "\n");
@@ -148,7 +168,7 @@ int Boot_Process(VPARAM Param)
148168
149169 /* プロセスの生成*/
150170 ProcInf.pszCommandLine = "sh -i"; /* 実行コマンド */
151- ProcInf.pszCurrentDir = ""; /* 起動ディレクトリ */
171+ ProcInf.pszCurrentDir = "/"; /* 起動ディレクトリ */
152172 ProcInf.pfncEntry = NULL; /* 起動アドレス */
153173 ProcInf.Param = 0; /* ユーザーパラメータ */
154174 ProcInf.StackSize = 2048; /* スタックサイズ */
--- a/aplfw/sample/mips/jelly/gcc/Makefile
+++ b/aplfw/sample/mips/jelly/gcc/Makefile
@@ -24,7 +24,7 @@ CMD_OBJCNV ?= $(GCC_ARCH)objcopy
2424
2525
2626 # %jp{ディレクトリ定義}%en{directories}
27-TOP_DIR = ../../../../..
27+TOP_DIR = $(HOME)/hos-v4a
2828 KERNEL_DIR = $(TOP_DIR)/kernel
2929 KERNEL_CFGRTR_DIR = $(TOP_DIR)/cfgrtr/build/gcc
3030 KERNEL_MAKINC_DIR = $(KERNEL_DIR)/build/common/gmake
@@ -59,15 +59,18 @@ endif
5959
6060
6161 # %jp{メモリマップ}
62-ifeq ($(MEMMAP),ram)
63-# %jp{内蔵RAM}
64-TARGET := $(TARGET)_ram
65-LINK_SCRIPT = ram.lds
66-else
62+ifeq ($(MEMMAP),rom)
6763 # %jp{内蔵ROM}
64+TARGET := $(TARGET)_rom
6865 LINK_SCRIPT = rom.lds
66+else
67+# %jp{内蔵RAM}
68+LINK_SCRIPT = ram.lds
6969 endif
7070
71+# loader COM port
72+COMPORT ?= 1
73+
7174
7275 # %jp{フラグ設定}
7376 CFLAGS = -march=mips1 -msoft-float -G 0
@@ -123,7 +126,7 @@ all: kernel_make make_subprj makeexe_all $(TARGET_EXE) $(TARGET_MOT) $(TARGET_HE
123126
124127 .PHONY : run
125128 run: $(TARGET_BIN)
126- jelly_loader -r $(TARGET_BIN)
129+ jelly_loader -c $(COMPORT) -r $(TARGET_BIN)
127130
128131
129132 .PHONY : make_subprj
--- a/aplfw/sample/mips/jelly/gcc/ram.lds
+++ b/aplfw/sample/mips/jelly/gcc/ram.lds
@@ -3,8 +3,8 @@ ENTRY(_reset_handler)
33
44 MEMORY
55 {
6- ro : o = 0x00000000, l = 0x00020000
7- rw : o = 0x00020000, l = 0x000e0000
6+ rom : o = 0x00000000, l = 0x00100000
7+ ram : o = 0x00100000, l = 0x00100000
88 }
99
1010 SECTIONS
@@ -18,7 +18,7 @@ SECTIONS
1818 *(.rodata*)
1919 *(.glue*)
2020 ___text_end = . ;
21- } > ro
21+ } > rom
2222 .tors :
2323 {
2424 . = ALIGN(4);
@@ -28,7 +28,7 @@ SECTIONS
2828 ___dtors = . ;
2929 *(.dtors)
3030 ___dtors_end = . ;
31- } > ro
31+ } > rom
3232 data : AT (ADDR(.tors) + SIZEOF(.tors))
3333 {
3434 ___data_rom = ADDR(.tors) + SIZEOF(.tors);
@@ -38,7 +38,7 @@ SECTIONS
3838 *(.sdata)
3939 *(.eh_frame)
4040 ___data_end = . ;
41- } > rw
41+ } > ram
4242 .bss :
4343 {
4444 ___bss = . ;
@@ -47,6 +47,6 @@ SECTIONS
4747 *(COMMON)
4848 *(.scommon)
4949 ___bss_end = . ;
50- } > rw
50+ } > ram
5151 }
5252
--- a/aplfw/sample/mips/jelly/gcc/rom.lds
+++ b/aplfw/sample/mips/jelly/gcc/rom.lds
@@ -3,8 +3,8 @@ ENTRY(_reset_handler)
33
44 MEMORY
55 {
6- ro : o = 0x00000000, l = 0x00010000
7- ra : o = 0x01000000, l = 0x00100000
6+ rom : o = 0x00000000, l = 0x00100000
7+ ram : o = 0x10000000, l = 0x00100000
88 }
99
1010 SECTIONS
@@ -18,7 +18,7 @@ SECTIONS
1818 *(.rodata*)
1919 *(.glue*)
2020 ___text_end = . ;
21- } > ro
21+ } > rom
2222 .tors :
2323 {
2424 . = ALIGN(4);
@@ -28,7 +28,7 @@ SECTIONS
2828 ___dtors = . ;
2929 *(.dtors)
3030 ___dtors_end = . ;
31- } > ro
31+ } > rom
3232 data : AT (ADDR(.tors) + SIZEOF(.tors))
3333 {
3434 ___data_rom = ADDR(.tors) + SIZEOF(.tors);
@@ -38,7 +38,7 @@ SECTIONS
3838 *(.sdata)
3939 *(.eh_frame)
4040 ___data_end = . ;
41- } > rw
41+ } > ram
4242 .bss :
4343 {
4444 ___bss = . ;
@@ -47,6 +47,6 @@ SECTIONS
4747 *(COMMON)
4848 *(.scommon)
4949 ___bss_end = . ;
50- } > rw
50+ } >ram
5151 }
5252
--- a/aplfw/sample/mips/jelly/ostimer.c
+++ b/aplfw/sample/mips/jelly/ostimer.c
@@ -14,9 +14,9 @@
1414 #include "ostimer.h"
1515
1616
17-#define TIMER0_CONTROL ((volatile unsigned long *)0xf1000000)
18-#define TIMER0_COMPARE ((volatile unsigned long *)0xf1000004)
19-#define TIMER0_COUNTER ((volatile unsigned long *)0xf100000c)
17+#define TIMER0_CONTROL ((volatile unsigned long *)0xfffff100)
18+#define TIMER0_COMPARE ((volatile unsigned long *)0xfffff104)
19+#define TIMER0_COUNTER ((volatile unsigned long *)0xfffff10c)
2020
2121 #define INTNO_TIMER0 0
2222
--- a/aplfw/sample/mips/jelly/system.cfg
+++ b/aplfw/sample/mips/jelly/system.cfg
@@ -11,14 +11,14 @@
1111
1212 /* %jp{カーネル独自の設定}%en{kernel} */
1313 /* KERNEL_HEP_MEM(65536, NULL); */
14-KERNEL_HEP_MEM(0x100000, 0x100000);
14+KERNEL_HEP_MEM(0x100000, 0x01200000);
1515 KERNEL_INT_STK(2048, NULL);
1616 KERNEL_SYS_STK(2048, NULL);
1717 KERNEL_MAX_TSKID(32);
1818 KERNEL_MAX_SEMID(32);
1919 KERNEL_MAX_FLGID(32);
20-KERNEL_MAX_MBXID(32);
2120 KERNEL_MAX_MTXID(32);
21+KERNEL_MAX_MBXID(32);
2222 KERNEL_MAX_MPFID(32);
2323 KERNEL_MAX_ISRID(32);
2424
--- a/sample/mips/jelly/gcc/Makefile
+++ b/sample/mips/jelly/gcc/Makefile
@@ -16,12 +16,12 @@ TARGET ?= sample
1616
1717
1818 # %jp{ツール定義}%en{tools}
19-GCC_ARCH ?= mips-elf-
20-CMD_CC ?= $(GCC_ARCH)gcc
21-CMD_ASM ?= $(GCC_ARCH)gcc
22-CMD_LINK ?= $(GCC_ARCH)gcc
23-CMD_OBJCNV ?= $(GCC_ARCH)objcopy
24-
19+GCC_ARCH ?= mips-elf-
20+CMD_CC ?= $(GCC_ARCH)gcc
21+CMD_ASM ?= $(GCC_ARCH)gcc
22+CMD_LINK ?= $(GCC_ARCH)gcc
23+CMD_OBJCNV ?= $(GCC_ARCH)objcopy
24+CMD_OBJDUMP ?= $(GCC_ARCH)objdump
2525
2626 # %jp{アーキテクチャ定義}%en{architecture}
2727 ARCH_NAME ?= jelly
@@ -106,10 +106,11 @@ CSRCS += ../ostimer.c
106106 # %jp{ALL}%en{all}
107107 .PHONY : all
108108 all: kernel_make makeexe_all $(TARGET_EXE) $(TARGET_MOT) $(TARGET_HEX) $(TARGET_BIN)
109+ $(CMD_OBJDUMP) -D $(TARGET_EXE) > $(TARGET)_disas.txt
109110
110111 .PHONY : run
111112 run: $(TARGET_BIN)
112- jelly_loader -r $(TARGET_BIN)
113+ jelly_loader -c 4 -r $(TARGET_BIN)
113114
114115 # %jp{クリーン}%en{clean}
115116 .PHONY : clean
--- a/sample/mips/jelly/ostimer.c
+++ b/sample/mips/jelly/ostimer.c
@@ -13,9 +13,9 @@
1313 #include "ostimer.h"
1414
1515
16-#define TIMER0_CONTROL ((volatile UW *)0xf1000000)
17-#define TIMER0_COMPARE ((volatile UW *)0xf1000004)
18-#define TIMER0_COUNTER ((volatile UW *)0xf100000c)
16+#define TIMER0_CONTROL ((volatile UW *)0xfffff100)
17+#define TIMER0_COMPARE ((volatile UW *)0xfffff104)
18+#define TIMER0_COUNTER ((volatile UW *)0xfffff10c)
1919
2020 #define INTNO_TIMER0 0
2121
--- a/sample/mips/jelly/uart.c
+++ b/sample/mips/jelly/uart.c
@@ -12,8 +12,8 @@
1212 #include "kernel.h"
1313
1414
15-#define UART0_DATA ((volatile UW *)0xf2000000)
16-#define UART0_STAT ((volatile UW *)0xf2000004)
15+#define UART0_DATA ((volatile UW *)0xfffff200)
16+#define UART0_STAT ((volatile UW *)0xfffff204)
1717
1818
1919
旧リポジトリブラウザで表示