Zbr's days.

About :: TODO :: Blog :: RSS :: Old blog :: Projects :: GIT :: Gallery :: Notes

Tue, 30 Aug 2005

2.6.14 kernel tree will be called "Affluent Albatross".


Fighting with EMAC driver on our new PPC405GPR based D16 board - it does not work with my Dlink switch (model DES-1008D), permanent FCS errors, and if omit FCS check frames itself are broken too. With something from CNet it works fine. I know, switch is crap, and now I have yet another confirmation on top of not working autonegotiation with Realtek 8169 PHY and Marvell 88e1111, managed by r8169 and forcedeth modules.

Climbed with Grange today, he finally returned from vacations. It was very good - people finally do not scream, that I shin without a rope, so several old traces were done, although not clean - next time it will be better.

:: Link / Comments ()


Mon, 29 Aug 2005

PPC hacking day.


Ok, new D16 board has beed booted - the main change from PPC405GP initialisation was only data cache size - it is now 16Kb, and in PPC405GP it was 8K, so BIOS caught an exception when tried to write into half-invalidated cache. Other changes were mostly setting different GPIO values. Now linux kernel 2.6.13 works ok. Next task is to change DSP drivers to the new addressing schema.

I've implemented simple no-way-zero-copy support for sendfile for socket <-> socket connections.
Patch is quite stupid - it uses kernel_recvmsg() into preallocated page and then provides it for given actor() method.
If this approach will be concidered usefull I will probably implement sendpage() method for fs, so it could be really usefull for huge ftp uploads and so on.
Until then you can find a patch in archive.

:: Link / Comments ()


Sun, 28 Aug 2005

The laziest day.


I feel myself as being a soulsick - why, should I ask, I spent several hours in my bed... watching all three parts of Harry Potter?
In russian it is spelled similar to "Potniy", i.e. Harry Potniy, which is Harry Wet in rough translation.
And I lie in my bed and ... and watching Harry "Wet" Potter.

Crap.

:: Link / Comments ()


Fri, 26 Aug 2005

Connector updated.


Ok, I've send updated netlink connector version to netdev@ maillist and updated archive.

4 hours of climbing in a two traces - I found new very complex bouldering and work on one traverse. It was very good time. I found that pain after the training moved from hands into the fingers and it's first phalange - pillows are just rubbed.

:: Link / Comments ()


Wed, 24 Aug 2005

Lazy day.


Nothing interesting happened today - new board is not loaded - ppc405GP BIOS can not be started on ppc405GPr, probably it freezes on data cache initilisation, and now it is impossible to reprogramm an eeprom so it will wait until Monday when programmator will be delivered.

Climbed a little today - it was huge crowd of people in Skala-city, so I only did several old traverses and starts. I've bought quarter season ticket to the climbing zone, so it could be called regular training start.

:: Link / Comments ()


Tue, 23 Aug 2005

PPC hacking.


I've finished ppc port to old D16 board. Today I hacked miscelaneous tools and host drivers for our new D16 board. Here is a photo (Warning, 4Mb!). It is PPC405GPr based embedded board with 32Mb SDRAM and 2MB flash memory installed. It ships 4 Analog Devices ADSP-2185 and set of i2c devices - RTC, thermal sensor. Tomorrow I will start porting 2.4/2.6 kernel on this board.

:: Link / Comments ()


Mon, 22 Aug 2005

Linux kernel 2.6 PPC ported to D16 digital board.


Ok, it works!
The most complex and interest part was to hack board's kernel loader, and searching in head.S and relocate_kernel.S where the kernel stops using some kind of this stub

        lis 0,0xaabb
        ori 0,0,52445
        lis 9,0x80
        stw 0,0(9)
_loop_:
	b _loop_
