Wednesday, June 29, 2011

comments

I found sometime ago that comments like an art. It's really something new. It's like a backstage of programmer mind.

Some text in russian, but it's meaningless
http://www.dataved.ru/2010/09/top-funny-source-code-comments.html

lets look =)
nika@nika-u:~/work/distros_os/linux_kernels/linux-2.6.38.y$ egrep -R "[Ff]uck" * | wc -l
31

it's like a sign on a picture from somebody genius and dont tell me that programming is not a new art. yup it's not a classical art like music or painting, but it's definitely.

Monday, June 20, 2011

Multithreaded data structures for parallel computing

Not stupid explanation. In the start a little bit boring, but then good enough... I can recommend to threads newbie.

Part 1

Part 2

Thursday, June 16, 2011

embedded libc hell

Sometimes embedded world is a real hell place. Lets look

# cd /bin/
# ./lscgroup
-sh: ./lscgroup: not found
# ls -la lscgroup
-rwxr-xr-x 1 65534 65534 23138 May 27 2011 lscgroup

wtf??? it's executable but some strange error message. Let's look deeply

# ldd ./lscgroup
.......
libc.so.0 => /lib/libc.so.0 (0x4000e000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x40000000)
.......
libc.so.6 => not found (0x00000000)
.......
#

I compiled libcgroups with glibc and try to run under uClibc. I spent to investigate this issue whole day(( I dont have crosslaform with uClibc and I cant change board environment to glibc. And what we can do??? I found (my friends told me that it's the common way to solve problem like this). We can chroot into a new envornment. For example from uClibc chroot to glibc. Ok.
Download fedore core rootfs
http://ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/fc6-arm-root-with-gcc.tar.bz2
it contains gcc!!! very usefull sometimes when all crash with cross building. Setup NFS server, unpack arch into dir, export dir (restart NFS server and check it with the command exportfs) and mount fedore core root to the device folder. After that you must mount /dev /proc /sys into chroot environment and chroot

mount -o bind /proc/ /root_fc/proc
mount -o bind /dev/ /root_fc/dev/
mount -o bind /sys/ /root_fc/sys/
chroot /root_fc/ /bin/sh

And....

# lscgroup
cgroups can't be listed: Cgroup is not mounted
#

it's working, check with ldd that all works fine.

Monday, June 13, 2011

Wednesday, June 8, 2011

Linus and C++

Linus and C++
http://drdobbs.com/blogs/cpp/229700143


Herb Sutter: C++ Questions and Answers

http://channel9.msdn.com/Shows/Going+Deep/Herb-Sutter-C-Questions-and-Answers