<?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>pcc &#8211; Virtually Fun</title>
	<atom:link href="https://virtuallyfun.com/category/pcc/feed/" rel="self" type="application/rss+xml" />
	<link>https://virtuallyfun.com</link>
	<description>Fun with Virtualization</description>
	<lastBuildDate>Fri, 22 Mar 2024 18:13:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>Building MIT PC/IP, or making apple pie</title>
		<link>https://virtuallyfun.com/2024/03/21/building-mit-pc-ip-or-making-apple-pie/</link>
					<comments>https://virtuallyfun.com/2024/03/21/building-mit-pc-ip-or-making-apple-pie/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Thu, 21 Mar 2024 18:13:25 +0000</pubDate>
				<category><![CDATA[4.1 BSD]]></category>
		<category><![CDATA[8086]]></category>
		<category><![CDATA[cross compiler]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[pcc]]></category>
		<category><![CDATA[SIMH]]></category>
		<category><![CDATA[VAX]]></category>
		<category><![CDATA[VAX 11/780]]></category>
		<category><![CDATA[virtual networking]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=14121</guid>

					<description><![CDATA[&#8220;If you want to make a pie from scratch, you must first create the universe&#8221; &#8211;Carl Sagan A little while ago I had touched briefly on the availability of of a PCC port to the 8086 done back in the &#8230; <a href="https://virtuallyfun.com/2024/03/21/building-mit-pc-ip-or-making-apple-pie/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><em>&#8220;If you want to make a pie from scratch, you must first create the universe&#8221; </em></p>
<cite><em>&#8211;Carl Sagan</em></cite></blockquote>



<p class="wp-block-paragraph">A little while ago <a href="/2022/11/04/on-the-trail-of-pcc-for-the-8086/" target="_blank" rel="noreferrer noopener">I had touched briefly</a> on the availability of of a PCC port to the 8086 done back in the early 1980&#8217;s that was hosted on VAX running 4.1BSD.  I&#8217;d ruled it basically useless as you are restricted to 64kb .COM files, and I couldn&#8217;t get much of anything interesting running on it.</p>



<p class="wp-block-paragraph">After all the fun of setting up <a href="/2024/03/03/installing-netmanage-chameleon-on-windows-3-0/" target="_blank" rel="noreferrer noopener">NetManage Chameleon on Windows 3.0</a>, over on IRC lys had mentioned I should try the MIT PC/IP stack.  I never knew anything about it&#8217;s history but it became the first PC TCP/IP stack.  You can read more about it from <a href="https://web.archive.org/web/20040215032121/http://www.drizzle.com/~aboba/internaut/pc-ip.html" target="_blank" rel="noreferrer noopener">&#8220;<em>Internaut</em>&#8220;</a>?</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Dave Clark had gone to England for sabbatical and while he was there, had implemented TCP/IP in BCPL for the TRIPOS operating system, a predecessor of the Commodore AMIGA operating system. He brought the TCP/IP code back with him, and the Lab for Computer Science had a bunch of Xerox Alto workstations, and someone at LCS ported Dave&#8217;s TCP/IP to the Alto.</p>



<p class="wp-block-paragraph">Then someone ported it to Version 6 UNIX and rewrote it in C. And that was what we took, and ported to PC DOS. At that point there were no C compilers that ran on the PC, and we were using a compiler that ran on a PDP 11/45 on Version 6 UNIX, and then on a VAX 750 running BSD v4.1. That was the AT&amp;T; portable C compiler, and a group of people on the fourth floor of the LCS had written an 8088 code generator for it. This was before Microsoft C, and before 4.2 BSD.</p>



<p class="wp-block-paragraph">Our first tasks were to bring up TFTP, TCP, and a telnet client under DOS. Several people were involved. Lou Konopelski did the initial TCP and telnet work, and Dave Brigham did similar work to what I did.</p>
<cite>John Romkey &#8211; <em>Internaut</em> &#8211; <strong>How PC-IP Came to Be</strong></cite></blockquote>



<p class="wp-block-paragraph">What is even more notable about PCIP is that it&#8217;s the reason the whole &#8216;MIT License&#8217; even exists, as word seems to have spread quickly about a TCP/IP stack for the IBM PC compatible market.  Jerome Saltzer has documented it all, if you want to read about it (<a href="https://www.mit.edu/~Saltzer/publications/MITLicense.pdf" target="_blank" rel="noreferrer noopener">WARNING PDF!</a>)</p>



<p class="wp-block-paragraph"><a href="https://en.wikipedia.org/wiki/John_Romkey" target="_blank" rel="noreferrer noopener">Romkey</a> would even then go on to found FTP software in that wonderful pre public internet era, before the eternal September.</p>



<p class="wp-block-paragraph">Over on <a href="http://bitsavers.trailing-edge.com/bits/MIT/pc-ip/">bitsavers</a> there are 3 files:</p>



<figure class="wp-block-table"><table><tbody><tr><td><img decoding="async" src="/wp-content/uploads/2024/03/tar.gif" alt="[   ]"></td><td>8086_C_19850820.tar</td><td>2019-03-12 14:36</td><td>750K</td><td>&nbsp;</td></tr><tr><td><img decoding="async" src="/wp-content/uploads/2024/03/tar.gif" alt="[   ]"></td><td>PC-IP_19850124.tar</td><td>2019-03-12 11:53</td><td>4.6M</td><td>&nbsp;</td></tr><tr><td><img decoding="async" src="/wp-content/uploads/2024/03/tar.gif" alt="[   ]"></td><td>PC-IP_19860403.tar</td><td>2019-03-12 11:53</td><td>6.9M</td><td>&nbsp;</td></tr></tbody></table><figcaption class="wp-element-caption">bitsavers.trailing-edge.com/bits/MIT/pc-ip/</figcaption></figure>



<p class="wp-block-paragraph">Of course, the one thing that stands out is that these files look tiny.  They aren&#8217;t even compressed!  PCC, or the Portable C Compiler was released from AT&amp;T, itself written in C, to make porting the C compiler easier to further allow Unix to be further easily ported. Now that I kind of had a mission, I decided to take the 8086 PCC leap, again.</p>



<h2 class="wp-block-heading">Get the time machine ready!</h2>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2024/03/Designer-5-jpg.webp"><img fetchpriority="high" decoding="async" width="1024" height="585" src="/wp-content/uploads/2024/03/Designer-5-1024x585.webp" alt="" class="wp-image-14127" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/Designer-5-1024x585.webp 1024w, https://virtuallyfun.com/wp-content/uploads/2024/03/Designer-5-300x171.webp 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/Designer-5-768x439.webp 768w, https://virtuallyfun.com/wp-content/uploads/2024/03/Designer-5-1536x878.webp 1536w, https://virtuallyfun.com/wp-content/uploads/2024/03/Designer-5-500x286.webp 500w, https://virtuallyfun.com/wp-content/uploads/2024/03/Designer-5-jpg.webp 1792w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">A man, his best friend and a time machine! &#8211; Microsoft Sydney</figcaption></figure>



<p class="wp-block-paragraph">Thankfully I had that 4.1c BSD image still up on <a href="https://sourceforge.net/projects/bsd42/" target="_blank" rel="noreferrer noopener">sourceforge</a>, aptly named: <a href="https://sourceforge.net/projects/bsd42/files/4BSD%20under%20Windows/v0.4/4.1c%20BSD.7z/download" target="_blank" rel="noreferrer noopener">4.1c BSD.7z</a>, so I could follow my old instructions to create the tap file and start working with 8086 C, going back from 1985.  And in no time, I had re-built the compiler, and assembler up and running.  But I wanted more, as much fun as 4.1BSD is, I wanted to run everything natively on Windows.</p>



<p class="wp-block-paragraph">At this point I&#8217;d remembered that this setup is a bit odd in that the object files that the assembler produces are OMAGIC (type 0407) <a href="https://en.wikipedia.org/wiki/A.out">a.out</a> files.  Thinking back to my old project of <a href="https://sourceforge.net/projects/linux011/" target="_blank" rel="noreferrer noopener">building Ancient Linux on Windows using vintage tools</a>, it also uses OMAGIC a.out files! It&#8217;s not that unexpected as the original GNU ld linker from 1986 has hooks for both old magic &amp; new magic (OMAGIC/NMAGIC) files, as this would be consistent from the era.  Thinking this was my out, I might have a way of migrating the build process off of the VAX.</p>



<p class="wp-block-paragraph">The first pass was to try to pull in all the VAX includes into my native Visual C++ 1.0, and get it to build with Microsoft C/C++ 8.0.  The next thing to do of course, is look for where it&#8217;s doing anything with binary files and make sure it&#8217;s all set to O_BINARY/&#8221;rb&#8221;/&#8221;wb&#8221; where appropriate as MS-DOS/Win32/OS2 all handle text files differently from binary data.  There is also fights with mktemp along with procedure name creep, like how &#8217;round&#8217; wasn&#8217;t a thing in 1980 but it sure is by 1993!  Before the era of the 486DX/68040/Pentium not everyone had a math co-processor (FPU) so it&#8217;d make sense that a lot of things wouldn&#8217;t have this by default.</p>



<p class="wp-block-paragraph">As a quick refresher the following diagram may be specific to the GNU GCC compiler, but the older PCC compiler uses the same methodology of first pre-processing files, then compiling them, assembling the resulting compiler output, then finally linking to an executable program.  ( See &#8211; &#8220;<a href="/2024/01/08/so-it-turns-out-gcc-could-have-been-available-on-windows-nt-the-entire-time/" target="_blank" rel="noreferrer noopener">So it turns out GCC could have been available on Windows NT the entire time</a>&#8220;)</p>



<figure class="wp-block-image size-large"><a href="/2024/01/08/so-it-turns-out-gcc-could-have-been-available-on-windows-nt-the-entire-time/" target="_blank" rel="noreferrer noopener"><img decoding="async" width="1024" height="384" src="/wp-content/uploads/2024/01/gcc-program-flow-1024x384.png" alt="" class="wp-image-13731" srcset="https://virtuallyfun.com/wp-content/uploads/2024/01/gcc-program-flow-1024x384.png 1024w, https://virtuallyfun.com/wp-content/uploads/2024/01/gcc-program-flow-300x112.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/01/gcc-program-flow-768x288.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/01/gcc-program-flow-1536x575.png 1536w, https://virtuallyfun.com/wp-content/uploads/2024/01/gcc-program-flow-500x187.png 500w, https://virtuallyfun.com/wp-content/uploads/2024/01/gcc-program-flow.png 1962w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">a rough explanation of how old C compilers work in stages</figcaption></figure>



<p class="wp-block-paragraph">The steps for PCC 8086 are quite similar but to spell them out:</p>



<ul class="wp-block-list">
<li>Pre-process with GNU cpp</li>



<li>Compile with PCC&#8217;s c86</li>



<li>Assemble with PCC&#8217;s a86</li>



<li>Link with GNU&#8217;s ld</li>



<li>Extract the MS-DOS .COM file with cvt86</li>
</ul>



<p class="wp-block-paragraph">There isn&#8217;t much to talk about the pre-processor, so I&#8217;ll skip it, suffice to say from my <a href="https://github.com/neozeed/cl386-research" target="_blank" rel="noreferrer noopener">cl386 research</a>, and porting GCC to OS2/NT, it just worked.</p>



<h2 class="wp-block-heading">Compiling the compiler</h2>



<p class="wp-block-paragraph">Surprisingly getting the compiler running wasn&#8217;t too difficult.  I do remember getting this running before, so seeing it run again wasn&#8217;t too much of a surprise.  The simple C program:</p>



<pre class="wp-block-code"><code>main(){
printf("hi from 8086 pcc\n");
}</code></pre>



<p class="wp-block-paragraph">Gives us the following generated assembly:</p>



<pre class="wp-block-code"><code>        .data
        .text
        .globl  _main
_main:
        push    bp
        mov     bp,sp
        push    si
        push    di
        sub     sp,#LF1
        mov     ax,#L14
        push    ax
        call    _printf
        pop     cx
L12:
        lea     sp,*-4(bp)
        pop     di
        pop     si
        pop     bp
        ret
        LF1 = 0
        .data
L14:
        .byte   104,105,32,102,114,111,109,32
        .byte   56,48,56,54,32,112,99,99
        .byte   10,0</code></pre>



<p class="wp-block-paragraph">So far, so good, right!  Even for fun, I was able to build it using Microsoft C 6.0!  I figured I may as well try to get as much out of that purchase as possible.</p>



<h2 class="wp-block-heading">Strage binary formats in a strange world</h2>



<p class="wp-block-paragraph">One thing that was a constant problem for me is that the assembler generated garbage, it never gave me the a.out OMAGIC file.  Opening it up in a hex editor, Hex Editor Neo, and it showed problem, right away.</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-vax.png"><img decoding="async" width="683" height="248" src="/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-vax.png" alt="" class="wp-image-14130" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-vax.png 683w, https://virtuallyfun.com/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-vax-300x109.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-vax-500x182.png 500w" sizes="(max-width: 683px) 100vw, 683px" /></a><figcaption class="wp-element-caption">A simple do nothing program, assembled on the VAX</figcaption></figure>



<p class="wp-block-paragraph">The OMAGIC sequence in hex should be written down as <strong>07 01</strong>, but when I looked at the output from my PC port the file was not only too big but it didn&#8217;t have the headder:</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-pc.png"><img loading="lazy" decoding="async" width="650" height="237" src="/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-pc.png" alt="" class="wp-image-14131" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-pc.png 650w, https://virtuallyfun.com/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-pc-300x109.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-pc-500x182.png 500w" sizes="auto, (max-width: 650px) 100vw, 650px" /></a><figcaption class="wp-element-caption">The same program assembled on the PC</figcaption></figure>



<p class="wp-block-paragraph">As you can see it&#8217;s just a bunch of zeros up front.  Later on, I&#8217;d realize this was a &#8216;pad&#8217; so it could be filled in later by the assembler when doing relocations.  The file in question was rel.c which also should have been the hint.  I don&#8217;t know if anyone saw it, but let me highlight it for you:</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-pc-hihglight.png"><img loading="lazy" decoding="async" width="650" height="237" src="/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-pc-hihglight.png" alt="" class="wp-image-14132" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-pc-hihglight.png 650w, https://virtuallyfun.com/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-pc-hihglight-300x109.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/OMAGIC-assembled-on-the-pc-hihglight-500x182.png 500w" sizes="auto, (max-width: 650px) 100vw, 650px" /></a><figcaption class="wp-element-caption">The OMAGIC header is being appended!</figcaption></figure>



<p class="wp-block-paragraph">As you can see, where the file ends on the VAX, on the PC the OMAGIC header is being appended.  I did a simple cut &amp; paste in the editor, and the object file validated just fine.  So why was this happening?  In my rush to just add &#8216;binary&#8217; flags to any file operations I had seen this in rel.c:</p>



<pre class="wp-block-code"><code>		(dout = fopen(Rel_name, "a")) == NULL)</code></pre>



<p class="wp-block-paragraph">I had taken this be an &#8216;append&#8217; for whatever reason it would need to do that kind of thing.  Well maybe that&#8217;s what it means in 1993, but in 1981 it doesn&#8217;t append, instead it just opens it normally.  Is this a bug in the assembler, or a feature of 4.1BSD?  Without debugging it, I just modified it to not append, as this was the only occurrence of an explicit append in the source code I could see.</p>



<pre class="wp-block-code"><code>		(dout = fopen(Rel_name, "wb")) == NULL)</code></pre>



<p class="wp-block-paragraph">And that did the trick, I now had a working assembler running on my PC!</p>



<p class="wp-block-paragraph">But we are not out of the woods yet!</p>



<p class="wp-block-paragraph">Naturally trying to build a much &#8216;larger&#8217; Fibonacci program crashed the assembler.  Luckily debugging it was a snap to find out that it was trying to free a static pointer.  Or so I think.  Today, in the future RAM is cheap, so I just commented out the offending free and now it was off to the linker.</p>



<h2 class="wp-block-heading">When is advanced optimization a bad idea?</h2>



<p class="wp-block-paragraph">When the machine you wrote this for no longer exists.  In the middle of the ld86 linker is this line:</p>



<pre class="wp-block-code"><code>		asm("movc3 r8,(r11),(r7)");</code></pre>



<p class="wp-block-paragraph">I have no idea why it&#8217;s there.</p>



<p class="wp-block-paragraph">I don&#8217;t know what it should be doing.</p>



<p class="wp-block-paragraph">This makes the linker un-portable.</p>



<p class="wp-block-paragraph">However, as I&#8217;d mentioned before I did have the GNU linker that I&#8217;d successfully used to build Linux kernels, so there was hope!</p>



<pre class="wp-block-code"><code>C:\msvc32s\proj\8086pcc&gt;\aoutgcc\bin\ld.exe -X -r -o hi.out crt0.b hi.b ./libc.a
C:\msvc32s\proj\8086pcc&gt;cvt86 hi.out hi.com
C:\msvc32s\proj\8086pcc&gt;msdos hi.com
hello from pcc for 8086!</code></pre>



<p class="wp-block-paragraph">I had now successfully run my first program without using the VAX.  Although I had not mentioned a step yet, cvt86, this utility is described as creating a MS-DOS .COM file from an a.out file.  I didn&#8217;t look into how it accomplishes this, but basically, it&#8217;s another linker.  And this issue would come to complicate things as I had thought that everything was working.</p>



<h2 class="wp-block-heading">libc &amp; the heart of C</h2>



<p class="wp-block-paragraph">Libc, is simply put the central C library for getting everything done.  While crt0 will setup the C environment everything else core from opening files, writing to the screen, and reading keyboard input is done through libc.  So I thought re-building libc would be easy enough.  To build the library you &#8216;archive&#8217; them with the &#8216;ar&#8217; archiver, then index them with &#8216;ranlib&#8217;.  And again, from my a.out adventures building Linux I had both tools, however no matter what I was doing they did not work with cvt86.  I wen&#8217;t back and rebuilt some kernels to verify, and yes it does generate archives but cvt86 was not happy.</p>



<p class="wp-block-paragraph">I still had the SIMH VAX running in case I needed it, so I just broke down and figured I&#8217;d just port the VAX ar/ranlib to the PC.  I don&#8217;t know off hand what the problem was, and I didn&#8217;t feel like spending an eternity to try to correct it, and both of the programs are somewhat portable.  But of course it wasn&#8217;t that simple as ar opens files in strange ways that work on 4.1BSD but yeild chaos on the PC.</p>



<pre class="wp-block-code"><code>#define ARMAG   "!&lt;arch&gt;\n"

#define SARMAG  8

#define ARFMAG  "`\n"</code></pre>



<p class="wp-block-paragraph">&#8216;ar&#8217; has it&#8217;s own magic, a simple !&lt;arch&gt; and a ` followed by a new line.  On any UNIX the \n is 10 in decimal 0xa in hex.  But on the PC it&#8217;s carriage return and linefeed!  And yes despite setting all the opens to binary, it was constantly injecting carriage returns &amp; linefeeds all over the place!  Some-how the file was being opened in text mode.  Thankfully debugging even in old Visual C is great and inspecting the temporary files lead me to find this part:</p>



<pre class="wp-block-code"><code>			f = creat(file, larbuf.lar_mode &amp; 0777);</code></pre>



<p class="wp-block-paragraph">In a few places it uses the <a href="https://linux.die.net/man/2/creat" target="_blank" rel="noreferrer noopener">creat</a> (or create call.  In an interview Dennis Ritchie had mentioned that this was one of his regrets in life, not naming creat create) call, which of course never has to set a mode, as everything is binary in Unix, unlike the PC.  Great.</p>



<p class="wp-block-paragraph">Luckily the fix was very simple after every creat, simply set the file mode to binary.</p>



<pre class="wp-block-code"><code>			setmode(f,O_BINARY);</code></pre>



<p class="wp-block-paragraph">Great!</p>



<h2 class="wp-block-heading">Apple pie!</h2>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/pcc-8086-self-hosting-fib.png"><img loading="lazy" decoding="async" width="979" height="512" src="/wp-content/uploads/2024/03/pcc-8086-self-hosting-fib.png" alt="" class="wp-image-14140" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/pcc-8086-self-hosting-fib.png 979w, https://virtuallyfun.com/wp-content/uploads/2024/03/pcc-8086-self-hosting-fib-300x157.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/pcc-8086-self-hosting-fib-768x402.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/03/pcc-8086-self-hosting-fib-500x261.png 500w" sizes="auto, (max-width: 979px) 100vw, 979px" /></a><figcaption class="wp-element-caption">Fibonacci sequence</figcaption></figure>



<p class="wp-block-paragraph">Now I could re-build libc from source and link it to the Fibonacci program!</p>



<p class="wp-block-paragraph">Yes it&#8217;d take this long to get to the point where I can now easily edit file on a modern machine and have a Win32 native toolchain!  VAX no longer required!  We&#8217;ve successfully extracted everything we needed from the 1980&#8217;s!</p>



<h2 class="wp-block-heading">First contact!</h2>



<p class="wp-block-paragraph">Now it&#8217;s time to look at what brought us on this adventure, MIT PC/IP.</p>



<p class="wp-block-paragraph">The MIT PC/IP (PCIP) does require changes to the libc to work correctly.  Unfortunately, they didn&#8217;t provide the full copy of the libc, but rather some ed scripts.  So, the first question is do I even have the version these are based off of to start?  I don&#8217;t know, so I had guessed, and I had guessed incorrectly.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="800" height="534" src="/wp-content/uploads/2024/03/800px-3com_3c501_front-jpg.webp" alt="" class="wp-image-14148" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/800px-3com_3c501_front-jpg.webp 800w, https://virtuallyfun.com/wp-content/uploads/2024/03/800px-3com_3c501_front-300x200.webp 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/800px-3com_3c501_front-768x513.webp 768w, https://virtuallyfun.com/wp-content/uploads/2024/03/800px-3com_3c501_front-449x300.webp 449w" sizes="auto, (max-width: 800px) 100vw, 800px" /><figcaption class="wp-element-caption">3com 3c501</figcaption></figure>



<p class="wp-block-paragraph">Configuring PCIP is somewhat involved, first you need MS-DOS 2.00 or greater which thankfully in the future is FREE!  The next thing you need is a 3com 3c501 card.  This is going to be a challenge but it&#8217;s just as any good time to mention 86box, and the latest version that I&#8217;ve been using that of course supports this kind of setup!</p>



<figure class="wp-block-image size-large"><a href="https://github.com/86Box/86Box/releases/tag/v4.1.1" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="1024" height="768" src="/wp-content/uploads/2024/03/V4.1.1_POST-1024x768.webp" alt="" class="wp-image-14149" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/V4.1.1_POST-1024x768.webp 1024w, https://virtuallyfun.com/wp-content/uploads/2024/03/V4.1.1_POST-300x225.webp 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/V4.1.1_POST-768x576.webp 768w, https://virtuallyfun.com/wp-content/uploads/2024/03/V4.1.1_POST-1536x1152.webp 1536w, https://virtuallyfun.com/wp-content/uploads/2024/03/V4.1.1_POST-2048x1536.webp 2048w, https://virtuallyfun.com/wp-content/uploads/2024/03/V4.1.1_POST-400x300.webp 400w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">New version 4.1.1</figcaption></figure>



<p class="wp-block-paragraph">I can&#8217;t recommend it enough, 86box is like all the inconveniences of old software &amp; hardware without having to spend a fortune for weird combinations, fighting to have space for it.  I naturally setup a 386sx with CGA, 20Mb hard disk and a 3c501 card.  It&#8217;s nice being able to also be very task specific, this doesn&#8217;t have to be a DooM/Quake machine!</p>



<p class="wp-block-paragraph">the first thing you need to do is add the netdev.sys device driver that is created as part of building PCIP from source.  a simple:</p>



<pre class="wp-block-code"><code>DEVICE=\NETDEV.SYS</code></pre>



<p class="wp-block-paragraph">in your config.sys is more than enough.  However, how do you configure it?  Well it&#8217;s the &#8216;custom&#8217; program that binary edit&#8217;s the device driver.</p>



<p class="wp-block-paragraph"><strong>YES, IT EDITS THE DEVICE DRIVER.</strong></p>



<p class="wp-block-paragraph">Setting stuff up is somewhat straight forward, however it displays TCP/IP information in decimal not in hex.  I haven&#8217;t even looked into the how or why.</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/Monitor_1_20240321-164435-259.png"><img loading="lazy" decoding="async" width="640" height="200" src="/wp-content/uploads/2024/03/Monitor_1_20240321-164435-259.png" alt="" class="wp-image-14150" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164435-259.png 640w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164435-259-300x94.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164435-259-500x156.png 500w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a><figcaption class="wp-element-caption">The first page</figcaption></figure>



<p class="wp-block-paragraph">The first page options are kind of banal, it&#8217;s back in the day when people would use finger to find people on the internet and call them up or send emails.  How cute.  1985 was a different world!</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/Monitor_1_20240321-164442-852.png" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="640" height="200" src="/wp-content/uploads/2024/03/Monitor_1_20240321-164442-852.png" alt="" class="wp-image-14151" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164442-852.png 640w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164442-852-300x94.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164442-852-500x156.png 500w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a><figcaption class="wp-element-caption">hardware options</figcaption></figure>



<p class="wp-block-paragraph">In the hardware options the only thing to check is the I/O base, IRQ &amp; DMA for the Ethernet card.  I just configured the card around 0x300/5/1 as it&#8217;s great being purpose built!</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/Monitor_1_20240321-164500-212.png" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="640" height="200" src="/wp-content/uploads/2024/03/Monitor_1_20240321-164500-212.png" alt="" class="wp-image-14152" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164500-212.png 640w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164500-212-300x94.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164500-212-500x156.png 500w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a><figcaption class="wp-element-caption">telnet options</figcaption></figure>



<p class="wp-block-paragraph">There is a separate window for telnet options.  Naturally high speed connections frame far too fast for something built from 1985.  I found lowering the TCP windows really helped with pacing.</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/Monitor_1_20240321-164506-586.png" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="640" height="200" src="/wp-content/uploads/2024/03/Monitor_1_20240321-164506-586.png" alt="" class="wp-image-14153" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164506-586.png 640w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164506-586-300x94.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-164506-586-500x156.png 500w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a><figcaption class="wp-element-caption">Site config</figcaption></figure>



<p class="wp-block-paragraph">As I had mentioned the site configuration displays all the information in decimal.  Also, I&#8217;m wasn&#8217;t sure what is going on with the netmask, but looking at the old Windows calculator revealed it was being stored in OCTAL.  It&#8217;s probably why the addresses have commas instead of periods.  Although I had configured DNS it didn&#8217;t work, as it uses UDP port 42. It&#8217;s clearly doing something very early 1980&#8217;s.</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/broken-telnet.png" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="720" height="350" src="/wp-content/uploads/2024/03/broken-telnet.png" alt="" class="wp-image-14147" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/broken-telnet.png 720w, https://virtuallyfun.com/wp-content/uploads/2024/03/broken-telnet-300x146.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/broken-telnet-500x243.png 500w" sizes="auto, (max-width: 720px) 100vw, 720px" /></a><figcaption class="wp-element-caption">The status CR/LF is broken!</figcaption></figure>



<p class="wp-block-paragraph">So close and yet so far away.  The only thing to do was try to figure out which of the libc stuff was &#8216;newest&#8217; in the pure state and try to figure out where to go from there.</p>



<h2 class="wp-block-heading">Redo!</h2>



<p class="wp-block-paragraph">While I had not configured the libc correctly, I had partial success!  I could actually establish a telnet session! Libc wasn&#8217;t working correctly as every line feed didn&#8217;t generate a carriage return, as you&#8217;d need for MS-DOS leaving it with broken status.</p>



<p class="wp-block-paragraph">But at the same time, despite all the weird &#8216;challenges&#8217; for the most part &#8216;it just worked&#8217;.  Which is pretty cool!</p>



<p class="wp-block-paragraph">It turns out the answer was the 8086_C_19850820 file.  As far as I can tell there was only one thing that didn&#8217;t patch correctly but I was able to build a libc in no time.. that didn&#8217;t work.  In the patch it removes ulrem/auldiv from arith.a86  Not sure why, I haven&#8217;t messed with it.  But that means I had to restructure to build with the non floating point n86c compiler as that&#8217;s the way PCIP is expected to be built.  After rebuilding with this compiler and this seemingly properly patched library I finally had it working!</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/Monitor_1_20240321-155250-479.png" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="640" height="200" src="/wp-content/uploads/2024/03/Monitor_1_20240321-155250-479.png" alt="" class="wp-image-14146" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-155250-479.png 640w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-155250-479-300x94.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-155250-479-500x156.png 500w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a><figcaption class="wp-element-caption">Ping my local gateway!</figcaption></figure>



<p class="wp-block-paragraph">Instead of a garbled mess, I had something I could read!</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/Monitor_1_20240321-155420-962.png" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="640" height="200" src="/wp-content/uploads/2024/03/Monitor_1_20240321-155420-962.png" alt="" class="wp-image-14154" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-155420-962.png 640w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-155420-962-300x94.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/Monitor_1_20240321-155420-962-500x156.png 500w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a><figcaption class="wp-element-caption">telnetting to my test BBS</figcaption></figure>



<p class="wp-block-paragraph">Now instead of a garbled mess, I can see it was trying to display the connected IP, and a clock.</p>



<p class="wp-block-paragraph">Sadly it doesn&#8217;t work with SLiRP.  I&#8217;m sure it&#8217;s either classful routing or it really doesn&#8217;t like how SLiRP handles ARP.  I suspect it&#8217;s also trying to do old style classful routing as well, which means you can&#8217;t just load arbitrary subnet masks wherever you want, to try to squeeze the 4 billion IP&#8217;s out of the internet.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="480" height="363" src="/wp-content/uploads/2024/03/fixedmit.gif" alt="" class="wp-image-14162"/><figcaption class="wp-element-caption">The updated telnet client connecting to a test BBS</figcaption></figure>
</div>


<h2 class="wp-block-heading">Final thoughts</h2>



<p class="wp-block-paragraph">I suspect that although there were binaries in the above tar files, going through the effort to rebuild PCIP really wasn&#8217;t all that expected for most people to carry out.  Sadly, there was no shared source &#8216;sites&#8217; online, and we&#8217;re lucky enough someone kept a few tarballs lying around.  I really can&#8217;t blame them for sticking with then current development tools, especially for what you&#8217;d need to build a C compiler back in the early 80&#8217;s.  It&#8217;s a shame the QL or the Macintosh didn&#8217;t have the RAM or the DASD capacity to become that home cross compiler of the 80&#8217;s.</p>



<p class="wp-block-paragraph">Most project just require you to work on that actual project, while this has been a substantially larger undertaking from anything normal, but I guess I&#8217;ve learned a bit along the way with all those &#8220;pointless&#8221; GCC port things I&#8217;d done, well it turns out they are incredibly useful! It&#8217;s been a fun archeological expedition for me, thankfully C is still a thing, I wonder what happened to all the ADA/Perl/Pascal/&#8221;Wave of the future&#8221; stuff that is always disappearing.  At least more and more people work on full system emulation so there is always that!</p>



<p class="wp-block-paragraph">For anyone that curious you can find all the code over on github:</p>



<p class="wp-block-paragraph"><a href="https://github.com/neozeed/8086pcc">https://github.com/neozeed/8086pcc</a></p>



<p class="wp-block-paragraph">Against my better judgement, I&#8217;ve added a <a href="https://github.com/neozeed/8086pcc/releases" target="_blank" rel="noreferrer noopener">binary package on github</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2024/03/21/building-mit-pc-ip-or-making-apple-pie/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>On the trail of PCC for the 8086</title>
		<link>https://virtuallyfun.com/2022/11/04/on-the-trail-of-pcc-for-the-8086/</link>
					<comments>https://virtuallyfun.com/2022/11/04/on-the-trail-of-pcc-for-the-8086/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 04 Nov 2022 13:35:18 +0000</pubDate>
				<category><![CDATA[4.1 BSD]]></category>
		<category><![CDATA[cross compiler]]></category>
		<category><![CDATA[pcc]]></category>
		<category><![CDATA[VAX]]></category>
		<category><![CDATA[VAX 11/780]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=12024</guid>

					<description><![CDATA[While on discord the topic came up of why there is no good/free C compiler for MS-DOS. Oh sure there is OpenWatcom but the 2 heavy hitters of the era, Microsoft C &#38; Borland C are not open in the &#8230; <a href="https://virtuallyfun.com/2022/11/04/on-the-trail-of-pcc-for-the-8086/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">While on discord the topic came up of why there is no good/free C compiler for MS-DOS.  Oh sure there is OpenWatcom but the 2 heavy hitters of the era, Microsoft C &amp; Borland C are not open in the slightest.</p>



<p class="wp-block-paragraph">There is <a rel="noreferrer noopener" href="http://desmet-c.com/" target="_blank">DeSmet C</a>, although it&#8217;s source is full of unnamed structs meaning that building it with anything sane would require a &#8216;lot of work &#8482;&#8217; which of course is not what I&#8217;m all that about.  Instead, I remembered a directory up on TUHS /Applications/Portable_CC with a zip file 8086.zip  Although this is a zip file, you&#8217;ll want to unzip on something Unix-y as there is a lot of case duplicate files.  That said this is a PCC port to the 8086, which includes a libc, 8087 support, and is all expected to be built on a VAX-11/780 running 4.1BSD.  Now this ended up being a stumbling block because I tried a *LOT* of things thinking that they were upwards compatible with 4.1, and the answer is USE 4.1!</p>



<p class="wp-block-paragraph">So to effectively get going you&#8217;ll need a SIMH VAX780 and just <a rel="noreferrer noopener" href="http://gunkies.org/wiki/Installing_4.1_BSD_on_SIMH" target="_blank">follow my old steps on Installing 4.1BSD</a>.  As far as the zip file, I used Linux but had to create a tar file specifying the Unix v7 format with:</p>



<pre class="wp-block-code"><code>tar --format=v7 -cf pcc.tar .</code></pre>



<p class="wp-block-paragraph">And of course, <a rel="noreferrer noopener" href="https://gunkies.org/wiki/Mkdisttap.pl" target="_blank">convert the tar file to a simh tap file</a>.  Or if you are like me, just download a tap file here: <a rel="noreferrer noopener" href="https://sourceforge.net/projects/bsd42/files/Package%20Tapes/Source%20Code/PCC-Machines.tap.bz2/download" target="_blank">PCC-Machines.tap.bz2</a>.</p>



<p class="wp-block-paragraph">With that said it&#8217;s a very strange setup as it relies on the 4.1BSD Vax environment so much that there is assembly injected into the linker.  </p>



<pre class="wp-block-preformatted">asm("movc3 r8,(r11),(r7)");</pre>



<p class="wp-block-paragraph">So this will not cleanly run.  Just as it depends on many system a.out specifics on building for MS-DOS.  It&#8217;s not so much a MS-DOS tool chain, rather it outputs to vax a.out and uses a slightly modified vax linker.  The MS-DOS magic happens in the conversion of the final a.out into a com file.</p>



<p class="wp-block-paragraph">That is right it&#8217;s a VAX specific cross compiler that only build&#8217;s COM files.</p>



<p class="wp-block-paragraph">I&#8217;ve managed to build some trivial stuff, and they work.  Sadly my attempt at building that <a href="https://virtuallyfun.com/2014/12/15/tracking-down-the-infotaskforce-from-1987/" target="_blank" rel="noreferrer noopener">InfoTaskforce of &#8217;87</a> failed.</p>



<p class="wp-block-paragraph">I haven&#8217;t dug that much further into the linker although I have to wonder if a GNU cross linker to make a.out could make something that the conversion program would be happy with.  The assembler of course doesn&#8217;t work, perhaps it&#8217;s something with packing structs?</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2022/11/hello-from-8086-pcc-VAX.png"><img loading="lazy" decoding="async" width="642" height="427" src="https://virtuallyfun.com/wp-content/uploads/2022/11/hello-from-8086-pcc-VAX.png" alt="" class="wp-image-12025" srcset="https://virtuallyfun.com/wp-content/uploads/2022/11/hello-from-8086-pcc-VAX.png 642w, https://virtuallyfun.com/wp-content/uploads/2022/11/hello-from-8086-pcc-VAX-300x200.png 300w, https://virtuallyfun.com/wp-content/uploads/2022/11/hello-from-8086-pcc-VAX-451x300.png 451w" sizes="auto, (max-width: 642px) 100vw, 642px" /></a></figure>



<p class="wp-block-paragraph">As always, the simple stuff looks trivial but it was a fair bit involved.</p>



<p class="wp-block-paragraph">Since there is no real &#8216;cc&#8217; it&#8217;s a script but the vauge steps are:</p>



<pre class="wp-block-preformatted">/lib/cpp -I/usr/src/pcc/Machines/8086/lib86/include hi.c hi.i
/usr/src/pcc/Machines/8086/c86/c86 &lt; hi.i &gt; hi.a86
/usr/src/pcc/Machines/8086/a86/a86 hi
/usr/src/pcc/Machines/8086/a86/ld86 -X -N -r -o hi.out /usr/src/pcc/Machines/8086/lib86/crt0.b hi.b /usr/src/pcc/Machines/8086/lib86/libc.a 
/usr/src/pcc/Machines/8086/a86/cvt86 hi.out hi.com</pre>



<p class="wp-block-paragraph">It kind of makes sense.</p>



<p class="wp-block-paragraph">Seems like somehow a lost opportunity in of itself back in the day</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2022/11/04/on-the-trail-of-pcc-for-the-8086/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>I just saw on the PCC mailing list that it just built NetBSD</title>
		<link>https://virtuallyfun.com/2011/05/10/i-just-saw-on-the-pcc-mailing-list-that-it-just-built-netbsd/</link>
					<comments>https://virtuallyfun.com/2011/05/10/i-just-saw-on-the-pcc-mailing-list-that-it-just-built-netbsd/#respond</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Tue, 10 May 2011 12:22:00 +0000</pubDate>
				<category><![CDATA[netbsd]]></category>
		<category><![CDATA[pcc]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=451</guid>

					<description><![CDATA[From Iain Hibbert: On Mon, 9 May 2011, Anders Magnusson wrote: > Modified Files:> pcc/arch/i386: table.c>> Log Message:> Simple fix to avoid bug reported in Jira#PCC-343 by Iain Hibbert. and so, pcc achieves another milestone.. kernel text is mapped with &#8230; <a href="https://virtuallyfun.com/2011/05/10/i-just-saw-on-the-pcc-mailing-list-that-it-just-built-netbsd/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>From Iain Hibbert:</p>
<p>On Mon, 9 May 2011, Anders Magnusson wrote:</p>
<p>> Modified Files:<br />>       pcc/arch/i386: table.c<br />><br />> Log Message:<br />> Simple fix to avoid bug reported in Jira#PCC-343 by Iain Hibbert.</p>
<p>and so, pcc achieves another milestone..</p>
<p>kernel text is mapped with 3 large pages and 302 normal pages<br />Loaded initial symtab at 0xc0e37650, strtab at 0xc0ecdaa0, # entries 38363<br />Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,<br />2006, 2007, 2008, 2009, 2010, 2011<br />The NetBSD Foundation, Inc.  All rights reserved.<br />Copyright (c) 1982, 1986, 1989, 1991, 1993<br />The Regents of the University of California.  All rights reserved.</p>
<p>NetBSD 5.99.48 (PCC) #1: Tue May 10 07:49:08 BST 2011<br />plunky@galant.ukfsn.org:/var/work/NetBSD-current/obj.i386/sys/arch/i386/compile/PCC<br />total memory = 127 MB<br />avail memory = 110 MB<br />mainbus0 (root)<br />cpu0 at mainbus0 apid 0: QEMU Virtual CPU version 0.13.0, id 0x633<br />cpu1 at mainbus0 apid 1: QEMU Virtual CPU version 0.13.0, id 0x633<br />ioapic0 at mainbus0 apid 2<br />acpi0 at mainbus0: Intel ACPICA 20110211<br />pckbc1 at acpi0 (KBD, PNP0303) (kbd port): io 0x60,0x64 irq 1<br />pckbc2 at acpi0 (MOU, PNP0F13) (aux port): irq 12<br />FDC0 (PNP0700) at acpi0 not configured<br />LPT (PNP0400) at acpi0 not configured<br />COM1 (PNP0501) at acpi0 not configured<br />hpet0 at acpi0 (HPET, PNP0103-0): mem 0xfed00000-0xfed003ff<br />apm0 at acpi0: Power Management spec V1.2<br />pckbd0 at pckbc1 (kbd slot)<br />pckbc1: using irq 1 for kbd slot<br />wskbd0 at pckbd0 mux 1<br />pms0 at pckbc1 (aux slot)<br />pckbc1: using irq 12 for aux slot<br />wsmouse0 at pms0 mux 0<br />pci0 at mainbus0 bus 0: configuration mode 1<br />pchb0 at pci0 dev 0 function 0: vendor 0x8086 product 0x1237 (rev. 0x02)<br />pcib0 at pci0 dev 1 function 0: vendor 0x8086 product 0x7000 (rev. 0x00)<br />piixide0 at pci0 dev 1 function 1: Intel 82371SB IDE Interface (PIIX3) (rev. 0x00)<br />piixide0: primary channel interrupting at ioapic0 pin 14<br />atabus0 at piixide0 channel 0<br />piixide0: secondary channel interrupting at ioapic0 pin 15<br />atabus1 at piixide0 channel 1<br />piixpm0 at pci0 dev 1 function 3<br />piixpm0: vendor 0x8086 product 0x7113 (rev. 0x03)<br />piixpm0: 24-bit timer<br />piixpm0: interrupting at ioapic0 pin 9<br />iic0 at piixpm0: I2C bus<br />vga1 at pci0 dev 2 function 0: vendor 0x1013 product 0x00b8 (rev. 0x00)<br />wsdisplay0 at vga1 kbdmux 1<br />drm at vga1 not configured<br />wm0 at pci0 dev 3 function 0: Intel i82540EM 1000BASE-T Ethernet, rev. 3<br />wm0: interrupting at ioapic0 pin 11<br />wm0: Ethernet address 52:54:00:12:34:56<br />makphy0 at wm0 phy 1: Marvell 88E1011 Gigabit PHY, rev. 0<br />makphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto<br />isa0 at pcib0<br />lpt0 at isa0 port 0x378-0x37b irq 7<br />com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo<br />com0: console<br />com0: kgdb<br />attimer0 at isa0 port 0x40-0x43<br />pcppi0 at isa0 port 0x61<br />midi0 at pcppi0: PC speaker<br />sysbeep0 at pcppi0<br />isapnp0 at isa0 port 0x279<br />npx0 at isa0 port 0xf0-0xff<br />fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2<br />attimer0: attached to pcppi0<br />acpicpu0 at cpu0: ACPI CPU<br />acpicpu1 at cpu1: ACPI CPU<br />wd0 at atabus0 drive 0<br />wd0: <qemu HARDDISK><br />wd0: 5000 MB, 10158 cyl, 16 head, 63 sec, 512 bytes/sect x 10240000 sectors<br />atapibus0 at atabus1: 2 targets<br />cd0 at atapibus0 drive 0: <qemu DVD-ROM, QM00003, 0.13.0> cdrom removable<br />pad0: outputs: 44100Hz, 16-bit, stereo<br />audio0 at pad0: half duplex, playback, capture<br />boot device: wd0<br />root on wd0a dumps on wd0b<br />mountroot: trying smbfs&#8230;<br />mountroot: trying ntfs&#8230;<br />mountroot: trying nfs&#8230;<br />mountroot: trying msdos&#8230;<br />mountroot: trying lfs&#8230;<br />mountroot: trying ext2fs&#8230;<br />mountroot: trying ffs&#8230;<br />root file system type: ffs<br />clock: unknown CMOS layout<br />init: copying out path `/sbin/init&#8217; 11<br />Tue May 10 07:50:12 GMT 2011<br />Starting root file system check:<br />/dev/rwd0a: file system is clean; not checking<br />swapctl: setting dump device to /dev/wd0b<br />swapctl: adding /dev/wd0b as swap device at priority 0<br />Starting file system checks:<br />Setting tty flags.<br />Setting sysctl variables:<br />ddb.onpanic: 2 -> 0<br />Starting network.<br />Hostname: qemu<br />IPv6 mode: host<br />Configuring network interfaces:.<br />Adding interface aliases:.<br />Building databases: dev, utmp, utmpx, services done<br />encoding -> uk<br />Starting syslogd.<br />Mounting all filesystems&#8230;<br />Clearing temporary files.<br />Updating fontconfig cache: done<br />Creating a.out runtime link editor directory cache.<br />Checking quotas: done.<br />swapctl: setting dump device to /dev/wd0b<br />Starting virecover.<br />Checking for core dump&#8230;<br />savecore: no core dump<br />Starting local daemons:.<br />Updating motd.<br />Starting inetd.<br />Starting cron.<br />Tue May 10 07:52:31 GMT 2011</p>
<p>NetBSD/i386 (qemu) (console)</p>
<p>login: root<br />May 10 07:52:45 qemu login: ROOT LOGIN (root) on tty console<br />Last login: Tue May 10 07:46:44 2011 on console<br />Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,<br />2006, 2007, 2008, 2009, 2010, 2011<br />The NetBSD Foundation, Inc.  All rights reserved.<br />Copyright (c) 1982, 1986, 1989, 1991, 1993<br />The Regents of the University of California.  All rights reserved.</p>
<p>NetBSD 5.99.48 (PCC) #1: Tue May 10 07:49:08 BST 2011</p>
<p>Welcome to NetBSD!</p>
<p>This system is running a development snapshot of the NetBSD operating system,<br />also known as NetBSD-current.  It is very possible that it has serious bugs,<br />regressions, broken features or other problems.  Please bear this in mind<br />and use the system with care.</p>
<p>You are encouraged to test this version as thoroughly as possible.  Should you<br />encounter any problem, please report it back to the development team using the<br />send-pr(1) utility (requires a working MTA).  If yours is not properly set up,<br />use the web interface at: http://www.NetBSD.org/support/send-pr.html</p>
<p>Thank you for helping us test and improve NetBSD.</p>
<p>Terminal type is vt100.<br />We recommend that you create a non-root account and use su(1) for root access.<br />qemu# ls<br />.cshrc    .klogin   .lesshst  .login    .profile  .shrc<br />qemu# cat >test.c<br />int<br />main(int ac, char *av[])<br />{<br />printf(&#8220;Hello World!\n&#8221;);<br />return 0;<br />}<br />^D<br />qemu# pcc -o test test.c<br />qemu# ./test<br />Hello World!<br />qemu# shutdown -p now<br />Shutdown NOW!<br />shutdown: [pid 369]<br />qemu#<br />wall: You have write permission turned off; no reply possible</p>
<p>*** FINAL System shutdown message from root@qemu ***<br />System going down IMMEDIATELY</p>
<p>May 10 07:54:14 qemu shutdown: poweroff by root:</p>
<p>System shutdown time has arrived</p>
<p>About to run shutdown hooks&#8230;<br />Stopping cron.<br />Waiting for PIDS: 345.<br />Stopping inetd.<br />Waiting for PIDS: 308.<br />Removing block-type swap devices<br />swapctl: removing /dev/wd0b as swap device<br />Tue May 10 07:54:57 GMT 2011</p>
<p>Done running shutdown hooks.<br />May 10 07:55:10 qemu syslogd[151]: Exiting on signal 15<br />syncing disks&#8230; 3 done</p>
<p>unmounting 0xcb6de004 /proc (procfs)&#8230;<br />unmounting 0xcb68f004 /dev/pts (ptyfs)&#8230;<br />unmounting 0xcb65f604 /kern (kernfs)&#8230;<br />unmounting 0xca77820c / (/dev/wd0a)&#8230;<br />unmounting 0xca77820c / (/dev/wd0a)&#8230;<br />cd0: detached<br />sysbeep0: detached<br />midi0: detached<br />atapibus0: detached<br />npx0: detached<br />pcppi0: detached<br />atabus1: detached<br />makphy0: detached<br />wm0: detached<br />pchb0: detached<br />audio0: detached</p>
<p>unmounting 0xca77820c / (/dev/wd0a)&#8230;<br />forcefully unmounting / (/dev/wd0a)&#8230;<br />wd0: detached<br />atabus0: detached<br />acpi0: entering state S5</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2011/05/10/i-just-saw-on-the-pcc-mailing-list-that-it-just-built-netbsd/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
