So Proud of Myself

Wednesday 9. April, 2008

Today I finally managed to repair my A-Link RR24AP(c) adsl-modem. The problem was that the wireless side didn’t function at all because the boot environment of the modem was corrupted. The corruption was my fault as I accidentaly used a wrong power source which wasn’t powerful enough, all I could see was the lan-connection light flickering.

Few weeks ago I contacted A-link’s tech support and they told me to send the modem to their technicians, but I didn’t bother to that as the warranty period had ended quite some time ago.

The modem accepts ssh-connections for controlling it and a linux shell/toolset, busybox. Boot environment configuration can be accessed through /proc/ticfg/env -file. A quick look into it and some knowledge from RouterTech’s forums and the modem’s system log revealed that WLAN_EEPROM-values were missing. I don’t know exactly what these values are but I do know that without them the wireless doesn’t work.

I found a recovery software through the same forums but the program didn’t start. I crashed immediately. I was very disappointed as it was my only hope. As I knew that I needed those WLAN_EEPROM-settings so it came to my mind to take a look on that program with a hex editor (Notepad++ with hex editing plugin, in case you want to know…) and indeed there they were! Apparently it was a template of the eeprom-settings, but still I got my hopes up again!

I didn’t expect this template to work directly which was then confirmed when I tried it. Again the answer was found in RouterTech’s forums. Some other guy had the same problem of missing/corrupted WLAN_EEPROMs and some other guy told him that WLAN_EEPROM8-line contains a hardware specific id in REVERSE order (12 34 56 would become 56 34 12). Modifying that line did the trick! The WLAN-led lit up! I had restored the right WLAN_EEPROMs (WLAN_EEPROM0-WLAN_EEPROM14) and I had a working wireless access point. One problem, though, the modem though that the BSSID was 00:00:00:00:00:00 THAT IS NOT RIGHT! (and only my laptop’s Intel 3945 detected it, my buffalo usb-wlan stick didn’t see anything).

And to the Google we went… it turned out that WLAN_HWADDR0 should be set and contain the MAC-address of the wlan-system.

Now the modem is under testing and seems to run just fine.

(I don’t publish the WLAN_EEPROM-values here because I don’t know if  that would be legal)

Advertisements

Incomplete standards

Saturday 5. April, 2008

My friend does some C programming and many times he has im’ed me about his progress in his projects or other interesting results. This time he complained that his code doesn’t work the same way in Linux as it does in Windows. I’ll demonstrate the problem with the same code he demonstrated the problem to me:

#include <stdio.h>

int main(int argc, char *argv[]) {
int temp = 0;
printf(“%d %d “, temp++, temp++);
printf(“%d\n”, temp);
return 0;
}

What do you expect this little program to do? Does it print something? You’re right but what exactly does it print? well, that depends on what compiler it was compiled on…

WIth University’s Sparc-Solaris gcc-3.0.4 it print 0 1 2, with Ubuntu Feisty’s gcc-4.1.2 and lcc-win32 it will print 1 0 2 and actually lcc-win32 printed the same as did Cygwin’s gcc-4.4.3.

Googling for explanation ended up telling that this case is not defined in standard C so results may vary on every compiler.

I wonder why that hasn’t been defined… For a programmer it should be quite clear that this code should print 0 1 2 but I do understand that this might get bit controversial as you could expect it to print anything from 0 0 1, 0 0 2, and so on to 0 1 2.

(Ha! You might have expected me to write about my lack of morality and standards instead of this…)

New Computer

Monday 3. March, 2008

I finally got around to buy me a new computer as the old one really started to feel old. Now I just have to cut in some “expenses” as it was rather pricey for a student budget.

This is what I had before:

  • AMD Athlon XP 2400+, 2.0 GHz processor
  • 1 GB RAM (DDR-333)
  • Asus A7V8X-X motherboard
  • 200 GB HD by Seagate
  • Geforce 6600 GT (AGP)
  • Some cheap DVD-drive that cannot read cd-rw-disks it burned
  • 1,44 MB floppy drive
  • 1,2 MB floppy drive  (I don’t really use it… It just looked cool)

Hmm.. funny… I don’t remember what components I had on it…
Anyway this is what I got now:

  • Intel Core 2 Duo E6750, 2.66 GHz
  • Asus P5N-E SLI motherboard
  • Corsair Twin2x  1 GB DDR2-800 memory kit, total 2 GB(TWIN2X2048-6400C4 G)
  • Western Digital Caviar SE16 320 GB HD
  • Gigabyte GV-NX88T256H graphics adapter based on NVIDIA 8800 GT
  • Antec Sonata III case with 500 W power supply

