-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
58 lines (50 loc) · 1.89 KB
/
Dockerfile
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
FROM ubuntu:16.04
MAINTAINER John Starich <[email protected]>
# Install set up tools
RUN apt-get update && \
DEBIAN_FRONTEND=noninterative \
apt-get install -y --no-install-recommends \
curl \
tar
# Prepare the Pintos directory
WORKDIR /tmp
RUN curl -o pintos.tar.gz \
-L http://www.stanford.edu/class/cs140/projects/pintos/pintos.tar.gz
RUN tar -xzf pintos.tar.gz && \
mv ./pintos/src /pintos && \
rm -rf ./pintos.tar.gz ./pintos
WORKDIR /pintos
# Install useful user programs
RUN apt-get update && \
DEBIAN_FRONTEND=noninterative \
apt-get install -y --no-install-recommends \
coreutils \
manpages-dev \
xorg openbox \
ncurses-dev \
wget \
vim emacs \
gcc clang make \
gdb ddd \
qemu
# Clean up apt-get's files
RUN apt-get clean autoclean && \
rm -rf /var/lib/apt/* /var/lib/cache/* /var/lib/log/*
# Add Pintos to PATH
ENV PATH=/pintos/utils:$PATH
# Fix ACPI bug
## Fix described here under "Troubleshooting": http://arpith.xyz/2016/01/getting-started-with-pintos/
RUN sed -i '/serial_flush ();/a \
outw( 0x604, 0x0 | 0x2000 );' /pintos/devices/shutdown.c
# Configure Pintos for QEMU
RUN sed -i 's/bochs/qemu/' /pintos/*/Make.vars
## Compile Pintos kernel
RUN cd /pintos/threads && make
## Reconfigure Pintos to use QEMU
RUN sed -i 's/\/usr\/class\/cs140\/pintos\/pintos\/src/\/pintos/' /pintos/utils/pintos-gdb && \
sed -i 's/LDFLAGS/LDLIBS/' /pintos/utils/Makefile && \
sed -i 's/\$sim = "bochs"/$sim = "qemu"/' /pintos/utils/pintos && \
sed -i 's/kernel.bin/\/pintos\/threads\/build\/kernel.bin/' /pintos/utils/pintos && \
sed -i "s/my (@cmd) = ('qemu');/my (@cmd) = ('qemu-system-x86_64');/" /pintos/utils/pintos && \
sed -i 's/loader.bin/\/pintos\/threads\/build\/loader.bin/' /pintos/utils/Pintos.pm
CMD ["sleep", "infinity"]