forked from trofi/ski
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
148 lines (115 loc) · 4.42 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
General Information
===================
This is ski: an ia64 instruction set simulator
This repository is a fork of:
http://ski.sourceforge.net
The license is GPL-2.
Installation
============
See the file 'INSTALL'
Running
=======
Running Ski requires a few moving parts:
1. build ski-specific linux kernel
2. prepare disk image of a file system
3. run ski
1. Building kernel
The caveat is that upstream removed Ski-specific bits from linux-5.0.
Thus latest supported kernel by Ski is 4.19 (see TODOs to get Ski ported
to newer kernels).
Once you get ia64-unknown-linux cross-compiler toolchain it is
straightforward:
$ wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.19.241.tar.xz
$ tar -xf linux-4.19.241.tar.xz
$ cd linux-4.19.241
$ ARCH=ia64 CROSS_COMPILE=ia64-unknown-linux-gnu- make sim_defconfig
$ ARCH=ia64 CROSS_COMPILE=ia64-unknown-linux-gnu- make -j$(nproc)
The toolchain versions I used to get working setup are:
- gcc-11.3.0
- binutils-2.36
Newer ones should work as well.
2. Preparing disk image
That can be any filesystem supported by guest kernel. sim_defconfig
supports ext2 as is. I used fresh Gentoo image to verify it:
$ wget https://bouncer.gentoo.org/fetch/root/all/releases/ia64/autobuilds/20220420T025349Z/stage3-ia64-systemd-20220420T025349Z.tar.xz
$ dd of=sdc if=/dev/zero bs=512 count=10485760 #5G
$ /sbin/mke2fs sdc
$ mkdir mnt
$ mknod /dev/loop0 b 7 0
$ mount -t ext2 -oloop sdc ./mnt
$ cd mnt
$ tar -xpf ../stage3-ia64-systemd-20220420T025349Z.tar.xz
# ignore dev creation failures
$ cd ..
$ umount mnt
Here we created `sdc` file and populated it with contents of `stage3`.
3. Running Ski
Once you have got the bits it should just run:
$ bski linux-4.19.241/arch/ia64/hp/sim/boot/bootloader linux-4.19.241/vmlinux root=/dev/sda simscsi=./sd simeth=eth0 init=/bin/bash PATH=/bin rw
...
loading linux-4.19.241/vmlinux...
starting kernel...
Linux version 4.19.241 (root@gentoo) (gcc version 11.3.0 (Gentoo 11.3.0 p4)) #1 SMP PREEMPT Tue May 3 23:52:46 BST 2022
...
root@(none) / # mount -t proc proc /proc
root@(none) / # uname -a
Linux (none) 4.19.241 #1 SMP PREEMPT Tue May 3 23:52:46 BST 2022 ia64 McKinley HP Ski Simulator GNU/Linux
root@(none) / # cat /proc/cpuinfo
processor : 0
vendor : HP Ski Simulator
arch : IA-64
family : 31
model : 0
model name : McKinley
revision : 0
archrev : 0
features : branchlong, 16-byte atomic ops
cpu number : 0
cpu regs : 4
cpu MHz : 2.000
itc MHz : 2.000000
BogoMIPS : 1.23
siblings : 1
Fork-specific notes
===================
The goal of this fork is to keep ski running on modern
systems. This include but is not limited to:
- pulling in downstream distribution patches
- updating dynamic translator code to work on
modern linux
New additions:
- Experimental minimal UART8250 console output. Can be used with the
following setup:
* kernel .config:
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
* kernel parameters:
earlycon=uart8250,mmio,0xff5e0000
TODOs:
* port bootloader over to earlycon to get visible output for
CONFIG_HP_SIMSERIAL_CONSOLE=n kernels.
* export UART1/UART2 via some interface (hcdp? SPCR?) to make it
usable as a promary console after early boot as well.
General software support for ia64
=================================
Last versions supported by the toolchain:
- `glibc-2.38`, removed in <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=460860f457e2a889785c506e8c77d4a7dff24d3e>
- `linux-6.6`, removed in <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cf8e8658100d4eae80ce9b21f7a81cb024dd5057>
- `gcc-13`, still not removed as of 2024-01-08
- `binutils-2.41`, still not removed as of 2024-01-08
TODOs
=====
- Port from ski-specific virtual devices to more standard VIRTIO:
* simcons -> virtio-console
* simscsi -> virtio-blk
* simeth -> virtio-net
- Bring CPU emulator up to the state where we could include it in qemu
* Currently CPU emulator uses global state for various things. It's
not very reusable as is.
- stop requiring 'bootloader' and be able to run unmodified ia64 kernel
* plumb EFI mapping
* plumb ACPI space
* plumb PCI space
* add support for initramfs loading
- covert doc/ documentation into something closer to plain text