As I don’t have a car, I had a bit of problem on how to get it into my apartment from the local post office, but my two friends from the university helped with it. I don’t live too far from the office so we brought the three packages over by our bare hands 🙂

The case was the heaviest package and I had to carry it as far as the first traffic lights until my friend told me I looked ridiculous carrying the heavy big package so we switched and I got the lightest package 🙂

Building the computer wasn’t so easy as I thought it would be. After putting every component where they belonged the computer booted fine. Then the problems started. My old Windows XP installation cd didn’t contain any sata-drivers as they were supplied in Service Pack 2. I had created the sata-driver floppy but the installation halted on STOP-error “PAGEFAULT_IN_NONPAGED_AREA” or something like that and a reboot later it told that the installation structures were damaged and it refused to continue. I restarted the installation several times just to get various different STOP-errors until I gave up and tried to install Ubuntu.

The Ubuntu installation didn’t start very well as I saw some error messages from the linux kernel, at this point suspicion rised. I rebooted and selected the memtesting from the boot menu of the Ubuntu dvd. What I was encountered with was various memory errors and a lot of red colored characters. OK, my memory chips weren’t working properly. Maybe one of the two Corsairs was broken? I tested them individually and neither of them failed testing. As I put them both back on the motherboard, the failing began again. I wasn’t thrilled at all. Apparently the motherboard fails to recognize the memkit and give them proper settings. Some googling with my laptop revealed that others have had the same problem. I had to manually set some timing and voltage settings in the BIOS. Tadaa! It didn’t fail anymore.

I think it was this site I got the working settings from:

Bios Settings:
SLI-Ready Memory = Disabled
Memory Voltage = 2.085
tCL = 4
tRCD = 4
tRP = 4
tRAS = 12
CMD = 2
Advanced Memory Timings

tRC = 22
tWTR = 15
All other settings = auto

Now I have Windows XP Professional, Windows 2003 Server and Ubuntu Linux installed (I got the Server from MS’ DreamSpark-service for students). Everything seems to working alright

As for performance… well.. none of few games has any performance issues. It was an interesting experience to play Portal and Half-Life 2: Episode Two without any stuttering or glitches. My SimCity Societies is still waiting to be tested as for some reason it keeps telling me about conflicts with emulation software even though I don’t have any emulation software. It seems like someone is going to get cracked.

