Friday, April 27, 2007

Yay! Suspend2 Will Be Merged Into Mainline

I like to use suspend2 to do hibernation aka STD (suspend to disk) on Linux, and today, a very important step has been taken to start merge it into mainline kernel.

Rafael said

Now, I think that the hibernation should better be done completely in the
kernel, because that's just conceptually simpler, although some data exchange
with the user land may be acceptable for some optional fancy stuff. I'm also
tierd of the endless "to merge or not to merge suspend2" discussions that just
lead to nowhere. For these reasons I declare that I'm ready to cooperate with
Nigel on integrating as much of suspend2 as reasonably possible into the
existing infrastructure, under the following conditions:
- we don't remove the existing user-visible interfaces
- we work on one piece of code at a time
- we avoid code duplication, as much as possible
- we avoid using open-coded things, if possible
- if we don't agree on something, we ask someone wiser (volunteers welcome ;-))

If that's acceptable, we can start tomorrow. In the process, we can try to
separate the hibernation code paths from the s2ram ones, but that will require
a lot of knowledge about things that neither me nor Nigel, AFAICT, are very
familiar with, like writing device drivers.


And Nigel answered:
I don't want to remove user visible interfaces either (I understand that
you mean the ioctls by that?). Perhaps we can find a way to make them
still usable with a more in-kernel solution (ie some things become
noops?).

> - we work on one piece of code at a time

Sure. We should spend some time discussing and planning beforehand so we
don't waste time and effort writing and rewriting.

> - we avoid code duplication, as much as possible

No problem there.

> - we avoid using open-coded things, if possible

Regarding open-coded things, I assume you're referring to the extents. I
would argue that they're not open-coded because list.h implements doubly
linked lists, and extents use a singly linked list. That said, I suppose
we could make the extents doubly linked and use list.h, even though that
would be a waste of 4/8 bytes per extent.

> - if we don't agree on something, we ask someone wiser (volunteers welcome ;-))

Absolutely!

Thursday, April 05, 2007

