20081111

EEE and Firefox Full Screen

I found that this little hack for your ~/.mozilla/firefox/[profile]/chrome/userChrome.css file greatly improved the usability of Firefox on the EEE PC. It makes the bookmarks toolbar, as well as the menubar (File, Edit, etc) visible from full screen mode simply by moving the mouse up to the top of the screen. When the mouse is moved away, all toolbars are autohidden, giving you that great full screen browsing ability!

#navigator-toolbox:hover > #PersonalToolbar,
#navigator-toolbox:hover > #toolbar-menubar
{
visibility: visible !important;
}

Many thanks to sewpafly for the above chrome fragment!

There is one shortcoming of this that I've already noticed. Namely, when I move the mouse up to the top of the screen, and then above a tab to close it, all of the toolbars autohide before I can close the tab. Normally, this is no problem for closing a tab (Ctrl+w), but for closing other tabs, no shortcut key exists yet, so it's only possible to do by mouse :P

This reminds me of two shortcut key proposals that I had way back when:

1) Ctrl+Shift+w - close all other tabs
2) Ctrl+Shift+PgUp/PgDown - move tab right / left

Those are both 'borrowed' from the Gnome Terminal, but I think they apply quite well to Firefox too.

20081103

SPSS 16 on the EEE PC


If you encounter an error in the SPSS 16 installer for Linux that says "No Java Runtime Environment (JRE) was found on this system", then I think I have the solution for you. The problem is that the installer does not properly run the bundled JRE that it installs in its own temporary directory. So, although the error sounds as though it's not finding your JRE, it's actually not finding its own JRE.

I'll start from the beginning, because this isn't the only part of the installation where I encountered errors.

A friend of mine asked me to install her copy of SPSS 16 for Linux on her EEE PC. She met all of the system requirements (aside from the screen resolution and minimum CPU speed), but still could not get the installation to work.



First I just tried to run the installer file, 'setup.bin', and the installer exited almost immediately. I scrolled up to find out that it could not find 'bc', the arbitrary precision calculator. So I followed the instructions here and installed bc with 'apt-get update; apt-get install bc'.

Then setup.bin failed with the message, "The directory /tmp does not contain enough space to extract temporary files. Please specify a temporary directory using the -is:tempdir option. Use the -is:help option for more information." So, I ended up using her 2 GB USB memory stick for the temporary directory (I reformatted it to use ext2). At this point, I was using './setup.bin -is:tempdir /media/D\:/tmp' for the setup command.

That failed as well, but this time with the message, "No Java Runtime Environment (JRE) was found on this system". I thought that was odd, so I ran './setup.bin -is:help' again and noticed that there was an '-is:javahome' option. So, I ran 'ls -la `which java`', and found that java was a symbolic link which pointed to /etc/alternatives/java, which was also a symbolic link pointing to /usr/lib/jvm/java-1.5.0-sun/jre/bin/java. Then I ran the installer again, and it failed with the same message. At this point, my setup command was './setup.bin -is:tempdir /media/D\:/tmp -is:javahome /usr/lib/jvm/java-1.5.0-sun/jre'.

I ran './setup.bin -is:help' again to see if somehow it could point me in the right direction, because the installation instructions were pretty horrible. I noticed the '-is:log' option, so I ran the setup again with the command './setup.bin -is:tempdir /media/D\:/tmp -is:javahome /usr/lib/jvm/java-1.5.0-sun/jre -is:log /media/D:\:/tmp/spss.log'. That gave me the hint at what was really happening. The log file ended with, "installing bundled JRE... Verifying... /media/D:/tmp/istemp2346224982367/_bundledJRE_/bin/java -cp /media/D:/tmp/istemp2346224982367/Verify.jar Verify java.vendor java.version Verification failed for /media/D:/tmp/istemp2346224982367/_bundledJRE_ using the JVM file /media/D:/tmp/istemp2346224982367/_bundledJRE_/jvm".


Sure enough, if I said '/media/D:/tmp/istemp2346224982367/_bundledJRE_/bin/java -cp /media/D:/tmp/istemp2346224982367/Verify.jar Verify java.vendor java.version', I would get the error message, "Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object".

I knew that this was a serious boo-boo on the part of whoever designed this installer (very poor quality control), so instead of hacking the jvm file during runtime, I thought I would try a different trick so that the various paths and environment variables where not messed up.

mount -o bind /media/D\:/tmp /tmp

This effectively gives me the storage space for -is:tempdir in /media/D\:/tmp, but allows programs to access /media/D\:/tmp from /tmp instead (the default place for -is:tempdir). Using only './setup.bin' this time, the setup proceeded past extracting the bundled JRE, verifying it, and extracting the installation archive, but then setup exited with the error, "The installer is unable to run in graphical mode. Try running the installer with the -console or -silent flag."

I knew that loss of X was pretty typical to using 'sudo', so I changed /etc/sudoers with the command 'visudo', and added "XAUTHORITY DISPLAY" to env_keep in the Defaults declaration. At that point, I had to end my sudo session and start a new one. I verified that XAUTHORITY and DISPLAY were preserved after I started my sudo session with 'sudo -s', 'env | grep "XAUTHORITY\|DISPLAY"'. At that point, all I had to do was close the terminal application, reopen it with Ctrl+Alt+t, start a sudo session with sudo -s, and run './setup.bin'. Then the installer worked perfectly. There are also a few patches to SPSS 16 for Linux as well, located here.

I haven't tried installing them yet, but hopefully they will work 'out of the box'.

I know that this wasn't a very short and sweet how-to, but ... well... I didn't write the installer script, and I didn't really feel like modifying it (which would probably be some kind of copyright violation if I redistributed it), so I thought I would just describe the fix for anyone to read. Hopefully the SPSS people will read this and fix this installation bug for their next release.

Install BC - The Arbitrary Precision Calculator
Format a USB memory stick with Ext2, use as tempdir
Mount tempdir (bind) at /tmp
Edit /etc/sudoers to preserve XAUTHORITY DISPLAY

20081028

Android Porting Progress

Hi everyone,

Sorry I haven't posted anything recently, but my days were busy with work, and then my nights were busy porting Android to the FreeRunner. In short, it's coming along, slowly but surely.

I've basically had to teach myself ARM assembly language in the last couple of days (fun, fun, fun!) and thought that I would quickly share all of useful resources that I've come across. So here they are:

The ARM Architecture Reference Manual

This is the definitive reference for pretty much everything. After reading this, I don't think I'll need any other reference material. In fact, I might even print myself a hard copy!

UNSW lab material on microprocessors and embedded systems

This is a surprisingly detailed tutorial for programming ARM in assembly language and C, which sort of bridges the gap between the two languages. It explains precisely the syntax of .S files and complies to the AAPCS (ARM Procedure Call Standard) and Thumb Procedure Call Standard (TPCS). I've archived the material for future reference in case this course website ever goes missing (which tends to happen often with universities).

Finally, the diff that I'm working from

Yes, I realize that it's pretty lame to cling to a single version of Android and not be constantly synchronizing with git and submitting code for review with gerrit, but I have no intentions of targetting anything aside from the FreeRunner / Neo1973 with my port, so I don't really want to deal with the build infrastructure right now. Ignore anything that starts with the less-compatible regular expression '^\- .*smull' (search by hitting '/') - I seem to have hastily deleted those routines in order to get my code to trivially compile before. Please, I don't recommend even trying to apply the diff as a patch - it will do nothing and may even inflict pain on some remote small kitten... and you wouldn't want that, would you? ... But seriously, the diff just highlights what code needs to be worked on. It actually has a lot of 'cruft', i.e. garbage, too, so just look for any lines matching '^\- ' that also contain one of the opcodes listed on the wiki.

