The Ski Simulator is an instruction level simulator for IA64 machines, that runs on IA64 or IA32 machines.
Contents
Getting SKI
Ski is now an open source project hosted at http://ski.sourceforge.net
You can download source from there, or get it from the mercurial repository by hg clone http://ski.sourceforge.net/cgi-bin/hgwebdir.cgi/ski
We're working on getting it upstream into Debian, and on other projects --- see /Projects
Quick kernel simulation setup
The simulator requires a simulated hard disk that can be retrieved from, e.g., HP.
The simulated disk should be placed in /var/ski-disks/ as sda
You need to build a kernel, see Using SKI to run a linux kernel.
Setting up SKI
You can set up to run the simulator so that the difference between IA32 and IA64 binaries is almost invisible.
The steps are:
Set up the shared libraries, as described in CrossCompilation
- Make the libraries available to IA64 binaries in the simulator:
# cd /lib # ln -s ../usr/ia64-unknown-linux/lib/ld-linux-ia64.so.2 . # echo /usr/ia64-unknown-linux/lib >> /etc/ld.so.conf # ldconfig
When this has been done, you can run executables using ski:
$ bskinc hello Hello, World!
Note that ski hasn't been updated to emulate the current kernel. You'll need to use old libraries, or you'll see:
$ bskinc hello FATAL: kernel too old doSyscall: unimplemented system call 1236
Register the IA64 binary format. You'll need to be running a vendor kernel, or to have compiled in CONFIG_BINFMT_MISC. The simplest way to do this is to install a file into /etc/init.d to register the format every time you boot (note for recent 2.5 kernels. you'll have to mount the binfmt_misc filesystem first --- or you could add them to your /etc/fstab)
# mount -t sysfs none /proc/sys # mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
- (This script is from the obsolete NUE package):
#
# ia64fmt This shell script takes care of starting and stopping
# ia64 binary interpreter
#
# Author: S.Eranian <eranian@hpl.hp.com>
#
# chkconfig: 2345 80 30
# description: install the binary_fmt module and also make sure the ia64
# interpreter is configured properly
# processname:
# config:
# pidfile:
fmt_base=/proc/sys/fs/binfmt_misc/
interp=/usr/bin/bskinc
# See how we were called.
case "$1" in
start)
echo -n "Installing IA-64 interpreter: "
if [ ! -d $fmt_base ]; then
/sbin/insmod binfmt_misc || exit 1
fi
echo ":ia64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x32\x00::$interp:" >$fmt_base/register
echo -n static,
echo ":ia64dyn:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x32\x00::$interp:" >$fmt_base/register
echo dynamic
;;
stop)
echo -n "Removing IA-64 interpreter: "
echo -1 >$fmt_base/ia64
echo -1 >$fmt_base/ia64dyn
echo done
;;
restart)
echo -n "Restarting IA-64 interpreter: "
if [ -f $fmt_base/ia64 ]; then
echo -1 >$fmt_base/ia64
echo -1 >$fmt_base/ia64dyn
fi
echo ":ia64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
02\x00\x32\x00::$interp:" >$fmt_base/register
echo -n static,
echo ":ia64dyn:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x03\x00\x32\x00::$interp:" >$fmt_base/register
echo dynamic
;;
status)
if [ ! -d $fmt_base ]; then
echo binfmt_misc support not present
exit 1
fi
echo binfmt_misc status is `cat $fmt_base/status`
if [ ! -f $fmt_base/ia64 ]; then
echo ia64 static not configured
exit 1
fi
if [ ! -f $fmt_base/ia64dyn ]; then
echo ia64 dynamic not configured
exit 1
fi
cat $fmt_base/ia64
cat $fmt_base/ia64dyn
;;
*)
echo "Usage: ia64fmt {start|stop|restart|status}"
exit 1
esac
exit 0You can set this up to run at every boot
# update-rc.d ski defaults
Using SKI
See SimulatorUse
Using SKI to run a linux kernel
In addition to the interpreter, you'll need a disk image. Instructions for creating one are at skidiskimage, or you can download a prebuilt one from http://www.hpl.hp.com/research/linux/ski/
When you configure your kernel, include CONFIG_HP_SIM, CONFIG_SIMSERIAL, CONFIG_SIMSCSI and CONFIG_SIMETH. You can KernelCrossCompile, or configure and build on a real Itanium. It's useful to compile with -g as the simulator can then display source.
Build the boot loader and a non-compressed kernel using make boot
Then run the kernel like this:
# ski arch/ia64/boot/bootloader vmlinux root=/dev/sda1 simscsi=/var/ski-discs/sd simeth=eth0
(assuming that your sdisk image is at /var/ski-disks/sda. If you want simulated ethernet, you have to run as root.
Simulated Ethernet
The simulated ethernet shares an ethernet port with the host machine. The way it is implemented precludes talking from the localhost to the simulated host.
Gilles Chanteperdrix <gilles DOT NOSPAM chanteperdrix DONT SEND SPAM AT laposte DOT I HATE SPAMMERS net> has written some scripts to allow dev/tun and dev/tap to be used instead: See SkiVirtualNetwork
Debugging the Kernel with SKI
See DebuggingKernelWithSkiSimulator
Capturing Output
To capture the console output you need an auxilliary program, which is described at CaptureSkiOutput.
Developing new code with SKI
We've devloped a virtual machine, LinuxOnLinux that uses the same (or actually, a slightly extended) API as a SKI kernel.
The basic API documentation was pbtained by reading the Linux kernel source; a summary is at SupervisorSystemCall.
