0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Simh Emulator on Docker

Last updated at Posted at 2023-01-09

いくつか Simh のことを書きました。
simhもopen-simhがフォークされるなど動きがあります。
取り合えず、open-simhを使ってみた。以下は I1401 で Fortran と COBOL を実行するのも含んでいます。

FROM alpine:3.20.3
RUN apk update \
    && apk --no-cache --virtual .build-deps add tzdata \
    && cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime \
    && echo "Asia/Tokyo" >  /etc/timezone \
    && apk del --purge .build-deps
RUN apk add gcc libc-dev make git xz libpcap-dev pcre-dev
RUN mkdir /src ; cd /src ; git clone -v https://github.com/open-simh/simh \
    && cd simh ; make GCC="gcc -D_LARGEFILE64_SOURCE -Wno-format" i1401 i7010 pdp11 vax780 \
    && cp BIN/i* BIN/p* BIN/v* /usr/local/bin
RUN cd /src ; wget http://blog.livedoor.jp/suzanhud/IBM1401/FORTRAN/FortranIV.tar.xz ; tar xvf /src/FortranIV.tar.xz
RUN cd /src/FortranIV/generation ; ./mksystem.sh
RUN cd /src/FortranIV/running ; ./sample.sh ; cat sample.lst
RUN cd /src ; wget http://ibm-1401.info/pictures/000COBOL/i1401-Cobol-Generation.zip ; mkdir /src/cobol ; cd /src/cobol ; unzip ../i1401-Cobol-Generation.zip
COPY Cobol_Generation_for_linux.ini /src/cobol/generation/
RUN cd /src/cobol/generation; i1401 Cobol_Generation_for_linux.ini
RUN cd /src/cobol; wget http://ibm-1401.info/pictures/000COBOL/i1401-Cobol.zip ; unzip i1401-Cobol.zip
RUN cd /src/cobol/Cobol; cp ../generation/Autocoder.cobol.tap .; cp ../generation/Cobol.tap .
COPY cobol_linux.ini autocoder_linux.ini /src/cobol/Cobol/
RUN cd /src/cobol/Cobol; dos2unix Hello.cob; i1401 cobol_linux.ini Hello.cob; i1401 autocoder_linux.ini

こんな感じです。

$ docker build --no-cache --progress=plain -t kazu_simh2 .
#0 building with "default" instance using docker driver

#1 [internal] load .dockerignore
#1 transferring context:
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 1.43kB 0.0s done
#2 DONE 0.0s
(snip)
#11 1.265 HALT instruction, IS: 3086 (B 3079)
#11 1.265 Goodbye
#11 1.266                          FORTRAN   RUN                                                      000SAMPL
#11 1.266 FORTRAN COMPILATION  VER 2 MOD 2
#11 1.266 $NO MULTIPLY DIVIDE
#11 1.266      C     SAMPLE PROGRAM TO TEST SYSTEM
#11 1.266      C                                                                       003SAMPL
#11 1.266      C     PROGRAM FOR FINDING THE LARGEST VALUE                             004SAMPL
#11 1.266      C       ATTAINED BY A SET OF NUMBERS                                    005SAMPL
#11 1.266 001        DIMENSION A(12)                                                   006SAMPL
#11 1.266 002        READ (1,1)N,(A(I),I=1,N)                                          007SAMPL
#11 1.266 003      1 FORMAT (I3/(12F6.2))                                              008SAMPL
#11 1.266 004        BIGA=A(1)                                                         009SAMPL
#11 1.266 005        DO 20 I=2,N                                                       010SAMPL
#11 1.266 006        IF (BIGA.LT.A(I)) BIGA = A(I)                                     011SAMPL
#11 1.266 007     20 CONTINUE                                                          012SAMPL
#11 1.266 008        WRITE (3,2)N,BIGA                                                 013SAMPL
#11 1.266 009      2 FORMAT (21H1THE LARGEST OF THESE,I3,11H NUMBERS IS,F9.2)          014SAMPL
#11 1.266 010        STOP                                                              015SAMPL
#11 1.266 011        END                                                               016SAMPL
(snip)
#11 1.266
          THE LARGEST OF THESE 12 NUMBERS IS  9876.54
(snip)

変更履歴

(2023/01/10)パッケージ「bridge-utils」は不要なので削除しました。Alpine Linuxを3.17.1にバージョンアップ。
(2023/04/08)Alpine Linuxを3.17.3にバージョンアップ。インストールするパッケージに「pcre-dev」を追加。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?