{
int i;
- StdIo_PutString("Hello!\r\n");
+ StdIo_PutString("Hello!\r\n\r");
+
StdIo_PrintFormat("argc = %d\r\n", argc);
- for ( i = 0; i < argc; i++ )
+ for ( i = 0; i < argc + 1; i++ )
{
- StdIo_PrintFormat("argv[%d](%d) %s\r\n", i, strlen(argv[i]), argv[i]);
+ if ( argv[i] == NULL )
+ {
+ StdIo_PrintFormat("argv[%d] = NULL\r\n", i);
+ }
+ else
+ {
+ StdIo_PrintFormat("argv[%d](%d) %s\r\n", i, (int)strlen(argv[i]), argv[i]);
+ }
}
return 0;
void SciDrv_IsrRecvErr(VPARAM Param)
{
C_SCIDRV *self;
-
+ int c;
+
self = (C_SCIDRV *)Param;
-
- SciHal_RecvChar(&self->SciHal);
+
+ while ( (c = SciHal_RecvChar(&self->SciHal)) >= 0 )
+ {
+ StreamBuf_SendChar(&self->StmBuf, c);
+ }
+ SysEvt_Set(self->hEvtRecv);
}
/* 受信割り込み */
ifeq ($(ROM),Yes)
TARGET := $(TARGET)_rom
-ADDR_VECT = 0
-ADDR_ROM = 0FFC140
-ADDR_RAM = 0FFE140
+ADDR_VECT = 0000000
+ADDR_ROM = 0000100
+ADDR_RAM = 0400000
else
ADDR_VECT = 0FFC040
-ADDR_ROM = 0400000
+#ADDR_ROM = 0400000
+ADDR_ROM = 0FFC140
ADDR_RAM = 0410000
endif
APLFW_BUILD_DIR = $(APLFW_DIR)/build/h8/h8300ha/ch38
KERNEL_CFG = $(OS_DIR)/cfgrtr/build/gcc/h4acfg-h8300ha.exe
+
+ifeq ($(DEBUG),Yes)
+KERNEL_LIB = $(KERNEL_BUILD_DIR)/libhosv4adbg.lib
+APLFW_LIB = $(APLFW_BUILD_DIR)/hosaplfwdbg.lib
+else
KERNEL_LIB = $(KERNEL_BUILD_DIR)/libhosv4a.lib
APLFW_LIB = $(APLFW_BUILD_DIR)/hosaplfw.lib
-
+endif
# Tools
CC = ch38
all: mkdir_objs mk_kernel mk_aplfw $(TARGET).abs
-$(TARGET).abs: $(OBJS) $(STD_LIBS) $(OS_LIBS)
+$(TARGET).abs: $(OBJS) $(KERNEL_LIB) $(APLFW_LIB) $(STD_LIBS)
echo rom D=R > $(OBJS_DIR)/subcmd.txt
echo -OPtimize >> $(OBJS_DIR)/subcmd.txt
echo list $(TARGET).map >> $(OBJS_DIR)/subcmd.txt
#include "system/sysapi/sysapi.h"
#include "system/process/process.h"
#include "system/file/filesys.h"
+#include "system/file/stdfile.h"
#include "system/command/command.h"
#include "system/shell/shell.h"
#include "driver/serial/renesas/scifile.h"
#include "apl/hello/hello.h"
-long g_SystemHeap[16 * 1024 / sizeof(long)];
+#define SYSCR ((volatile unsigned char *)0xfee012)
+#define IPRB ((volatile unsigned char *)0xfee019)
+
+/* long g_SystemHeap[16 * 1024 / sizeof(long)]; */
C_SCIDRV g_SciDrv[2];
T_PROCESS_INFO ProcInfo;
HANDLE hFile;
+ /*************************/
+ /* 固有設定 */
+ /*************************/
+ *SYSCR &= ~0x08; /* UIビットを割込みマスクに使う */
+ *IPRB |= 0x0e; /* SCI1の割り込み優先度を上げる */
/*************************/
/* 初期化 */
/*************************/
/* システム初期化 */
- System_Initialize(g_SystemHeap, sizeof(g_SystemHeap));
-
+/* System_Initialize(g_SystemHeap, sizeof(g_SystemHeap)); */
+ System_Initialize((void *)0x00500000, 0x00100000);
/*************************/
/* デバドラ登録 */
/* システムプロセス */
int System_Boot(VPARAM Param)
{
+ StdIo_PutString("\r\nHOS Application Platform Ver 0.01\r\n");
+
/* シェル起動 */
return Command_Execute("hsh");
}
/* %jp{カーネル独自の設定}%en{kernel} */
-KERNEL_HEP_MEM(4096, NULL);
+/* KERNEL_HEP_MEM(0x80000, 0x480000); */
+KERNEL_HEP_MEM(8192, NULL);
KERNEL_MAX_TSKID(16);
KERNEL_MAX_SEMID(16);
KERNEL_MAX_FLGID(16);
/* ---------------------------------------------- */
/* %jp{遅延プロシージャーコール} */
-#define _KERNEL_CFG_DPC TRUE /**< Deferred Procedure Call */
+#define _KERNEL_CFG_DPC FALSE /**< Deferred Procedure Call */
/* %jp{対称型マルチプロセッサ対応[未実装]} */
#define _KERNEL_CFG_SMP FALSE /**< Symmetric Multiple Processor */
#else /* %jp{バズロック型の場合} */
#define _KERNEL_ENTER_SVC() do { _KERNEL_DIS_INT(); } while (0)
-#define _KERNEL_LEAVE_SVC() do { if (!(_KERNEL_SYS_GET_STST() & _KERNEL_TSS_DINT)){ _KERNEL_ENA_INT(); } } while (0)
+#define _KERNEL_LEAVE_SVC() do { if (!(_KERNEL_SYS_GET_STST() & (_KERNEL_TSS_LOC | _KERNEL_TSS_SYS))){ _KERNEL_ENA_INT(); } } while (0)
#endif
; -----------------------------------------------
; 割り込み処理
;
-; 割り込み発生時は er0 を push した後、er0 に
+; 割り込み発生時は er0 を push した後、r0l に
; 割り込み番号をセットして、ここにジャンプする
; -----------------------------------------------
__kernel_int_hdr:
{
/* %jp{割り込みコンテキストを抜ける} */
_KERNEL_SYS_CLR_CTX();
-
+
+ _KERNEL_ENA_INT(); /* %jp{割込み許可} */
+
/* %jp{サービスコール処理の実施} */
_KERNEL_ENTER_SVC(); /* %jp{サービスコールに入る}%en{enter service-call} */
_KERNEL_LEAVE_SVC(); /* %jp{サービスコールに入る}%en{enter service-call} */
+
+ _KERNEL_DIS_INT(); /* %jp{割込み禁止} */
}