{"id":1184,"date":"2010-02-10T00:01:48","date_gmt":"2010-02-10T08:01:48","guid":{"rendered":"http:\/\/www.wambooli.com\/blog\/?p=1184"},"modified":"2010-02-09T16:28:34","modified_gmt":"2010-02-10T00:28:34","slug":"a-nerdy-post-on-programs","status":"publish","type":"post","link":"https:\/\/www.wambooli.com\/blog\/?p=1184","title":{"rendered":"A Nerdy Post on Programs"},"content":{"rendered":"<p>Here I go! Off the deep end! Prepare to flee in terror from this blog post, because I&#8217;m going to be talking about how programs work on a computer. Not how to work a program, but what happens when the operating system takes a program from the computer&#8217;s mass storage system and tosses that code into computer memory.<br \/>\n<!--more--><br \/>\nAre you still there? Weird. I thought most people would be off to <a href=\"http:\/\/www.stumbleupon.com\/\" target=\"other\">Stumble Upon<\/a> by now, playing that cool game with the little guy sliding down the lines you randomly draw. Anyway.<\/p>\n<p>One of the operating system&#8217;s primary duties is to run software, the programs you have installed on your computer. Like everything else, programs are stored on the computer&#8217;s mass storage system, typically the hard drive.<\/p>\n<p>(I&#8217;m moving away from referring to long-term computer storage as &#8220;the hard drive&#8221; or &#8220;on disk&#8221; as not all computers have disk drives these days, and in the future everything will be solid state.)<\/p>\n<p>The operating system takes a program from mass storage, then transfers that data \u2014 the raw program code \u2014 into the computer&#8217;s short-term storage, or memory. Once loaded into memory, the operating system then passes computer control over to that program. That&#8217;s the bare bones description.<\/p>\n<p>There are two types of programs in the Windows world: image and executable.<\/p>\n<p>An image program file is the older kind of program file that DOS used. The filename extension was <code>COM<\/code>, but <code>BIN<\/code> could also be used. (Though DOS wouldn&#8217;t run a <code>BIN<\/code> file directly from the command prompt.)<\/p>\n<p><code>COM<\/code> stands for Command. <code>BIN<\/code> for Binary.<\/p>\n<p><code>COM<\/code> files were exact images of the code, simply plopped down into memory by the operating system. After loading, the operating system passed control to the program, starting at a certain offset (100 hex) in memory. At that point, the program ran \u2014 or not, whatever the case would be.<\/p>\n<p><code>COM<\/code> programs were tiny and tight. At most they could only be 64K in size. Obviously you can see that would be an issue for any advanced program, such as, well, anything.<\/p>\n<p>The executable program files sported the <code>EXE<\/code> filename extension, which stands for <em>executable<\/em>. Unlike <code>COM<\/code> files, <code>EXE<\/code> files could be huge. (<code>excel.exe<\/code> weighs in at over 19MB.)<\/p>\n<p><code>EXE<\/code> program files contain binary information, but they also contain a loader that tells the operating system where to place the program in memory. That way, the program can be laid out in larger swaths and use memory more effectively and efficiently than the older <code>COM<\/code> programs.<\/p>\n<p>Today, Windows uses <code>EXE<\/code> files as the primary program file format and filename extension.<\/p>\n<p>Over in the Unix world, program files are not known by their filename extension, but rather by their <em>attributes<\/em>. That&#8217;s a whole &#8216;nuther worm I&#8217;ll probably write about someday when I&#8217;m feeling nerdy again!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here I go! Off the deep end! Prepare to flee in terror from this blog post, because I&#8217;m going to be talking about how programs work on a computer. Not how to work a program, but what happens when the operating system takes a program from the computer&#8217;s mass storage system and tosses that code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1184","post","type-post","status-publish","format-standard","hentry","category-main"],"_links":{"self":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1184"}],"version-history":[{"count":4,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1184\/revisions"}],"predecessor-version":[{"id":1188,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1184\/revisions\/1188"}],"wp:attachment":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}