git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15367 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
214b482751
commit
f46f3a2181
|
@ -115,11 +115,11 @@ include $(CHIBIOS)/os/vfs/vfs_syscalls.mk
|
||||||
# Auto-build files in ./source recursively.
|
# Auto-build files in ./source recursively.
|
||||||
include $(CHIBIOS)/tools/mk/autobuild.mk
|
include $(CHIBIOS)/tools/mk/autobuild.mk
|
||||||
# Other files (optional).
|
# Other files (optional).
|
||||||
include $(CHIBIOS)/os/test/test.mk
|
#include $(CHIBIOS)/os/test/test.mk
|
||||||
include $(CHIBIOS)/test/rt/rt_test.mk
|
#include $(CHIBIOS)/test/rt/rt_test.mk
|
||||||
include $(CHIBIOS)/test/oslib/oslib_test.mk
|
#include $(CHIBIOS)/test/oslib/oslib_test.mk
|
||||||
include $(CHIBIOS)/os/hal/lib/streams/streams.mk
|
include $(CHIBIOS)/os/hal/lib/streams/streams.mk
|
||||||
include $(CHIBIOS)/os/various/shell/shell.mk
|
#include $(CHIBIOS)/os/various/shell/shell.mk
|
||||||
include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk
|
include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk
|
||||||
|
|
||||||
# Define linker script file here
|
# Define linker script file here
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType">
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.connection" value="gdb:localhost:3333#"/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="3"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set remotetimeout 20 monitor reset init monitor sleep 50"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDSocket"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value="${workspace_loc:\SB-RAM-MSH\build\msh.elf}"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value="20060000"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REMOTE_TIMEOUT_ENABLED" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.REMOTE_TIMEOUT_VALUE" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/ch.elf"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="RT-STM32L4R9-DISCOVERY-RAM_SB_HOST_DYNAMIC"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/RT-STM32L4R9-DISCOVERY-RAM_SB_HOST_DYNAMIC"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="4"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||||
|
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><memoryBlockExpressionList context="reserved-for-future-use"><gdbmemoryBlockExpression address="134676480" label="0x08070000"/></memoryBlockExpressionList>"/>
|
||||||
|
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
|
||||||
|
</launchConfiguration>
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType">
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.connection" value="gdb:localhost:3333#"/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="3"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set remotetimeout 20 monitor reset init monitor sleep 50"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDSocket"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value="${workspace_loc:\SB-RAM-MSH\build\msh.elf}"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value="20060000"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REMOTE_TIMEOUT_ENABLED" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.REMOTE_TIMEOUT_VALUE" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/ch.elf"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="RT-STM32L4R9-DISCOVERY-RAM_SB_HOST_DYNAMIC"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/RT-STM32L4R9-DISCOVERY-RAM_SB_HOST_DYNAMIC"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="4"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||||
|
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><memoryBlockExpressionList context="reserved-for-future-use"><gdbmemoryBlockExpression address="134676480" label="0x08070000"/></memoryBlockExpressionList>"/>
|
||||||
|
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
|
||||||
|
</launchConfiguration>
|
|
@ -6,7 +6,7 @@
|
||||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/>
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
|
||||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
|
||||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set remotetimeout 20 monitor reset init monitor sleep 50"/>
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set remotetimeout 20 monitor reset init monitor sleep 50"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDSocket"/>
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDSocket"/>
|
||||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
|
||||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
#include "sb.h"
|
#include "sb.h"
|
||||||
#include "chprintf.h"
|
#include "chprintf.h"
|
||||||
|
|
||||||
#include "rt_test_root.h"
|
//#include "rt_test_root.h"
|
||||||
#include "oslib_test_root.h"
|
//#include "oslib_test_root.h"
|
||||||
|
|
||||||
#include "nullstreams.h"
|
#include "nullstreams.h"
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ static void SBHandler(eventid_t id) {
|
||||||
if (!sbIsThreadRunningX(&sbx1)) {
|
if (!sbIsThreadRunningX(&sbx1)) {
|
||||||
msg_t msg = sbWaitThread(&sbx1);
|
msg_t msg = sbWaitThread(&sbx1);
|
||||||
|
|
||||||
chprintf((BaseSequentialStream *)&SD2, "SB1 terminated (%d)\r\n", msg);
|
chprintf((BaseSequentialStream *)&SD2, "SB1 terminated (%08lx)\r\n", msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,91 +197,17 @@ int main(void) {
|
||||||
* the FatFS driver but are restricted to "/sb1" and "/sb2" directories.
|
* the FatFS driver but are restricted to "/sb1" and "/sb2" directories.
|
||||||
*/
|
*/
|
||||||
drvOverlayObjectInit(&sb1_root_overlay_driver, (vfs_driver_c *)&fatfs_driver, "/sb1");
|
drvOverlayObjectInit(&sb1_root_overlay_driver, (vfs_driver_c *)&fatfs_driver, "/sb1");
|
||||||
// drvOverlayObjectInit(&sb2_root_overlay_driver, (vfs_driver_c *)&fatfs_driver, "/sb2");
|
|
||||||
ret = drvOverlayRegisterDriver(&sb1_root_overlay_driver,
|
ret = drvOverlayRegisterDriver(&sb1_root_overlay_driver,
|
||||||
drvStreamsObjectInit(&sb1_dev_driver, &sb1_streams[0]),
|
drvStreamsObjectInit(&sb1_dev_driver, &sb1_streams[0]),
|
||||||
"dev");
|
"dev");
|
||||||
if (CH_RET_IS_ERROR(ret)) {
|
if (CH_RET_IS_ERROR(ret)) {
|
||||||
chSysHalt("VFS");
|
chSysHalt("VFS");
|
||||||
}
|
}
|
||||||
// ret = drvOverlayRegisterDriver(&sb2_root_overlay_driver,
|
|
||||||
// drvStreamsObjectInit(&sb2_dev_driver, &sb2_streams[0]),
|
|
||||||
// "dev");
|
|
||||||
// if (CH_RET_IS_ERROR(ret)) {
|
|
||||||
// chSysHalt("VFS");
|
|
||||||
// }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Initializing overlay driver for the directory shared among the sandboxes.
|
|
||||||
* It is seen as "/shared".
|
|
||||||
*/
|
|
||||||
#if 0
|
|
||||||
drvOverlayObjectInit(&sb_shared_overlay_driver, (vfs_driver_c *)&fatfs_driver, "/shared");
|
|
||||||
ret = drvOverlayRegisterDriver(&sb1_root_overlay_driver,
|
|
||||||
(vfs_driver_c *)&sb_shared_overlay_driver,
|
|
||||||
"shared");
|
|
||||||
if (CH_RET_IS_ERROR(ret)) {
|
|
||||||
chSysHalt("VFS");
|
|
||||||
}
|
|
||||||
ret = drvOverlayRegisterDriver(&sb2_root_overlay_driver,
|
|
||||||
(vfs_driver_c *)&sb_shared_overlay_driver,
|
|
||||||
"shared");
|
|
||||||
if (CH_RET_IS_ERROR(ret)) {
|
|
||||||
chSysHalt("VFS");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sandbox objects initialization.
|
* Sandbox objects initialization.
|
||||||
*/
|
*/
|
||||||
sbObjectInit(&sbx1, &sb_config1);
|
sbObjectInit(&sbx1, &sb_config1);
|
||||||
// sbObjectInit(&sbx2, &sb_config2);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Associating standard input, output and error to sandbox 1.
|
|
||||||
*/
|
|
||||||
ret = vfsDrvOpen((vfs_driver_c *)&sb1_root_overlay_driver,
|
|
||||||
"/dev/VSD1", VO_RDWR, &np);
|
|
||||||
if (CH_RET_IS_ERROR(ret)) {
|
|
||||||
chSysHalt("VFS");
|
|
||||||
}
|
|
||||||
sbRegisterDescriptor(&sbx1, STDIN_FILENO, (vfs_node_c *)roAddRef(np));
|
|
||||||
sbRegisterDescriptor(&sbx1, STDOUT_FILENO, (vfs_node_c *)roAddRef(np));
|
|
||||||
sbRegisterDescriptor(&sbx1, STDERR_FILENO, (vfs_node_c *)roAddRef(np));
|
|
||||||
vfsClose(np);
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/*
|
|
||||||
* Associating standard input, output and error to sandbox 1.
|
|
||||||
*/
|
|
||||||
ret = vfsDrvOpen((vfs_driver_c *)&sb2_root_overlay_driver,
|
|
||||||
"/dev/VSD1", VO_RDWR, &np);
|
|
||||||
if (CH_RET_IS_ERROR(ret)) {
|
|
||||||
chSysHalt("VFS");
|
|
||||||
}
|
|
||||||
sbRegisterDescriptor(&sbx2, STDIN_FILENO, (vfs_node_c *)roAddRef(np));
|
|
||||||
sbRegisterDescriptor(&sbx2, STDOUT_FILENO, (vfs_node_c *)roAddRef(np));
|
|
||||||
sbRegisterDescriptor(&sbx2, STDERR_FILENO, (vfs_node_c *)roAddRef(np));
|
|
||||||
vfsClose(np);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* Starting sandboxed thread 1.*/
|
|
||||||
sb1tp = sbStartThread(&sbx1, "sbx1",
|
|
||||||
waUnprivileged1, sizeof (waUnprivileged1),
|
|
||||||
NORMALPRIO - 1);
|
|
||||||
if (sb1tp == NULL) {
|
|
||||||
chSysHalt("sbx1 failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Starting sandboxed thread 2.*/
|
|
||||||
sb2tp = sbStartThread(&sbx2, "sbx2",
|
|
||||||
waUnprivileged2, sizeof (waUnprivileged2),
|
|
||||||
NORMALPRIO - 1);
|
|
||||||
if (sb2tp == NULL) {
|
|
||||||
chSysHalt("sbx2 failed");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Listening to sandbox events.
|
* Listening to sandbox events.
|
||||||
|
@ -295,18 +221,31 @@ int main(void) {
|
||||||
while (true) {
|
while (true) {
|
||||||
chEvtDispatch(evhndl, chEvtWaitOneTimeout(ALL_EVENTS, TIME_MS2I(500)));
|
chEvtDispatch(evhndl, chEvtWaitOneTimeout(ALL_EVENTS, TIME_MS2I(500)));
|
||||||
|
|
||||||
/* Checking for user button, launching sandbox if pressed.*/
|
if (sdmon_ready && !sbIsThreadRunningX(&sbx1)) {
|
||||||
if (palReadLine(LINE_BUTTON)) {
|
chThdSleepMilliseconds(1000);
|
||||||
if (!sbIsThreadRunningX(&sbx1)) {
|
|
||||||
|
|
||||||
/* Running the sandbox.*/
|
/*
|
||||||
ret = sbExec(&sbx1, "/bin/msh.elf",
|
* Associating standard input, output and error to sandbox 1.
|
||||||
waUnprivileged1, sizeof (waUnprivileged1), NORMALPRIO - 1,
|
*/
|
||||||
sbx1_argv, sbx1_envp);
|
ret = vfsDrvOpen((vfs_driver_c *)&sb1_root_overlay_driver,
|
||||||
if (CH_RET_IS_ERROR(ret)) {
|
"/dev/VSD1", VO_RDWR, &np);
|
||||||
chprintf((BaseSequentialStream *)&SD2, "SBX1 launch failed (%08lx)\r\n", ret);
|
if (CH_RET_IS_ERROR(ret)) {
|
||||||
chThdSleepMilliseconds(1000);
|
chprintf((BaseSequentialStream *)&SD2, "Opening /dev/VSD1 failed (%08lx)\r\n", ret);
|
||||||
}
|
continue;
|
||||||
|
}
|
||||||
|
sbRegisterDescriptor(&sbx1, STDIN_FILENO, (vfs_node_c *)roAddRef(np));
|
||||||
|
sbRegisterDescriptor(&sbx1, STDOUT_FILENO, (vfs_node_c *)roAddRef(np));
|
||||||
|
sbRegisterDescriptor(&sbx1, STDERR_FILENO, (vfs_node_c *)roAddRef(np));
|
||||||
|
vfsClose(np);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Running the sandbox.
|
||||||
|
*/
|
||||||
|
ret = sbExec(&sbx1, "/bin/msh.elf",
|
||||||
|
waUnprivileged1, sizeof (waUnprivileged1), NORMALPRIO - 1,
|
||||||
|
sbx1_argv, sbx1_envp);
|
||||||
|
if (CH_RET_IS_ERROR(ret)) {
|
||||||
|
chprintf((BaseSequentialStream *)&SD2, "SBX1 launch failed (%08lx)\r\n", ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/>
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
|
||||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
|
||||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set remotetimeout 20 monitor reset init monitor sleep 50 monitor erase_address pad 0x08180000 0x00080000 load /home/giovanni/Projects/ChibiStudio/chibios_trunk/demos/various/SB-CLIENT-256k-08180000-128k-20060000/build/sb.elf load /home/giovanni/Projects/ChibiStudio/chibios_trunk/demos/various/SB-CLIENT-256k-081C0000-128k-20080000/build/sb.elf "/>
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set remotetimeout 20 monitor reset init monitor sleep 50 monitor erase_address pad 0x08180000 0x00080000 load /home/giovanni/Projects/ChibiStudio/chibios_trunk/demos/various/SB-CLIENT-256k-08180000-128k-20060000/build/sb.elf load /home/giovanni/Projects/ChibiStudio/chibios_trunk/demos/various/SB-CLIENT-256k-081C0000-128k-20080000/build/sb.elf "/>
|
||||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDSocket"/>
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.OpenOCDSocket"/>
|
||||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
|
||||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
|
||||||
|
|
|
@ -187,9 +187,10 @@ int main(int argc, char *argv[], char *envp[]) {
|
||||||
(void)argv;
|
(void)argv;
|
||||||
(void)envp;
|
(void)envp;
|
||||||
|
|
||||||
|
/* Welcome.*/
|
||||||
|
shell_write(SHELL_WELCOME_STR SHELL_NEWLINE_STR SHELL_NEWLINE_STR);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
/* Welcome.*/
|
|
||||||
shell_write(SHELL_WELCOME_STR SHELL_NEWLINE_STR);
|
|
||||||
|
|
||||||
/* Prompt.*/
|
/* Prompt.*/
|
||||||
shell_write(SHELL_PROMPT_STR);
|
shell_write(SHELL_PROMPT_STR);
|
||||||
|
@ -216,6 +217,9 @@ int main(int argc, char *argv[], char *envp[]) {
|
||||||
}
|
}
|
||||||
args[i] = NULL;
|
args[i] = NULL;
|
||||||
|
|
||||||
shell_execute(i, args);
|
/* Executing command, if any.*/
|
||||||
|
if (i > 0) {
|
||||||
|
shell_execute(i, args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue