Wednesday 22 July 2009

emacs macro open-this-file and minimum .emacs settings for c-mode


; open file (path and file at cursor) and bounce back to original buffer next line
; handy for restoring sessions or opening list of interesting files
; it's obvious here I'm repeating myself somewhat
; easier creating a quick macro each time sometimes than reading docs and trying to find the one-and-only proper way of the probably few ways of doing something
(fset 'open-this-file2
[?\C- ?\C-e escape ?w ?\C-x ?\C-f ?\C- left left left left left left left left left left left left left left left left left left left left left left left left left left ?\C-a ?\C-y ?\C-k return ?\C-x ?b return ?\C-a down])

(fset 'load-file-at-cursor
[?\C- ?\C-e escape ?w ?\C-a ?\C-x ?\C-f ?\C-a ?\C-y ?\C-k return ?\C-x ?b return down])

(fset 'open-this-file
[?\C- ?\C-e escape ?w ?\C-a down ?\C-x ?\C-f ?\C-a ?\C-y ?\C-k return ?\C-x ?b return])


I used to carry a massive .emacs file around everywhere, now-a-days I just put in the minimum:

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(c-basic-offset 4)
'(c-default-style (quote ((java-mode . "java") (awk-mode . "awk") (other . "gnu"))))
'(indent-tabs-mode nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

ECB = Emacs Code Browser, quick to set up, my head is less befuddled with code/file locations

;ECB = Emacs Code Browser
;Sometimes there are too many source code files, directories and lines.
;ECB turns emacs into a more friendly source code editor/browser.
;Emacs is zippy and lightweight and stable when compated with Eclipse/Netbeans/Visual Studio
;The install doc is slightly scary however the install is really easy.
; there's just one easy to install dependancy which is CEDET (= Collection of Emacs Development Environment Tools)
;http://ecb.sourceforge.net/
;http://www.emacswiki.org/emacs/EmacsCodeBrowser
;http://cedet.sourceforge.net/
;http://xtalk.msk.su/~ott/en/writings/emacs-devenv/EmacsCedet.html

; get cedet, unpack it (I'm working in ~/src) and build it with `make`
; http://sourceforge.net/projects/cedet/files/cedet/1.0pre6/cedet-1.0pre6.tar.gz/download
; add settings in your .emacs (see below)
; get ecb, unpack it
; http://sourceforge.net/projects/ecb/files/ecb/ECB%202.40/ecb-2.40.tar.gz/download
; add settings in your .emacs (see below): add to load-path and (require 'ecb)
; restart emacs
; you may be prompted to confirm some initialisation actions
; in emacs: tools -> Start Code Browser ECB


(load-file "~/src/cedet-1.0pre6/common/cedet.el")
(global-ede-mode 1) ; Enable the Project management system
(semantic-load-enable-code-helpers) ; Enable prototype help and smart completion
(global-srecode-minor-mode 1) ; Enable template insertion menu


(add-to-list 'load-path
"~/src/ecb-2.40")
(require 'ecb)
;(require 'ecb-autoloads)



;; screenshots
; Code editing windows
; File and dir list, file source control status shown.
; Code method/symbol semantic view.
; http://www.dspsrv.com/~jamesc/torture/Screenshot-emacs-ECB-sun_jmf_gstreamer.png
; http://www.dspsrv.com/~jamesc/torture/Screenshot-emacs-ECB-whereami-symbian.png

fedora 10 Sun embedded Java media:


ubuntu jaunty whereami symbian:

Tuesday 21 July 2009

Intel 945GM graphics acceleration problem Ubuntu jaunty

* glxgears gives about 200fps in it's small window.
* google earth is torturous
* bzflag a bit ... urkish

can we fix it?

Incidentially s/Ctrl-Alt-Backspace|dontzap|xorg.conf edit/Alt-SysRq-[whatever]/
http://en.wikipedia.org/wiki/Magic_SysRq_key
http://www.kernel.org/doc/Documentation/sysrq.txt

Changing display resolution doesn't help.
In fact lower resolutions seem very glitchy/bad!
sudo /etc/init.d/gdm restart
## => hang :(


$ glxinfo |grep rend
get fences failed: -1
param: 6, val: 0
direct rendering: Yes
OpenGL renderer string: Mesa DRI Intel(R) 945GM GEM 20090326 2009Q1 RC2 x86/MMX/SSE2


hmmmm ...

my /etc/X11/xorg.conf is very basic
tried lots of various settings ...
http://codeidol.com/unix/ubuntu/X11/Enable-3-D-Video-Acceleration/
http://grumpymole.blogspot.com/2008/03/ubuntu-hardy-intel-945-graphics-driver.html
http://www.linuxquestions.org/questions/linux-hardware-18/intel-945gm-and-3d-acceleration-625937/

package "xserver-xorg-video-intel"

This package provides the driver for the Intel i8xx and i9xx family
of chipsets, including i810, i815, i830, i845, i855, i865, i915, i945
and i965 series chips.

This package also provides an XvMC (XVideo Motion Compensation) driver
for i810 and i815 chipsets.

More information about X.Org can be found at:




This package is built from the X.org xf86-video-intel driver module.

Canonical provides critical updates for xserver-xorg-video-intel until October 2010.


http://bbs.archlinux.org/viewtopic.php?id=24481
http://www.phoronix.com/scan.php?page=news_item&px=NzM3OQ
via http://forums.opensuse.org/hardware/laptop/418072-video-performance-intel-945gm-kernel-2-6-30-a.html
Intel Releases xf86-video-intel 2.8 RC Driver
Posted by Michael Larabel on July 13, 2009

Hmmm. Very recent.


http://blog.programmerslog.com/?m=200906
http://blog.programmerslog.com/?p=378
How to install the latest Intel drivers on Ubuntu
June 20th, 2009


So anyway I updated my drivers and xorg.conf settings.
But not kernel,
And ... AIE! and AUGH.
I get the ubuntu session login screen okay.
But when gnome logs in I just see the colour on whole screen and mouse pointer. Moving and clicking mouse I can see there's some action going on! Desktop is functional but cannot see anything. Switching away and back gives black screen.

restarting/reconfiguring xorg.conf in various ways doesn't recover.
verious errors starting X, see /var/log/Xorg.* MTRR error, others.

After wailing and gnashing of the teeth the solution was found to kill compiz and any other compiz process.
And System->Preferences->Appearance->Visual Effects->None

hmmm, no we can't fix it!

but at least we recovered from the big mess we made right!

Swearing at work found to build team spirit, increases productivity.

Swearing at work;
http://illinois.edu/blog/view?blogId=25&topicId=1121&count=1&ACTION=VIEW_TOPIC_DIALOGS&skinId=286

This blogger also found to be quite a pleasant and humourous read.

Everything IN MODERATION now children!

Clarence Darrow may have been the first to describe swearing as a non-optional linguistic universal: "I don't swear just for the hell of it . . . . Language is a poor enough means of communication as it is. So we ought to use all the words we've got. Besides, there are damned few words that everybody understands."
http://en.wikipedia.org/wiki/Clarence_Darrow


Swearing not maladaptive:
http://illinois.edu/blog/view?blogId=25&topicId=2831&count=1&ACTION=VIEW_TOPIC_DIALOGS&skinId=286
Tolerance of pain increased for people who swear when they’re hurt.
Not yet FDA approved though.

so ... when I'm muttering away under my breath cursing at the code/script I'm writing that means I'm building team spirit (between me and my code!!!) :)


I stumbled across this when reading the weekly summary from A Word A Day
http://wordsmith.org/awad/

Tuesday 14 July 2009

notes/howto setup symbian dev environment linux

You can set up a symbian development environment in a couple of hours.
Follow these instructions: http://www.martin.st/symbian/ they are very good.
Here are my extra notes on the install.
They might be useful to someone else (or myself again in future).

I have a nokia E65 and although it is very grotty (interface-wise) it has nice hardware. I like being able to make software for my electronic devices. I played with python apps on the phone a bit. Symbian signing is very awkward for sharing and even playing/experimenting/developing little apps.

I http://www.openstreetmap.org a bit and I use a bluetooth GPS with my mobile to collect the data with WhereAmI http://www.symbianos.org/whereami which is a really nice map display and GPS collection tool. It can also collect GSM cellid information, or rather, it hints it can but it doesn't on my phone. So I want to get the source and see what the problem is and can I get it working.

================================================================================


http://www.google.ie/search?q=symbian+development+linux

http://wiki.forum.nokia.com/index.php/Symbian_development_on_Linux_and_OS_X
The three main approaches. Realistically there seems to be one sensible approach.

Symbian's build system is based mostly on perl. And a bit of make.
It seems heavyish and they should have used make perhaps but the symbian apps are all going to be small enough really. These scripts are modified to work on unix. This matches symbian build system very closely. Seems to be best supported.

Other options: Replacing the build system with makefiles giving a lighter build system or integrating the build system with IDEs don't seem to be well supported.




Start here.


http://www.martin.st/symbian/ based on GnuPoc project
"for S60 3rd ed and UIQ 3, you need the EKA2 toolchain."
Of course we're going to build the compiler from source and not take binaries >;)
And of course we're going to install the extra gnupoc tools so we don't have to use wine too much.


What is going to be installed.



1. Working in this area and tools/scripts + source code are going here:
export SYM_WORKING_DIR=$HOME/src/mobile

2. compiler is going here:
export SYM_COMPILER_DIR=$HOME/csl-gcc

3. SDK is going here:
export EPOCROOT=$HOME/symbian-sdks/s60_3_fp2_v11/


Install steps.



0. Signup to nokia and start SDK download


http://www.forum.nokia.com/Tools_Docs_and_Code/Tools/Platforms/S60_Platform_SDKs/
3rd ed fp2 v1.1 430Mish


1. install gnupoc tools and 2. install compiler



mkdir -p $SYM_WORKING_DIR; cd $SYM_WORKING_DIR
wget http://www.martin.st/symbian/gnupoc-package-1.13.tar.gz
# http://www.codesourcery.com/sgpp/lite/arm/releases/2005Q1C # and form fill and get OR:
wget http://www.martin.st/symbian/gnu-csl-arm-2005Q1C-arm-none-symbianelf.src.tar.bz2

tar -zxvf gnupoc-package-1.13.tar.gz
cd gnupoc-package-1.13
cd tools

less README
# I needed to install bison, I also do other development so possibly already had a
# bunch of other devel packages and tools installed. If it needs bison it probably
# needs make/autoconf/gcc packages
sudo apt-get install bison

./install_csl_gcc ../../gnu-csl-arm-2005Q1C-arm-none-symbianelf.src.tar.bz2 $SYM_COMPILER_DIR

# I also did need libssl-dev and already had zlib
sudo apt-get install libssl-dev
dpkg -l |grep zlib

./install_eka2_tools $SYM_COMPILER_DIR
#that goes off and gets cross-binutils and compiler and builds them ....


Here is the error I got that showed I needed bison. "Unexcpected(sic) error"
Flailing newbie help trap.

bison -d -o gengtype-yacc.c gengtype-yacc.y
make[1]: bison: Command not found
make[1]: [gengtype-yacc.h] Error 127 (ignored)
gcc -c -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-error -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I. -I./. -I./../include \
gengtype-lex.c -o gengtype-lex.o
gcc: gengtype-lex.c: No such file or directory
gcc: no input files
make[1]: *** [gengtype-lex.o] Error 1
make[1]: Leaving directory `$HOME/src/mobile/gnupoc-package-1.13/tools/csl-build/gcc-csl-arm/gcc'
make: *** [all-gcc] Error 2
Unexcpected error: aborting.


Here is the error I got that showed I needed ssl-dev package.
It actually did say you needed openssl in the README.
Flailing newbie help trap.

g++ -Wall -gstabs+ -I../include -DTEST -ggdb -c signutils.cpp -o signutils.o
signutils.cpp:36:25: error: openssl/evp.h: No such file or directory
signutils.cpp:37:25: error: openssl/pem.h: No such file or directory
signutils.cpp:44:25: error: openssl/err.h: No such file or directory



2-and-a-half. Read up on symbian build tools and


No excuses for slacking off while compiling/installing/downloading.

Also poke inside the scripts you've installed.

Read more about gnupoc here: http://gnupoc.sourceforge.net/HOWTO/
http://gnupoc.sourceforge.net/
gnupoc_install gnupoc-utils
http://web.archive.org/web/*/http://www.wayfinder.it/resources/uiq_gnupoc.php

Reading the "Build tools guide" is helpful to know more about what the build scripts are doing.
http://developer.symbian.com/main/documentation/sdl/symbian94/sdk/doc_source/ToolsAndUtilities94/BuildTools/index.html
How to use bldmake, How to use abld, etc.


3. install the SDK


# Example on(sic) installing an SDK:

## no! don't get your own unshield. sudo apt-get install unshield
export PATH=`pwd`/unshield:$PATH

cd $SYM_WORKING_DIR/gnupoc-package-1.13/sdks
mv ~/Downloads/S60_3rd_Edition_SDK_Feature_Pack_2_v1_1_en.zip ../..

./install_gnupoc_s60_32 ../../S60_3rd_Edition_SDK_Feature_Pack_2_v1_1_en.zip ~/symbian-sdks/s60_3_fp2_v11

# needed to do this (lzma_decoder.h and any SDK includes need to be findable from working area)
# perhaps should be working inside the SDK dir structure
cd $SYM_WORKING_DIR/whereami_trunk/sis
ln -s $HOME/symbian-sdks/s60_3_fp2_v11/epoc32 ../../

## I did this: don't know did it work, switched to using gcc
cp $HOME/symbian-sdks/s60_3_fp2_v11/epoc32/tools/uidcrc.exe $HOME/.wine/drive_c/windows/
cp $HOME/symbian-sdks/s60_3_fp2_v11/epoc32/tools/make.exe $HOME/.wine/drive_c/windows/
#MESSY:
cp $HOME/symbian-sdks/s60_3_fp2_v11/epoc32/tools/*.exe $HOME/.wine/drive_c/windows/
ls $HOME/symbian-sdks/s60_3_fp2_v11/epoc32/release/winscw/udeb/sdkw.exe



Info on figuring out problems with how to set up environment for SDK:

### unshield did not work for me initially at this stage until I figured out where it was and set PATH
./unshield/unshield -V
./unshield/unshield -D3 l _e/data2.cab
find $HOME/symbian-sdks/s60_3_fp2_v11/epoc32/tools -name \*.orig -exec rm {} \;
cd $HOME/symbian-sdks/s60_3_fp2_v11/epoc32/tools; chmod a+x *.pl bldmake abld makmake bmconv rcomp makesis epoc eshell petran pfsdump setupcomms elf2e32 mifconv makekeys signsis extmake rtf2ptml cjpeg

### Take a look at the SDK, the install doc, the examples

ls $HOME/symbian-sdks/s60_3_fp2_v11/
epoc32/ S60_3rd_Edition_FP2_SDK_for_Symbian_OS_Installation_Guide_V1.1.pdf
examples/ s60cppexamples/
GCCE_readme.txt s60tools/
Nokia_EULA.txt series60doc/

ls $HOME/symbian-sdks/s60_3_fp2_v11/s60cppexamples/
addressbook clientserverasync dynamicsettinglist helperfunctions localization note progressbar webclient
aiwconsumerbasics clientserversync filelist helpexample locationlandmarksrefappfors60 npbitmap query
animation contacts finditemtestapp hwrmtestapp locationlandmarksuirefapp ocrexample readme.txt
audiostreamexample datamobility focusevent imopenapiexample locationrefappfors60 openc_ex registration
brctlsampleapp directorylocalizerex graphics isvtelcallapp locationsatviewrefapp openglex richtexteditor
chat _doc guiengine isvtelinfoapp messaging popupfield sipexample
clfexample driveinfo helloworldbasic listbox myview popuplist uniteditorex

cat $HOME/symbian-sdks/s60_3_fp2_v11/s60cppexamples/readme.txt
To open the Example Application Help documentation, please go to the _doc folder
and double-click the index.htm file found there.

wine: could not load L"C:\\windows\\system32\\make.exe": Module not found
make: *** [FINALicons] Error 126

ls $HOME/csl-gcc/bin/
arm-none-symbianelf-addr2line arm-none-symbianelf-cpp arm-none-symbianelf-gcov arm-none-symbianelf-ranlib bmconv makekeys signsis
arm-none-symbianelf-ar arm-none-symbianelf-g++ arm-none-symbianelf-ld arm-none-symbianelf-readelf copy makesis uidcrc
arm-none-symbianelf-as arm-none-symbianelf-gcc arm-none-symbianelf-nm arm-none-symbianelf-size del mifconv
arm-none-symbianelf-c++ arm-none-symbianelf-gcc-3.4.3 arm-none-symbianelf-objcopy arm-none-symbianelf-strings elf2e32 rcomp
arm-none-symbianelf-c++filt arm-none-symbianelf-gccbug arm-none-symbianelf-objdump arm-none-symbianelf-strip extmake rem


find $EPOCROOT -name make.exe
$HOME/symbian-sdks/s60_3_fp2_v11/epoc32/tools/make.exe
$HOME/symbian-sdks/s60_3_fp2_v11/epoc32/tools_orig/make.exe


cp $HOME/symbian-sdks/s60_3_fp2_v11/epoc32/tools/uidcrc.exe $HOME/.wine/drive_c/windows/
cp $HOME/symbian-sdks/s60_3_fp2_v11/epoc32/tools/make.exe $HOME/.wine/drive_c/windows/


perl -S makmake.pl -D $HOME/src/mobile/whereami_trunk/group/s60_v3/whereami WINSCW
ERROR: Unable to identify a valid CodeWarrior for Symbian OS installation
make: *** [MAKEFILEwhereami] Error 255


MESSY:
cp $HOME/symbian-sdks/s60_3_fp2_v11/epoc32/tools/*.exe $HOME/.wine/drive_c/windows/
$HOME/symbian-sdks/s60_3_fp2_v11/epoc32/release/winscw/udeb/sdkw.exe






4. try out hello world


cd ~/symbian-sdks/s60_3_fp2_v11/s60cppexamples
cd helloworldbasic/group/
bldmake bldfiles
abld build gcce urel
cd ../sis
makesis helloworldbasic_gcce.pkg helloworldbasic.sis


Yay. Install finished




Install this in your .bashrc




# This goes in my .bashrc or symbian environment setup script:
export SYM_WORKING_DIR=$HOME/src/mobile
export SYM_COMPILER_DIR=$HOME/csl-gcc
export PATH=$PATH:$HOME/symbian-sdks/s60_3_fp2_v11/epoc32/tools
export PATH=$PATH:$SYM_COMPILER_DIR/bin
export EPOCROOT=$HOME/symbian-sdks/s60_3_fp2_v11/




Now play with WhereAmI



# everyday commands:
cd $SYM_WORKING_DIR/whereami_trunk
cd group/s60_v3

bldmake bldfiles
abld build gcce urel # this works instead

cd ../../sis
makesis whereami_s60_v3.pkg whereami_s60_v3_jco.sis
signsis whereami_s60_v3_jco.sis whereami_s60_v3_jco.sisx mycert.cer mykey.key
cd ../../group/s60_v3




cd $SYM_WORKING_DIR
svn co https://svn.symbianos.org/whereami/trunk/ whereami_trunk

# And this is how I can work quickly compile and make .sis for whereami
# put this in a script or README or notes or blog somewhere
cd $SYM_WORKING_DIR/whereami_trunk
cd group/s60_v3
bldmake bldfiles
#abld build winscw udeb #? needs wine, .. make.exe problem?
abld build gcce urel # this works instead

cd ../../sis
makesis whereami_s60_v3.pkg whereami_s60_v3_jco.sis

# and key signing to make sisx, don't know does this help much?
# privately made key. My phone is a bit hacked so I can install any .sis on it.
# first make key and cert for yourself
[[ ! -f mykey.key ]] || [[ ! -f mycert.cer ]] &&
makekeys -cert -expdays 3650 -dname "CN=Name Surname OU=Development O=Company Name C=UK EM=foo@bar.com" mykey.key mycert.cer
# sign application each time you need to
signsis whereami_s60_v3_jco.sis whereami_s60_v3_jco.sisx mycert.cer mykey.key

# how clean make/build?
# this does a bit of it anyway:
rm $HOME/symbian-sdks/s60_3_fp2_v11/epoc32/build${HOME}/src/mobile/whereami_trunk/group/s60_v3/whereami*/*/urel/*.{o,exe}




WhereAmI needed lzma_decoder.h



This is done above to resolve this problem:

cd $SYM_WORKING_DIR/whereami_trunk/sis
ln -s $HOME/symbian-sdks/s60_3_fp2_v11/epoc32 ../../



WARNING: Can't find following headers in User or System Include Paths
"lzma_decoder.h"
(User Inc Paths "$HOME/src/mobile/whereami_trunk/src/" "$HOME/src/mobile/whereami_trunk/group/s60_v3/" "$HOME/src/mobile/whereami_trunk/inc/" "$HOME/src/mobile/whereami_trunk/data/")
Dependency list for "$HOME/src/mobile/whereami_trunk/src/nmeaparser.cpp" may be incomplete



dpkg-query -L lzma-dev # no, LzmaDecode.h
# here it is:
svn co https://svn.symbianos.org/lzma/
cd lzma/C/Symbian/group
#oops! it's part of SDK:
$HOME/symbian-sdks/s60_3_fp2_v11/epoc32/include/lzma_decoder.h




GSM_LOCATION enable



GSM_LOCATION is compiled out in the source code as you get it now.


+++ add to this file group/s60_v3/whereami.mmp (after GPS_LBS)
MACRO GSM_LOCATION
#define GSM_LOCATION


svn diff >../whereami_enable_gsm_location.patch
meld .

Monday 13 July 2009

defin_I_te and definitely

I was putting definitely in an email earlier and had to look it up.
Apparently it is a common enough mis-spelling. :)

It's spelt definite. Not definate! definate seems to be the way I pronounce it which is presumably wrong or my accent. And If it's spelt definite then spelling definitely is EASY.

http://www.google.ie/search?q=definitely =>
http://www.d-e-f-i-n-i-t-e-l-y.com/
http://www.merriam-webster.com/dictionary/definitely
definite definition definitive infinite (again I pronounce _ate!)
http://etymonline.com/index.php?term=define

Loganberry jam and Blackberry and accidental cider

Yummmm: Loganberry jam. Logans from Cobh:
http://graciesbakes.com/2009/07/07/loganberry-jam/

Loganberries + sugar. Nyam. Nyam.
Not a very refined or complicated dish.

Loganberry and apple jam. Yumm.

I've tried to sneak a loganberry into back garden but it is a bit obvious and hasn't escaped attention of Fionn :( I want to find a lonely patch and gureilla garden a loganberry into it.

I want to try this:
Blackberry wine. No blackberries but a couple of buckets of blackberry shoots/tips.
http://books.google.ie/books?id=H4h0zC-EKIgC&pg=PA245&lpg=PA243&vq=pine&dq=reed+wildfood+europe
Plus rasins, sugar or honey and yeast.

Did I ever tell you I found a bucket of old apples in the old orchard in Cobh once?
In Wintertime.
All full with wizened old apples (cooking apples) and rainwater,
Not sure how it escaped being kicked over by the cattle who would have been in the field.
It smelled lovely and I brought it back to the yard and forgot about it.
A week later I spilled it out on the gravel which FIZZED and produced a fawn couloured big bubbled FROTH.
Oops wow!
Must try that again using less accidental and more hygenic methods.

We have a small gooseberry bush (with reddish gooseberries on it now) and a very young blackcurrant with fruit and a young apple tree in the front garden.

Friday 10 July 2009

epic device recovery/flashing/breaking back into redboot via kernel saga

The hexdump write last week was part of an epic struggle to get back onto the RedBoot prompt of a device which was booting into a not very well working full linux and which had some problems in the flash images.

The plot of the epic is more or less:

James starts using device and is very cautious with flash mounted filesystem.
After some weeks using the system James gets more confident and puts minor handy links and scripts on the flash system,
After more than a month James is happy making mods to the file-system. Removes a 600kish app and unpacks a package in /lib/modules.
Next reboot => severe b0rkedness.
Struggle and puzzle with device for a couple of hours,
Augh. It's a jffs2 filesystem image.

Nope. Give up. Reflash with OS image and original busybox jffs2 image.
Reboot. Set up system, configure stuff.
Mount drives. Config environment.
Hurngghh. Problems problems problems Ehhh?
Struggle struggle struggle. wtf ?
Extreme puzzledness.

Start again.
Reflash.
Configure configure.
Still same problems! MAH!
But this time the redboot delay is 0 before running boot script.
That's the default after fis init!
AUGH :(
And this image seems to be even more problematic.

Email replying to some questions from device makers, they use squashfs now and before that they had lots of jffs2 bug fixes so yeah, using and writing to the jffs2 flash image WAS a bad idea :(

So ... now ... then ... I never quite got a nfs boot working for the device but now seems like a good time to try!

BUT can't get at RedBoot to reflash or just reconfigure RedBoot.
Can we write to flash with BusyBox?
mtd device ... seems to have limited writing capability?
not really?
Compile mtd_utils.
They give info but unlocking/writing not allowed by kernel.
fconfig ported to linux ... looks noice but again can't open mtd for write.
kexec? ... Hurmmm.
Okay.
Write a kernel module.
Get address of mtd data structures from kernel with nm.
hexdump them
Get the pointer to the mtd device in which RedBoot config is written,
Follow the structure and find the WRITABLE flag.
Set writable to 1!
Now mtd_unlock mtd_write does something. But? Flash not changed :(
fconfig seems to do more. Use it to set time delay to 2, not 0.
BUt it doesn't quite work.
The config is not modified ... BUT ... the CRC is!
A few more attempts to correct it back to valid don't seem to work.
fconfig won't write it again as the CRC is invalid!
Hah hah.
Okay.
Fine.
Reboot.
OH yessss! Redboot detects bad CRC in it's fconfig block and breaks into command-line! YES!! >;-)

Right. nfs boot.
Manual reading. Configure stuff. Unpack initrd.gz/initrd_media.gz, mount, make a copy of it. Config config. Read manuals. After a while have nfs boot, BUT *sigh* half the libs are not there. It's a different image really than the busybox_media.jffs2? Thus ensues lib/bin/module finding and installing ... which never quite completely works.

MAH! MAH! MAH! I've seriously run out of time.

So.

Hopefully we can recover that box sometime.

For now share another box and do some real work.
(real work = spend hours on weird timing/gfx/memory problems to find eventually the main problem is gstreamer tcpserversrc binding to default ("localhost") doesn't work. A bind to 0.0.0.0 does work.)
Now we still have mostly memory problems now.
Buffering video is probably using up too much especially when 1 video ends + another starts maybe? Multiple rebuilds and reconfigs and runs with different memory settings later ....



http://ecos.sourceware.org/docs-latest/redboot/flash-image-system.html
http://www.embedded.com/story/OEG20020729S0043 If the RedBoot fits
http://sourceware.org/redboot/
http://www.gelato.unsw.edu.au/lxr/source/drivers/mtd/redboot.c

Inside my kernel this seems to be in place:
201 #ifdef CONFIG_MTD_REDBOOT_PARTS_READONLY
202 if (!memcmp(names, "RedBoot", 8) ||
203 !memcmp(names, "RedBoot config", 15) ||
204 !memcmp(names, "FIS directory", 14)) {
205 parts[i].mask_flags = MTD_WRITEABLE;
206 }
207 #endif

But writing to flash may not be possible for other reasons. The mtd driver might be find for read only. Writing to flash might be fully supported in redboot code but not in mtd code in busybox? Not sure. The flash writing procedure requires unlock, erase, write, lock.

http://www.gelato.unsw.edu.au/lxr/source/drivers/mtd/mtdpart.c

28 /* Our partition node structure */
29 struct mtd_part {
30 struct mtd_info mtd;
31 struct mtd_info *master;
32 u_int32_t offset;
33 int index;
34 struct list_head list;
35 int registered;
36 };

http://www.gelato.unsw.edu.au/lxr/ident?i=mtd_info

http://www.gelato.unsw.edu.au/lxr/source/include/linux/mtd/mtd.h#L59

59 struct mtd_info {
60 u_char type;
61 u_int32_t flags;
62 u_int32_t size; // Total size of the MTD
63
.
.
.


http://www.linux-mtd.infradead.org/
Linux MTD (flash device drivers).

http://wiki.davincidsp.com/index.php/MTD_Utilities
MTD utils
Heh heh, mtd_utils has a little hexdump inside also.

fconfig ported to work in linux/busybox: HANDY!
http://andrzejekiert.ovh.org/software.html.en
http://andrzejekiert.ovh.org/software/fconfig/fconfig-20080329.tar.gz


Could build kexec for the platform and trigger boot of a particular image from busybox. Maybe.
http://www.ibm.com/developerworks/linux/library/l-kexec.html
http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/


# this will more or less get things going:
CC=arm-linux-gcc CXX=arm-linux-g++ make

motortax.ie Internet Exploder only :(

2 posts about use/abuse of Microsoft formats/packages in linux in a row :( sorry :(

The wine I have has an internet exploder with it .. but .. it doesn't work? :(
Not sure what is up.

Found this:
http://www.tatanka.com.br/ies4linux/page/Installation
Download. Unpack. Run. (installer breaks out and warning. Run again. Gets further. Breaks out again.
Run again. Disable Flash install as that is giving a run32.dll exception.

:~/src/ies4linux-2.99.0.1$ wine --version
wine-1.1.25
:~/src/ies4linux-2.99.0.1$ ./ies4linux
IEs4Linux 2 is developed to be used with recent Wine versions (0.9.x). It seems that you are using an old version. It's recommended that you update your wine to the latest version (Go to: winehq.com).

Yeah. Okay.

ie6

Uoh. neat :)
motortax.ie site works fine.
Ow, where are my insurance details.
Clicketty click.
Done.

Screenshot here:
http://www.dspsrv.com/~jamesc/torture/ScreenshotOfRunInternetExploderOnLinux.png

Working with .mpp (Microsoft Project Plan) files in linux

Use Projity openproj. http://openproj.org/
"OpenProj is a free, open source desktop alternative to Microsoft Project."
Very good, it read the .mpp I was interested in no bother.
Other linux project planning tools don't work much with .mpps.
Colleagues have used it to edit .mpps and exchange them with Windows people.

Downloads here:
http://sourceforge.net/projects/openproj/files/
The rpm worked well for me on Fedora 10.
The .deb (openproj_1.4-2.deb) installed and runs but menus/gui were invisible for me on ubuntu jaunty.
I have some java dev packages installed so my java environment is not a bog-standard one.
google problem trap: help problem openproj cannot see interface b0rked doesn't work horrendous argh help!

Projity was acquired recently by Serena Software.
Common Public Attribution Licensed.
Implemented in Java.
Seems to be a relationship with Sun and distros so hopefully coming as the project planning part of StarOffice and OpenOffice sometime. No I'm not affiliated in any way and still don't even like java though somewhat grudgingly have to admit it's somewhat useful.


vi `which openproj`
# Set it to log to file and control what version of java it chooses.
# The command-line it chose was this:
/usr/lib/jvm/java-1.5.0-sun/bin/java -Xms128m -Xmx768m -jar /usr/share/openproj/openproj.jar --silentlyFail true
# This command-line worked for me (just use my default java which is 1.6):
java -Xms128m -Xmx768m -jar /usr/share/openproj/openproj.jar

I have these jvms:

java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu7)
OpenJDK Server VM (build 14.0-b08, mixed mode)

java version "1.5.0_18"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02)
Java HotSpot(TM) Server VM (build 1.5.0_18-b02, mixed mode)

Monday 6 July 2009

silly james, quick c hexdump

Not AGAIN! DOH. ended up writing a quick c hexdump AGAIN :(.


void hexdump(char *msg, char *buf, int len)
{
int i;
char c;
char str[0x11];
if (msg != NULL) printf("%s: %s\n", __func__, msg);
i=0;
while(i<len){
if (i%0x10 == 0) printf("%08x: ",i);
c = *(buf+i);
printf("%02x", (int)c);
str[i%0x10] = '.';
if (c >= 32 && c<=120) str[i%0x10] = c;
if (i%2 == 0) printf(" ");
if (i%0x10 == 0xf) {
str[i%0x10+1] = 0;
printf(" %s\n",str);
}
i++;
}
if (i%0x10 != 0xf) {
str[i%0x10+1] = 0;
printf(" %s\n",str);
}

}

Saturday 4 July 2009

cycle in the hills, Nokia E65 SIM hack, rabbits

We went on a cycle today, I cycled over to Kilmashogue (start of Wicklow way near Marlay park).
Yeow! Steep hill. Fionn drove with kids and kids bikes.
Then we cycled up the hill, had a picnic and cycled back down.
http://www.facebook.com/album.php?aid=2015681&id=1118555017&l=59f1dcfc6b
We found 2 burnt out cars. One micra in car park.
One white/black BMW up the hills.
Then I cycled back home over the hills instead of on the road.
More steepness. Up and Down steepness. After Three Rock extreme rocky downhill steepness.
Trails deteriorated into very interesting cycling.
I had to walk a bit,
I think there might be an easier track to cycle (as I joined it 100m from bottom of hill!) only it has moved since the map I had was done.
http://www.openstreetmap.org/user/gaoithe/traces/432302
http://www.openstreetmap.org/?lat=53.25161&lon=-6.25589&zoom=15&layers=B000FTF

My mobile phone (Nokia E65) has been misbehaving.
Saying "Insert SIM card" and "General System Error" reset needed and crashing/resetting itself (more often than normal).
The web votes for jamming something in behind the SIM and it seems to be working for me :)
I quite like hardware hacks like this :-D
http://discussions.europe.nokia.com/discussions/board/message?board.id=hardware&message.id=7926&jump=true#M7926
http://ocpdesign.wordpress.com/2008/09/12/nokia-e65-sim-card-registration-failed-insert-sim-card-error-cant-update-firmware/
http://www.boards.ie/vbulletin/showthread.php?p=58081238

New hutch for the rabbits.
They're not impressed.
Ran around the edges of the garden alot at bedtime.
Twinkle Star is inside nice and cosy but Jack isn't - though he is inside the chicken run so safe.
I also saw a rabbit/hare up in the hills today.

At home GPS trace uploading of the cycle ensued and I wanted an elevation graph.
Here one is: http://www.dspsrv.com/~jamesc/map/Kilmashogue_to_ThreeRock_gpxreport.pdf
http://utrack.crempa.net/
http://code.google.com/p/wherewasi/wiki/WhereWasI
wherewasi.py --eprof -g wami-20090704-00.gpx
wherewasi_gui.py
http://www.fsckin.com/2008/04/06/review-four-linux-gps-packages/
http://www.mapability.com/blogs/gps/2008/07/gpx-route-map-technical-detail.html
http://utrack.crempa.net/
http://wiki.openstreetmap.org/wiki/Making_Tracks_with_Homebrew-ware
http://www.nabble.com/Displaying-the-properties-of-GPX-points-td22432909.html
sudo apt-get install viking
http://www.ncc.up.pt/gpsman/wGPSMan_1.html