(The HL2:EP2 achievement about squishing 333 grubs was only 3 bugs away… >:-()

After midnight, part 4: LaTeX

Tuesday 11. December, 2007

What has happened since the last blog entry? Well, I’m not sick anymore and I live on my own now (okay, it’s relative “on my own”).

Unlike the previous After midnight -posts, this isn’t actually about a programming language.

Do you know “Structured text processing” (Rakenteellinen tekstinkäsittely, in Finnish)? It was the fancier name for our university’s LaTeX-typesetting course. It’s like text processing, but not at all like it. Today everybody uses these “What You See, Is What You Get” software (M$ Word, OpenOffice.Org Writer), but no one has ever hear that you could type those documents with a TeX-system. Usage of LaTeX is quite a bit different from those wysiwyg-programs as you don’t see what you get until you have compiled the tex file into something more readable such as DVI- or PostScript-file.

Personally I’m impressed by the looks of the documents I have made so far.

If you want to try it out, you need a LaTeX-environment, see MikTex. Then you need the Ghostscript-software. You probably want GSView too. You can write tex-files with Notepad or any text editor, as those files are more or less pure ascii-text. If you really start using LaTeX, I suggest you to download TexMaker. It’s free (open source) LaTeX editor and available for Linux systems too or if you are using Linux, you can also try out Kile editor and if you are using Ubuntu, you can install all you need with “apt-get install kile”. Besides the editor, this should pull all required packages including LaTeX-system.

I suppose our text processing environment is now installed and working (well, you probably don’t know if it is working yet)

Open up you editor, so we can start writing our first LaTeX-document. It all begins with lines

\documentclass[12pt]{report}
\begin{document}
Hello this is our very first \LaTeX-document.
\end{document}

Save it and if you are using Texmaker, there should be a button with text “LATEX”, push it. If your specified paths are correct (you can check them in settings), the latex-system now compiles our document into a dvi-file. The animal button next to LATEX-button opens up a dvi-file viewer and you should see your document there.

The commands given above first define the type of our document, which is “report” with font size 12pt. All options in [] are optional, where {} are required. Without required parameters the compilation will fail. You probably have noticed that all Latex commands begins with \. The \begin{document} defines a document environment and \end{document} will end it. Everything you write and want it to be seen in the final document must be written inside the document environment.

For more information on LaTeX resides in the “doc”-folder inside your miktex installation (if documentation was installed). There’s also a folder named ‘guide’ or ‘guides’ in which resides a tutorial to LaTeX-system. You can also find a lot of information on latex with the help of Google.

(I can’t write a complete tutorial here as this is only a blog posting nor could I do it anyway as I’m not very familiar with LaTeX by myself. If you find these instructions too complicated to understand, leave a comment and I’ll try to help)

Hello? Are you still standing there?

Sunday 25. November, 2007

[DIARY ENTRY WARNING] 

Who can guess where that line is taken from? Here’s a hint: It’s a computer game and it’s name starts with P.

Apparently I have got a new obsession related to that game. I hope it’s nothing serious, though. I still want a big blue tower.

On the other news, it seems there’s something wrong somewhere as my laptop’s hard drive seem to be under massive use in both Fedora and Ubuntu. I have no idea what’s going on there, the system just uses hard drive. I suppose it’s somehow related to swapping, but it didn’t do that in previous versions of Ubuntu. Also, when ever it’s updating/installing/removing packages (aka using the hd) the whole system goes nearly unusable state. It’s not nice at all.  I already downloaded a Vector Linux installation cd image as they say it’s a lightweight distribution, but if the problem lies some where in the hardware changing distro won’t help.

I don’t remember having this sort of problem in my personally built Prospekt Linux. In case I get tired of Vector too Prospekt is the next installation. Hmm… I should write some sort of installation program for it…

I had to do a practice work (in Java) to the programming course I mentioned in an earlier post. So far I have a working implementation of “program that calculates the age of a person in months and years. Current date is taken from the system.” I still have to do some testing, write API documentation using Javadoc and a small report containing the testing material, short instructions and stuff. (How much instructions users need for a program that asks their birthday?)

Last Friday the teacher did a small review on the current state of our projects. He told my program was great (I’m not really sure how to translate the adjective he used) and needed only testing. I was quite sure that wrong input format wouldn’t crash it, but he still managed to do it. Apparently I never tested what would happen if there’s some extra spaces before the actual birthday. It was quite easy to fix, though, and I’m somewhat proud of it. Now it “cleans” all extra space from the input string by utilizing Java’s StringTokenizer-class.

Yet another news: I’m sick. My throat hurts and I’ve got fever. Usually I’ve been sick around December 6th, but it came early this year, it seems. A quick check to my calendar shows that the 6th day is Thursday and we’ll have final test in Calculus III on Friday, so I guess my immune-system predicted the test and decided I must get sick this weekend instead so I can attend to the test. It also knew that getting sick next weekend would have compromised the final test in Fotonics or my possible moving to Joensuu.

New Prospekts

Monday 20. August, 2007

Since it has been very boring, I have been rebuilding my little Prospekt Linux -project. This time I have followed Linux From Scratch book quite closely, except for gcc+glibc+binutils combination. I know these are critical packages but some distros are going on glibc 2.6.1, gcc 4.2.1 and binutils 2.17.50.0.18 and so am I.

Currently the desktop of choice is GNOME 2.18.3? as I haven’t yet built KDE. I was thinking that I would build KDE4 when it’s released and not KDE3. I know that would radically limit the KDE software available, but that would be less compiling for me 🙂 .

As for package management, I have returned to RPM for some reason. I just like it (and Conary didn’t let me forget my mistakes of various sizes, I know, I shouldn’t have commited those recipes in the first place).

I did try to use rPath Linux Development as my base, but as their installation dvd was badly outdated, Conary proposed over 900 updates and actually removed some troves due to missing dependencies in their repository. I spent several hours updating until I got fed up and did rm -rf / (of course everything important were unmounted at the time of destruction).

I have thought of using my own package manager, but it isn’t very reliable (like I would trust on something I have written myself…) and has bugs and lots of non-implemented features.

A small advertisement for GetDeb.Net

Tuesday 17. July, 2007

GetDeb.Net is a “Ubuntu Software Portal” containing some software packages for Ubuntu (and, why not, derivates). Software collection contains at the time of writing a bit over 200 packages for Ubuntu Feisty (32-bit).

If you cannot find the package you’re searching for in (massive) Ubuntu repositories, try GetDeb.Net. You’re not losing anything.

Most importantly, the package collection contains Pidgin at least for Ubuntu Feisty. Yay 🙂