Here is complete dmesg:
<5>Linux version 2.6.13-rc6 (s0mbre@uganda) 
(gcc version 4.1.0 20050716 (experimental)) #54 Mon Aug 22 14:40:49 MSD 2005
<4>Running as PCI slave, kernel PCI disabled !
<4>PCLIO_BASE = 0xe7ffe000
<4>PCI bridge regs before fixup 
<4>            ma       la    pcila    pciha
<4> pmm0 00000000 fffe0000 fffe0000 00000000
<4> pmm1 00000000 00000000 00000000 00000000
<4> pmm2 00000000 00000000 00000000 00000000
<4> ptm1 ms: fe000001 la: 00000000
<4> ptm2 ms: fe000001 la: fe000000
<4>PCI bridge regs after fixup 
<4>            ma       la    pcila    pciha
<4> pmm0 c0000001 80000000 80000000 00000000
<4> pmm1 00000000 00000000 00000000 00000000
<4> pmm2 00000000 00000000 00000000 00000000
<4> ptm1 ms: fe000001 la: 00000000
<4> ptm2 ms: fe000001 la: fe000000
<4>Message 1
<0>Message 2
<4>sk: mem_ipc_setup() done
<4>       D16 port (C) 2000-2005
<4>       machine: D16
<4>
<4>  bi_s_version: 
<4>  bi_r_version: 
<4>    bi_memsize: 0x00ff0000	 16320KBytes
<4>bi_enetaddr 0: 732069-703d3a
<4>bi_enetaddr 1: 3a3a3a-643136
<4> pin strapping: 0x6aaa9000
<4>    bi_intfreq: 198Mhz
<4> plb bus clock: 33MHz
<4>bi_pci_busfreq: 33MHz
<4> opb bus clock: 33MHz
<4>cs0 CR: ff09a000 AP: 03840200
<4>cs1 CR: fe07c000 AP: 80000380
<4>cs2 CR: 00000000 AP: 00000000
<4>cs3 CR: 00000000 AP: 00000000
<4>cs4 CR: 00000000 AP: 00000000
<4>cs5 CR: 00000000 AP: 00000000
<4>cs6 CR: 00000000 AP: 00000000
<4>cs7 CR: 00000000 AP: 00000000
<4>EBC0_CFG: 80400000
<7>On node 0 totalpages: 4096
<7>  DMA zone: 4096 pages, LIFO batch:1
<7>  Normal zone: 0 pages, LIFO batch:1
<7>  HighMem zone: 0 pages, LIFO batch:1
<4>Built 1 zonelists
<5>Kernel command line: root=/dev/nfs ip=::::d16-0.net:eth0:any console=ttyS binfo=0xabcd 
idsp=ixpro,d16,8,0xfe020000,0x8000,0,0,0xfe028000,0x8000,0xfe060000,0x8000,0,0,0xfe068000,
0x8000,0xfe0a0000,0x8000,0,0,0xfe0a8000,0x8000,0xfe0d0000,0x8000,0,0,0xfe0d8000,0x8000,
0xfe110000,0x8000,0,0,0xfe118000,0x8000,0xfe150000,0x8000,0,0,0xfe158000,0x8000,0xfe190000,
0x8000,0,0,0xfe198000,0x8000,0xfe1d0000,0x8000,0,0,0xfe1d8000,0x8000 amb=ixpro,d16,1,0xfe300000,
0x1ffff,0x10000,0x18000 l_tx_ptr=0x80000000 l_tx_len=0x1000
<4>binfo_setup: MAC 00:00:dd:dd:ab:cd
<4>PID hash table entries: 128 (order: 7, 2048 bytes)
<4>Console: colour dummy device 80x25
<4>Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
<4>Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
<4>Memory: 13184k available (2260k kernel code, 636k data, 108k init, 0k highmem)
<7>Calibrating delay loop... 196.09 BogoMIPS (lpj=98048)
<4>Mount-cache hash table entries: 512
<6>NET: Registered protocol family 16
<6>PCI: Probing PCI hardware
<3>Memory resource not set for host bridge 0
<4>D16 serial port emulator driver.
<4>mem_con	d16 char io device registered to major: 253 minor:  0
<6>Initializing Cryptographic API
<4>vty_init
<4>tty_register_driver: register_chrdev_region() failed with error=0.
<4>tty_register_driver: register_chrdev_region() failed with error=0.
<4>tty_register_driver: register_chrdev_region() failed with error=0.
<6>Serial: 8250/16550 driver $Revision: 1.90 $ 32 ports, IRQ sharing enabled
<4>tty_register_driver: register_chrdev_region() failed with error=0.
<4>ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
<4>ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
<6>io scheduler noop registered
<6>io scheduler cfq registered
<4>RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
<6>loop: loaded (max 8 devices)
<6>mal0: Initialized, 1 tx channels, 1 rx channels
<6>emac: IBM EMAC Ethernet driver, version 2.0
<6>Maintained by Benjamin Herrenschmidt 
<4>eth0: IBM emac, MAC 00:00:dd:dd:ab:cd
<6>eth0: Found Generic MII PHY (0x02)
<4>netconsole: not configured, aborting
<6>mice: PS/2 mouse device common for all mice
<6>i2c /dev entries driver
<6>IBM IIC driver v2.1
<6>ibm-iic0: using standard (100 kHz) mode
<6>oprofile: using timer interrupt.
<6>NET: Registered protocol family 2
<4>IP route cache hash table entries: 256 (order: -2, 1024 bytes)
<4>TCP established hash table entries: 1024 (order: 1, 8192 bytes)
<4>TCP bind hash table entries: 1024 (order: 2, 28672 bytes)
<6>TCP: Hash tables configured (established 1024 bind 1024)
<6>TCP reno registered
<6>TCP bic registered
<6>NET: Registered protocol family 1
<6>NET: Registered protocol family 17
<6>eth0: Link is Up
<6>eth0: Speed: 100, Full duplex.
<6>eth0: Link is Up
<6>eth0: Speed: 100, Full duplex.
<5>Sending DHCP and RARP requests ., OK
<4>IP-Config: Got DHCP answer from 192.168.0.202, my address is 192.168.0.243
<4>IP-Config: Complete:
<4>      device=eth0, addr=192.168.0.243, mask=255.255.248.0, gw=192.168.0.1,
<4>     host=d16-0, domain=, nis-domain=net,
<4>     bootserver=192.168.0.202, rootserver=192.168.0.188, rootpath=/home/pwp/work/nfsbox
<5>Looking up port of RPC 100003/2 on 192.168.0.188
<5>Looking up port of RPC 100005/1 on 192.168.0.188
<4>VFS: Mounted root (nfs filesystem) readonly.
<4>Freeing unused kernel memory: 108k init
After good hacking day it was definitely good climbing evening - although I did not shinned up quite high, but instead found couple of very interesting starts and small traverses. Although saw one little bouldering, but was too tired to complete.

