{"id":57,"date":"2011-06-17T09:45:01","date_gmt":"2011-06-17T14:45:01","guid":{"rendered":"http:\/\/tommysprinkle.com\/txxos\/?p=57"},"modified":"2021-04-17T18:31:15","modified_gmt":"2021-04-17T23:31:15","slug":"card-ipl-deck","status":"publish","type":"post","link":"https:\/\/tommysprinkle.com\/txxos\/?p=57","title":{"rendered":"First IPL Card"},"content":{"rendered":"<p>Now that we have been through an overview of the IPL process and the basic concepts of the PSW and I\/O we can begin to construct a deck of cards to IPL from.\u00a0\u00a0 We know that if we set the IPL device address to that of a card reader and press the IPL key the CPU will read a single card and transfer the first 24 bytes of data (card columns 1-24) and ignore the rest of the card.<\/p>\n<p>The contents of our first card should be a PSW followed by two CCWs.<\/p>\n<pre>IPLCARD0 DS\u00a0\u00a0\u00a0 0D\r\n*\r\nPSW\u00a0\u00a0\u00a0\u00a0\u00a0 DC\u00a0\u00a0 \u00a0X\u201900\u2019\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 * I\/O &amp; External Interrupts Disabled\r\n         DC\u00a0\u00a0 \u00a0X\u201900\u2019\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 * Key=0; BC; Ext Int Disabled; Sup State\r\n         DC\u00a0\u00a0 \u00a0X\u20190000\u2019\r\n         DC\u00a0\u00a0 \u00a0X\u201900\u2019\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 * Prog Int Disabled\r\n         DC\u00a0\u00a0 \u00a0AL3(1024)   * Address to begin Execution\r\n*\r\n*\r\nCCW1\u00a0\u00a0   DC\u00a0\u00a0 \u00a0X\u201902\u2019\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 * Read\r\n         DC\u00a0\u00a0 \u00a0AL3(512)\u00a0 \u00a0 * Storage Address For Data\r\n         DC\u00a0\u00a0 \u00a0X\u201960\u2019\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 * SLI + CC\r\n         DC\u00a0\u00a0 \u00a0X\u201900\u2019\r\n         DC\u00a0\u00a0 \u00a0AL2(80)\u00a0\u00a0\u00a0\u00a0 * Length\r\n*\r\n*\r\nCCW2\u00a0\u00a0   DC\u00a0\u00a0 \u00a0X\u201908\u2019\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 * Transfer In Channel (TIC)\r\n         DC\u00a0\u00a0 \u00a0AL3(512)\u00a0 \u00a0 * Address of next CCW\r\n         DC\u00a0\u00a0 \u00a0X\u201900\u2019\r\n         DC\u00a0\u00a0 \u00a0X\u201900\u2019\r\n         DC\u00a0\u00a0 \u00a0AL2(0)\u00a0\u00a0\u00a0\u00a0\u00a0 * Length Not Used For TIC\r\n*\r\n*<\/pre>\n<p>&nbsp;<\/p>\n<p>This makes up the contents of our first IPL record.\u00a0 The first eight bytes become our initial PSW when the IPL CCW chain is completed.\u00a0 The first byte contains the interrupt mask flags for channels 0 through 5, the I\/O mask bit (for channels 6 and higher) and the External Interrupt mask.\u00a0 We set all of these to zero which inhibits these conditions from generating an interrupt.<\/p>\n<p>The next byte contains the protection key in the first four bits.\u00a0 We will initially set our key to zero which will allow us to access any valid memory location.<\/p>\n<p>The next bit is set to zero to indicate a BC mode PSW.\u00a0 The Machine Check Interrupt mask is set to zero to inhibit interruptions.\u00a0 The Wait bit is set to zero so the CPU will immediately begin executing instructions.\u00a0 The Problem State bit is set to zero placing us in Supervisor State therefore allowing us to execute privileged instructions.<\/p>\n<p>The next two bytes are set to all zeros.\u00a0 These bytes contain the interruption code and are only meaningful in an Old PSW to indicate the source of the interruption.\u00a0 When the IPL process is completed the address of the IPL device will be stored here.<\/p>\n<p>The next byte contains the Instruction Length Code (ILC), Condition Code and Program Mask.\u00a0 We set all of these to zero and disallow any of the related program checks from generating interrupts.<\/p>\n<p>The next three bytes contain the memory address of the first instruction to be executed.\u00a0 It is our responsibility to load a valid instruction sequence into memory starting at this address.<\/p>\n<p>Following the PSW are two CCWs.\u00a0 The First CCW is a read command (command code = x\u201902\u2019).\u00a0 This will cause the next card in our IPL Deck to be read.\u00a0 We specify a storage location to receive the contents of the card.\u00a0 The next byte specifies the flags.\u00a0 We set the Command Chain flag so a new CCW will be fetched upon completion of the read command.\u00a0 The Suppress Incorrect Length\u00a0 (SLI) bit is also set to avoid any problems with reading a short or long block of data.\u00a0 Since we are reading from a card device the block size is set at 80 so we really shouldn\u2019t need to set this flag.\u00a0 In general it is a good idea to suppress any exceptional conditions possible since at this time there is no option for error recovery.<\/p>\n<p>The next CCW is a Transfer In Channel (TIC) command.\u00a0 A TIC is a branch command in a channel program.\u00a0 The TIC will cause a new CCW to be fetched from the address specified.\u00a0 We will set the address to point to the contents of the card that was read by the previous CCW.<\/p>\n<p>At this point the IPL process has read two cards into memory.\u00a0 The first card contained two CCWs to read the second card and then load a new CCW.<\/p>\n<p>Card two needs to contain additional CCWs to read additional cards into memory that contain executable code.<\/p>\n<p><a title=\"Second IPL Card\" href=\"http:\/\/tommysprinkle.com\/txxos\/?p=67\">[Next &#8211; Second IPL Card]<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that we have been through an overview of the IPL process and the basic concepts of the PSW and I\/O we can begin to construct a deck of cards to IPL from.\u00a0\u00a0 We know that if we set the &hellip; <a href=\"https:\/\/tommysprinkle.com\/txxos\/?p=57\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"template-page-builder-no-sidebar.php","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1CPQT-V","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=57"}],"version-history":[{"count":8,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":529,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions\/529"}],"wp:attachment":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}