Monthly Archive for December, 2007

New Site Almost Finished!

Frustrated with the long list of bugs involving Internet Explorer, I took a break from developing my new site layout.  However, a few hours ago, I decided to pick up the pieces and see what I could do.

The result was pretty favorable.  I was able to hack my way around numerous IE shortcomings without adding a ridiculous amount of code to make the site inefficient.  In fact, there are only two real problems that I can’t/don’t feel like fixing.  The first is due the lack of the :first-child attribute in IE (this allows me to set properties for the first element in a list, for example).   The second involves changing the background color of list elements.  Other browsers do it fine, but in IE, it is impossible to set the background color in a list element.  As a result, you would need to set background properties for the content in the list element itself.

Things I have left to do:

  • Clean up the CSS a bit more.  Do some testing to remove as much redundant code as possible.
  • Finalize the style.  Add all necessary functions and so forth.
  • Port the theme over to my blog.
  • Test everything.
  • Done!

With a little more work, I should be able to get the site done fairly soon.

VirtualBox and Kernel 2.6.24

So, I decided to switch over to 2.6.24 using a modified version of zen-sources. That was pretty easy. I also installed uvesafb, the new framebuffer for handling splash screens and stuff. That was pretty easy, too. Because I was working off of a new tree, I needed to recompile the only two modules used in my system: nvidia and vboxdrv. So, I redownloaded the latest nVidia driver and installed it. Again, pretty easy. Recompiling vboxdrv, however, wasn’t.

Apparently, there are a few lines of code in the VirtualBox kernel module that conflict with 2.6.24 series kernels (they try redefine a few things that have already been defined in this series of kernels; the 2.6.23 series does not have this problem). To fix this problem, Gentoo developers created a simple patch to stop the kernel module from doing this.

One problem, though: the patch is broken. It tries to patch 2 files: include/iprt/types.h and Config.kmk. When I first tried to reinstall vboxdrv (app-emulation/virtualbox-modules), this problem came up and I dug through some log files to find out what was going on. Apparently, the patch couldn’t find Config.kmk. Neither could I.

So, I decided to try a manual build. I did the following:

ebuild /usr/portage/app-emulation/virtualbox-modules/virtualbox-modules-1.5.2-r1.ebuild fetch
ebuild /usr/portage/app-emulation/virtualbox-modules/virtualbox-modules-1.5.2-r1.ebuild unpack

I then grabbed a copy of Config.kmk and slipstreamed it in. Then, I tried:

ebuild /usr/portage/app-emulation/virtualbox-modules/virtualbox-modules-1.5.2-r1.ebuild compile

But, once again, it failed. This time, the patch against Config.kmk failed. I suppose Innotek drastically changed the document after this patch was written.

So, somewhat fed up, I decided to do the following.

  1. I modified the ebuild, commenting out the code pertaining to the patching.
  2. I ran:

    ebuild /usr/portage/app-emulation/virtualbox-modules/virtualbox-modules-1.5.2-r1.ebuild digest

    This regenerated a digest for the ebuild so that it wouldn’t fail.

  3. I ran the ebuild commands to fetch and unpack the data.
  4. I slipstreamed Config.kmk in (just in case it was still needed).
  5. I patched types.h myself with:

    patch -p0 -g0 -E –no-backup-if-mismatch < /usr/portage/app-emulation/virtualbox-modules/files/virtualbox-modules_2.6.24.patch

  6. I ran:

    ebuild virtualbox-modules-1.5.2-r1.ebuild compile
    ebuild virtualbox-modules-1.5.2-r1.ebuild install
    ebuild virtualbox-modules-1.5.2-r1.ebuild qmerge

  7. Finally, I invoked:

    modprobe vboxdrv

  8. I profited.

Moral of the story: if you are going to use Gentoo, figure out how to use Portage.  If I did, I probably wouldn’t have spent hours being frustrated.

Some Assembly Required

So, I’ve decided to learn assembly. Why? Well, nerdiness for one thing. But more importantly, I’m interested in learning it because I’d like to examine the importance of efficiency. Obviously, in modern computers, the need for efficient code is beginning to disappear. But, there are still plenty of small, embedded devices that are limited by the efficiency of the code. Take calculators, for example. A while ago, one of my friends mused that on a programmable calculator, loops actually need to be optimized. But TI-Basic (which he was referring to) can only be optimized so far. Z80 assembly is used for the most efficiency simply because assembly code has no overhead. It allows the developer to play with all aspects of the system. I’m interested in learning assembly because I’d like to start developing advanced applications in Z80 assembly and in HP’s ARM assembly for their calculators (they also have an emulation layer which runs old Saturn assembly programs, too).

One of my little side projects is to understand how I’m learning the language. I learned Python by reading a few manuals and experimenting with the interpreter. I learned PHP by applying my knowledge of Python, with a new syntax. But learning assembly will be a very different process, since it is so foreign to me. I intend to place emphasis more on the actual learning of the language rather than experimentation (until I know what I’m doing).

I am still looking for good guides to follow. I have already found quite a few (I’ll post them later) that have been helpful.

In other news, I’ve been playing around with transparency in GD/PHP (more avatar rotating scripts coming). That has not been fun. I’m just about to give up on it. Usually when I’m at that point, though, it probably means that something is wrong with the server configuration or something. I’ll have to install PHP to a test box to see if that could be the problem.

By the way:
http://xkcd.com/353/
That pretty much sums up my feelings, too.