Wednesday, October 22, 2008

Time conflicts in Dual-boot, UTC or Local time in BIOS?

I'm surprised that I've used dual-boot many times but I've just found this problem. There is a problem about time between Windows and others such as Debian.

The problem is
Debian (or unix-like) uses time in BIOS as UTC time
Windows uses time in BIOS as local time.

So the problem shows out. I'm in Thailand so my timezone is +7. If UTC time is 10:00, I boot to Debian then the time in BIOS should be 10:00 and Debian shows 17:00 as a time. Then I switch to windows , it shows the time 10:00 as my time. The time is in the past. I adjust to the right time 17:00 and windows sets it in BIOS too. If I switched to Debian again, it will show the time is 00:00 (17:00+7 hours). That's it.

The root of the problem is each OS treat time in BIOS in different ways.
So the question is "Which time should be in BIOS? UTC or local time?"

UTC - more standards and every systems can treat it in their way. It makes sense.
Local time - After I googled , why windows does it like that, there are reasons. First is backward compatibility. The former windows system such as MS-DOS or Windows 3.1 do this way so they have to do the same way to remain compatibilites and can dual-boot between Windows' family. Last is to avoid confusing on BIOS time itself. If you're in the BIOS setting and you've to set the BIOS time. Which time will you set? your local time or UTC. It makes sense that you will set it by local time. If BIOS asks you UTC time, it's a bit strange.

So I still don't know the answer of this question. But there are some workarounds to fix this problems
You need to do only one of these.

In Linux :

Edit /etc/default/rcS
by set UTC=Yes to UTC=No


In Windows:

Add the registry
HKEY_LOCAL_MACHINE System CurrentControlSet Control TimeZoneInformation RealTimeIsUniversal
and set its value to 1.
Uncheck the "Automatically synchronize with an Internet time server" in Date and Time Properties.

*I don't recommend this way because I found many people told about few following problems.

but I still don't know why I didn't found this problem when I was dual-booting Ubuntu and Windows. OR Didn't I notice this problem?

Thursday, October 16, 2008

Gumstix-OE Connex on QEmu

I'm newbies to Gumstix and OpenEmbedded platform so I try to emulate it for working easier and more safety with my experiments.

From this and this tutorial , those're for verdex , you can change a bit for you connex easily.

First you have to install qemu (version 0.9.1 or later) to you system. I'm using Debian so do this way.

sudo apt-get update
sudo apt-get install qemu

Second you need to find the 3 file for creating the qemu image. These consist of

  1. U-boot
    This is the boot loader for you gumstix. You can build your own from source or get the pre-built file from the gumstix webstie here.
    Example is "u-boot-connex-400-r1604.bin".

  2. Kernel Image
    It's the kernel for your system. It's usually start with 'uImage'. Of course you can build your own via this tutorial or pick the right pre-built image from gumstix website here. About the difference between glibc and uclibc you can googling to find out yourself.
    Example is "uImage-2.6.21-r1-gumstix-custom-connex.bin".

  3. Filesystem Image
    It's the files for your gumstix including many packages installed. You can built it your own from the same tutorial above or pick it here.
    Example is "Angstrom-gumstix-basic-image-glibc-ipk-2007.9-test-20080512-gumstix-custom-connex.rootfs.jffs2".

Now you can create the qemu image by this way.

dd of=flash.img bs=128k count=128 if=/dev/zerodd of=flash.img bs=128k conv=notrunc if=u-boot-connex-400-r1604.bindd of=flash.img bs=128k conv=notrunc seek=2 if=gumstix-basic-image-gumstix-custom-connex.jffs2dd of=flash.img bs=128k conv=notrunc seek=120 if=uImage-2.6.21-r1-gumstix-custom-connex.bin

The italic have to be changed according to your files. The bold are those difference from the reference tutorial. Because of memory, the verdex has 32 MB flash memory but the connex has only 16MB. So 256*128k changes to 128*128k. The kernel is on the end of the memory (Size -1MB) so (256-8)*128k changes to (128-8)*128k.

Now there will be a "flash.img". This is your qemu image file.
You can run it by

qemu-system-arm -M connex -m 289 -nographic -monitor null -pflash flash.img

And see it booted. But my problem now is I can't exit the qemu. -_-" Ctrl+A x doesn't work.

I think buildroot platfrom can do this method too. Because it builds to the 3 files as above and then use the same method to emulate it.

How to make BCM4318 (with Acer wireless button) works in Debian!

My laptop model is Acer 5021. I have a problem with the wireless , in particular the acer wireless button that's in front of the body can't lid up to enable the wireless just like in Windows. In the past I got it work by installing ndiswrapper and acerhk. But after the Edgy came out , it haven't worked anymore.

Now I switched from Ubuntu to Debian and found the same problem. But I see the suggestion message while it's booting. Something likes

[ 59.267579] b43-phy0 ERROR: Firmware file "b43/ucode5.fw" not found or load failed.
[ 59.267588] b43-phy0 ERROR: You must go to and download the correct firmware (version 4).

So I went to the url in the message. It told me to do this

sudo apt-get install b43-fwcutter

Now I reboot and the error message disappeared. But I still can't use the wireless because of the Acer wireless button. I googling more , go to acerhk website. And found that acerhk is stopped and got into the main kernel development (names acer_acpi) that's the good news. and now acer_acpi is moved to acer_wmi.

if you have the kernel>= 2.6.25 , it might have the acer_wmi in the kernel already and be detected to load automatically. You can check this by

lsmod | grep acer

you would found acer_wmi.

so the rest is easy. Due to this useful (and hidden) document , you can

To read the status of the wireless radio (0=off, 1=on):cat /sys/devices/platform/acer-wmi/wirelessTo enable the wireless radio:echo 1 > /sys/devices/platform/acer-wmi/wirelessTo disable the wireless radio:echo 0 > /sys/devices/platform/acer-wmi/wirelessTo set the state of the wireless radio when loading acer-wmi, pass:wireless=X (where X is 0 or 1)

and It works!!!

I wonder this method also works with the other Acer models which have the problem with the wireless button in front of it.

good luck.