{"id":20213,"date":"2008-11-13T10:00:00","date_gmt":"2008-11-13T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2008\/11\/13\/why-is-the-maximum-boot-ini-delay-11-million-seconds\/"},"modified":"2008-11-13T10:00:00","modified_gmt":"2008-11-13T10:00:00","slug":"why-is-the-maximum-boot-ini-delay-11-million-seconds","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20081113-00\/?p=20213","title":{"rendered":"Why is the maximum boot.ini delay 11 million seconds?"},"content":{"rendered":"<p>I mentioned in passing that <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/10\/16\/5465592.aspx\"> the maximum delay you can specify in boot.ini is about 11 million seconds<\/a>. I&#8217;m disappointed but sadly not surprised that everybody focused on that number and completely missed the point of the article.<\/p>\n<p> First of all, the value of 11 million was not a conscious limitation. It&#8217;s just an artifact of other limitations. The delay is specified in seconds in boot.ini, but internally it is converted to BIOS clock ticks. (Remember, this is a boot loader; there&#8217;s not much infrastructure available yet.) The conversion is done in 32-bit arithmetic, and 4 billion BIOS clock ticks at 18.2 ticks per second is about 110 million seconds. <\/p>\n<p> <i>Wait, but you said 11 million seconds, not 110 million seconds.<\/i> <\/p>\n<p> Well, yes, but the conversion is done in 32-bit integer arithmetic: <code>BiosTicks = BootIniSeconds * 182 \/ 10<\/code>. A value for BootIniSeconds larger than about 11 million  will result in a signed integer overflow in the intermediate product. <\/p>\n<p> That&#8217;s why the limit is 11 million seconds. <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/10\/16\/5465592.aspx#5472869\"> It&#8217;s a storage limitation, not an arbitrary cutoff<\/a>. And it is indeed <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/10\/16\/5465592.aspx#5473542\"> the limit of a natural data type<\/a>, just hidden behind some other computations. (<a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/10\/16\/5465592.aspx#5475875\">SB<\/a> figured this out, though I fear that this shout-out will only serve to encourage people to speculate even more wildly than they already do in the hopes of earning a future shout-out.) <\/p>\n<p> Now you&#8217;d think this would be plenty enough of a boot delay. I mean, it&#8217;s already much longer than the maximum amount you can delay with a single call to <code>Sleep<\/code> or <code>WaitForSingleObject<\/code>. And who would ever need a computer to pause <i>four months<\/i> before booting? Yet there&#8217;s one commenter who thought 11 million seconds wasn&#8217;t enough: &#8220;<a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/10\/16\/5465592.aspx#5471717\">What if I want a timeout of 129 days?<\/a>&#8221; If you need a timeout of 129 days, then <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/10\/16\/5465592.aspx#5472287\"> go buy a custom hardware timer device that waits 129 days after the onset of power before allowing current to flow<\/a>. This same commenter has difficulty comprehending that just because you&#8217;re capable of delaying something for a specific length of time and you&#8217;re capable of never doing it at all, that doesn&#8217;t mean that you are also capable of delaying something for an arbitrary length of time. <\/p>\n<p> One commenter suggested that <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2007\/10\/16\/5465592.aspx#5472524\"> the problem could be solved by using a bignum library<\/a>. Before you solve a problem, you first have to be sure that what you have really is a problem in the first place. I have yet to hear of any customers who are running into the 11 million second limit. Using bignums here would be a solution in search of a problem. &#8220;Hey, let&#8217;s consume valuable developer and tester resources in order to add a bunch of code to a tightly-constrained environment to cover a case that <i>nobody cares about<\/i>.&#8221; (And I failed to live up to <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2008\/08\/25\/8880082.aspx#8894393\"> my promise to Ulric<\/a> merely to incorporate this lecture by reference in the future.) <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I mentioned in passing that the maximum delay you can specify in boot.ini is about 11 million seconds. I&#8217;m disappointed but sadly not surprised that everybody focused on that number and completely missed the point of the article. First of all, the value of 11 million was not a conscious limitation. It&#8217;s just an artifact [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[2],"class_list":["post-20213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>I mentioned in passing that the maximum delay you can specify in boot.ini is about 11 million seconds. I&#8217;m disappointed but sadly not surprised that everybody focused on that number and completely missed the point of the article. First of all, the value of 11 million was not a conscious limitation. It&#8217;s just an artifact [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/20213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=20213"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/20213\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=20213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=20213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=20213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}