Ada harapan baru winmodem bisa dipakai

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC883 Analog [ALC883 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 6: Si3054 Modem [Si3054 Modem]
Subdevices: 0/1
Subdevice #0: subdevice #0

$ sudo /etc/init.d/sl-modem-daemon start
Starting SmartLink Modem driver for: hw:0,6.
Creating /dev/modem symlink, pointing to: /dev/ttySL0.

$ sudo wvdialconf
Editing `/etc/wvdial.conf'.

Scanning your serial ports for a modem.

Modem Port Scan<*1>: S0 S1 S2 S3
WvModem<*1>: Cannot get information for serial port.
ttySL0<*1>: ATQ0 V1 E1 -- OK
ttySL0<*1>: ATQ0 V1 E1 Z -- OK
ttySL0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttySL0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttySL0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttySL0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttySL0<*1>: Modem Identifier: ATI -- SmartLink Soft Modem
ttySL0<*1>: Speed 4800: AT -- OK
ttySL0<*1>: Speed 9600: AT -- OK
ttySL0<*1>: Speed 19200: AT -- OK
ttySL0<*1>: Speed 38400: AT -- OK
ttySL0<*1>: Speed 57600: AT -- OK
ttySL0<*1>: Speed 115200: AT -- OK
ttySL0<*1>: Speed 230400: AT -- OK
ttySL0<*1>: Speed 460800: AT -- OK
ttySL0<*1>: Max speed is 460800; that should be safe.
ttySL0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found a modem on /dev/ttySL0.
Modem configuration written to /etc/wvdial.conf.
ttySL0: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"

Sunday, April 01, 2007

Code::Blocks for Debian

I wonder why nobody try to package Code::Blocks, a good, GUI, IDE into Debian. It was wnpp-ed long time ago (April 2005), then abandoned. The easy alternative is to use Ubuntu's which have been actively developed. Instaling them into Debian Sid was very smooth. But then I said to myself, "Why wouldn't I try compile it myself?". I tried, and it was a rather frustrating experience :(

My result so far: succes on Debian Etch AMD64. Big failure on Debian Sid i386. We need this tiny patch to compile it in Debian:

--- codeblocks/debian/rules.orig        2007-04-01 14:15:57 +0700
+++ codeblocks/debian/rules 2007-04-01 14:17:11 +0700
@@ -93,7 +93,7 @@
# dh_installemacsen
# dh_installpam
dh_installmime
- dh_iconcache
+# dh_iconcache
# dh_installinit
# dh_installcron
# dh_installinfo
In Sid i386, preparation process by running bootstrap always failed with this uncommunicative error messages:
src/base/tinyxml/Makefile.am:6: Libtool library used but `LIBTOOL' is undefined
src/base/tinyxml/Makefile.am:6:
src/base/tinyxml/Makefile.am:6: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'
src/base/tinyxml/Makefile.am:6: to `configure.in' and run `aclocal' and `autoconf' again.
So I tried alternative: run bootstrap on Ubuntu Dapper AMD64, apply above patch, then continue build fakeroot debian/rules binary. Voila! We got a native Debian one!

Update April 4th, 2007
I found the culprit: libtool from experimental. After downgrading back to sid, everything's fine now.

Tuesday, March 27, 2007

Suka Seafood? Jangan Salah Pilih!

Ternyata beberapa macam seafood yang sering saya temui tidak disarankan untuk dikonsumsi, karena berbagai alasan. Silahkan baca selengkapnya di situs WWF Indonesia.

Golongan merah (hindari):

abalonies [3]
ketam kelapa [2]
lumba-lumba [2]
duyung [1]
kima raksasa [1]
kerapu [2,3]
lobster/udang karang [2]
pari manta [2]
napoleon [2,3]
mola-mola [2]
hiu, semua produk [2]
triton [2,3]
trochus [3]
telur penyu [1]
penyu [1]
hiu paus [2]

Golongan kuning (kurangi):
lencam/emperor [3]
telur ikan [3]
ikan sebelah [3]
ekor kuning [3]
kepiting bakau [3]
layaran/marlin [4]
gurita [2,3]
baronang [3]
teripang [3]
kuda laut [3]
udang [3]
kakap [3]
pari [3]
butana [3]
gerot-gerot/sweetlips [3]
todak [4]
kambing-kambing [3]

Kode:
[1] spesies yang dilindungi secara hukum
[2] perkembangannya lambat dan sedikit, dan rentan terhadap over-fishing
[3] cara penangkapannya sangat merusak habitat
[4] berbahaya bagi kesehatan karena mengandung ciguatera atau memiliki kandungan logam yang terakumulasi dalam tubuhnya

Bagaimana kita bisa membedakan udang hasil budidaya (tambak) dengan udang hasil tangkap di laut?

Daftar di atas belum lengkap dan belum berakhir. Jenis ikan yang disebutkan bisa berpindah dari kategori yang satu ke kategori lainnya sewaktu-waktu. Perkembangan terbaru dapat Anda lihat di website www.wwf.or.id atau www.panda.org

Saturday, March 24, 2007

Debian di Acer Aspire 5583 NWXMi

Dokumentasi tentang instalasi Debian di notebook Acer Aspire 5583 NWXMi saya pasang di web, bukan blog, karena sifat dokumennya yang relatif statik, tetapi beberapa bagian akan di-update.

Halaman tersebut saya informasikan juga ke pengelola situs Linux on Laptop dan Linux With Laptops, Notebooks, PDAs and Mobile Cell Phones, agar pemakai laptop yang sama/serupa dan mengalami masalah instalasi, lebih mudah mencari informasi. Apakah anda punya pengalaman serupa dan sudah mendokumentasi serta mempublikasikannya?

Thursday, March 22, 2007

Tukul Merambah Formula 1?


note: hasil kreativitas Pendekar Photosop

Friday, March 09, 2007

Eksperimen CPU Hotplug dan Konsumsi Power

Kondisi awal: paksakan governor userspace untuk cpufreq; set frekuensi CPU 1.666 GHz. Hal ini dipilih agar tidak terjadi perubahan frekuensi CPU secara otomatis, yang mungkin terjadi ketika kita memilih governor bertipe conservative, powersave, maupun ondemand. Ukur pemakaian arus.

root@hokage:~# cpufreq-set -d 1.666g
root@hokage:~# cpufreq-set -u 1.666g
root@hokage:~# cpufreq-set -g userspace
root@hokage:~# cpufreq-info
cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to linux@brodo.de, please.
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which need to switch frequency at the same time: 0 1
hardware limits: 1000 MHz - 1.67 GHz
available frequency steps: 1.67 GHz, 1.33 GHz, 1000 MHz
available cpufreq governors: userspace, powersave, ondemand, conservative, performance
current policy: frequency should be within 1.67 GHz and 1.67 GHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 1.67 GHz (asserted by call to hardware).
analyzing CPU 1:
driver: acpi-cpufreq
CPUs which need to switch frequency at the same time: 0 1
hardware limits: 1000 MHz - 1.67 GHz
available frequency steps: 1.67 GHz, 1.33 GHz, 1000 MHz
available cpufreq governors: userspace, powersave, ondemand, conservative, performance
current policy: frequency should be within 1.67 GHz and 1.67 GHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 1.67 GHz (asserted by call to hardware).

root@hokage:~# grep rate /proc/acpi/battery/BAT1/state
present rate: 1693 mA

Tahap kedua, kita coba matikan CPU #1. CPU #0 tidak bisa dimatikan :D
root@hokage:~# echo 0 > /sys/devices/system/cpu/cpu1/online
root@hokage:~# cpufreq-info
cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to linux@brodo.de, please.
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which need to switch frequency at the same time: 0
hardware limits: 1000 MHz - 1.67 GHz
available frequency steps: 1.67 GHz, 1.33 GHz, 1000 MHz
available cpufreq governors: userspace, powersave, ondemand, conservative, performance
current policy: frequency should be within 1.67 GHz and 1.67 GHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 1.67 GHz (asserted by call to hardware).
root@hokage:~# grep processor /proc/cpuinfo
processor : 0

CPU #1 offline! Tapi, coba kita lihat pemakaian arus:
root@hokage:~# grep rate /proc/acpi/battery/BAT1/state
present rate: 2084 mA

2084 > 1693 tentu saja! Kenapa? CPU #1 dimatikan, tapi arus malah naik?
Kita coba hidupkan lagi CPU #1
root@hokage:~# echo 1 > /sys/devices/system/cpu/cpu1/online
root@hokage:~# grep processor /proc/cpuinfo
processor : 0
processor : 1
root@hokage:~# grep rate /proc/acpi/battery/BAT1/state
present rate: 1653 mA

... dan arus kembali ke level semula. Percobaan pengiritan daya yang gagal *sigh*.Apakah anda juga mengalami hal yang sama? FYI prosesor saya adalah Core 2 Duo T5500 1.66GHz:
root@hokage:~# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz
stepping : 6
cpu MHz : 1667.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi
mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3336.47
clflush size : 64

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz
stepping : 6
cpu MHz : 1667.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi
mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3333.58
clflush size : 64
root@hokage:~# head -1 /var/log/dmesg
Linux version 2.6.20-acer-2 (andika@hokage) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #3 SMP PREEMPT Fri Mar 9 13:15:14 WIT 2007