:: Link / Comments ()


Sat, 20 Aug 2005

Embedded PPC hacking.


Finally it boots, although not the whole kernel. Here is first dmesg:

version 2.6.13-rc6 (s0mbre@uganda) 
(gcc version 4.1.0 20050716 (experimental)) #24 Sat Aug 20 21:11:46 MSD 2005
<4>Running as PCI slave, kernel PCI disabled !
<7>On node 0 totalpages: 4096
<7>  DMA zone: 4096 pages, LIFO batch:1
<7>  Normal zone: 0 pages, LIFO batch:1
<7>  HighMem zone: 0 pages, LIFO batch:1
<4>Built 1 zonelists
<5>Kernel command line:
<4>PID hash table entries: 128 (order: 7, 2048 bytes)
<4>Console: colour dummy device 80x25
<4>Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
<4>Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
This required to hack board's BIOS, i.e. those program which is loaded from the EEPROM before kernel is loaded and even copied through PCI. It looks like problem lives in PCI initialisation part, since board should not look like PCI slave. Probably BIOS fixup is called too late.

Not bad for two days, I think.

:: Link / Comments ()


Fri, 19 Aug 2005

PPC embedded development.


Ok, the whole morning I'm fighting with the 2.6 kernel on our custom embedded PPC405GP/PPC405GPr board. Now it almost run!