Now from what I've been looking at in the code, there are 3 different options for optimizing the .S files for ARMv4T

1) using preprocessor macros for simple opcode translation
2) using globally visible AAPCS-compatible functions for emulating the v5TE instructions (this is where the UNSW tutorial has really come in handy). This is necessary for opcodes that are slightly more complicated, or ones with tricky addressing modes. The GNU preprocessor doesn't really have the capabilities to become a fully fledged scripting language unfortunately.
3) individual, call-by-call changes ... this is the ugly one that I don't really want to touch... but I'm guessing I will have to at some point.

Good luck with your porting efforts!

Chris


Enjoy!

PS: I find black sabbath very useful for putting myself into the 'zone' for programming in ARM assembly.

20081022

Android FreeRunner Updates

Well, I feel as though I've made significant progress in less than one day. I have Android trivially compiling for the ARMv4T / FreeRunner! By saying it compiles 'trivially', i mean that all I've done is remove the ARMv5E instruction extensions and gotten the build process to atually finish without errors. See my post on the android-porting mailing list for further info.

There obviously needs to be a different kernel configuration, but Benno has already done that.

20081021

Hello, Open-Source World!

It's official... Google's brainchild, Android, has finally said
Hello, Open-Source World!

I wonder how many hours it will take for the first Neo 1973 or Neo FreeRunner port to surface. The biggest challenge, it will seem, will be to provide a bridge between the (minimal) ARMv5TE instruction set that Android was designed for, and the OpenMoko handsets' ARMv4T instruction set (as present in the Samsung 2442 SoC).

Perhaps the next handset that OpenMoko releases will feature native ARMv5TE compatibility.

