<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Making an ELF in a bochs</title>
	<atom:link href="http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs/feed" rel="self" type="application/rss+xml" />
	<link>http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs</link>
	<description>Thoughts on Programming, Life, and Travel</description>
	<lastBuildDate>Thu, 24 Nov 2011 18:08:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Alex</title>
		<link>http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs/comment-page-1#comment-439</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sun, 06 Jul 2008 04:53:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexmccarthy.net/?p=128#comment-439</guid>
		<description>If you just use the script that posts to the emulator, don&#039;t run the script that posts to the school machines, copy over the bios/floppy images/etc (once!), and run the 452mkemu script (once!) on your machine, I think that you shouldn&#039;t need an internet connection to work.

Also, if you&#039;re playing around with bochs on your home machine, you can boost the IPS (instructions per second) in the 452mkemu script to make bochs a lot snappier</description>
		<content:encoded><![CDATA[<p>If you just use the script that posts to the emulator, don&#8217;t run the script that posts to the school machines, copy over the bios/floppy images/etc (once!), and run the 452mkemu script (once!) on your machine, I think that you shouldn&#8217;t need an internet connection to work.</p>
<p>Also, if you&#8217;re playing around with bochs on your home machine, you can boost the IPS (instructions per second) in the 452mkemu script to make bochs a lot snappier</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs/comment-page-1#comment-438</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Sun, 06 Jul 2008 03:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexmccarthy.net/?p=128#comment-438</guid>
		<description>I would rather run everything locally so that a computer without Internet connection (or extremely slow connection in my case) can still work.  So I have created a script for mounting the floppy image, copying the modules and kernel, recreating grub&#039;s menu.lst, and umounting the floppy.  It uses sudo as I couldn&#039;t figure out how to mount arbitary image file as users.

---------------------------------------------------------
#!/bin/bash
sudo modprobe loop
sudo mount -o loop otherfloppy.img /mnt/floppy
EMUDIR=/mnt/floppy
MENU=$EMUDIR/grub/menu.lst

if [ -e $MENU ] ; then
  rm $MENU &#124;&#124; exit 1
fi

if [ ! -e $MENU ] ; then
  touch $MENU
fi

TITLE=&quot;$1&quot;
shift

if [ &quot;x$TITLE&quot; = x ] ; then
  echo &quot;Usage: $0 title kernel [modules]&quot;
  exit 1
fi

gawk &#039;BEGIN { inside = 0; } /^title &#039;&quot;$TITLE&quot;&#039;$/ { inside = 1; next } /^title / { inside = 0; } { if (!inside) print; }&#039;  $MENU.tmp
mv $MENU.tmp $MENU

KERNEL=&quot;$1&quot;
shift
if [ &quot;x$KERNEL&quot; = x ] ; then
  echo &quot;Usage: $0 title kernel [modules]&quot;
  exit 1
fi

if [ ! -e &quot;$KERNEL&quot; ] ; then
  echo &quot;Kernel $KERNEL does not exist. Aborting&quot;
  exit 1
fi

cp $KERNEL $EMUDIR
KERNEL=`basename &quot;$KERNEL&quot;`

if [ -e $MENU.prepend ] ; then rm $MENU.prepend ; fi
echo &quot;title $TITLE&quot; &gt;&gt; $MENU.prepend
echo &quot;root (fd0)&quot; &gt;&gt; $MENU.prepend
echo &quot;kernel /$KERNEL&quot; &gt;&gt; $MENU.prepend

MODULE=&quot;$1&quot;
shift
while [ &quot;x$MODULE&quot; != x ]; do
  if [ ! -e &quot;$MODULE&quot; ] ; then
    echo &quot;Module $MODULE does not exist. Aborting&quot;
        exit 1
  fi
  cp $MODULE $EMUDIR
  MODULE=`basename &quot;$MODULE&quot;`
  echo &quot;module /$MODULE&quot; &gt;&gt; $MENU.prepend
  MODULE=&quot;$1&quot;
  shift
done

cat $MENU &gt;&gt; $MENU.prepend
mv $MENU.prepend $MENU
sudo umount /mnt/floppy

-------------------------------------------------------
I resized the file image as it is too small.

$ resize2fs otherfloppy.img 2M</description>
		<content:encoded><![CDATA[<p>I would rather run everything locally so that a computer without Internet connection (or extremely slow connection in my case) can still work.  So I have created a script for mounting the floppy image, copying the modules and kernel, recreating grub&#8217;s menu.lst, and umounting the floppy.  It uses sudo as I couldn&#8217;t figure out how to mount arbitary image file as users.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
#!/bin/bash<br />
sudo modprobe loop<br />
sudo mount -o loop otherfloppy.img /mnt/floppy<br />
EMUDIR=/mnt/floppy<br />
MENU=$EMUDIR/grub/menu.lst</p>
<p>if [ -e $MENU ] ; then<br />
  rm $MENU || exit 1<br />
fi</p>
<p>if [ ! -e $MENU ] ; then<br />
  touch $MENU<br />
fi</p>
<p>TITLE=&#8221;$1&#8243;<br />
shift</p>
<p>if [ "x$TITLE" = x ] ; then<br />
  echo &#8220;Usage: $0 title kernel [modules]&#8221;<br />
  exit 1<br />
fi</p>
<p>gawk &#8216;BEGIN { inside = 0; } /^title &#8216;&#8221;$TITLE&#8221;&#8216;$/ { inside = 1; next } /^title / { inside = 0; } { if (!inside) print; }&#8217;  $MENU.tmp<br />
mv $MENU.tmp $MENU</p>
<p>KERNEL=&#8221;$1&#8243;<br />
shift<br />
if [ "x$KERNEL" = x ] ; then<br />
  echo &#8220;Usage: $0 title kernel [modules]&#8221;<br />
  exit 1<br />
fi</p>
<p>if [ ! -e "$KERNEL" ] ; then<br />
  echo &#8220;Kernel $KERNEL does not exist. Aborting&#8221;<br />
  exit 1<br />
fi</p>
<p>cp $KERNEL $EMUDIR<br />
KERNEL=`basename &#8220;$KERNEL&#8221;`</p>
<p>if [ -e $MENU.prepend ] ; then rm $MENU.prepend ; fi<br />
echo &#8220;title $TITLE&#8221; &gt;&gt; $MENU.prepend<br />
echo &#8220;root (fd0)&#8221; &gt;&gt; $MENU.prepend<br />
echo &#8220;kernel /$KERNEL&#8221; &gt;&gt; $MENU.prepend</p>
<p>MODULE=&#8221;$1&#8243;<br />
shift<br />
while [ "x$MODULE" != x ]; do<br />
  if [ ! -e "$MODULE" ] ; then<br />
    echo &#8220;Module $MODULE does not exist. Aborting&#8221;<br />
        exit 1<br />
  fi<br />
  cp $MODULE $EMUDIR<br />
  MODULE=`basename &#8220;$MODULE&#8221;`<br />
  echo &#8220;module /$MODULE&#8221; &gt;&gt; $MENU.prepend<br />
  MODULE=&#8221;$1&#8243;<br />
  shift<br />
done</p>
<p>cat $MENU &gt;&gt; $MENU.prepend<br />
mv $MENU.prepend $MENU<br />
sudo umount /mnt/floppy</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
I resized the file image as it is too small.</p>
<p>$ resize2fs otherfloppy.img 2M</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denver Gingerich</title>
		<link>http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs/comment-page-1#comment-437</link>
		<dc:creator>Denver Gingerich</dc:creator>
		<pubDate>Thu, 26 Jun 2008 13:32:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexmccarthy.net/?p=128#comment-437</guid>
		<description>I saw your post on uw.cs.cs452, read this blog post, and then remembered that I had run into this problem before and fixed it.  I regularly read uw.cs.cs452 to see if there are any problems people are running into that I&#039;ve seen before so I can help them out.

With CS 452, a lot of time can be spent seeking out the information needed to do a particular thing (like implementing a PS/2 mouse driver, for example).  Spending time finding these things does not seem useful, especially when it&#039;s been found before and it&#039;s not integral to the point of the course.  So if I can make this information available (since I found it in the past, for example) then it will make the lives of future CS 452 students much less painful.

By the way, you should &lt;a href=&quot;http://wordpress.org/extend/plugins/openid/&quot; rel=&quot;nofollow&quot;&gt;add OpenID support&lt;/a&gt; to your blog.  Among other things, this would allow you to let OpenID-authenticated users post without moderation.</description>
		<content:encoded><![CDATA[<p>I saw your post on uw.cs.cs452, read this blog post, and then remembered that I had run into this problem before and fixed it.  I regularly read uw.cs.cs452 to see if there are any problems people are running into that I&#8217;ve seen before so I can help them out.</p>
<p>With CS 452, a lot of time can be spent seeking out the information needed to do a particular thing (like implementing a PS/2 mouse driver, for example).  Spending time finding these things does not seem useful, especially when it&#8217;s been found before and it&#8217;s not integral to the point of the course.  So if I can make this information available (since I found it in the past, for example) then it will make the lives of future CS 452 students much less painful.</p>
<p>By the way, you should <a href="http://wordpress.org/extend/plugins/openid/" rel="nofollow">add OpenID support</a> to your blog.  Among other things, this would allow you to let OpenID-authenticated users post without moderation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs/comment-page-1#comment-436</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 26 Jun 2008 05:58:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexmccarthy.net/?p=128#comment-436</guid>
		<description>Thanks for the tip, Denver.  Consider the course staff to be officially pestered.

Out of curiosity, what brings your advice to this doorstep?</description>
		<content:encoded><![CDATA[<p>Thanks for the tip, Denver.  Consider the course staff to be officially pestered.</p>
<p>Out of curiosity, what brings your advice to this doorstep?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denver Gingerich</title>
		<link>http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs/comment-page-1#comment-435</link>
		<dc:creator>Denver Gingerich</dc:creator>
		<pubDate>Thu, 26 Jun 2008 00:54:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexmccarthy.net/?p=128#comment-435</guid>
		<description>The reason you couldn&#039;t compile everything with GCC 4 is likely that you need to update your Makefile to use new library paths.  I described how to update these paths in a past uw.cs.cs452 newsgroup post:

http://groups.google.com/group/uw.cs.cs452/browse_thread/thread/5dab31bbcd7df344/6fe6e79853215517

Unfortunately, the course staff haven&#039;t updated the &lt;a href=&quot;http://www.student.cs.uwaterloo.ca/~cs452/docs/crosscompiler.html&quot; rel=&quot;nofollow&quot;&gt;cross-compilation page&lt;/a&gt; yet.  If someone wishes get it updated, I suggest pestering the course staff every once in a while until it&#039;s done.

It would be nice if someone could confirm that this works with the latest GCC (currently 4.3.1).  I would suggest using the latest versions of all the tools, but I suppose if you don&#039;t want to deal with any unforeseen compile problems when you switch back to the school servers, then you&#039;d want to use the versions they use.  In practice, such compile problems almost never occur.</description>
		<content:encoded><![CDATA[<p>The reason you couldn&#8217;t compile everything with GCC 4 is likely that you need to update your Makefile to use new library paths.  I described how to update these paths in a past uw.cs.cs452 newsgroup post:</p>
<p><a href="http://groups.google.com/group/uw.cs.cs452/browse_thread/thread/5dab31bbcd7df344/6fe6e79853215517" rel="nofollow">http://groups.google.com/group/uw.cs.cs452/browse_thread/thread/5dab31bbcd7df344/6fe6e79853215517</a></p>
<p>Unfortunately, the course staff haven&#8217;t updated the <a href="http://www.student.cs.uwaterloo.ca/~cs452/docs/crosscompiler.html" rel="nofollow">cross-compilation page</a> yet.  If someone wishes get it updated, I suggest pestering the course staff every once in a while until it&#8217;s done.</p>
<p>It would be nice if someone could confirm that this works with the latest GCC (currently 4.3.1).  I would suggest using the latest versions of all the tools, but I suppose if you don&#8217;t want to deal with any unforeseen compile problems when you switch back to the school servers, then you&#8217;d want to use the versions they use.  In practice, such compile problems almost never occur.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex&#8217;s Alliterative Adventures &#187; Copying files with ssh</title>
		<link>http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs/comment-page-1#comment-433</link>
		<dc:creator>Alex&#8217;s Alliterative Adventures &#187; Copying files with ssh</dc:creator>
		<pubDate>Mon, 23 Jun 2008 02:52:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexmccarthy.net/?p=128#comment-433</guid>
		<description>[...] at 1Gbit in the labs, so bandwidth isn&#8217;t the bottleneck. I followed Alexei&#8217;s lead and compressed our files: tar -cjf files.tar.bz2 $FILES scp files.tar.bz2 $LOGIN@$SERVER ssh $LOGIN@$SERVER tar -xjf [...]</description>
		<content:encoded><![CDATA[<p>[...] at 1Gbit in the labs, so bandwidth isn&#8217;t the bottleneck. I followed Alexei&#8217;s lead and compressed our files: tar -cjf files.tar.bz2 $FILES scp files.tar.bz2 $LOGIN@$SERVER ssh $LOGIN@$SERVER tar -xjf [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexei Karpenko</title>
		<link>http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs/comment-page-1#comment-432</link>
		<dc:creator>Alexei Karpenko</dc:creator>
		<pubDate>Mon, 16 Jun 2008 00:07:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexmccarthy.net/?p=128#comment-432</guid>
		<description>Yes, I have remote directory set up, it&#039;s pretty nice to work with remote files. It might be faster to use that, so I should give it a try. A friend told me also that &quot;rsync -e ssh&quot; is faster than scp in his experience, so that might be also worth considering.

As for IDE, I have been using GEdit but might try Anjuta soon. My computer is pretty slow with Eclipse, unfortunately...</description>
		<content:encoded><![CDATA[<p>Yes, I have remote directory set up, it&#8217;s pretty nice to work with remote files. It might be faster to use that, so I should give it a try. A friend told me also that &#8220;rsync -e ssh&#8221; is faster than scp in his experience, so that might be also worth considering.</p>
<p>As for IDE, I have been using GEdit but might try Anjuta soon. My computer is pretty slow with Eclipse, unfortunately&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs/comment-page-1#comment-431</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sun, 15 Jun 2008 20:22:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexmccarthy.net/?p=128#comment-431</guid>
		<description>That would definitely do it. I&#039;m working from the labs, and I&#039;m plugged in at something like 1GB/s :P

Yeah, my thoughts exactly. I&#039;m really new to linux too. I wonder if it&#039;s possible to have an always-open ssh session in the background... I also read something something about mount a remote directory as a drive that might speed up the scp. I guess that I have something to play with once we hand in this assignment ;)

Are you using eclipse? It&#039;s like living in the lap of luxury..</description>
		<content:encoded><![CDATA[<p>That would definitely do it. I&#8217;m working from the labs, and I&#8217;m plugged in at something like 1GB/s <img src='http://www.alexmccarthy.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Yeah, my thoughts exactly. I&#8217;m really new to linux too. I wonder if it&#8217;s possible to have an always-open ssh session in the background&#8230; I also read something something about mount a remote directory as a drive that might speed up the scp. I guess that I have something to play with once we hand in this assignment <img src='http://www.alexmccarthy.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Are you using eclipse? It&#8217;s like living in the lap of luxury..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexei Karpenko</title>
		<link>http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs/comment-page-1#comment-430</link>
		<dc:creator>Alexei Karpenko</dc:creator>
		<pubDate>Sun, 15 Jun 2008 20:14:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexmccarthy.net/?p=128#comment-430</guid>
		<description>Hmm, perhaps. Your connection speed is probably a factor too. With my connection (Rogers Hi-Speed, heh...), compressed is faster by about 3 seconds.

It would be nice to combine scp and ssh into one single ssh call so that the connection isn&#039;t established and reestablished twice. But my Linux Fu is not strong enough :(</description>
		<content:encoded><![CDATA[<p>Hmm, perhaps. Your connection speed is probably a factor too. With my connection (Rogers Hi-Speed, heh&#8230;), compressed is faster by about 3 seconds.</p>
<p>It would be nice to combine scp and ssh into one single ssh call so that the connection isn&#8217;t established and reestablished twice. But my Linux Fu is not strong enough <img src='http://www.alexmccarthy.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.alexmccarthy.net/archives/2008/06/13/making-an-elf-in-a-bochs/comment-page-1#comment-429</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sun, 15 Jun 2008 19:45:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexmccarthy.net/?p=128#comment-429</guid>
		<description>We were just straight-up copying our files without compression, so I tried adding some tar magic to our special sauce. When posting 4 modules to the servers, we averaged around 2.7s without compression, and something like 3.1s with :O A cool experiment, though. I wonder if the balance will shift when we start uploading more modules?</description>
		<content:encoded><![CDATA[<p>We were just straight-up copying our files without compression, so I tried adding some tar magic to our special sauce. When posting 4 modules to the servers, we averaged around 2.7s without compression, and something like 3.1s with :O A cool experiment, though. I wonder if the balance will shift when we start uploading more modules?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