Linux/PPC load: .... ..Uncompressing Linux.....done.
..initrd moved:  .Now booting the kernel
.exit
...pause
..

..

 -- System halted.0123456789ABCDEF....bad gzipped data
...gunzip: ran out of data in header
..oops... out of memory

On this nice news I climbed very good - I've finished complex old trace, done several interesting starts and boulderings. I'm entering quite nice stripe in a life, which results in excellent results in almost every aspect of life, I'me quite sure it will be finished, but it will be well-deserved rest from the active time.

:: Link / Comments ()


Thu, 18 Aug 2005

PPC development day.


It was not so easy to extract my PPC tree from BitKeeper, since bk after Jul 1 refuses to work completely, so I found Andrew Tridgell's sourcepuller and extracted the tree, then found that the latest version I work with is 2.4.26, which is definitely not what I wanted to work with, so after several hours of merging/reading/writing/thinking I compiled 2.4.26 kernel for our ppc405 based platform from pure 2.4.26, without huge Montavista's patches. It works, which is very nice. Later today I will merge this project with the latest 2.4 tree.
The main purpose of this steps is to port 2.6 kernel to this platform. Size of the resulted patch is about 1.5 Mbytes.

:: Link / Comments ()


Wed, 17 Aug 2005

Acrypto and asynchronous IPsec.


Something major happened between 2.6.12-rc2 and current kernel in XFRM processing engine. My old proof-of-concept patch can only send 5 packets now, but with old kernel it's asynchronous performance was almost the same as synchronous stack. So I need to investigate what changes in XFRM stack can cause such behaviour.

Test shows that it is ICMP which has such a strange behaviour - TCP ssh over asynchronous IPsec works perfectly without any stalls.

Ok, ICMP problem found - raw_sendmsg()->ip_append_data()->sock_alloc_send_skb()-> sock_alloc_send_pskb()->atomic_read(&sk->sk_wmem_alloc), this means that sk_wmem_alloc is never decreased enough to free space in socket queue, it is decremented in sock_wfree() which is called from kfree_skb(), so it looks like raw skbs do not pass the same way TCP/UDP skbs are processed...

Ok, this problem has been fixed and I released new patch. It's md5sum is 506ad2ad7148199c29e25d8b0afe0c66.

:: Link / Comments ()


Tue, 16 Aug 2005

Acrypto hacking.


First half of the day was spent in PPC cross-platform compilation. Due to simple typo in the very first config file I was needed to recompile glibc with different compilers, faking it's configure to allow part of it to be compiled using x86_64 gcc-4.0.1, other as compiled using x86_32 gcc-3.2... Crap, but finally it was finished, many thanks to Dan Kegel for his excellent cross-development toolchain.

Second half of the day was spent in acrypto hacking - I replaced yesterday's diff with new one, but it still has some issues. It probably broken more deeply, than my local version, so do not use it for now, I will investigate it further. Local version has one big problem - it only sends 5 ICMP packets, and then dst->otput() is not even called. Tomorrow I will setup my very old proof-of-concept patch with asynchronous IPsec processing and verify that it still works, if it does not, then something major happened between 2.6.12-rc2 and 2.6.13-rc6 in core network stack, it's about 4 months, and I will investigate current XFRM deeply. If old patch still works, and I think it will, then something small and stupid sneaked into my code.

:: Link / Comments ()


Mon, 15 Aug 2005

Acrypto and IPsec.


Many thanks to Treker Chen who tested my IPsec patches - logic is completely broken there, it creates infinite loop in esp_output()->crypt->esp_callback()->esp_output()->..., so I will figure this out hopefully today and release new IPsec patch.

I've "released" new asynchronous IPsec with ACRYPTO support patch. It is awailable in archive. Patch is against 2005_08_15 midnight GIT update for linux 2.6 kernel.
Gigantic thanks to Mr. Treker Chen for tests.

I've setup Dan's Kegel crosstools and compile the latest gcc4 for ppc405 platform. Main goal is to port some of PPC405GPR or PPC440GX based boards to the 2.6 linux kernel so I would have big-endian and different cache architecture environment to test my patches.

