{"id":339,"date":"2012-01-03T23:18:28","date_gmt":"2012-01-04T05:18:28","guid":{"rendered":"http:\/\/tommysprinkle.com\/txxos\/?p=339"},"modified":"2021-04-17T18:23:06","modified_gmt":"2021-04-17T23:23:06","slug":"dispatcher-initialization","status":"publish","type":"post","link":"https:\/\/tommysprinkle.com\/txxos\/?p=339","title":{"rendered":"TXXDINIT &#8211; Dispatcher Initialization"},"content":{"rendered":"<p>For now the Dispatcher\u00a0initialization\u00a0routine will simply add the dummy Wait Task to the TCB queue. \u00a0This dummy task TCB must always be present and must be the first TCB on the queue. \u00a0Because we are not adding any other TCB&#8217;s to the queue for now the only thing that will happen when we IPL is the Dispatcher will enter the enabled wait until the Interval Timer expires at which time the Dispatcher will once again enter the enabled wait. \u00a0Later we will add additional TCB&#8217;s that will perform some work.<\/p>\n<pre>000000                                4 TXXDINIT CSECT ,\r\n000000 18CF                           5          LR    R12,R15             ESTABLISH\r\n                            00000     6          USING TXXDINIT,R12                 BASE REGISTER\r\n                                      7 *\r\n000002 58B0 0010      00010           8          L     R11,16              CVT ADDRESS\r\n                            00000     9          USING @CVT,R11\r\n                                     10 *\r\n000006 4140 C098      00098          11          LA    R4,WAITTASK         POINT TO DUMMY WAIT TASK\r\n                            00000    12          USING @TCB,R4\r\n                                     13 *\r\n00000A 9640 4004      00004          14          OI    TCBFLGS,TCBFNDSP    DO NOT DISPATCH TASK\r\n                                     15 *\r\n00000E 5040 B004      00004          16          ST    R4,CVTTASKQ         ADD TO TASK QUEUE\r\n000012 5040 B000      00000          17          ST    R4,CVTCTCB          MAKE IT CURRENT TASK\r\n000088 07FE                          51          BR    R14                 RETURN TO CALLER<\/pre>\n<p>The only thing we need to do to set up the TCB is to set the Do Not Dispatch flag (TCBFNDSP).<\/p>\n<pre>                                     60          PUSH PRINT\r\n                                     61          PRINT NOGEN\r\n                                     62          @TCB  ,\r\n                                    110          @RB   ,\r\n                                    142          POP   PRINT\r\n\r\n000094                              146 TXXDINIT CSECT ,\r\n000098                              147 WAITTASK DS    0D\r\n000098 0000000000000000             148          DC    (TCBLEN)X'00'<\/pre>\n<p>Because we want to refer the length of the TCB control block DSECT to define the Wait Task TCB storage, the equate for TCBLEN must be defined before it is used. \u00a0To do so, we can include the @TCB macro to define the DSECT and then we continue the CSECT.<\/p>\n<p>[Next &#8211; <a title=\"TXXSVCIR \u2013 SVC Interrupt Handler\" href=\"http:\/\/tommysprinkle.com\/txxos\/?p=341\">TXXSVCIR &#8211; SVC Interrupt Routine<\/a>]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For now the Dispatcher\u00a0initialization\u00a0routine will simply add the dummy Wait Task to the TCB queue. \u00a0This dummy task TCB must always be present and must be the first TCB on the queue. \u00a0Because we are not adding any other TCB&#8217;s &hellip; <a href=\"https:\/\/tommysprinkle.com\/txxos\/?p=339\">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-339","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1CPQT-5t","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/339","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=339"}],"version-history":[{"count":4,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/339\/revisions"}],"predecessor-version":[{"id":482,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/339\/revisions\/482"}],"wp:attachment":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}