Update: I've been building android for the last few hours, having made a few build-oriented changes that I think will help bridge the ARMv5TE - ARMv4T gap. I'm going to list a few of the errors I've been running into below. Please note - although I only list each undefined instruction once, the errors occur in multiplicity and in different subdirectories. I will post ARMv4T compliant work-arounds soon. Please be patient.

  • bionic/libc/arch-arm/bionic/memcmp.S:44: Error: selected processor does not support `pld [r0,#0]
  • system/core/libpixelflinger/t32cb16blend.S:121: Error: selected processor does not support `smulbb lr,r7,lr'
  • system/core/libpixelflinger/t32cb16blend.S ... Error: selected processor does not support `smulbt ...'
  • external/jpeg/jidctfst.S:148: Error: selected processor does not support `smlabb r0,r2,r3,r5'
  • dalvik/vm/arch/arm/CallEABI.S:239: Error: selected processor does not support `blx ip'
  • dalvik/vm/mterp/out/InterpAsm-armv5.S:2653: Error: selected processor does not support `ldrd r2,[r0,#offStaticField_value]'
  • dalvik/vm/mterp/out/InterpAsm-armv5.S ... Error: selected processor does not support `strd ...'
  • external/sonivox/arm-wt-22k/lib_src/ARM-E_mastergain_gnu.s:77: Error: selected processor does not support `smulwb r4,r4,nGain'
  • external/sonivox/arm-wt-22k/lib_src/ARM-E_voice_gain_gnu.s:114: Error: selected processor does not support `smlawb tmp1,gainLeft,tmp0,tmp1'
  • external/opencore//codecs_v2/audio/aac/dec/src/calc_auto_corr.cpp
    /tmp/ccBi9nUH.s: Assembler messages:
    /tmp/ccBi9nUH.s:652: Error: selected processor does not support `clz r0,ip'
  • smultt, smlatt, smlawt, smulwt, qadd, qsub, qdadd, qdsub, smlabt
  • etc, etc, etc ...
Build problems that were not architecturally related:
  • out/target/product/generic/obj/SHARED_LIBRARIES/libdvm_intermediates/Misc.o: In function `dvmAllocBit': dalvik/vm/Misc.c:247: undefined reference to `ffs'
Theoretically, there are three possibilities to in order to have Android on the FreeRunner.
  • The first is to ] replace [ the red-highlighted mnemonics using an equivalent ARMv4 or ARMv4T instruction sequence. In some cases, this is impossible without a lot of context information.
  • The second is to completely re-implement each section from scratch, wherever one of the ARMv5TE instructions are issued, but using an algorithm optimized for the ARMv4 or ARMv4T architecture
  • The third option is to just remove it, e.g. for the pld instruction which only optimizes memory fetches by hinting (or not?)

20081014

The 2008 Election

It looks as though Canada will again be under a minority conservative regime until we hold our next election. The results of our 2008 election are almost identical to that of 2006 (300 000 000 #$!@#^@!ing dollars later) but with a few notes. Voter turnout was only 59% - the worst in the history of Canada - with only 13832972 of 23401064 registered electors casting a ballot (that does not include unregistered voters). However, I'm happy to see that the Liberals, NDP, Bloc Quebecois, and Green Party managed to prevent a majority conservative government disaster.

It's terribly tragic that Canadians were seduced into voting for the conservative party out of fear for our economic situation - a situation which the conservative party must take a large part of responsibility for. Please let me take this opportunity to apologize to the rest of the world; Canada had her chance to show the world's developing nations how we, the developed nations, deal with environmental issues. By allowing ourselves to continue subjugation to Harper's slippery oil-mafia, we have basically written an environmental cheque that our asses cannot cash.

Green party results by province
ProvinceNumber of Votes%
Alberta1115059
British Columbia1687239
Manitoba317237
New Brunswick226836
Newfoundland32742
Northwest Territories7526
Nova Scotia350228
Nunavut6758
Ontario4114448
Prince Edward Island34885
Quebec1262994
Saskatchewan232796
Yukon188013
Green Votes826747
The size of a metropolitan city...
6%
and we still don't have 1 single seat in the house of commons


I hope that the Harper government acknowledges that poor voter turnout had a huge hand in their minority victory yesterday. There are many Canadians who were unable to make it to the ballot box due to extenuating circumstances - the working class in particular - a huge contrast to Harper's generally upper-class representation. On the other hand, there are probably a lot of Canadians who have such little confidence in our system that they choose not to vote. Some vote because they have not been following the debates.

One thing that was very interesting to observe is that None of the metropolitan cities in Canada (Toronto, Vancouver, Montreal) were won over by the Conservative party. My guess is because we are the ones who primarily have to deal with the smog. People in urban environments are usually have the lesser addiction to oil.

In any event, the Green Party has achieved such an amazing increase in voter turnout from previous years. However, of the ~ 14 million people who voted, ~ 1 million of those voted for the Green Party, yet we still don't have a single seat representing our interests in the House of Commons due to the MP system.

Seriously, we need to reform the way that we vote in this country - why not assign a score to each political candidate instead of voting for a single one? Also, account for "no-shows" and "no-confidence" votes. Mathematically, proportional representation just makes more sense. Account for the loss of power by rural communities by giving rural areas more municipal and regional power, while the interests of the greater public are represented proportionally.

20081006

Linux-2.6.27-rc8 on the EEE 702

Although the Linux kernel version 2.6.27 has not yet been officially released, I was able to download, build and patch release-candidate-8 for my EEE PC with many notable improvements - most notably a working ath5k module. Correction: The Linux kernel version 2.6.27 was released 20081009 and you can read the changes here.

First of all, I was actually planning on using the 2.6.26-gentoo sources, which implemented the changes upstream that I had made for the 2.6.24-eee-r1 sources, because it already had the eeepc-laptop module sources included, and (limited) ath5k support.

However, when I tried to 'modprobe ath5k' with the 2.6.26-gentoo kernel, I encountered a nasty error message saying that the AR2425 chip is still under development (boo-urns!), and that support for the AR2425 chip would be included in the 2.6.27 sources. That made me revert back to my 2.6.24-eee-r1 linux kernel, but not for long!

Having never been the type to accept defeat so easily, I decided to use the vanilla-sources-2.6.27-rc8. The main difference between the vanilla and Gentoo sources are, that the Gentoo kernel sources (and subsequently the eee sources) are patched versions of the vanilla kernel, which include security fixes as well as various other features (SquashFS for example).

Now, I do need SquashFS for my squashed portage, but the security patches I could do without for the time being, until Kernel.org, and Gentoo, release their respective 2.6.27 kernel sources. Aside from that, I would need to compile external modules for the EEE pc, such as uvcvideo (webcam), eeepc-linux (Fan / CPU / FSB control).

Thanks to the inclusion of the eeepc-laptop sources, providing ACPI interfaces for all of the EEE PC Fn buttons, I could now omit the external asus-acpi module, as well as the quasi-proprietary ath_hal module provided with net-wireless/madwifi-ng.

Yes, that's right! Now the Atheros chipset on the EEE PC will work with the standard 'wext' wireless interface, allowing the unpatched version of NetworkManager to run seamlessly!!! Although I have switched to WICD since the last time I tried to use NetworkManager, but I thought I'd mention the changes anyway.

Here are a few patches that might be of interest:
eeepc-linux-2.6.27-rc8.patch
linux-2.6.27-rc8-squashfs3.4.patch
atl2-2.6.27-rc8.patch

All of these will work with sys-kernel/vanilla-sources-2.6.27_rc8.

Enjoy!

20080926

New Overlay for Syscomp Design

I recently used my digital storage oscilloscope and  function generator for the first time since retrieving all of my electronics from storage after returning from Germany. These are really handy devices for examining low-frequency (pre-micro) electronics. After I wrote a couple of ebuilds to install the Open Instrumentation Project software, I thought I'd make the ebuilds publicly available.

Syscomp Design is incidentally run by a former professor of mine from Ryerson, Peter Hiscocks. I thoroughly enjoyed his course on microprocessor / microelectronic interfacing, and luckily did so before he went into early retirement. On a somewhat unrelated note, we're both part of the TLUG :) It's good to see that Prof. Hiscocks is keeping himself busy these days - Syscomp just released a new device that obseletes both of the units I bought 3 years ago! Although he mentioned that the older oscilloscope circuit has more dedicated storage space and time resolution.

If anyone would like to check out the overlay using layman, then you should be able to do it with the following command
layman -o http://virtb.visibleassets.com:2080/layman.conf -a syscomp

After that, you should be able to do the following (as root)
for i in dso101 cgr101 wgm101; do
echo "sci-electronics/$i" >> /etc/portage/package.keywords
done
emerge -av1 dso101 cgr101 wgm101

I've contributed two patches (one for wgm and another cgr) which allow for more flexible storage of the program files in /usr/lib.

Enjoy!

20080919

EEE 702 Has Poor Graphics Performance

I've owned my EEE 8G for quite a long time and also fully customized the software on it as a binary Gentoo distribution. However, one thing that I've found noticeably lacking is the performance of full-screen video. The video device on the EEE is an Intel 915 Mobile Graphics chip, which I believe uses shared memory.

If you know of a way to improve the video framerate of the EEE, then please post your Xorg.conf and related mesa / intel driver versions.

Thane Heins' Demos on 'Back EMF'

The interpretation of the results obtained by Thane Heins are under quite a bit of debate. Many people doubt their own eyes because they seem to think that he's create 'free energy'. Even a prof at MIT is 'stumped'.

Another engineer friend of mine who's well versed in electric motors is going to try to replicate the experiment and hopefully see exactly where the extra energy is coming from. Many people have been able to charge a battery from their self-built apparatus.

Results of search "Thane Heins" on YouTube.com