Climbing was excellent today - new traces, old traces, it was really cool, probably because of number of good things happened today was more than bad ones, or maybe because of nice time at climbing area itself, but this day definitely has been spent very good.

:: Link / Comments ()


Sun, 14 Aug 2005

Acrypto tests.


Treker Chen reports today, that he could succefully run acrypto with HIFN adapter and IPsec setup, but unfortunately not for a long time. He caught the same problem with HIFN driver as I saw with session rate more than one session per 1-10 msec. My HIFN 7955 adapter just refuses to finish current sessions and does not start next sessions. Probably my driver is broken, so it writes into the diferent descriptors, or hardware just does not allow descriptor rewriting while other descriptors are processed.

IPsec patch is marked as TESTED now, although it is not completely true - it still has some problems to work on.

LUFS unortunately is not a very good solution - it's ftpfs provides many errors during directory listing - it can be connection reset, operation not permitted.

:: Link / Comments ()


Sat, 13 Aug 2005

W1 updates have been merged.

And will be pushed when tree will be opened for feature commits.

I've bought Yaroslav's Gashek "Brave soldier Shveik adventures" - his humour and life optimism brings really good reading time.

It is nice to live near the river - almost each day and definitely each Saturday sky is filled with fireworks from weddings on hydrofoils. But in a couple of month it will be finished - navigable time will be finished.

:: Link / Comments ()


Fri, 12 Aug 2005

Lazy day.

Installed LUFS - excellent application, it's userspace filesystems are really killing, although I need to hack a very little to compile it's kernel module.

:: Link / Comments ()


Thu, 11 Aug 2005

w1 hacking - added hotplug support.


Archive has been updated.
w1.hotplug - main w1 hotplug loading script and w1.hotplug.table - w1 supported devices table.
w1.hotplug requires table to be in /tmp/w1.hotplug.table file or in $W1_TABLE_FILE
w1.hotplu should be placed where your distribution stores hotplug files, in my FC3/4 it is /etc/hotplug.d/w1/

w1 update - several cleanups, fixed longstanding detouchnig race, added driver for DS2433 EEPROM from Ben Gardner bgardner_wabtec.com.

Climbing was excellent today - I finally have finished quite interesting start, also shinned several old traces, although failed since was hell tired, but definitely it was a very good time.

:: Link / Comments ()


Wed, 10 Aug 2005

Internet provider updated.


I have a very fast internet connection at home now, so I can follow development process more closely with GIT, news and fresh software. Connection is really fast - so no problems with annoying GPRS latencies.

Downloaded several very interesting music albums - Ray Charles, Eric Clapton and B.B. King, Floyd Lee, it's time to buy good sound system.

:: Link / Comments ()


Tue, 09 Aug 2005

Yet another lazy day...


I'm waiting for tomorrow, when fast Internet link will be stretched to my loft, I will buy a new climbing shoes and even shine some traverses, starts and boulderings.

I need an idea. An interesting idea. I would even say the Idea.
CARP, w1, connector, OSF, acrypto are finished - they were very interesting projects, and it is possible to still clean them up, create new macros on top of existing, refactor code and so on, but it will not add neither new interesting features and functionality, nor removes some bugs.
So I'm looking for the Idea. And I will find it.

:: Link / Comments ()


Mon, 08 Aug 2005

New acrypto relase.


It now supports nice scatterlist walkers, usage can be found in async_provider.c [bridge to the sync API].
By design acrypto provides whole scatterlists array to the driver so it can optimize it's processing.

This is _probably_ the last release, due to starting asynchronous development based on top of existing SW/TFM crypto stack, but work is not completely stopped, it just goes into the shadow.

As usual, archive is available here.

Acrypto page can be found here.

Archive contains acrypto subsystem itself, driver for HIFN 795x cards, driver for SuperCrypt CE99C003B chip, driver for VIA padlock engine, port of the existing HW RNG for AMD/Intel/VIA to acrypto, asynchronous crypto provider based on SW stack for AES, and asynchronous IPsec support for in-kernel IPsec engine and it's binding to acrypto.

