Appendix E: The Linuxipl JCL

 < Day Day Up > 

In this appendix, we describe the JCL written by Rob van der Heij which prepares a DASD to IPL Linux from an LPAR. It can be found on the Web at:


There are two symbolics that must be set in this sample JCL:


The DASD VOLSER on which you are installing the image


The high level qualifier for the location of the three Linux files (initrd,parmfile,taleipl.ikr)

    // SET LINUX=LINUXZ , (*)                                               00001001    // SET UID=NL66157                                                      00002002    //* after change in for LINUXZ you need to change the            00003000    //* verify in the ICKDSF STEP                                           00004000    //ASMIPLD  EXEC PGM=ASMA90                                              00005000    //SYSLIB   DD  DSN=SYS1.MACLIB,DISP=SHR                                 00006000    //SYSUT1   DD  UNIT=VIO,SPACE=(CYL,(10,5))                              00009000    //SYSLIN   DD  DSN=&&IPLDECK,BLKSIZE=3120,RECFM=FB,LRECL=80,            00009100    // SPACE=(TRK,(15,0)),DISP=(,PASS)                                      00009200    //SYSPRINT DD  SYSOUT=*,DCB=(BLKSIZE=3509)                              00009300    //SYSIN DD *                                                            00009900    * Bootstrap to boot Linux with ramdisk from an OS formatted volume.     LIN00010                                                                            LIN00020    *     13 Feb 2001  Rob van der Heij <>                    LIN00030    *      7 Jun 2001  rmh  Added retry for I/O                             LIN00040    *     14 Oct 2001  Greg Smith <> setup.h constants      LIN00045    *      6 Nov 2001  Greg Smith <> handle eof properly    LIN00047                                                                            LIN00050    * The volume is prepared for IPL by an ICKDSF with the BOOTSTRAP option LIN00060    * Use the concatenation of SYS.SAMPLIB(IPLRECS) and this object deck as LIN00070    * the input for IPLDD. When the volume is IPLed the bootstrap locates   LIN00080    * the 3 datasets in the VTOC, loads them into memory and transfer       LIN00090    * control to the Linux kernel.                                          LIN00100                                                                            LIN00110    LINUXIPL CSECT                                                          LIN00120                                                                            LIN00130    IPLPSW   DC    X'00080000',AL4(X'80000000'+ENTRY)                       LIN00140             ORG   LINUXIPL+X'200'                                          LIN00150             DC    C'+-------------------------------+'                     LIN00160             DC    C'|Linux for S/390      Bootstrap |'                     LIN00170             DC    C'+-------------------------------+'                     LIN00180             ORG   LINUXIPL+X'260'                                          LIN00190                                                                            LIN00200    ENTRY    DS    0H                                                       LIN00210             BALR  R12,0                                                    LIN00220             USING *,R12                                                    LIN00230             LA    R13,X'0800'          Use next 2K as work space           LIN00240             L     R1,X'B8'             Save subchannel address of IPL      LIN00250             ST    R1,DEVSUBCH          device                              LIN00260             LCTL  R6,R6,=X'FF000000'   Enable for I/O interrupts           LIN00270                                                                            LIN00280             BAL   R11,READVTOC                                             LIN00290             MVI   STATUS,X'30'                                             LIN00300                                                                            LIN00310             L     R8,=X'0001000'       Load kernel into memory             LIN00320             LR    R4,R8                                                    LIN00330             LA    R6,EXT1                                                  LIN00340             BAL   R11,READFILE                                             LIN00350             MVI   STATUS,X'60'                                             LIN00360                                                                            LIN00370             L     R8,=A(RAMDISK_ORIGIN) Load address for initrd            LIN00385             LA    R6,EXT3                                                  LIN00390             BAL   R11,READFILE                                             LIN00400             MVI   STATUS,X'90'                                             LIN00410             S     R8,=A(RAMDISK_ORIGIN) Compute size of ramdisk image      LIN00428             L     R6,=A(PARMAREA)       Parameter area for setup.h         LIN00436             MVC   INITRD_START-PARMAREA(4,R6),=A(RAMDISK_ORIGIN)           LIN00444             STCM  R8,B'1111',INITRD_SIZE-PARMAREA(R6)                      LIN00452                                                                            LIN00460             L     R8,=X'0008000'       Load parm file at page 8            LIN00470             LA    R6,EXT2                                                  LIN00480             BAL   R11,READFILE                                             LIN00490             MVI   STATUS,X'B0'                                             LIN00500             L     R6,=A(COMMAND_LINE)       Move parm file contents down   LIN00516             L     R7,=A(COMMAND_LINE_SIZE)  into area defined by setup.h   LIN00522             L     R8,=X'00008000'                                          LIN00530             LR    R9,R7                                                    LIN00540             MVCL  R6,R8                                                    LIN00550             MVI   STATUS,X'F0'                                             LIN00560                                                                            LIN00570             L     R1,=X'0010000'      Run the kernel now                   LIN00580             BR    R1                                                       LIN00590                                                                            LIN00600                                                                            LIN00610    DSN      DC    CL44'SYS1.LINUX.TAPEIPL.IKR'                             LIN00620             DC    CL44'SYS1.LINUX.PARMFILE'                                LIN00630             DC    CL44'SYS1.LINUX.INITRD'                                  LIN00640    SCHIB    DS    8D                                                       LIN00650    DROPDEAD ST    R14,WAITPSW+4        Show caller address instead         LIN00660             MVC   WAITPSW+3(1),STATUS                                      LIN00670             MVI   WAITPSW,X'00'        Make it disabled wait               LIN00680             LPSW  WAITPSW                                                  LIN00690             DS    0D                                                       LIN00700    WAITPSW  DC    X'020A0000',X'80DEAD00'                                  LIN00710    MYNEWPSW DC    X'00080000',A(X'80000000'+INT)                           LIN00720                                                                            LIN00730    IOR6     DS    F                                                        LIN00740    *                                 Execute a channel program at (R1)     LIN00750    IO       EQU   *                                                        LIN00760             ST    R6,IOR6            Save R6 to be used as counter         LIN00770             LA    R6,10              10 retries                            LIN00780             MVC   X'78'(8),MYNEWPSW  Prepare I/O new PSW                   LIN00790             ST    R1,ORB+8                                                 LIN00800             L     R1,DEVSUBCH        Get subchannel address back           LIN00810    IO1      SSCH  ORB                                                      LIN00820    IO4      LPSW  WAITPSW                                                  LIN00830    INT      C     R1,X'B8'           Did my I/O complete?                  LIN00840             BNE   IO4                                                      LIN00850             TSCH  IRB                                                      LIN00860             CLC   =XL2'0C00',IRB+8   Check for I/O completion              LIN00870             BZ    IO5                                                      LIN00880             BCT   R6,IO1                                                   LIN00890             CLC   =XL2'0C00',IRB+8                                         LIN00900    IO5      L     R6,IOR6            Restore R6                            LIN00910             BR    R5                                                       LIN00920    *                                 Read a single dataset                 LIN00930    * R6: Points to CCHH of first track and CCHH of last track              LIN00940    * R8: Address where data must be loaded                                 LIN00950    * R4: Number of bytes to skip initially                                 LIN00960    READFILE EQU   *                                                        LIN00970             MVC   CCW1P+8(8),0(R6)   Copy CCHH's to Define Extent          LIN00980             L     R3,0(R6)           First track                           LIN00990    RF01     EQU   *                  Repeat for each track in extent       LIN01000                                                                            LIN01010             ST    R3,CCW2P+4         Put CCHH in Locate Record             LIN01020             ST    R3,CCW2P+8                                               LIN01030                                                                            LIN01040             LA       R1,CCW1    Read a single track                        LIN01050             BAL      R5,IO                                                 LIN01060                                                                            LIN01070    * Process raw track just read and move the payload to (R8)              LIN01080    * Skip the first R4 bytes while doing so                                LIN01090             L     R2,CCW3+4     See where data was loaded                  LIN01100             A     R4,=F'8'      Also skip R0                               LIN01110    RF02     EQU   *                                                        LIN01120             SLR   R3,R3                                                    LIN01130             IC    R3,5(R2)       Load keylength                            LIN01140             AH    R3,6(R2)       Add datalength                            LIN01150             BZ    RF09           Exit if end-of-file                       LIN01155             LA    R2,8(R2)       Payload address is beyond count field     LIN01160             LR    R9,R3                                                    LIN01170             LTR   R4,R4          Any bytes to skip?                        LIN01180             BZ    RF03                                                     LIN01190                                                                            LIN01200             CR    R4,R3          Part of payload to be skipped?            LIN01210             BP    RF04           Less than one record to skip              LIN01220             AR    R2,R4          Account for bytes skipped                 LIN01230             SLR   R3,R4          So many bytes less to move                LIN01240             LR    R9,R3          Correct target                            LIN01250             SLR   R4,R4          No more bytes to skip                     LIN01260             B     RF03           Go and move the                           LIN01270    RF04     SLR   R4,R3          Skip entire record                        LIN01280             AR    R2,R3          Adjust pointer to input data              LIN01290             B     RF05                                                     LIN01300    RF03     MVCL  R8,R2                                                    LIN01310    RF05     CLC   0(4,R2),=F'-1' Next count field -1 ?                     LIN01320             BNZ   RF02                                                     LIN01330    *                             Go to next track                          LIN01340             L     R3,CCW2P+4     Get CCHH back again                       LIN01350             C     R3,CCW1P+12    Are we done already?                      LIN01360             BZ    RF09                                                     LIN01370             LA    R3,1(R3)                                                 LIN01380             LH    R0,=X'00FF'                                              LIN01390             NR    R0,R3                                                    LIN01400             CH    R0,=H'15'      Beyond last track?                        LIN01410             BNZ   RF01                                                     LIN01420             A     R3,=AL4(X'10000'-15)                                     LIN01430             B     RF01                                                     LIN01440    RF09     BR    R11                                                      LIN01450                                                                            LIN01460    *                             Read the VTOC of the volume in a buffer   LIN01470    *                             and search for the 3 datasets             LIN01480    READVTOC EQU   *                                                        LIN01490             LA    R1,CCW4        Channel program to read R3                LIN01500             LR    R10,R11        Save my return address                    LIN01510             BAL   R5,IO          Read R3                                   LIN01520             BZ    VT01                                                     LIN01530             LA    R1,SENSEID                                               LIN01540             BAL   R5,IO                                                    LIN01550             BAL   R14,DROPDEAD                                             LIN01560    VT01     MVC   VOL1BUF+15(4),VOL1BUF+11 Get VOLVTOC pointer             LIN01570             LA    R6,VOL1BUF+11 And use one track as the extent            LIN01580             SLR   R4,R4                                                    LIN01590             L     R8,=X'00800000'                                          LIN01600             BAL   R11,READFILE Read this single track                      LIN01610                                                                            LIN01620             CLC   VOL1BUF+15(4),X'2D'(R8)   Just one track?                LIN01630             BE    VT02                                                     LIN01640             L     R8,=X'00800000'                                          LIN01650             SLR   R4,R4                                                    LIN01660             MVC   VOL1BUF+15(4),X'2D'(R8)   Last CCHH used by VTOC         LIN01670             BAL   R11,READFILE                                             LIN01680    VT02     L     R3,=F'3'      3 datasets to find                         LIN01690             LA    R2,DSN        Point to first one                         LIN01700             LA    R4,EXT1       Point to first extent                      LIN01710             LR    R9,R8         End of VTOC in memory                      LIN01720    VT03     IC    R8,STATUS                                                LIN01730             LA    R8,1(R8)                                                 LIN01740             STC   R8,STATUS                                                LIN01750             L     R8,=X'00800000'                                          LIN01760    VT04     CLC   0(44,R2),0(R8)                                           LIN01770             BNZ   VT05                                                     LIN01780             MVC   0(8,R4),X'06B'(R8) Copy extent info                      LIN01790             B     VT06                                                     LIN01800    VT05     LA    R8,140(R8)    Advance to next VTOC entry                 LIN01810             CR    R8,R9                                                    LIN01820             BL    VT04                                                     LIN01830             BAL   R14,DROPDEAD                                             LIN01840    VT06     SLR   R1,R1                                                    LIN01850             LA    R2,44(R2)     Next DSN                                   LIN01860             LA    R4,8(R4)      Next extent                                LIN01870             BCT   R3,VT03                                                  LIN01880             BR R10                                                         LIN01890    *                                                                       LIN01900             DS    0D                                                       LIN01910    IRB      DS    16F                                                      LIN01920    DEVSUBCH DS    F                                                        LIN01930    ORB      DC    A(0)                                                     LIN01940             DC    X'0080FF00'                                              LIN01950             DC    A(CCW1)       Channel Program Address                    LIN01960    STATUS   DC    AL1(0)                                                   LIN01970    *                                                                       LIN01980             DS    0D                                                       LIN01990    CCW1P    DC    X'00CC0000',X'00000000'      ECKD for sequential read    LIN02000             DC    X'00000000',X'00000000'                                  LIN02010    CCW2P    DC    X'4c000001',X'00000000'      Prepare to read full track  LIN02020             DC    X'00000000',X'01FF0000'                                  LIN02030    *                                                                       LIN02040    SENSEID  DC    X'04000020',A(SENSEID1)                                  LIN02050    CCW1     DC    X'63400010',A(CCW1P)         Define Extent               LIN02060    CCW2     DC    X'47400010',A(CCW2P)         Locate Record               LIN02070    CCW3     DC    X'DE20F000',X'00700000'      Read full track             LIN02080                                                                            LIN02090             DS    0D                                                       LIN02100    CCW4P    DC    X'00C00000',X'00000000'      ECKD channel program        LIN02110             DC    X'00000000',X'00000000'                                  LIN02120    CCW5P    DC    X'06000001',X'00000000'      Locate R3 for reading       LIN02130             DC    X'00000000',X'03FF0000'                                  LIN02140                                                                            LIN02150    CCW4     DC    X'63400010',A(CCW4P)         Define Extent               LIN02160    CCW5     DC    X'47400010',A(CCW5P)         Locate Record               LIN02170    CCW6     DC    X'06200050',A(VOL1BUF)       Read 80 bytes               LIN02180                                                                            LIN02190    SENSEID1 DS    8F                                                       LIN02200    EXT1     DS    2F                                                       LIN02210    EXT2     DS    2F                                                       LIN02220    EXT3     DS    2F                                                       LIN02230                                                                            LIN02240    VOl1BUF  DS    80C                                                      LIN02250                                                                            LIN02261    * Constants from include/asm-s390/setup.h                               LIN02262    PARMAREA          EQU X'10400'                                          LIN02263    COMMAND_LINE_SIZE EQU 896                                               LIN02264    RAMDISK_ORIGIN    EQU X'800000'                                         LIN02265    RAMDISK_SIZE      EQU X'800000'                                         LIN02266                                                                            LIN02267    IPL_DEVICE        EQU X'10404'                                          LIN02268    INITRD_START      EQU X'1040C'                                          LIN02269    INITRD_SIZE       EQU X'10414'                                          LIN02270    COMMAND_LINE      EQU X'10480'                                          LIN02271                                                                            LIN02272    R0       EQU   0                                                        LIN02273    R1       EQU   1                                                        LIN02280    R2       EQU   2                                                        LIN02290    R3       EQU   3                                                        LIN02300    R4       EQU   4                                                        LIN02310    R5       EQU   5                                                        LIN02320    R6       EQU   6                                                        LIN02330    R7       EQU   7                                                        LIN02340    R8       EQU   8                                                        LIN02350    R9       EQU   9                                                        LIN02360    R10      EQU   10                                                       LIN02370    R11      EQU   11                                                       LIN02380    R12      EQU   12                                                       LIN02390    R13      EQU   13                                                       LIN02400    R14      EQU   14                                                       LIN02410    R15      EQU   15                                                       LIN02420             END   ,                                                        LIN02430    //INTLINUX EXEC PGM=ICKDSF,PARM='NOREPLYU'                              00051600    //SYSPRINT DD SYSOUT=*                                                  00051700    //IPLTEXT  DD DSN=SYS1.SAMPLIB(IPLRECS),DISP=SHR                        00051800    //         DD DSN=&&IPLDECK,DISP=(OLD,DELETE)                           00051900    //LINUX    DD UNIT=SYSALLDA,VOL=SER=&LINUX.,DISP=OLD                    00052000    //SYSIN    DD *                                                         00060000      INIT DDNAME(LINUX)                            -                       00190000           OWNER(SYS1)                              -                       00200000           BOOTSTRAP                                -                       00201000           IPLDD(IPLTEXT)                           -                       00202000           PURGE                                    -                       00210000           VERIFY(LINUXZ)                           -                       00220000           VTOC(1,0,15)                             -                       00250000           NIX                                                              00260000    //TAPEIPL  EXEC PGM=IEBGENER                                            00290000    //SYSPRINT DD SYSOUT=*                                                  00300000    //SYSUT1 DD DSN=&UID..TAPEIPL.IKR,DISP=SHR                              00310000    //SYSUT2 DD DSN=SYS1.LINUX.TAPEIPL.IKR,DISP=(NEW,KEEP),                 00320000    // UNIT=SYSALLDA,RECFM=FB,LRECL=1024,BLKSIZE=0,                         00330000    // SPACE=(TRK,(28,0),,CONTIG),VOL=SER=&LINUX                            00340002    //SYSIN DD DUMMY                                                        00350000    //*                                                                     00360000    //INITRD EXEC PGM=IEBGENER                                              00370000    //SYSPRINT DD SYSOUT=*                                                  00380000    //SYSUT1 DD DSN=&UID..INITRD,DISP=SHR                                   00390000    //SYSUT2 DD DSN=SYS1.LINUX.INITRD,DISP=(NEW,KEEP),                      00400000    // UNIT=SYSALLDA,RECFM=FB,LRECL=1024,BLKSIZE=0,                         00410000    // SPACE=(TRK,(179,0),,CONTIG),VOL=SER=&LINUX                           00420002    //SYSIN DD DUMMY                                                        00430000    //*                                                                     00440000    //PARMFILE EXEC PGM=IEBGENER                                            00450000    //SYSPRINT DD SYSOUT=*                                                  00460000    //SYSUT1 DD DSN=&UID..PARMFILE,DISP=SHR                                 00470000    //SYSUT2 DD DSN=SYS1.LINUX.PARMFILE,DISP=(NEW,KEEP),                    00480000    // UNIT=SYSALLDA,RECFM=FB,LRECL=1024,BLKSIZE=0,                         00490000    // SPACE=(TRK,(1,0),,CONTIG),VOL=SER=&LINUX                             00500002    //SYSIN DD DUMMY                                                        00510000 

 < Day Day Up > 

IBM Lotus Domino 6. 5 for Linux on zSeries Implementation
IBM Lotus Domino 6.5 for Linux on Zseries Implementation
ISBN: 0738491748
EAN: 2147483647
Year: 2003
Pages: 162
Authors: IBM Redbooks © 2008-2017.
If you may any questions please contact us: