<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AT&amp;T Unix &#8211; Virtually Fun</title>
	<atom:link href="https://virtuallyfun.com/category/att-unix/feed/" rel="self" type="application/rss+xml" />
	<link>https://virtuallyfun.com</link>
	<description>Fun with Virtualization</description>
	<lastBuildDate>Wed, 28 Feb 2024 17:41:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.1</generator>
	<item>
		<title>The Rise of Unix. The Seeds of its Fall. / A Chronicle of the Unix Wars</title>
		<link>https://virtuallyfun.com/2024/01/05/the-rise-of-unix-the-seeds-of-its-fall-a-chronicle-of-the-unix-wars/</link>
					<comments>https://virtuallyfun.com/2024/01/05/the-rise-of-unix-the-seeds-of-its-fall-a-chronicle-of-the-unix-wars/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 05 Jan 2024 09:42:29 +0000</pubDate>
				<category><![CDATA[32v]]></category>
		<category><![CDATA[386BSD]]></category>
		<category><![CDATA[4 BSD]]></category>
		<category><![CDATA[4.2 BSD]]></category>
		<category><![CDATA[4.3 BSD]]></category>
		<category><![CDATA[4.3 BSD RENO]]></category>
		<category><![CDATA[80386]]></category>
		<category><![CDATA[AT&T Unix]]></category>
		<category><![CDATA[BSD]]></category>
		<category><![CDATA[i386]]></category>
		<category><![CDATA[SIMH]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[videos]]></category>
		<category><![CDATA[virtual networking]]></category>
		<category><![CDATA[Win32]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=13695</guid>

					<description><![CDATA[It&#8217;s not mine, rather it&#8217;s Asianometry&#8216;s. It&#8217;s a nice overview of the rise of Unix. I&#8217;d recommend checking it out, it&#8217;s pretty good. And of course, as I&#8217;m referenced! And part 2: A Chronicle of the Unix Wars Years ago &#8230; <a href="https://virtuallyfun.com/2024/01/05/the-rise-of-unix-the-seeds-of-its-fall-a-chronicle-of-the-unix-wars/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">It&#8217;s not mine, rather it&#8217;s <a href="https://www.youtube.com/@Asianometry">Asianometry</a>&#8216;s.  It&#8217;s a nice overview of the rise of Unix.  I&#8217;d recommend checking it out, it&#8217;s pretty good.  And of course, as I&#8217;m referenced!<a href="https://www.youtube.com/@Asianometry"></a></p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="The Rise of Unix. The Seeds of its Fall." width="584" height="329" src="https://www.youtube.com/embed/HADp3emVABg?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div><figcaption class="wp-element-caption">The Rise of Unix. The Seeds of its Fall.</figcaption></figure>



<p class="wp-block-paragraph">And part 2: A Chronicle of the Unix Wars</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="A Chronicle of the Unix Wars" width="584" height="329" src="https://www.youtube.com/embed/Ffh3DRFzRL0?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div><figcaption class="wp-element-caption"><a href="https://www.youtube.com/watch?v=Ffh3DRFzRL0">A Chronicle of the Unix Wars (youtube.com)</a></figcaption></figure>



<p class="wp-block-paragraph">Years ago I had tried to make these old OS&#8217;s accessible to the masses with a simple windows installer where you could click &amp; run these ancient artifacts.  Say 4.2BSD.</p>



<p class="wp-block-paragraph"><a href="https://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.3%20Beta%201/BSD4.2-install-0.3.exe/download">Download BSD4.2-install-0.3.exe (Ancient UNIX/BSD emulation on Windows) (sourceforge.net)</a></p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="649" src="https://virtuallyfun.com/wp-content/uploads/2024/01/install-4.2BSD-on-windows-1024x649.png" alt="" class="wp-image-13696" srcset="https://virtuallyfun.com/wp-content/uploads/2024/01/install-4.2BSD-on-windows-1024x649.png 1024w, https://virtuallyfun.com/wp-content/uploads/2024/01/install-4.2BSD-on-windows-300x190.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/01/install-4.2BSD-on-windows-768x487.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/01/install-4.2BSD-on-windows-473x300.png 473w, https://virtuallyfun.com/wp-content/uploads/2024/01/install-4.2BSD-on-windows.png 1305w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Installing should be pretty straight forward, I just put the license as a click through and accept defaults.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="622" src="https://virtuallyfun.com/wp-content/uploads/2024/01/booted-into-4.2BSD-1024x622.png" alt="" class="wp-image-13697" srcset="https://virtuallyfun.com/wp-content/uploads/2024/01/booted-into-4.2BSD-1024x622.png 1024w, https://virtuallyfun.com/wp-content/uploads/2024/01/booted-into-4.2BSD-300x182.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/01/booted-into-4.2BSD-768x466.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/01/booted-into-4.2BSD-494x300.png 494w, https://virtuallyfun.com/wp-content/uploads/2024/01/booted-into-4.2BSD.png 1031w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Starting BSD via &#8216;RUN BSD42&#8217; and the emulator will fire up, and being up a console program (Tera Term) giving you the console access.  Windows will probably warn you that it requested network access.  This will allow you to access the VAX over the network, including being able to telnet into the VAX via &#8216;Attach a PTY&#8217; which will spawn another Tera Term, prompting you to login.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="822" height="427" src="https://virtuallyfun.com/wp-content/uploads/2024/01/attach-a-ptty.png" alt="" class="wp-image-13698" srcset="https://virtuallyfun.com/wp-content/uploads/2024/01/attach-a-ptty.png 822w, https://virtuallyfun.com/wp-content/uploads/2024/01/attach-a-ptty-300x156.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/01/attach-a-ptty-768x399.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/01/attach-a-ptty-500x260.png 500w" sizes="auto, (max-width: 822px) 100vw, 822px" /><figcaption class="wp-element-caption">telnettting into the VAX</figcaption></figure>



<p class="wp-block-paragraph">You can login as root, there is no password, and now you are up and running your virtual VAX with 4.2BSD!</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-items.png"><img loading="lazy" decoding="async" width="748" height="652" src="https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-items.png" alt="" class="wp-image-13699" srcset="https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-items.png 748w, https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-items-300x261.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-items-344x300.png 344w" sizes="auto, (max-width: 748px) 100vw, 748px" /></a><figcaption class="wp-element-caption">All the items</figcaption></figure>



<p class="wp-block-paragraph">I converted many of the old documents into PDF&#8217;s so you may want to start with the Beginners guide to Unix.  I thought this was a great way to bring a complex system to the masses, but I&#8217;m not sure if I succeded.</p>



<figure class="wp-block-image size-large"><a href="https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-download-stats.png"><img loading="lazy" decoding="async" width="1024" height="488" src="https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-download-stats-1024x488.png" alt="" class="wp-image-13700" srcset="https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-download-stats-1024x488.png 1024w, https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-download-stats-300x143.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-download-stats-768x366.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-download-stats-500x238.png 500w, https://virtuallyfun.com/wp-content/uploads/2024/01/4.2BSD-download-stats.png 1171w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">776 downloads</figcaption></figure>



<p class="wp-block-paragraph">As it sits now, since 2007 it&#8217;s had 776 downloads.  I&#8217;d never really gotten any feedback so I&#8217;d hoped it got at least a few people launched into the bewildering world of ancient Unix.  Of course I tried to make many more packages but I&#8217;d been unsure if any of them went anywhere.  It&#8217;s why I found these videos so interesting as at least the image artifacts got used for something!</p>



<p class="wp-block-paragraph">But in the off hand, maybe this can encourage some Unix curious into a larger world.</p>



<p class="wp-block-paragraph">Other downloads in the same scope are:</p>



<ul class="wp-block-list">
<li><a href="https://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.3%20Beta%201/Research-unixv1-0.3.exe/download">Research-unixv1</a></li>



<li><a href="https://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.3%20Beta%201/unix32v-0.3.exe/download">unix32v</a></li>



<li><a href="https://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.3%20Beta%201/BSD4.3-install-0.3.exe/download">BSD4.3</a></li>



<li><a href="https://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.4/4.3BSD-Uwisc-install-0.4.exe/download">4.3BSD-Uwisc</a></li>



<li><a href="https://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.3%20Beta%201/BSD4.3-Reno-installer-0.3.exe/download">BSD4.3-Reno</a></li>



<li><a href="https://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.4/386BSD-0.1.exe/download">386BSD-0.1</a></li>
</ul>



<p class="wp-block-paragraph">Enjoy!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2024/01/05/the-rise-of-unix-the-seeds-of-its-fall-a-chronicle-of-the-unix-wars/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Thanks to shadyjesse Philpem&#8217;s FreeBee can now run the C compiler!</title>
		<link>https://virtuallyfun.com/2020/08/29/thanks-to-shadyjesse-philpems-freebee-can-now-run-the-c-compiler/</link>
					<comments>https://virtuallyfun.com/2020/08/29/thanks-to-shadyjesse-philpems-freebee-can-now-run-the-c-compiler/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Sat, 29 Aug 2020 06:03:15 +0000</pubDate>
				<category><![CDATA[68000]]></category>
		<category><![CDATA[AT&T Unix]]></category>
		<category><![CDATA[disk images]]></category>
		<category><![CDATA[m68k]]></category>
		<category><![CDATA[SYSV]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/wordpress/?p=10465</guid>

					<description><![CDATA[Again super thanks to shadyjesse for finding and fixing the larger issues, and philpem for his great emulator, freebee! I have to say, having never played with an AT&#38;T Unix PC, it&#8217;s kind neat with this windowing non X11 UI. &#8230; <a href="https://virtuallyfun.com/2020/08/29/thanks-to-shadyjesse-philpems-freebee-can-now-run-the-c-compiler/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="722" height="375" src="https://virtuallyfun.com/wp-content/uploads/2020/08/freebee-with-c.png" alt="" class="wp-image-10467" srcset="https://virtuallyfun.com/wp-content/uploads/2020/08/freebee-with-c.png 722w, https://virtuallyfun.com/wp-content/uploads/2020/08/freebee-with-c-300x156.png 300w, https://virtuallyfun.com/wp-content/uploads/2020/08/freebee-with-c-500x260.png 500w" sizes="auto, (max-width: 722px) 100vw, 722px" /><figcaption>I call it Freebee with C!</figcaption></figure>



<p class="wp-block-paragraph">Again super thanks to <a href="https://github.com/shadyjesse">shadyjesse</a> for finding and fixing the larger issues, and <a href="https://github.com/philpem">philpem</a> for his great emulator, freebee!</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1017" height="1012" src="https://virtuallyfun.com/wp-content/uploads/2020/08/68k.jpg" alt="" class="wp-image-10469" srcset="https://virtuallyfun.com/wp-content/uploads/2020/08/68k.jpg 1017w, https://virtuallyfun.com/wp-content/uploads/2020/08/68k-300x300.jpg 300w, https://virtuallyfun.com/wp-content/uploads/2020/08/68k-150x150.jpg 150w, https://virtuallyfun.com/wp-content/uploads/2020/08/68k-768x764.jpg 768w, https://virtuallyfun.com/wp-content/uploads/2020/08/68k-301x300.jpg 301w" sizes="auto, (max-width: 1017px) 100vw, 1017px" /><figcaption>So 1970&#8217;s</figcaption></figure>



<p class="wp-block-paragraph">I have to say, having never played with an AT&amp;T Unix PC, it&#8217;s kind neat with this windowing non X11 UI.  Although even in emulation it&#8217;s incredibly slow.  But such was the Unix microprocessor revolution of the era, it&#8217;s crazy to think the mighty SUN-2 is also on the same level of performance, although SUN would at least go the way of the 68020 before giving up on the 68k for SPARC.</p>



<p class="wp-block-paragraph">Even though the 68000 lacked the ability to recover from bus faults, allowing a better path to UNIX with the 68010, OEM&#8217;s still brought their own MMU technology to flesh it out, leading to divergent systems.  Not that it mattered all that much for AT&amp;T as they started to establish themselves as the new defacto go to UNIX vendor they quickly abandoned the market leaving the Unix PC, and 3B2&#8217;s to die off.  While so many like to think that the &#8216;Unix&#8217; business is booming, it really only boomed once AT&amp;T exited the market until Linux had started to gain enough mindshare post 1.0&#8230; Which also included 68000 support, although aimed for the the stronger 68030/68040&#8217;s.</p>



<p class="wp-block-paragraph">Anyways I&#8217;m sure you didn&#8217;t come here for my ramblings about the 68000 instead you want an easy to run package to click and GO!</p>



<p class="wp-block-paragraph">So here, you are, <a href="https://vpsland.superglobalmegacorp.com/old/install/UNIX/3B1/freebee-d3c948646770721bff31fec91b70ce3adf981596.zip">freebee based on</a> <a href="https://github.com/philpem/freebee/commit/d3c948646770721bff31fec91b70ce3adf981596">build d3c9486 of freebee</a>.</p>



<p class="wp-block-paragraph">There are two executables, for normies, tourists, and people only wanting to witness the fun it doesn&#8217;t matter which one you use.  For anyone wanting to install the 3B1 Unix, you&#8217;ll want &#8220;freebee-10sec-O2.exe&#8221;.  Since the 3B1 uses a non standard format, if you want to use FAT 360kb disks from a PC emulator then you&#8217;ll need &#8220;freebee-9sec-O2.exe&#8221;.  Isn&#8217;t compatibility great?</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2020/08/29/thanks-to-shadyjesse-philpems-freebee-can-now-run-the-c-compiler/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Philip Pemberton&#8217;s 3B1 emulator moved</title>
		<link>https://virtuallyfun.com/2020/03/17/philip-pembertons-3b1-emulator-moved/</link>
					<comments>https://virtuallyfun.com/2020/03/17/philip-pembertons-3b1-emulator-moved/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Tue, 17 Mar 2020 15:53:26 +0000</pubDate>
				<category><![CDATA[68000]]></category>
		<category><![CDATA[AT&T Unix]]></category>
		<category><![CDATA[m68k]]></category>
		<category><![CDATA[SYSV]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/wordpress/?p=10167</guid>

					<description><![CDATA[It&#8217;s been a while since I played with Philip Pemberton&#8217;s excellent emulator, however the source code has been moved to github&#8230; As a nice bonus it&#8217;s been updated to build against the newer source drops of Karl Stenerud&#8217;s Musashi. The &#8230; <a href="https://virtuallyfun.com/2020/03/17/philip-pembertons-3b1-emulator-moved/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">It&#8217;s been a while since I played with Philip Pemberton&#8217;s excellent <a href="http://www.philpem.me.uk/code/3b1emu/">emulator</a>, however the source code has been moved to <a href="https://github.com/philpem/freebee">github</a>&#8230;</p>



<p class="wp-block-paragraph">As a nice bonus it&#8217;s been updated to build against the newer source drops of <a href="https://github.com/kstenerud/Musashi">Karl Stenerud&#8217;s Musashi</a>.</p>



<p class="wp-block-paragraph">The Makefile is so nice it chains in c files from sub-directories to build, which unfortunately it doesn&#8217;t work so well with the latest Musashi.  Like a bull charging into the China shop I just smashed together a build script, and got a working exe:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="722" height="375" src="https://virtuallyfun.com/wp-content/uploads/2020/03/FreeBee-3B1.png" alt="" class="wp-image-10168" srcset="https://virtuallyfun.com/wp-content/uploads/2020/03/FreeBee-3B1.png 722w, https://virtuallyfun.com/wp-content/uploads/2020/03/FreeBee-3B1-300x156.png 300w, https://virtuallyfun.com/wp-content/uploads/2020/03/FreeBee-3B1-500x260.png 500w" sizes="auto, (max-width: 722px) 100vw, 722px" /></figure>



<p class="wp-block-paragraph">And it&#8217;s so nice to see it actually boot up.</p>



<p class="wp-block-paragraph">Things like the C compiler still break, apparently the 6100 had an actual physical memory buffer for IPC?  It&#8217;s all so confusing.</p>



<p class="wp-block-paragraph">Not that mine is all that great but my crap fork is here:</p>



<p class="wp-block-paragraph"><a href="https://vpsland.superglobalmegacorp.com/install/UNIX/3B1/freebee-master_17032020.zip">freebee-master_17032020.zip</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2020/03/17/philip-pembertons-3b1-emulator-moved/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
		<item>
		<title>Unix50 &#8211; Unix Today and Tomorrow: Future of Compute &#038; Platforms: The Kernel</title>
		<link>https://virtuallyfun.com/2019/10/23/unix50-unix-today-and-tomorrow-future-of-compute-platforms-the-kernel/</link>
					<comments>https://virtuallyfun.com/2019/10/23/unix50-unix-today-and-tomorrow-future-of-compute-platforms-the-kernel/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Wed, 23 Oct 2019 11:59:42 +0000</pubDate>
				<category><![CDATA[AT&T Unix]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[videos]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/wordpress/?p=9853</guid>

					<description><![CDATA[Also don't forget The Origin of Unix Panel Session followup. So apparently Nokia owns what is left of Bell Labs, and they in turn own Unix...?]]></description>
										<content:encoded><![CDATA[
<div class="jsmpeg" data-url="/videos/Unix50_-_Unix_Today_and_Tomorrow_-_Future_of_Compute_Platforms_-_The_Kernel-dUt3L3fLFt4.ts"></div>
<script type="text/javascript" language="javascript">
if(!window.scriptHasRun) { window.scriptHasRun = true; document.write('<script type="text/javascript" language="javascript" src="/videos/jsmpeg.min.js"><\/script>')}
</script>



<p class="wp-block-paragraph">Also don't forget <a href="https://www.youtube.com/watch?v=lz3GADLe__M">The Origin of Unix Panel Session</a> followup.</p>



<p class="wp-block-paragraph">So apparently Nokia owns what is left of Bell Labs, and they in turn own Unix...?</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2019/10/23/unix50-unix-today-and-tomorrow-future-of-compute-platforms-the-kernel/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>fread and fwrite demystified: stdio on UNIX V7</title>
		<link>https://virtuallyfun.com/2018/03/01/fread-and-fwrite-demystified-stdio-on-unix-v7/</link>
					<comments>https://virtuallyfun.com/2018/03/01/fread-and-fwrite-demystified-stdio-on-unix-v7/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Thu, 01 Mar 2018 07:36:25 +0000</pubDate>
				<category><![CDATA[AT&T Unix]]></category>
		<category><![CDATA[guest post]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[v7x86]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=8209</guid>

					<description><![CDATA[(This is a guest post by xorhash.) 1. Introduction Did I say I&#8217;m done with UNIX Seventh Edition (V7)? How silly of me; of course I&#8217;m not. V7 is easy to study, after all. Something that&#8217;s always bothered me about &#8230; <a href="https://virtuallyfun.com/2018/03/01/fread-and-fwrite-demystified-stdio-on-unix-v7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><em>(This is a guest post by <a href="https://twitter.com/xorhash">xorhash</a>.)</em></p>
<h1>1. Introduction</h1>
<p>Did I say I&#8217;m done with UNIX Seventh Edition (V7)? How silly of me; of course I&#8217;m not. V7 is easy to study, after all.</p>
<p>Something that&#8217;s always bothered me about the <code>stdio.h</code> primitives <code>fread</code>() and <code>fwrite</code>() are their weak guarantees about what they actually do. Is a short read or write â€œnormalâ€ in the sense that I should normally expect it? While this makes no answer about modern-day operating systems, a look at V7 may enlighten me about what the historical precedent is.</p>
<p>As an aside: It&#8217;s worth noting that the <code>stdio.h</code> functions are some of the few that require a header. It was common historical practice not to declare functions in headers, just see <a href="https://man.openbsd.org/UNIX-7/crypt.3">crypt(3)</a> as an example.</p>
<p>I will first display the man page, then ask the questions I want to answer, then look at the implementation and finally use that gained knowledge to answer the questions.</p>
<h1>2. Into the Man Page</h1>
<p>The man page for <code>fread</code>() and <code>fwrite</code>() is rather terse. Modern-day man pages for those functions are equally terse, though, so this is not exactly a novelty of age. Here&#8217;s what it reads:</p>
<p><!-- Yes, the font-size and font-family is intentional, to try and match the original manuals. --></p>
<div style="padding-left: 1em; border: 1px solid #ccc; font-family: Times, Liberation Serif, Times New Roman, serif; font-size: 10pt;">
<h2 style="font-size: 10pt;">NAME</h2>
<p style="margin-left: 2rem; margin-top: 1em;">fread, fwrite &#8211; buffered binary input/output</p>
<h2 style="font-size: 10pt;">SYNOPSIS</h2>
<p style="margin-left: 2rem; margin-top: 1em;"><b>#include &lt;stdio.h&gt;</b></p>
<p style="margin-left: 2rem; margin-top: 1em;"><b>fread(ptr, sizeof(*ptr), nitems, stream) <small><br />
FILE</small> *stream;</b></p>
<p style="margin-left: 2rem; margin-top: 1em;"><b>fwrite(ptr, sizeof(*ptr), nitems, stream) <small><br />
FILE</small> *stream;</b></p>
<h2 style="font-size: 10pt;">DESCRIPTION</h2>
<p style="margin-left: 2rem; margin-top: 1em;"><b><i>Fread</i></b> reads, into a block beginning at <i>ptr, nitems</i> of data of the type of <i>*ptr</i> from the named input <i>stream</i>. It returns the number of items actually read.</p>
<p style="margin-left: 2rem; margin-top: 1em;"><i>Fwrite</i> appends at most <i>nitems</i> of data of the type of <i>*ptr</i> beginning at <i>ptr</i> to the named output <i>stream</i>. It returns the number of items actually written.</p>
<h2 style="font-size: 10pt;">SEE ALSO</h2>
<p style="margin-left: 2rem; margin-top: 1em;">read(2), write(2), fopen(3), getc(3), putc(3), gets(3), puts(3), printf(3), scanf(3)</p>
<h2 style="font-size: 10pt;">DIAGNOSTICS</h2>
<p style="margin-left: 2rem; margin-top: 1em;"><i>Fread</i> and <i>fwrite</i> return 0 upon end of file or error.</p>
</div>
<p>So there are the following edge cases that are interesting:</p>
<ul>
<li>In <code>fread</code>(): If <code>sizeof(*ptr)</code> is greater than the entire file, what happens?</li>
<li>If <code>sizeof(*ptr) * nitems</code> overflows, what happens?</li>
<li>Is the â€œnumber of items actually read/writtenâ€ guaranteed to be the number of items that <em>can</em> be read/written (until either EOF or I/O error)?</li>
<li>Is the â€œnumber of items actually writtenâ€ guaranteed to have written every item in its entirety?</li>
<li>What qualifies as error?</li>
</ul>
<h1>3. A Look at <code>fread</code>()</h1>
<p><em>Note</em>: All file paths for source code are relative to <code>/usr/src/libc/stdio/</code> unless noted otherwise. You can read along <a href="http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/libc">at the TUHS website</a>.</p>
<p><code>rdwr.c</code> implements <code>fread</code>(). <code>fread</code>() is simple enough; it&#8217;s just a nested loop. The outer loop runs <code>nitems</code> times. The outer loop sets the number of bytes to read (<code>sizeof(*ptr)</code>) and runs the inner loop. The inner loop calls <code>getc</code>() on the input <code>FILE *stream</code> and writes each byte to <code>*ptr</code> until either <code>getc</code>() returns a value less &lt;Â 0 or all bytes have been read.</p>
<p><code>/usr/include/stdio.h</code> implements <code>getc</code>(<code>FILE *p</code>) as a C preprocessor macro. If there is still data in the buffer, it returns the next character and advances the buffer by one. Interestingly, <code>*(p)-&gt;_ptr++&amp;0377</code> is used to return the character, despite <code>_ptr</code> being a <code>char *</code>. I&#8217;m not sure why that <code>&amp;0377</code> (<code>&amp;0xFF</code> is there. If there is no data in the buffer, it instead returns <code>_filbuf</code>(<code>p</code>).</p>
<p><code>filbuf.c</code> implements <code>_filbuf</code>(). This function is a lot more complex than the other ones until now. It begins with a check for the _IORW flag and, if set, sets the _IOREAD flag as well. It then checks if _IOREAD is <em>not</em> set or if _IOSTRG <em>is</em> set and returns EOF (defined as -1 in <code>stdio.h</code>) if so. These all seem rather inconsequential to me. I can&#8217;t make heads or tails of _IOSTRG, however, but it seems irrelevant; _IOSTRG is only ever set internally in sprintf and sscanf for temporary internal <code>FILE</code> objects. After those two flag checks, <code>_filbuf</code>() allocates a buffer into <code>iop-&lt;_base</code>, which seems to be the base pointer of the buffer. If flag _IONBF is set, which happens when <code>setbuf</code>() is used to switch to unbuffered I/O, a temporary, static buffer is used instead. Then <code>read</code>() is called, requesting either 1 bytes if unbuffered I/O is requested or <code>BUFSIZ</code> bytes. If <code>read</code>() returned 0, the <code>FILE</code> is flagged as end-of-file and EOF is returned by <code>_filbuf</code>(). If <code>read</code>() returned &lt;0, the <code>FILE</code> is flagged as error and EOF is returned by <code>_filbuf</code>(). Otherwise, the first character that has been read is returned by <code>_filbuf</code>() and the buffer pointer incremented by one.</p>
<p>According to <a href="https://man.openbsd.org/UNIX-7/read.2">its man page</a>, <code>read</code>() only returns 0 on end-of-file. It can also return -1 on â€œmany conditionsâ€, namely â€œphysical I/O errors, bad buffer address, preposterous <i>nbytes</i>, file descriptor not that of an input fileâ€</p>
<p>As an aside, <code>BUFSIZ</code> still exists today. ISO C11 Â§Â 7.21.2 no.Â 9 dictates that <code>BUFSIZ</code> must be at least 256. V7 defines it as 512 in <code>stdio.h</code>. One is inclined to note that on V7, a filesystem block was understood 512Â bytes length, so this was presumably chosen for efficient I/O buffering.</p>
<h1>4. A Look at <code>fwrite</code>()</h1>
<p><code>rdwr.c</code> also implements <code>fwrite</code>(). <code>fwrite</code>() is effectively the same as <code>fread</code>(), except the inner loop uses <code>putc</code>(). After every inner loop, a call to <code>ferror</code>() is made. If there was indeed an error, the outer loop is stopped.</p>
<p><code>/usr/include/stdio.h</code> implements <code>putc</code>(<code>int x</code>, <code>FILE *p</code>) as a C preprocessor macro. If there is still room in the buffer, the write happens into the buffer. Otherwise, <code>_flsbuf</code>() is called.</p>
<p><code>flsbuf.c</code> implements <code>_flsbuf</code>(<code>int c</code>, <code>FILE *iop</code>). This function, too, is more complex than the ones until now, but becomes more obvious after reading <code>_filbuf</code>(). It starts with a check if _IORW is set and if so, it&#8217;ll set _IOWRT and clear the EOF flag. Then it branches into two major branches: the _IONBF branch without buffering, which is a straight call to <code>write</code>(), and the other branch, which allocates a buffer if none exists already or otherwise calls <code>write</code>() if the buffer is full. If <code>write</code>() returned less than expected, the error flag is set and EOF returned. Otherwise, it returns the character that was written.</p>
<p>According to <a href="https://man.openbsd.org/UNIX-7/write.2">its man page</a>, <code>write</code>() returns the number of characters (bytes) actually written; a non-zero value â€œshould be regarded as an errorâ€. With only a cursory glance over the code, this appears to happen for similar reasons as <code>read</code>(), which is either physical I/O error or bad parameters.</p>
<h1>5. Conclusions</h1>
<p><strong>In <code>fread</code>(): If <code>sizeof(*ptr)</code> is greater than the entire file, what happens?</strong><br />
On this under-read, <code>fread</code>() will end up reading the entire file into the memory at <code>ptr</code> and still return 0. The I/O happens byte-wise via <code>getc</code>(), filling up the buffer until <code>getc</code>() returns EOF. However, it will not return EOF until a <code>read</code>() returns 0 on EOF or -1 on error. This result may be meaningful to the caller.</p>
<p><strong>If <code>sizeof(*ptr) * nitems</code> overflows, what happens?</strong><br />
No overflow can happen because there is no multiplication. Instead, two loops are used, which avoids the overflow issue entirely. (If there are strict filesystem constraints, however, it may be de-facto impossible to read enough bytes that <code>sizeof(*ptr) * nitems</code> overflows. And of course, there&#8217;s no way you could have enough RAM on a PDP-11 for the result to actually fit into memory.)</p>
<p><strong>Is the â€œnumber of items actually read/writtenâ€ guaranteed to be the number of items that <em>can</em> be read/written (until either EOF or I/O error)?</strong><br />
Partially: Both <code>fread</code>() and <code>fwrite</code>() short-circuit on error. This causes the number of items that have actually been read or written successfully to be returned. The only relevant error condition is filesystem I/O error. Due to the byte-wise I/O, it&#8217;s possible that there was a partial read or write for the last element, however. Therefore, it would be more accurate to say that the â€œnumber of items actually read/writtenâ€ is guaranteed to be the number of non-partial items that can be read/written. A short read or short write is an abnormal condition.</p>
<p><strong>Is the â€œnumber of items actually writtenâ€ guaranteed to have written every item in its entirety?</strong><br />
No, it isn&#8217;t. A partial write is possible. If a series of structs is written and then to be read out again, however, this is not a problem: <code>fread</code>() and <code>fwrite</code>() only return the count of <em>full</em> items read or written. Therefore, the partial write will not cause a partial read issue. If a set of bytes is written, this is an issue: There will be incomplete data â€“ possibly to be parsed by the program. It is therefore to preferable to write (and especially read) arrays of structs than to write and read arrays of bytes. (From a modern-day perspective, this is horrendous design because this means data files are not portable across platforms.)</p>
<p><strong>What qualifies as error?</strong><br />
Effectively, only a physical I/O error or a kernel bug. Short <code>fread</code>() or <code>fwrite</code>() return values are abnormal conditions. I&#8217;m not sure if there is the possibility that the process got a signal and the current <code>read</code>() or <code>write</code>() ends up writing nothing before the <code>EINTR</code>; this seems to be more of a modern-day problem than something V7 concerned itself.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2018/03/01/fread-and-fwrite-demystified-stdio-on-unix-v7/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Date and Time on UNIX V7</title>
		<link>https://virtuallyfun.com/2018/01/28/date-and-time-on-unix-v7/</link>
					<comments>https://virtuallyfun.com/2018/01/28/date-and-time-on-unix-v7/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Sun, 28 Jan 2018 01:01:38 +0000</pubDate>
				<category><![CDATA[2038]]></category>
		<category><![CDATA[AT&T Unix]]></category>
		<category><![CDATA[guest post]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[Y2k]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=8085</guid>

					<description><![CDATA[(This is a guest post by xorhash.) Introduction I&#8217;ve recently defeated one of my bigger inconveniences, broken DEL as backspace on the UNIXÂ®â€  operating system, Seventh Edition (commonly known as UNIX V7 or just V7). However, I&#8217;ve had another pet &#8230; <a href="https://virtuallyfun.com/2018/01/28/date-and-time-on-unix-v7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><em>(This is a guest post by <a href="https://twitter.com/xorhash">xorhash</a>.)</em></p>
<h1>Introduction</h1>
<p>I&#8217;ve recently defeated <a href="https://virtuallyfun.com/2018/01/17/teaching_an_almost_40-year_old_unix_about_backspace/">one of my bigger inconveniences, broken DEL as backspace</a> on the UNIXÂ®â€  operating system, Seventh Edition (commonly known as UNIX V7 or just V7). However, I&#8217;ve had another pet peeve for a while: How much manual labor is involved in booting the system. Reader DOS <a href="https://virtuallyfun.com/2018/01/17/teaching_an_almost_40-year_old_unix_about_backspace/comment-page-1/#comment-190861">found out</a> that SIMH recently added support for <code>SEND</code>/<code>EXPECT</code> pairs to react to output from the simulator. Think of them like UUCP chat scripts, effectively. This can be used to automate the bootup procedure.</p>
<p>Yet DOS&#8217;s script skips over a part of the bootup procedure that can be fully automated with some additional tooling. Namely, setting the date/time to the current time as defined by the host system. As per <a href="https://man.openbsd.org/UNIX-7/boot.8">boot(8)</a>, the operator is meant to set the date/time every time the system is brought up. This should be possible to automate, right?</p>
<h1>Setting the Date Automatically</h1>
<p>date(1) itself does not support setting years past 2000, so we need custom code in any case. SIMH, fortunately, also provides a way to get the current timestamp in the form of %UTIME%, which is interpreted in any argument to any command. I&#8217;ve thus written a utility called <strong>tsdate</strong> that takes a timestamp as argument and sets the current time to be that timestamp. I put the executable in <code>/etc/tsdate</code>, but there&#8217;s really no reason to do so other than not wanting to accidentally call it. Once tsdate is in place, changing <a href="https://virtuallyfun.com/2018/01/17/teaching_an_almost_40-year_old_unix_about_backspace/comment-page-1/#comment-190861">DOS&#8217;s script</a> slightly will already do the trick:</p>
<p><code>expect "\n\r# " send "/etc/tsdate %UTIME%\r\004"; c</code></p>
<p>This approach already has a minor amount of time drift ab initio, namely the difference between the actual time on the host system and the UNIX timestamp. In the worst case, this may be very close to 1. If for some reason you need higher accuracy than this, you&#8217;ll probably have a fairly hard time. I could imagine some kind of NTP-over-serial, but you&#8217;d need support for chat scripts to get past the authentication due to getty(8) spawning login(1).</p>
<p>The system is <em>not</em> suitable for usage past the year 2038. However, you can at least push it back until around 2100 by changing the internal representation of time to be an <code>unsigned long</code> instead of simply a <code>long</code>. <code>time_t</code> was not used systematically. Instead, everything assumed <code>long</code> as the type for times. This assumption is in a lot of places in userspace and even the man pages use <code>long</code> instead of <code>time_t</code>.</p>
<p>If you overflow tsdate&#8217;s timestamp, you&#8217;ll just get whatever happens when atol(3) overflows. There&#8217;s nothing in the standard library for parsing strings into <code>unsigned long</code> and the year 2038 is far enough away that I didn&#8217;t want to bother. stime(2) would presumably also need to be adjusted.</p>
<h1>Year 2000 Compatibility in the System</h1>
<p>V7 is surprisingly good at handling years past 2000. Most utilities can print years up to and including 2099 properly. Macros for nroff(1)/troff(1), however, are blissfully unaware that years past 1999 may exist. This causes man pages to be supposedly printed in the year 19118. The root cause for this is that the number register <code>yr</code> only holds the current year minus 1900. Patches to the <code>-ms</code> and <code>-man</code> macros are required. Similarly, refer(1) only considers years until 2000 to be actual years, though I did not bother patching that since it should only affect keyword matching.</p>
<p>Leap year handling is broken in two different places due to wrong <a href="https://en.wikipedia.org/wiki/Leap_year">leap year</a> handling: at(1) and the undocumented dysize() function, used by date(1) as well as inside <code>/usr/src/libc/gen/ctime.c</code> for various purposes. This affects the standard library, so recompiling the entire userland is recommended. Because the calculation is just a naÃ¯ve division by four, it actually works on the year 2000 itself. A year is a leap year, i.e. has February 29, if a year is:</p>
<ol>
<li>a multiple of 4, and</li>
<li>
<ol>
<li>not a multiple of 100, or</li>
<li>a multiple of 400.</li>
</ol>
</li>
</ol>
<p><a href="https://en.wikipedia.org/wiki/Leap_second">Leap seconds</a> are also not accounted for, but that comes to nobody&#8217;s surprise. Leap seconds just add a second 60 to the usual 00-59, so they don&#8217;t hurt doing date calculations on timestamps unless precisely on a leap second. For my purposes, they can be ignored.</p>
<p>Note that I haven&#8217;t gone through the system with a fine-toothed comb. There can always be more subtle time/date issues remaining in the system. For my purposes, this works well enough. If other things crop up, you&#8217;re welcome to put them in the comments for future generations.</p>
<h1>The Good Stuff</h1>
<p>There&#8217;s really not much to it. Applying diff and recompilation of the affected parts is left as an exercise for the reader.</p>
<p>Files:</p>
<ol>
<li><a href="https://virtuallyfun.com/xorhash/tsdate.c">tsdate.c</a></li>
<li><a href="https://virtuallyfun.com/xorhash/tsdate.1m">tsdate.1m</a></li>
<li><a href="https://virtuallyfun.com/xorhash/y2kpatches.diff">y2kpatches.diff</a></li>
</ol>
<p style="font-size: smaller;">â€ Â UNIX is a trademark of The Open Group.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2018/01/28/date-and-time-on-unix-v7/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>Teaching an Almost 40-year Old UNIX about Backspace</title>
		<link>https://virtuallyfun.com/2018/01/17/teaching_an_almost_40-year_old_unix_about_backspace/</link>
					<comments>https://virtuallyfun.com/2018/01/17/teaching_an_almost_40-year_old_unix_about_backspace/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Wed, 17 Jan 2018 03:00:34 +0000</pubDate>
				<category><![CDATA[AT&T Unix]]></category>
		<category><![CDATA[guest post]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[v7x86]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=8068</guid>

					<description><![CDATA[(This is a guest post by xorhash.) Introduction I have been messing with the UNIX®† operating system, Seventh Edition (commonly known as UNIX V7 or just V7) for a while now. V7 dates from 1979, so it&#8217;s about 40 years old &#8230; <a href="https://virtuallyfun.com/2018/01/17/teaching_an_almost_40-year_old_unix_about_backspace/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><em>(This is a guest post by <a href="https://twitter.com/xorhash">xorhash</a>.)</em></p>
<h1>Introduction</h1>
<p>I have been messing with the UNIX®† operating system, Seventh Edition (commonly known as UNIX V7 or just V7) for a while now. V7 dates from 1979, so it&#8217;s about 40 years old at this point. The <a href="https://virtuallyfun.com/2018/01/10/life-in-unix-v7-an-attempt-at-a-simple-task/" target="_blank" rel="noopener noreferrer">last post</a> was on V7/x86, but since I&#8217;ve run into <a href="https://news.ycombinator.com/item?id=16086730" target="_blank" rel="noopener noreferrer">various issues with it</a>, I moved on to a proper installation of V7 on SIMH. The Internet has some <a href="http://a.papnet.eu/UNIX/v7/Installation" target="_blank" rel="noopener noreferrer">really good resources on installing V7 in SIMH</a>. Thus, I set out on my own journey on installing and using V7 a while ago, but that was remarkably uneventful.</p>
<p>One convenience that I have been dearly missing since the switch from V7/x86 is a functioning backspace key. There seem to be multiple different definitions of backspace:</p>
<ol>
<li><code>BS</code>, as in ASCII character 8 (010, 0x08, also represented as <code>^H</code>), and</li>
<li><code>DEL</code>, as in ASCII character 127 (0177, 0x7F, also represented as <code>^?</code>).</li>
</ol>
<p>V7 does not accept either for input by default. Instead, <code>#</code> is used as the erase character and <code>@</code> is used as the kill character. These defaults have been there <a href="https://www.bell-labs.com/usr/dmr/www/man41.pdf" target="_blank" rel="noopener noreferrer">since UNIX V1</a>. In fact, they have been “there” since <a href="http://web.mit.edu/saltzer/www/publications/multics/bc-2-03.pdf" target="_blank" rel="noopener noreferrer">Multics</a>, where they got chosen seemingly arbitrarily. The erase character erases the character before it. The kill character kills (deletes) the whole line. For example, “<code>ba##gooo#d</code>” would be interpreted as “<code>good</code>” and “<code>bad line@good line</code>” would be interpreted as “<code>good line</code>”.</p>
<p>There is some debate on whether <code>BS</code> or <code>DEL</code> is the correct character for terminals to send when the user presses the backspace key. However, most programs have settled on <code>DEL</code> today. <code>tmux</code> forces <code>DEL</code>, even if the terminal emulator sends <code>BS</code>, so simply changing my terminal to send <code>BS</code> was not an option. The change from the defaults outlined here to today&#8217;s modern-day defaults occurred between 4.1BSD and 4.2BSD. enf on Hacker News has written <a href="https://news.ycombinator.com/item?id=16118351" target="_blank" rel="noopener noreferrer">a nice overview</a> of the various conventions.</p>
<h1>Changing the Defaults</h1>
<p>These defaults can be overridden, however. Any character can be set as erase or kill character using stty(1). It accepts the <a href="https://en.wikipedia.org/wiki/Caret_notation" target="_blank" rel="noopener noreferrer">caret notation</a>, so that <code>^U</code> stands for ctrl-u. Today&#8217;s defaults (and my goal) are:</p>
<p><!-- Holy shit I'm using a table, and not even for layouting! --></p>
<table>
<tbody>
<tr>
<th>Function</th>
<th>Character</th>
</tr>
<tr>
<td>erase</td>
<td><code>DEL</code> (<code>^?</code>)</td>
</tr>
<tr>
<td>kill</td>
<td><code>^U</code></td>
</tr>
</tbody>
</table>
<p>I wanted to change the defaults. Fortunately, stty(1) allows changing them. The caret notation represents ctrl as <code>^</code>. The effect of holding ctrl and typing a character is bitwise-ANDing it with 037 (0x1F) as implemented in <code>/usr/src/cmd/stty.c</code> and mentioned in the stty(1) man page, so the notation as understood by stty(1) for <code>^?</code> is broken for <code>DEL</code>: ASCII <code>?</code> bitwise-AND 037 is <code>US</code> (unit separator), so <code>^?</code> requires special handling. stty(1) in V7 does not know about this special case. Because of this, a separate program – or a change to stty(1) – is required to call stty(2) and change the erase character to <code>DEL</code>. Changing the kill character was easy enough, however:</p>
<pre>$ stty kill '^U'</pre>
<p>So I wrote that program and found out that <code>DEL</code> still didn&#8217;t work as expected, though <code>^U</code> did. <code>#</code> stopped working as erase character, so something certainly did change. This is because in V7, <code>DEL</code> is the interrupt character. Today, the interrupt character is <code>^C</code>.</p>
<p>Clearly, I needed to change the interrupt character. But how? Given that stty(1) nor the underlying syscall stty(2) seemed to let me change it, I looked at the code for tty(4) in <code>/usr/sys/dev/tty.c</code> and <code>/usr/sys/h/tty.h</code>. And in the header file, lo and behold:</p>
<pre>#define	CERASE	'#'		/* default special characters */
#define	CEOT	004
#define	CKILL	'@'
#define	CQUIT	034		/* FS, cntl shift L */
#define	CINTR	0177		/* DEL */
#define	CSTOP	023		/* Stop output: ctl-s */
#define	CSTART	021		/* Start output: ctl-q */
#define	CBRK	0377
</pre>
<p>I assumed just changing these defaults would fix the defaults system-wide, which I found preferable to a solution in <code>.profile</code> anyway. Changed the header, one cycle of <code>make all</code>, <code>make unix</code>, <code>cp unix /unix</code> and a reboot later, the system exhibited the same behavior. No change to the default erase, kill or interrupt characters. I double-checked <code>/usr/sys/dev/tty.c</code>, and it indeed copied the characters from the header. Something, somewhere must be overwriting my new defaults.</p>
<p>Studying the man pages in <a href="https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/v7vol1.pdf" target="_blank" rel="noopener noreferrer">vol. 1 of the manual</a>, I found that on multi-user boot <code>init</code> calls <code>/etc/rc</code>, then calls getty(8), which then calls login(1), which ultimately spawns the shell. <code>/etc/rc</code> didn&#8217;t do anything interesting related to the console or ttys, so the culprit must be either getty(8) or login(1). As it turns out, both of them are the culprits!</p>
<p>getty(8) changes the erase character to <code>#</code>, the kill character to <code>@</code> and the <code>struct tchars</code> to <code>{ '\177', '\034', '\021', '\023', '\004', '\377' }</code>. At this point, I realized that:</p>
<ol>
<li>there&#8217;s a <code>struct tchars</code>,</li>
<li>it can be changed from userland.</li>
</ol>
<p>The first member of <code>struct tchars</code> is <code>char t_intrc</code>, the interrupt character. So I could&#8217;ve had a much easier solution by writing some code to change the <code>struct tchars</code>, if only I&#8217;d actually read the manual. I&#8217;m too far in to just settle with a <code>.profile</code> solution and a custom executable, though. Besides, I still couldn&#8217;t actually fix my typos at the login prompt unless I make a broader change. I&#8217;d have noticed the first point if only I&#8217;d actually read the man page for tty(4). Oops.</p>
<p>login(1) changes the erase character to <code>#</code> and the kill character to <code>@</code>. At least the shell leaves them alone. Seriously, three places to set these defaults is crazy.</p>
<h1>Fixing the Characters</h1>
<p>The plan was simple, namely, perform the following substitution:</p>
<table>
<tbody>
<tr>
<th>Function</th>
<th>Old Character</th>
<th>Old Character<br />
ASCII (Octal)</th>
<th>New Character</th>
<th>New Character<br />
ASCII (Octal)</th>
</tr>
<tr>
<td>erase</td>
<td><code>#</code></td>
<td>043</td>
<td><code>DEL</code></td>
<td>0177</td>
</tr>
<tr>
<td>kill</td>
<td><code>@</code></td>
<td>0100</td>
<td><code>^U</code></td>
<td>025</td>
</tr>
<tr>
<td>interrupt</td>
<td><code>DEL</code></td>
<td>0177</td>
<td><code>^C</code></td>
<td>003</td>
</tr>
</tbody>
</table>
<p>So, I changed the characters in tty(4), getty(8) and login(1). It worked! <em>Almost.</em> Now <code>DEL</code> did indeed erase. However, there was no feedback for it. When I typed <code>DEL</code>, the cursor would stay where it is.</p>
<p>Pondering the code for tty(4) again, I found that there is a variable called <code>partab</code>, which determines delays and what kind of special handling to apply if any. In particular, <code>BS</code> has an entry whose handler looks like this:</p>
<pre>	/* backspace */
	case 2:
		if (*colp)
			(*colp)--;
		break;
</pre>
<p>Naïve as I was, I just changed the entry for <code>DEL</code> from “non-printing” to “backspace”, hoping that would help. Another recompilation cycle and reboot later, nothing changed. <code>DEL</code> still only silently erased. So I changed the handler for another character, recompiled, rebooted. Nothing changed. Again. At that point, I noticed something else must have been up.</p>
<p>I found out that the tty is in so-called <code>echo</code> mode. That means that all characters typed get echoed back to the tty. It just so happens that the representation of <code>DEL</code> is actually none at all. Thus it only looked like nothing changed, while the character was actually properly echoed back. However, when temporarily changing the erase character to <code>BS</code> (<code>^H</code>) and typing <code>^H</code> manually, I would get the erase effect and the cursor moved back by one character on screen. When changing the erase character to something else like <code>#</code> and typing <code>^H</code> manually, I would get no erasure, but the cursor moved back by one character on screen anyway. I now properly got the separation of character effect and representation on screen. Because of this unprintable-ness of <code>DEL</code>, I needed to add a special case for it in <code>ttyoutput()</code>:</p>
<pre>	if (c==0177) {
		ttyoutput(010, tp);
		ttyoutput(' ', tp);
		ttyoutput(010, tp);
		return;
	}
</pre>
<p>What this does is first send a <code>BS</code> to move the cursor back by one, then send a space to rub out the previous character on screen and then send another <code>BS</code> to get to the previous cursor position. Fortunately, my terminal lives in a world where doing this is instantaneous.</p>
<h1>Getting the Diff</h1>
<p>For future generations as well as myself when I inevitably majorly break this installation of V7, I wanted to make a diff. However, my V7 is installed in SIMH. I am not a very intelligent man, I didn&#8217;t keep backup copies of the files I&#8217;d changed. Getting data out of this emulated machine is an exercise in frustration.</p>
<p>Transmission over ethernet is out by virtue of there being no ethernet in V7. I could simulate a tape drive and write a tar file to it, but neither did I find any tools to convert from simulated tape drive to raw data, nor did I feel like writing my own. I could simulate a line printer, but neither did V7 ship with the LP11 driver (apparently by mistake), nor did I feel like copy/pasting a long lpr program in – a simple cat(1) to <code>/dev/lp</code> would just generate fairly garbled output. I could simulate another hard drive, but even if I format it, nothing could read the ancient file system anyway, except maybe <a href="http://netbsd.gw.com/cgi-bin/man-cgi?mount_v7fs++NetBSD-current" target="_blank" rel="noopener noreferrer">mount_v7fs(8) on NetBSD</a>. Though setting up NetBSD for the sole purpose of mounting another virtual machine&#8217;s hard drive sounds silly enough that I might do it in the future.</p>
<p>While V7 does ship with uucp(1), it requires a device to communicate through. It seems that communication over a tty is possible V7-side, but in my case, quite difficult. I use the version of SIMH as packaged on Debian because I&#8217;m a lazy person. For some reason, the DZ11 terminal emulator was removed from that package. The DUP11 bit synchronous interface, which I hope is the same as the DU-11 mentioned <code>/usr/sys/du.c</code>, was not part of SIMH at the time of packaging. V7 only speaks the <code>g</code> protocol (see <code>Ptbl</code> in <code>/usr/src/cmd/uucp/cntrl.c</code>), which requires the connection to be 8-bit clean. Even if the simulator for a DZ11 were packaged, it would most likely be unsuitable because telnet isn&#8217;t 8-bit clean by default and I&#8217;m not sure if the DZ11 driver can negotiate 8-bit clean Telnet. That aside, I&#8217;m not sure if Taylor UUCP for Linux would be able to handle “impure” TCP communications over the simulated interface, rather than a direct connection to another instance of Taylor UUCP. Then there is the issue of general compatibility between the two systems. As <a href="https://virtuallyfun.com/2018/01/10/life-in-unix-v7-an-attempt-at-a-simple-task/#comment-190677" target="_blank" rel="noopener noreferrer">reader DOS pointed out</a>, there seem to be quite some difficulties. Those difficulties were experienced on V7/x86, however. I&#8217;m not ruling out that the issues encountered are specific to V7/x86. In any case, UUCP is an adventure for another time. I expect it&#8217;ll be such a mess that it&#8217;ll deserve its own post.</p>
<p>In the end, I printed everything on screen using cat(1) and copied that out. Then I performed a manual diff against the original source code tree because tabs got converted to spaces in the process. Then I applied the changes to clean copies that did have the tabs. And finally, I actually invoked diff(1).</p>
<h1>Closing Thoughts</h1>
<p>Figuring all this out took me a few days. Penetrating how the system is put together was surprisingly fairly hard at first, but then the difficulty curve eased up. It was an interesting exercise in some kind of “reverse engineering” and I definitely learned something about tty handling. I was, however, <em>not</em> pleased with using ed(1), even if I do know the basics. vi(1) is a blessing that I did not appreciate enough until recently. Had I also been unable to access recursive grep(1) on my host and scroll through the code, I would&#8217;ve probably given up. Writing UNIX under those kinds of editing conditions is an amazing feat. I have nothing but the greatest respect for software developers of those days.</p>
<p>Here&#8217;s the diff, but V7 predates patch(1), so you&#8217;ll be stuck manually applying it: <a href="http://vpsland.superglobalmegacorp.com/backspace.diff">backspace.diff</a></p>
<p style="font-size: smaller;">† UNIX is a trademark of The Open Group.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2018/01/17/teaching_an_almost_40-year_old_unix_about_backspace/feed/</wfw:commentRss>
			<slash:comments>20</slash:comments>
		
		
			</item>
		<item>
		<title>learn: Ancient troff sources vs. modern-day groff</title>
		<link>https://virtuallyfun.com/2017/12/22/learn-ancient-troff-sources-vs-modern-day-groff/</link>
					<comments>https://virtuallyfun.com/2017/12/22/learn-ancient-troff-sources-vs-modern-day-groff/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Thu, 21 Dec 2017 18:23:51 +0000</pubDate>
				<category><![CDATA[AT&T Unix]]></category>
		<category><![CDATA[guest post]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=7964</guid>

					<description><![CDATA[(This is a guest post by xorhash.) Introduction I&#8217;ve been on a trip on the memory lane lately, digging around old manuals of UNIXÂ® operating system before BSD.â€  In doing so, I&#8217;ve come across the sources for the 7th Edition &#8230; <a href="https://virtuallyfun.com/2017/12/22/learn-ancient-troff-sources-vs-modern-day-groff/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><em>(This is a guest post by <a href="https://twitter.com/xorhash">xorhash</a>.)</em></p>
<h1>Introduction</h1>
<p>I&#8217;ve been on a trip on the memory lane lately, digging around old manuals of <em>UNIX</em>Â® operating system before BSD.â€  In doing so, I&#8217;ve come across the <a href="https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/index.html">sources for the 7th Edition manuals</a>. I wanted to show one part of volume 2A to other people, but didn&#8217;t want to make them download the entire 336 pages of volume 2A for the part in question. The part I wanted to extract was â€œLEARN â€” Computer-Aided Instruction on UNIXâ€, starting at p. 107 in the <a href="https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/v7vol2a.pdf"> volume 2A PDF file</a>).</p>
<p>A normal person would, I presume, try to split the PDF file. That is straightforward and produces the expected results. I believe I needn&#8217;t state that you wouldn&#8217;t be reading this if I solved this problem like any sane person would. Instead, I opted to rebuild the PDF from the troff sources provided at the link above.</p>
<p>I am not a very clever man, and thus I <em>completely</em> disregarded the <a href="https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/bswv7.html"> generation procedure that was already spelled out</a>. However, it wasn&#8217;t exactly specific anyway, so I didn&#8217;t miss out on much.</p>
<h1>Getting the sources</h1>
<p>So I knew what I needed to do: Get the troff sources. I asked that the Heavens have mercy on my poor soul if this requires a lot of adjustment for 2017 text processing tools. However, a man must do what a man must do. The file in question was called â€œ<a href="https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/vol2/learn.bun.txt">vol2/learn.bun</a>â€. I had no idea what a bun file is, hoped it wasn&#8217;t related to steamed buns and clicked it. As it turns out, it&#8217;s just what we would call a <a href="https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/vol2/learn.bun.txt">self-extracting archive</a> today. The shell commands are not very weird, so the extraction process actually worked out just fine. Now I had files â€œ<code>p0</code>â€ through â€œ<code>p7</code>â€. Except what happened to â€œ<code>p1</code>â€, the world will never know.</p>
<h1>First Steps</h1>
<p>I&#8217;ve dabbled in man pages before, but that was mostly <a href="http://mandoc.bsd.lv/">mandoc</a>, not actual troff.<br />
Accordingly, the first attempt at getting something going was as naive as it could get:<br />
<code>$ groff -Tpdf p* | zathura -</code><br />
It led to, shall we say, varying results.<br />
<!-- TODO --></p>
<p><div id="attachment_7965" style="width: 810px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7965" class="size-full wp-image-7965" src="https://virtuallyfun.com/wp-content/uploads/2017/12/learn1.png" alt="" width="800" height="615" /><p id="caption-attachment-7965" class="wp-caption-text">really butchered rendering attempt</p></div></p>
<p>Clearly, I was doing something very fundamentally wrong. Conveniently, volume 2A also had a lot of troff documentation. Apparently I was supposed to pass <code>-ms</code> and first run tbl(1) over the troff source before actually giving it to groff. That sounded like a good idea, but the results were still somewhat off:<br />
<!-- TODO --></p>
<p><div id="attachment_7966" style="width: 810px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7966" class="size-full wp-image-7966" src="https://virtuallyfun.com/wp-content/uploads/2017/12/learn2.png" alt="" width="800" height="724" /><p id="caption-attachment-7966" class="wp-caption-text">not very butchered rendering attempt</p></div></p>
<p>Allow me to express my doubts that this text was written in 2017. If you compare the output with the known-good PDF, you&#8217;ll also notice that, somehow, â€œBellÂ Laboratories, MurrayÂ Hill, NewÂ JerseyÂ 07974â€ turned into â€œCAIâ€. Unfortunate.</p>
<h1>Back to Square One and Pick Up the Breadcrumbs</h1>
<p>Continuing to read the page I got the <code>learn.bun</code> from, I also spied a section called â€œMacros and Referencesâ€. That sounds relevant to my interests. <code>tmac.s</code>, which after studying groff(1) seems to be what would get used with <code>-ms</code> references some files in <code>/usr/lib/tmac</code>. I was not in the mood to let this flood over into my system, so I had to make minor adjustments and turn it into relative paths. I also renamed <code>tmac.s</code> to <code>tmac.os</code> to avoid colliding with the one provided by groff, making the new invocation:</p>
<p><code>$ tbl p* | groff -M./macros -mos -Tpdf | zathura -</code></p>
<p>Now we&#8217;re getting somewhere:</p>
<p><div id="attachment_7967" style="width: 810px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7967" class="size-full wp-image-7967" src="https://virtuallyfun.com/wp-content/uploads/2017/12/learn3.png" alt="" width="800" height="735" /><p id="caption-attachment-7967" class="wp-caption-text">almost not butchered rendering attempt</p></div></p>
<p>It&#8217;s better than the previous attempts. But there are also some warnings and problems that need cleaning up:</p>
<ol>
<li>There&#8217;s a note that Bell Laboratories holds the <em>UNIX</em>Â®<br />
trademark, which is no longer true.â€ </li>
<li>Now, this most <em>certainly</em> was not written in DecemberÂ 21,<br />
19117, either.</li>
<li><code>tmac.os:806: warning: numeric expression expected (got `\')</code></li>
<li>Every time the <code>.UX</code> macro was requested, I got:<br />
<code>warning: macro `ev1' not defined (possibly missing space after `ev')<br />
environment stack underflow</code></li>
</ol>
<p>Point 1 was easy to address, it&#8217;s a simple text change. Point 2 was caused by spurious dots in front of a call to <code>.ND</code>. However, the actual volume 2A PDF said a different date than in the file, so I adjusted that to match (June 18, 1976 to January 30, 1979).</p>
<h1>And Down the Slippery Slope</h1>
<p>As for points 3 and 4&#8230; Let&#8217;s just say groff/troff macros are definitely not meant to be written or read by humans and it&#8217;s a feat comparable to magic that someone wrote this set of troff macros. Line 806 is <code>.ch FO \\n(YYu</code>. Supposedly, that <a href="https://www.gnu.org/software/groff/manual/html_node/Page-Location-Traps.html#Page-Location-Traps">changes the location of a page trap</a> when the given macro is invoked. The second argument is meant to be a distance, which explains why groff is complaining. I tried to checked what groff does and left none the wiser. FO seems related to the page footer, I seemed to get away with just deleting that line, though.</p>
<p>Finally, point 4. Apparently, <code>.ev1</code> was used multiple times in theÂ <code>tmac.os</code>. <a href="https://www.gnu.org/software/groff/manual/html_node/Environments.html#Environments">This looked like it should&#8217;ve been <code>.ev 1</code> instead</a>. Changing those, lo and behold, <code>.UX</code> stopped behaving funky for the most part. Yet for some reason, I&#8217;d still get multiple footnotes about the trademark ownership of the <em>UNIX</em>Â® trademark.â€ Â <code>tmac.os</code> sets a troff register (<code>GA</code>) when the <code>.UX</code> macro is first encountered so that the footnote is only made once. The footnote is being made twice. Something does not add up here.<code>.AI</code> (author&#8217;s institution) resets <code>GA</code>, but the firstÂ <code>.UX</code> comes <em>after</em> <code>.AI</code>, so that&#8217;s not the problem. Removing the <code>.AB</code>/<code>.AE</code> macros from page 1 caused only one footnote to be made. Thus, I infer it&#8217;s actually <em>intended</em> behavior that the footnote is made once for the abstract and once for the main body. Checking with the volume 2A PDF again, I realized that point 4 was, in fact, fixed just by the <code>ev1</code> changes and I was just chasing a bug that does not exist. I really should&#8217;ve checked the PDF twice.</p>
<p>The abstract finally looks okay.</p>
<p><div id="attachment_7968" style="width: 810px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7968" class="size-full wp-image-7968" src="https://virtuallyfun.com/wp-content/uploads/2017/12/learn4.png" alt="" width="800" height="706" /><p id="caption-attachment-7968" class="wp-caption-text">good rendering attempt</p></div></p>
<h1>Done! Wait, No, Almost</h1>
<p>Okay, we&#8217;re done, we can go home, right? Almost, one last thing to do: On the last page, there&#8217;s something really important missing: the bibliography. Instead, there&#8217;s just â€œ$LIST$â€ there. We can&#8217;t just turn Brian W.Â Kernighan and Michael E.Â Lesk into plagiarists!</p>
<p>Back to the troff documentation in volume 2A, there&#8217;s a match for â€œ$LIST$â€ on p. 183. Apparently I need a reference file and preprocess the file with refer(1). That sounds simple enough. Fortunately, I got the reference file along with the macros above, so I didn&#8217;t have to look for that separately.</p>
<p><code>$ refer -pRv7man -e p* | tbl | groff -M./macros -mos -Tpdf | zathura -</code></p>
<p><div id="attachment_7969" style="width: 810px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7969" class="size-full wp-image-7969" src="https://virtuallyfun.com/wp-content/uploads/2017/12/learn5.png" alt="" width="800" height="316" /><p id="caption-attachment-7969" class="wp-caption-text">half of the references are blank</p></div></p>
<p>Of course. Why would it work? That&#8217;d have been too much to ask for.<br />
At least I get some nice hints:</p>
<p><code>refer:p2:148: no matches for `skinner teaching 1961'<br />
refer:p3:114: no matches for `kernighan editor tutorial 1974'</code></p>
<p>The troff documentation conveniently explains the format for the reference file, so I could just add these two entries to <code>Rv7man</code> and be done with it. Thankfully, the pre-compiled PDF of the volume 2A manual had the information necessary to compile the bibliography entries with.</p>
<pre>%T Why We Need Teaching Machines
%A B. F. Skinner
%J Harvard Educational Review
%V 31
%P 377-398
%D 1961

%T A Tutorial Introduction to the Unix Editor ed
%A B. W. Kernighan
%D 1974
</pre>
<p><div id="attachment_7970" style="width: 810px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7970" class="size-full wp-image-7970" src="https://virtuallyfun.com/wp-content/uploads/2017/12/learn6.png" alt="" width="800" height="371" /><p id="caption-attachment-7970" class="wp-caption-text">now that&#8217;s what I call a bibliography</p></div></p>
<p>And of course, here isÂ <a href="https://virtuallyfun.com/wp-content/uploads/2017/12/LEARN-Computer-Aided_Instruction_on_UNIX.pdf">the product of this whole ordeal</a>.</p>
<h1>Closing Remarks</h1>
<p>The Heavens were feeling somewhat merciful, but only just enough that I could waste no more than a day on this project. They really wanted me to spend that day on it, though.</p>
<p>On a side note, â€œ<a href="https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/bswv7.html">the missing learn references</a>â€ aren&#8217;t available from the link that was<br />
provided.Â <a href="http://cm.bell-labs.com/cm/cs/who/bwk/learn.tar.gz">http://cm.bell-labs.com/cm/cs/who/bwk/learn.tar.gzÂ </a>is now down, though the web archive still has it. Needless to say, I didn&#8217;t read that.</p>
<p>I will never, ever touch troff/groff again. mandoc is good at what it does and I&#8217;ll stick to mandoc for writing man pages. But if I ever need to get something typeset nicely from plain text?</p>
<p>LaTeX is the answer.<br />
Not troff.<br />
Never troff.<br />
Not even once.</p>
<p>â€ <em>UNIX</em>Â® is a registered trademark of The Open Group.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2017/12/22/learn-ancient-troff-sources-vs-modern-day-groff/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
		<item>
		<title>AT&#038;T 3B2 400 emulated</title>
		<link>https://virtuallyfun.com/2017/11/24/att-3b2-400-emulated/</link>
					<comments>https://virtuallyfun.com/2017/11/24/att-3b2-400-emulated/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 24 Nov 2017 08:43:21 +0000</pubDate>
				<category><![CDATA[AT&T Unix]]></category>
		<category><![CDATA[SIMH]]></category>
		<category><![CDATA[SYSV]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=7803</guid>

					<description><![CDATA[This is super awesome! AT&#038;T 3B2 SYSTEM CONFIGURATION: Memory size: 4 Megabytes System Peripherals: Device Name Subdevices Extended Subdevices SBD Floppy Disk 72 Megabyte Disk Welcome! This machine has to be set up by you. When you see the "login" &#8230; <a href="https://virtuallyfun.com/2017/11/24/att-3b2-400-emulated/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>This is super awesome!</p>
<pre>AT&T 3B2 SYSTEM CONFIGURATION:

Memory size: 4 Megabytes
System Peripherals:

        Device Name        Subdevices           Extended Subdevices

        SBD
                        Floppy Disk
                        72 Megabyte Disk

        Welcome!
This machine has to be set up by you.  When you see the "login" message type
                                setup
followed by the RETURN key.  This will start a procedure that leads you through
those things that should be done the "first time" the machine is used.

The system is ready.

Console Login:
</pre>
<p>Back in the 1980&#8217;s AT&amp;T shifted UNIX from being an internal research project that got somewhat popular in college spaces (and larger companies, General Motors was an early UNIX adapter, along with companies like Industrial Light and Magic).Â  Quickly after the <a href="https://en.wikipedia.org/wiki/AT%26T_Computer_Systems">divestiture of 1984</a>, AT&amp;T entered the commercial space with it&#8217;s own custom machines &amp; their home made UNIX operating system.Â  Below is one of the <a href="https://books.google.com.hk/books?id=mF8EAAAAMBAJ&amp;lpg=PA34&amp;dq=AT%26T%203B2&amp;pg=PA34#v=onepage&amp;q=AT&amp;T%203B2&amp;f=false">ads they ran in 1984</a>, touting their so called &#8216;super microcomputers&#8217;, featuring the 3B2, the 3B5, and the AT&amp;T Personal Computer.</p>
<p><div id="attachment_7805" style="width: 594px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2017/11/att-new-computers.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7805" class="size-large wp-image-7805" src="https://virtuallyfun.com/wp-content/uploads/2017/11/att-new-computers-1024x686.jpg" alt="" width="584" height="391" /></a><p id="caption-attachment-7805" class="wp-caption-text">Thew new computers from AT&amp;T</p></div></p>
<p>And indeed for many a government institute bewildered by the dozens of UNIX vendors, standards, and chaos of different platforms and processors many were all to happy to buy AT&amp;T UNIX on AT&amp;T machines.</p>
<p>And indeed this was my first experience with genuine SYSV Unix.</p>
<p>And I hated it.</p>
<p>Initially I had been thrown at an English computer lab because I knew how logon and do my work in <a href="https://virtuallyfun.com/2016/05/29/style-diction/">style &amp; diction</a>, they decided I could help.Â  The system was aging and had major problems, as some prior students had figured out enough of the link kit that they would put their own attempts at re-writing portions of the kernel into the system, and it&#8217;d break.Â  Naturally the original installation diskettes were lost, and the best that could be done was basically shut it down throughout the day and run the disk repair utilities.Â  It was not a fun job.</p>
<p>Later on the 3B2&#8217;s were thrown into the &#8216;common garbage&#8217; aka free kit for other departments, and the 3B2&#8217;s re-appeared at the next place I was volunteering at on campus.Â  However in addition to the two machines, there was a few other boxes of manuals, and oddly enough the installation diskettes.Â  And also about a dozen of these AT&amp;T ISA Starlan adapters.Â  These weren&#8217;t the ones that were basically Ethernet (Starlan10) but rather the original ones.</p>
<p>Through some incredible luck we did find an NDIS 3 MS-DOS driver for the Starlan car, and we were able to cobble together a Starlan1 LAN consisting of a 3B2 that we cannibalized the RAM and disks from one of them to make a &#8216;super&#8217; 3B2, with added TCP/IP software and a massively cut down port I did of samba to turn it into a tiny file &amp; print server (72MB MFM disks were it&#8217;s biggest if I recall), along with Windows 95 clients.Â  And of course with a TCP/IP lan we could easily load a proxy server (WinGate?) on one machine with the 56kb modem, and now we all had internet access.Â  I know it&#8217;s sad today, but trust me back then it was &#8220;a big deal&#8221; that we had a fully functional LAN.</p>
<p>Over on <a href="https://loomcom.com/">loomcom.com</a> there is an incredible amount of information about the reverse engineeredÂ <a href="https://loomcom.com/3b2/">WE32100, along with the 3B2 hardware</a>, and of course information about the newest <a href="https://loomcom.com/3b2/emulator/">SIMH simulator the 3B2/400</a>!</p>
<p>Instructions and disk images on the site made it incredibly easy to grab the latest <a href="https://github.com/simh/Win32-Development-Binaries">SIMH Windows Development binaries</a>, and get my own virtual 3B2 up and running in minutes! So naturally I pasted in <a href="http://vpsland.superglobalmegacorp.com/install/dhrystone.c">dhrystone.c</a> to see if it&#8217;d work.Â  And that was the first weird issue is that the backspace is the pound # key.Â  So all the C macro definitions lost their # sign.Â  I added them in vi without full terminal support because I&#8217;m crazy and:</p>
<pre># uname -a
unix unix 3.2 2 3B2
# ./dhrystone
Dhrystone(1.0) time for 500000 passes = 40
This machine benchmarks at 12500 dhrystones/second
</pre>
<p>Obviously this is 100% bogus, as the real machine should get around 735, and I didn&#8217;t even bother with the -O flag.</p>
<p>The current emulator doesn&#8217;t do any additional serial ports, nor any Ethernet adapters.Â  So you only get a console.Â  But with the pre-installed C compiler image, I was able to build a trivial file just fine.Â  Although pasting on the console really leaves a lot to be desired.</p>
<p><div id="attachment_7806" style="width: 650px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2017/11/IMG_0280.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7806" class="size-full wp-image-7806" src="https://virtuallyfun.com/wp-content/uploads/2017/11/IMG_0280.jpg" alt="" width="640" height="480" /></a><p id="caption-attachment-7806" class="wp-caption-text">SDF AT&amp;T 3B2/500 UNIX System</p></div></p>
<p>I know for some of us old people the 3B2 hid in the corners of our call centres, running our AT&amp;T Definity switches, our voicemail, and <a href="https://sdf.org/?tour/museum/index">even some of our early ISPs</a>.Â  After funneling money into SUN to get them to work on SYSVr4 which was the grand unification of BSD + SYSV AT&amp;T&#8217;s interest if UNIX quickly waned, and they divested themselves of UNIX, and eventually all PC hardware, although they did re-enter the PC space a few times before exiting yet again.</p>
<p>As time would tell, proprietary hardware + a previously &#8216;open&#8217; operating system were not the winning combination.Â  And so far the only UNIX vendor to weather the Linux storm so far is IBM with it&#8217;s A/IX.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2017/11/24/att-3b2-400-emulated/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
			</item>
		<item>
		<title>AMIX</title>
		<link>https://virtuallyfun.com/2013/01/13/amix/</link>
					<comments>https://virtuallyfun.com/2013/01/13/amix/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Sun, 13 Jan 2013 23:54:26 +0000</pubDate>
				<category><![CDATA[68000]]></category>
		<category><![CDATA[68030]]></category>
		<category><![CDATA[Amiga]]></category>
		<category><![CDATA[AT&T Unix]]></category>
		<category><![CDATA[SUN]]></category>
		<category><![CDATA[SYSV]]></category>
		<category><![CDATA[UAE]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=2756</guid>

					<description><![CDATA[Back in 1990 Commodore took the Amiga in a new direction with it&#8217;s new Amiga 3000, by commissioning a port of A&#38;T SYSV Unix to the Amiga. Taking advantage of the 3000&#8217;s 68030 CPU and 68881 Math coprocessor, along with &#8230; <a href="https://virtuallyfun.com/2013/01/13/amix/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><div id="attachment_2758" style="width: 239px" class="wp-caption alignleft"><a href="https://virtuallyfun.com/2013/01/13/amix/pub-amiga3000ux-svr4/" rel="attachment wp-att-2758"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2758" class="size-medium wp-image-2758" src="https://virtuallyfun.com/wp-content/uploads/2013/01/pub-amiga3000ux-svr4-229x300.jpg" alt="AMIX Ad" width="229" height="300" /></a><p id="caption-attachment-2758" class="wp-caption-text">AMIX Ad</p></div></p>
<p>Back in 1990 Commodore took the Amiga in a new direction with it&#8217;s new Amiga 3000, by commissioning a port of A&amp;T SYSV Unix to the Amiga. Taking advantage of the 3000&#8217;s 68030 CPU and 68881 Math coprocessor, along with its integrated SCSI controller. It certainly was the hallmark of typical UNIX machines of the time.</p>
<p>When originally announced there was some big interest in the platform by SUN, as their original SUN-1, SUN-2 &amp; SUN-3 lines of workstations were all 68000 based machines, and being able to rebrand a mass produced Commodore model would have been a good thing, however the dealÂ ultimatelyÂ fell through. Â The machine would have been the <a href="http://www.bigbookofamigahardware.com/bboah/product.aspx?id=29">Amiga 3500</a>, which later became the <a href="http://www.bigbookofamigahardware.com/bboah/product.aspx?id=25">Amiga 3000T</a>.</p>
<p>Another thing to keep in mind is that SUN&#8217;s SYSV (Solaris) was targeted to the SPARC processor, and it is unlikely that they wouldÂ benefitÂ from selling a 68030 based machine in 1991.</p>
<p>Typical of the time, AMIX installs from a set of boot floppies, and then pulls the rest of the installation from a tape drive, such as the <a href="http://www.bigbookofamigahardware.com/bboah/product.aspx?id=1296">A3070</a>.</p>
<p>AMIX was released at a time when the UNIX world was rapidly moving to RISC processors, SUN had their SPARC, SGI had their MIPS, IBM and their POWER, Motorola built UNIX machines around their 88000 RISC processor, NeXT was also going to move to the 88000 until they gave up making their own hardware and shifted to a software company. Â So who would want a then dated 68030 based machine when the industry had made their first steps into the world of RISC computing.</p>
<p>So how does it measure up? Â Well it is SYSV, and if you&#8217;ve seen one, well honestly you&#8217;ve seen them all. Â What is kind of neat is that AMIX includes <a href="http://en.wikipedia.org/wiki/OPEN_LOOK">OpenLook</a>Â and a C compiler, which is kind of a rarity for the period.</p>
<p>Another flaw was that when the 68040 processor was released it&#8217;s MMU was incompatible with the 68030, and the VM subsystem for any UNIX would have to be rewritten. Â While NetBSD can run on both the 68030 and 68040, AMIX never was updated, and so it can only run on 68030 based machines.</p>
<p>AMIX never did get any critical traction, and slipped into oblivion with the death of Commodore.</p>
<p>Up until recently it was impossible to run AMIX in any emulator, but there has been a lot of work on the <a href="http://aranym.org/">ARANYM</a>Â and <a href="http://previous.alternative-system.com/">Pervious</a> emulators which included doing 68030 MMU support for theÂ possibilityÂ of running early versions of NeXTSTEP. Toni Wilen was able to adapt their work onto <a href="http://eab.abime.net/showthread.php?t=67366">WinUAE</a> and it is not possible to run AMIX.!</p>
<p>Reading through <a href="http://eab.abime.net/showthread.php?t=67210">this thread</a>, Â I was able to put together the needed bits, and get it running under CrossOver, by using the pre-configured settings for WinUAE, and replacing the exe with the new beta exe, the supplied hard disk image from <a href="http://amigaunix.com/tiki-index.php">amigaunix.com</a>Â and I was up and running in no time! Â The only real change from the <a href="http://eab.abime.net/attachment.php?attachmentid=33680&amp;d=1357042994">config</a> was to change the SCSI ID of the hard disk from 0 to 6.</p>
<p><div id="attachment_2757" style="width: 811px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/2013/01/13/amix/screen-shot-2013-01-13-at-8-48-54-pm/" rel="attachment wp-att-2757"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2757" class="size-full wp-image-2757" src="https://virtuallyfun.com/wp-content/uploads/2013/01/Screen-Shot-2013-01-13-at-8.48.54-PM.png" alt="Screen Shot 2013-01-13 at 8.48.54 PM" width="801" height="622" /></a><p id="caption-attachment-2757" class="wp-caption-text">AMIX starting up on WinUAE</p></div></p>
<p style="text-align: left;">The default password is wasp. Â I thought it was kind of interesting that AMIX includes &#8216;dungeon&#8217;. Â really cool!</p>
<p><div id="attachment_2759" style="width: 782px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/2013/01/13/amix/screen-shot-2013-01-13-at-11-32-32-pm/" rel="attachment wp-att-2759"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2759" class="size-full wp-image-2759" src="https://virtuallyfun.com/wp-content/uploads/2013/01/Screen-Shot-2013-01-13-at-11.32.32-PM.png" alt="Open Look on AMIX" width="772" height="567" /></a><p id="caption-attachment-2759" class="wp-caption-text">Open Look on AMIX</p></div></p>
<p>I am unsure of how to enable the high resolution graphics, but sadly the Amiga known for its multimedia capabilities, AMIX with stock graphics runs in monochrome. Â Such a major underwhelming thing.</p>
<p>Oh well, for anyone inclined you can now run AMIX, and enjoy another dead SYSV.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2013/01/13/amix/feed/</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
			</item>
	</channel>
</rss>