:: Link / Comments ()


Tequila == to-kill-her?

:: Link / Comments ()


Sun, 07 Aug 2005

w1 updated.

w1 does not need to multicast it's state to the several groups at once, and upcoming netlink changes will not allow bitmask for groups anyway, so I updated w1 and placed it into archive.

I plan to release the last acrypto version - it will support new scatterlist walkers instead of direct page referencing in each driver, no new functionality or bugs will be added.

:: Link / Comments ()


Sat, 06 Aug 2005

Tennis and motocycling day.

Played tennis a little this morning - it was too hot, so it was not a good time. Later Alexander shown me his new motocycle - cool Honda's two-wheels monster. He gave me a drive - it is completely unspeakable feelings to drive on speed more than 100 km/h even as passanger without helmet.
Control of the speed and full contact with the motion brings just another level of sensations.

Created simple program to change access/modification time of the files - now blog entries can be written even from the future.

:: Link / Comments ()


Fri, 05 Aug 2005

Climbing alone today.

It was quite nice, although it was only traverses, also found one new very interesting start. Climbing shoes are completely broken, but new pair I selected will be delivered only in the middle of the next week, so I probably will not go climbing at all until wednesday, or will continue to damage my fingers on the legs.

:: Link / Comments ()


Thu, 04 Aug 2005

Lazy day - relaxing after climbing.


Acrypto definitely will not be included into mainline, at least until current crypto maintainer finishes his own implementation of acrypto ideas on top of existing and absolutely incompatible synchronous software stack.

Working with map analyzer. Here one can find first screenshots - there are start and target points and the shortest path between them, on different screenshots one can see how target point is being moved and path is being changed appropriately.
Map of Moscow center was obtained from original pixmap from internet, algorithm is fully automatic, one only needs to select a couple of roads at start. Start and/or target points can be bound to GPS coordinates, but it requires map to be at least somehow precise and be bound to GPS too, although it is not done yet.

:: Link / Comments ()


Wed, 03 Aug 2005

Playing with GIT.


GIT is a new interface for version controlling used in linux kernel development. I finally set it up yesterday and was even able to pull the latest tree, today I experiment with commits - fortunately it is very easy to fallback to some previous revision - just point it in .git/HEAD instead of curent one and remove unneded sha1 objects.

Synced w1 and DS9490 sources with kernel tree, w1 update is available in w1 and in ds9490r archives.

It was excellent climbing today - although I did several complex traces but with several simplified pieces, it was definitely very good. Since Grange goes to vacation, I will go climbing without him, so will do traverses and train technique.

:: Link / Comments ()


Tue, 02 Aug 2005

Acrypto development.


It's future is almost determined now - acrypto will not be included into official kernel tree.

It was decided to create asynchronous processing over existing software crypto stack implementation, it will have many features similar to acrypto, but lack failover, crypto routing and probably modular crypto scheduling.

:: Link / Comments ()


Mon, 01 Aug 2005

Gee, Grange has a new blog.


Added it into my read-while-getting-morning-tee list of interesting links.

Pinged crypto maintainer again about acrypto, let's see how it will end up.

Added memory barrier into AF_TLB module - writing into the shared memory only happens when control page is updated, i.e. when new skb is mapped and new offset is written and "ps" is updated, so this patch should be enough:

--- af_tlb.c~   2005-07-29 21:01:56.000000000 +0400
+++ af_tlb.c    2005-08-01 16:39:16.000000000 +0400
@@ -558,6 +558,8 @@
        if (++po->last == po->budget)
                po->last = 0;

+               wmb();
+
        {
                start = po->vma->vm_start;
. I've updated AF_TLB source in archive.

It was nice climbing today - found new quite complex trace and climbed several old ones. My climbing shoes are almost killed, although I bought them only about a month or two ago, so probably I will buy new pair next time, probably it will not be Rock Pillars, since currrent pair is definitely bad choice.

:: Link / Comments ()