Files
ioccc/2004/gavin/index.html
T
Landon Curt Noll c457b16358 fix all HTML headers
Renamed `ioccc.ico` to `favicon.ico`.

Correctly added use of `favicon.ico` to all constructed HTML headers.
Fixed the smart quote in HTML elements problem.

Moved HTML "DO NOT EDIT" comments down below at the bottom of the
HTML phase 1 section.  According to to the Nu Html Checker, a charset
attribute on a meta element found after the first 1024 bytes.

Changed `bin/md2html.sh` VERSION from "1.1.3 2024-03-28"
to "1.2 2024-03-30".

Improved `bin/gen-status.sh` to adjust the "status_update" value
only when the "contest_status" is changed.

Performed a `make www` to perform and test the above under macOS.
2024-03-30 22:21:45 -07:00

359 lines
20 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- END: this line ends content from: inc/top.default.html -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<link rel="stylesheet" href="../../ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2004/gavin - Best of Show</title>
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
<meta name="description" content="2004 IOCCC entry gavin - Best of Show">
<meta name="keywords" content="IOCCC, 2004, IOCCC 2004, IOCCC entry, gavin, Best of Show">
</head>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- END: this line ends content from: inc/head.default.html -->
<!-- -->
<!-- This web page was formed via the tool: bin/readme2index.sh -->
<!-- The content of main section of this web page came from: 2004/gavin/README.md -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2004/gavin/README.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2004/gavin/README.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2004/gavin/README.md !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- Markdown content was converted into HTML via the tool: bin/md2html.sh -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<div class="header">
<img src="../../png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2004/gavin - Best of Show</h2>
</div>
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<div class="topnav">
<a class="Left" href="../gavare/index.html">&larr; gavare</a>
<a class="Left" href="../index.html">&uarr; 2004 &uarr;</a>
<a class="Left" href="../hibachi/index.html">hibachi &rarr;</a>
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/2004/gavin/gavin.c">C code</a>
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/2004/gavin/Makefile">Makefile</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="../../index.html">IOCCC Home</a>
<a href="../../years.html">Winning Entries</a>
<a href="../../authors.html">People who have won</a>
<a href="../../location.html">Location of authors</a>
</div>
<hr>
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="../../bugs.html">Bugs &amp; (mis)features</a>
<a href="../../faq.html#fix_an_entry">Fixing IOCCC entries</a>
<a href="../../faq.html#fix_web_site">Fixing the web site</a>
<a href="../../faq.html#fix_author">Fixing author info</a>
<a href="../../thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="../../judges.html">The IOCCC Judges</a>
<a href="../../contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Gavin_Barraclough">Gavin Barraclough</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>There is an alternate version for those who wish to use QEMU rather than having
to reboot and rely on having a floppy drive (if you even remember what those are
:-) ) etc. See <a href="#alternate-code">alternate code</a> below.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: compiled executable crashes - please help us fix
STATUS: doesn&#39;t work with some platforms - please help us fix
STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2004_gavin">2004 gavin bugs</a>.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./gavin</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<p>To enjoy the results (on a Linux/x86 machine) with a floppy drive (remember
those? We do!):</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">su</span></span></code></pre></div>
<p>Make a floppy with an ext2 filesystem (<code>mke2fs /dev/fd0</code> replacing <code>fd0</code> with
whatever the floppy device is!), mount it under <code>/mnt/floppy</code> and then:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cp</span> kernel fs.tar lilo.conf boot.b /mnt/floppy</span></code></pre></div>
<p>NOTE: If the version of your lilo is not 21.4, use the appropriate boot.b file.</p>
<p>NOTE: If your floppy drive is not <code>/dev/fd0</code>, edit lilo.conf appropriately.</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">lilo</span> <span class="at">-C</span> /mnt/floppy/lilo.conf</span></code></pre></div>
<p>Boot from the floppy on an x86 machine with a PS/2 keyboard and mouse.
Move the window away from the corner.</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">vi</span> gavin.c</span></code></pre></div>
<p>Scroll up and down the file with up-arrow and down-arrow.</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sh</span></span></code></pre></div>
<p>You can have several shell windows:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">vi</span> README.md</span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./prim</span></span></code></pre></div>
<p>Press and hold any key.</p>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version’s main difference is that the macro <code>K</code> is redefined to <code>1</code> so that
you can use it with <code>QEMU</code>.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>The use is mostly the same as <code>gavin</code> except that one initially executes <code>gavin.alt</code>
(which <code>make alt</code> will do) and one will have to use <code>QEMU</code> instead. The files
generated are the same names. See <a href="#to-use">to use</a> and <a href="#try">try</a> above as
well as the judges’ remarks below plus <a href="gavin.html">gavin.html</a>.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Over the years, we’ve seen a program that immediately dumps core if executed on
the “wrong” architectures (e.g., <a href="../../1984/mullender/index.html">1984/mullender</a>) and a
program that dumps core after a while (e.g., <a href="../../2001/bellard/index.html">2001/bellard</a>).
This entry will happily compile and execute on most any architecture - the trick
is that the result, to be useful, must be produced (and can only be enjoyed) on
a particular architecture. We have not decided yet whether to disallow this for
future contests.</p>
<p>If you do not want to mess with a floppy and you use GRUB, see
<a href="gavin.html">gavin.html</a>.</p>
<p>You can put additional text files in <code>fs.tar</code> for browsing with vi.</p>
<p>If you do not want to bother rebooting your computer at all, see
<a href="http://bellard.org" class="uri">http://bellard.org</a> for QEMU (<a href="../../authors.html#Fabrice_Bellard">Fabrice Bellard</a>
is an IOCCC 2001 winning entry), but your experience will be limited; use the
<a href="#alternate-code">alternate code</a> instead. You’ll have to move the mouse to
trigger the initial screen update.</p>
<p>The judges were able to write a few more programs to run in this OS.
What are the limitations for such programs?</p>
<p>What can you do and what can you not do in such programs?</p>
<p>The program called <code>prim</code>, written by the judges, computes and prints prime
numbers.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This is a 32-bit multitasking operating system for x86 computers, with GUI and
filesystem, support for loading and executing user applications in ELF binary
format, with PS/2 mouse and keyboard drivers, and VESA graphics. And a command
shell. And an application - a simple text-file viewer.</p>
<p>The OS has ended up as a traditional monolith with one entry point for syscalls,
with apps treated as cooperative-multitasking tasks that can be sent different
messages (e.g. ‘initialize’, ‘key hit’, ‘render to buffer’) through their main
entry point, and which will return control to the OS after having performed the
necessary work. Applications are passed a pointer to their task structure,
which is partially defined by the OS, and partially for the application’s own
use.</p>
<p>The program compiles into a tool to build a kernel image,
so having built the program, the <a href="Makefile">Makefile</a> will run it,
redirecting the output into a file called <code>kernel</code>.
The Makefile will then proceed to build a root filesystem image.
This involves rebuilding the program with different compiler flags,
then building a tarball containing the resulting programs
(the filesystem format supported by the OS is the tarball format).</p>
<p>For further usage information see <a href="gavin.html">gavin.html</a>.</p>
<p>The filenames <code>vi</code> and <code>sh</code> are significant, and should not be changed.</p>
<h3 id="known-features">Known ‘features’</h3>
<p>Known issues are really too plentiful to list.</p>
<p>If the mouse pointer goes off the left hand side of the screen
it will reappear on the right, and vice-versa.
If it goes off the top or bottom, it will go and corrupt some memory.</p>
<p>The file system is kinda optimistic about matching names, so,
for example if you type the command <code>shell</code> into a command-line
it will execute the program <code>sh</code> - close enough a match for it.</p>
<p>The <a href="https://en.wikipedia.org/wiki/Executable_and_Linkable_Format">ELF binaries</a>
are not loaded at the correct address, and their entry point must be the start
address of the <a href="https://en.wikipedia.org/wiki/Code_segment">text segment</a>.</p>
<p>The keyboard driver can cope with the basic alpha-numeric keys,
but gets confused by fancy things like <code>shift</code> or <code>backspace</code>.</p>
<p>In the text-file viewer, <code>vi</code>, the up/down and PgUp/PgDn keys
scroll up or down by one line. There is nothing to stop you
from scrolling above the top of the file, and pressing any
other keys might have an undefined effect.</p>
<p>The x86 is bootstrapped into 32bit mode in 6 instructions, with 4 more to set up
data/stack segments and a stack-pointer to allow C code to be run. On top of
this there are also about a dozen instructions to switch the video card into
graphics mode. All in all, a relatively tiny number of instructions next to the
size of the C program. Also, the string is mostly composed of data - a
Linux-esque kernel header for the bootloader, protected mode descriptor tables,
keyboard maps, etc. (I should also mention that it contains mini functions to
perform an x86 <code>in</code> and <code>out</code> instruction - to allow the keyboard &amp; mouse to be
driven from C code).</p>
<p>Porting to another architecture should be relatively easy* -
the string simply needs be replaced with one containing
data &amp; code suitable for the new target platform.
Accesses to data in the string are made relative to the define <code>V</code>,
so these may need updating as appropriate (<code>0x90200</code> is the address
at which a Linux bootloader loads an x86 kernel image).</p>
<pre><code>\* ;-)</code></pre>
<!--
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/
-->
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2004gavin"><a name="inventory"></a>Inventory for 2004/gavin</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/gavin/gavin.c">gavin.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/gavin/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/gavin/gavin.alt.c">gavin.alt.c</a> - alternative source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/gavin/gavin.orig.c">gavin.orig.c</a> - original source</li>
<li><a href="gavin.html">gavin.html</a> - author usage guide</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/gavin/lilo.conf">lilo.conf</a> - boot loader configuration</li>
<li><a href="boot.b">boot.b</a> - boot sector</li>
<li><a href="img/fs.tar">img/fs.tar</a> - tar of root file system</li>
<li><a href="img/kernel">img/kernel</a> - Linux kernel x86 boot executable zImage</li>
<li><a href="prim">prim</a> - prime number printing program</li>
<li><a href="2004_gavin.tar.bz2">2004_gavin.tar.bz2</a> - download entry</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/gavin/README.md">README.md</a> - markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/gavin/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/gavin/gavin.md">gavin.md</a> - markdown source for gavin.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/gavin/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
<!-- END: this line ends content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<!--
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/
-->
<div class="footer">
<h2>Copyright and CC BY-SA 4.0 License</h2>
<p>This file and web page is:</p>
<blockquote><b>Copyright &copy; 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
<p>You are free to share and adapt this file under the terms of this license:</p>
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
<p>For more information, see:</p>
<blockquote><a
href="https://creativecommons.org/licenses/by-sa/4.0/">https://creativecommons.org/licenses/by-sa/4.0/</a></blockquote>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2004%2Fgavin%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->