Suspend the Emulator

From ES40 Emulator
Jump to: navigation, search

We explain here how you can start the emulator, and manage the running emulation process on the host system.

Danger sign.png Remark: You first need to configure the SRM Firmware as explained here.

Start the emulator

Better run at lower priority to allow other host programs to use CPU time.

nice ./es40

serial0(serial): Waiting for connection on port 21264.

Start the console via telnet

Danger sign.png Remark: The port 21264 was choosen on purpose. Actually this was the first EV6 Alpha processor CPU model number.

telnet 0 21264
...
This is serial port #0 on AlphaSim

Issue: CPU usage on host system

The ES40 Emulator is using a lot of CPU time, even if you would expect that the emulated system should be idle.

The reason is that the emulator does not have hardware interrupts, so it needs to continuously scan for interrupts.

Therefore, running the emulation process on a lower priority could allow other programs on the host system to behave correctly.

ps -ef |grep  es40
UID        PID  PPID  C STIME TTY          TIME CMD
geertvp   3310  3257 72 09:44 pts/2    01:25:32 ./es40
ps aux |grep es40
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
geertvp   3310 42.6 37.2 740564 385460 pts/2   RN   09:44  87:40 ./es40

State R = Running

kill -l
17) SIGCHLD    18) SIGCONT    19) SIGSTOP

Host process management

Starting the emulator takes a lot of time. So it could be better to suspend and continue the host process instead of exiting and restarting the host process.

To suspend the process

kill -19 3310

or

kill -s STOP 3310
ps aux |grep es40
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
geertvp   3310 43.0 37.2 740564 385460 pts/2   TN   09:44  89:40 ./es40

State T = sTopped

To continue the process

kill -18 3310

or

kill -s CONT 3310

To change the priority

renice 20 -p 3310