The PowerPC simulator is a program (to be run on a host computer) that emulates a PowerPC CPU and some firmware system calls to perform basic I/O (console, disk). This bare-bones platform has no real networking support. Although rtems-networking is fully functional, the simulator provides no supported network device and therefore only the loopback interface is functional.
Because GeSys, the generic system application, usually loads add-on and application modules from remote filesystems the lack of a network device constitutes a severe restriction of operation. In particular, EPICS applications cannot be executed on the simulator (to be precise: they can but no client will be able to connect to a CA server executing on a PPC simulator IOC) since EPICS heavily relies on networking.
The simulator is still quite useful for training and evaluation purposes, however. The question is: how can files be copied to the simulator environment? Note that the simulator provides no access to the host file system either - the simulated CPU executes in a very basic environment with only very few I/O channels available ot the host environment (more powerful channels, such as a simulated network interface could be written, though).
The RTEMS system running on the simulator has the usual IMFS ('in memory file system') support built in. The simulator is able to perform simple 'disk' I/O operations by means of firmware system calls. The simulated disk can either be a real disk or a file (to be specified in the 'device-tree file' for the simulation). Note that the firmware has no filesystem support and therefore providing access to a real disk device is pretty useless.
A simple routine, loadTarImg(int verbose, int disk_no), was implemented which is able to extract a tar archive into the IMFS thus making all files in the archive accessible to RTEMS (note: they occupy RAM memory). The archive file must exist when the simulation is started and must only contain directories and/or ordinary files.
Here's how it works:
A shell script, gesys-psim, wraps proper arguments for calling the simulator and executing the generic system application:
/afs/slac/package/rtems/4.6.2/host/<host_arch>/bin/gesys-psim [user_tar_archive]
An optional tar archive argument may be provided which is mapped to 'disk 1' and hence accessible from the Cexp> prompt via the loadTarImg() routine (set the disk_no argument to 1).
The tar archive file may be overwritten and re-read with 'loadTarImg()':
tar cf tst_img object_file
gesys-psim tst_img
Cexp> loadTarImg(1,1)
Cexp> mod=cexpModuleLoad("path_in_IMFS")
Cexp> cexpModuleUnload(mod)
If desired, the simulator can be run from gdb (the DDD frontend [start with the --debugger powerpc-rtems-gdb option] is very nice):
powerpc-rtems-gdb rtems.exe
(gdb) target sim -f my_psim_tree
(gdb) load
(gdb) run
This should start GeSys in the debugger. Note that GeSys tries to send ANSI Esc. sequences to query your terminal size. This probably hangs in your debugger window and you might to have to hit the Return key a few times to get past this stage.