Posts for: #Linux

qemu eats up /dev/shm

I’ve been using qemu ([with kqemu]{kqemu-install}) to run my client’s windows software, which talks to the linux driver/daemon that I am working on. Having multiple qemu instances really chews into the shared memory… and the amount available depend on how /dev/shm is mounted.

    # df /dev/shm
    Filesystem            Size  Used Avail Use% Mounted on
    none                  2.0G  713M  1.4G  35% /dev/shm

On Debian you can control this via /etc/default/tmpfs SHM_SIZE variable….

Read more →

ipw2200 not working

Err! I recently nuked and paved over my X41, with debian/lenny. When I wanted to use the wireless I was greeted by:

    ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, 1.2.0kmprq
    ipw2200: Copyright(c) 2003-2006 Intel Corporation
    ACPI: PCI Interrupt 0000:04:02.0[A] -> GSI 21 (level, low) -> IRQ 23
    ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection
    ipw2200: ipw2200-bss.fw request_firmware failed: Reason -2
    ipw2200: Unable to load firmware: -2
    ipw2200: failed to register network device
    ACPI: PCI interrupt for device 0000:04:02.0 disabled

It turns out that I have not done any wireless twiddling recently and forgotten that I had to get the firmware before things started working again.

Read more →

ATA messages via SCSI layer

I’ve been working on a contract for Symbio Technologies for the last month. They are makers of a few thin client terminals.

My work for Symbio involves talking to a SATA hard disk using ATA command set. What makes this a bit more interesting is that /dev/hda is the way of the past. New devices are covered by libata drives which fit into the SCSI subsystem.

So, the challenge for me was how to send raw ATA messages using the SCSI layer to the SATA drive. Besides the fact that the interface is sparsely documented, it was pretty easy.

Read more →

pxeboot and nfsroot with debian

I have two boxes (i386 and amd64) in the lab that I use for testing of drivers I work on. Recently another Maxtor hard disk died on me, and I decided to get network booting working. I already have a file server from which I host my $HOME directories and do all backups from. It sounded like a win.

I’ve never done this before, so it took me a few hours to get the first host going, the second took 10 minutes plus the amount of time to build the kernel for it.

Below, I describe steps I took to get pxe-enabled hardware to boot a debian image, from a debian DHCP, TFTP and NFS servers.

Read more →

etc snapshots with git

I got this idea from a blog posting a few months back. I think the guy was using darcs. Unfortunately, I was unable to find the reference to link to him.

Anyway, here is how you can track your /etc directory with git, and have apt update it automatically each time a package is installed.

Read more →

klips loses zlib

Last time I [wrote about openswan]{leaner-meaner-openswan} I commented how Martin and I chopped off 18 thousand lines from KLIPS.

Most recently I finished rewriting IPCOMP handling to use CryptoAPI’s api to zlib, and Martin was able to remove the zlib that was duplicated in KLIPS. Here are the updated stats:

    $ git diff origin/public HEAD -- include/openswan net/ipsec/ | diffstat | tail -n1
     135 files changed, 14549 insertions(+), 39839 deletions(-)

That, along with other cleanup, bumped us up to 25k lines less then the #public branch of openswan.

Read more →

leaner meaner openswan

I started working for Xelerance in April of 2006, and the contract ended in December. Since then I’ve been working on a KLIPS-ng, of sorts. The idea was to remove all the crypto code from KLIPS and convert it to use CryptoAPI already in the Linux kernel.

Last objective of my work was to add OCF support to KLIPS, so that we could take advantage of the asynchronous crypto facilities provided there, as well as several OCF hardware drivers. The BSD kernels have been using OCF, Open Cryptographic Framework, for some time and more recently it was ported to Linux.

Read more →

dump and restore

I’ve heard many people talk about backups via dump and restore. I’ve never really tried it, although it looks like I should have been using it all along.

I am rebuilding my firewall, which is based on a WRAP 1C-2 [sbc]{tag/sbc}. I want to use two such boxes, one to connect to my two ISPs (both cheap) and the other to create a DMZ network.

I just finished building one of them (similar as the steps in [this article]{sbc-bootstrap-with-debian}). Now I want to clone the image, because the systems will be almost identical. So I stick in the CF card into my card reader, and run

Read more →

C style

A new comer to my place of work was asking me how he can improve his code style. Here are some suggestions I had for him.

Read more →