{"id":183,"date":"2011-11-24T17:56:05","date_gmt":"2011-11-24T23:56:05","guid":{"rendered":"http:\/\/tommysprinkle.com\/txxos\/?p=183"},"modified":"2021-04-17T18:27:24","modified_gmt":"2021-04-17T23:27:24","slug":"direct-access-storage-devices-dasd","status":"publish","type":"post","link":"https:\/\/tommysprinkle.com\/txxos\/?p=183","title":{"rendered":"Direct Access Storage Devices &#8211; DASD"},"content":{"rendered":"<p>Now we can begin to explore DASD (disc) devices.\u00a0 We will focus on &#8220;Count, Key, Data&#8221; (CKD) type devices, specifically the 3350.<\/p>\n<p>******************WARNING********************<\/p>\n<p>Doing I\/O to a DASD device could result in data loss and possibly the need to reformat the volume.\u00a0 Caution should be used and you should avoid using a volume with valuable data.<\/p>\n<p>For testing I created a new 3350 device using the DASDINIT command from Hercules.\u00a0 I added the device to my MVS 3.8J Hercules configuration and used the shared DASD feature to access it from my TXXOS Hercules.<\/p>\n<p>I attached my 3350 device as device address x&#8217;345&#8242; which happens to be sysgened as a 3350 on my MVS system.<\/p>\n<p>******************WARNING********************<\/p>\n<p>CKD devices have fixed Cylinder and Head arrangements but the record format on the track is up to the user or application.\u00a0 Each track is identified by its Cylinder and Head address (CCHH).<\/p>\n<p>Each track begins with a Home Address record.\u00a0 This record is part of the track formatting and is not normally accessed by applications.\u00a0 It is created when the dasd volume is formatted.\u00a0 The Home Address is read and written using special CCW commands.<\/p>\n<p>The Home Address is followed by Record Zero.\u00a0 R0 normally does not contain any data and should be considered part of the track formatting.<\/p>\n<p>Each record consists of three components: Count, Key and Data.\u00a0 The count area describes the record.\u00a0 The count area contains the record&#8217;s address (CCHHR), the Key area length, and the Data area length.\u00a0 The key and data areas maybe zero.\u00a0 A record with a Key Length of zero and a Data Length of zero indicates an End-Of-File (EOF) record.<\/p>\n<p>The count area is followed by the Key (if present) and the Data (if present).<\/p>\n<p>To access a record we first have to position the device to the proper location for the record.\u00a0 This is accomplished using the SEEK and SEARCH commands.<\/p>\n<p>SEEK (command code x&#8217;07&#8217;) is used to position the heads to the proper cylinder and to select the proper head.\u00a0 A SEARCH command is used to position to the correct location on the track.\u00a0 A SEARCH command is followed by a TIC command to &#8220;loop&#8221; the channel program until either the proper position is achieved or an error condition is signaled.<\/p>\n<p>A typical channel command for\u00a0 DASD begins with the SEEK, SEARCH, TIC sequence:<\/p>\n<pre>CCWSEEK\u00a0 DC\u00a0\u00a0\u00a0 X'07',AL3(MBBCCHHR+1),X'40',X'00',AL2(6)\u00a0\u00a0\u00a0 SEEK\u00a0\u00a0 \u00a0\r\n       \u00a0 DC\u00a0\u00a0\u00a0 X'31',AL3(MBBCCHHR+3),X'40',X'00',AL2(5)\u00a0\u00a0\u00a0 SEARCH ID=\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DC\u00a0\u00a0\u00a0 X'08',AL3(*-8),X'40',X'00',AL2(0)           TIC\r\n         DC    ...next CCW...                              Read\/Write\/etc.\r\n*\r\n*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 +0+1+2+3+4+5+6+7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\r\n*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 M B B C C H H R\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\r\nMBBCCHHR DC\u00a0\u00a0\u00a0 X'0000000000000101'<\/pre>\n<p>The first CCW is the SEEK (x&#8217;07&#8217;), the data address is 6 bytes specifying 00CCHH.\u00a0 We specify Command Chain to continue with the next CCW.<\/p>\n<p>The second CCW is a SEARCH (x&#8217;31&#8217; Search ID Equal), the data address is 5 bytes containing the record id (CCHHR) that will match the record ID in the count area.<\/p>\n<p>The TIC will cause the channel program to loop back to the SEARCH if the record is not found.\u00a0 If the record matching the CCHHR is found the program will skip over the TIC and execute the CCW following the TIC.<\/p>\n<p>A search for a record may be performed either by record ID (CCHHR) or by key.\u00a0 We can search for ID equal, ID high, or ID equal or high.\u00a0 We can also search for key equal, key high, or key equal or high.\u00a0 Each form of SEARCH has a unique command code.<\/p>\n<p>To access the Key or Data area we search for the ID of the record we want to access.\u00a0 To access the count area we have to search for the record before the record we want to access.\u00a0 For example to read the Count area of record one we have to search for record zero.\u00a0 If we just want to read the Data we would search for record one.<\/p>\n<p>Cylinder zero, Track zero is reserved for IPL and Volume Label record.\u00a0 Record zero is the first IPL record.\u00a0 Like our first IPL card it contains a PSW and two CCW&#8217;s (a read followed by a TIC).\u00a0 Record one is used to contain additional CCW&#8217;s.<\/p>\n<p>Record three contains the volume label.\u00a0 It contains the Volume Serial (VOLSER) and the address of the Volume Table Of Contents (VTOC).<\/p>\n<p>Record four is used to contain additional IPL data that can be read by the CCW&#8217;s in record two.<\/p>\n<p>[Next &#8211; <a title=\"DASD Volume Label Record and VTOC\" href=\"http:\/\/tommysprinkle.com\/txxos\/?p=186\">DASD Volume Label Record and VTOC<\/a>]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now we can begin to explore DASD (disc) devices.\u00a0 We will focus on &#8220;Count, Key, Data&#8221; (CKD) type devices, specifically the 3350. ******************WARNING******************** Doing I\/O to a DASD device could result in data loss and possibly the need to reformat &hellip; <a href=\"https:\/\/tommysprinkle.com\/txxos\/?p=183\">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-183","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1CPQT-2X","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/183","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=183"}],"version-history":[{"count":4,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":185,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/183\/revisions\/185"}],"wp:attachment":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}