• C++ code in the kernel

    I have always been fond of the idea of having an operating system kernel written entirely in C++ so that it had a clean class hierarchy, exception-based error control, etc. I know this is very difficult to achieve due to the inherent complexity of C++ and its runtime, but not impossible if appropriate care is taken. C++ for Kernel Mode Drivers is an article I just found that talks about using C++ in driver code for the Windows OS.

  • FAT versions

    FAT12, FAT16 and FAT32 are all different versions of the FAT file system. As far as I know, the FAT was originally designed to work on floppy disks, on which it does a decent job. Soon after, it was adapted to work on hard disks (bigger capacity) and hence FAT16 was born. Much later, and due to the introduction of bigger disks — which means something over 500MB — FAT32 was created.

  • Samba performance under Mac OS X

    I have a NetBSD/i386 3.0 file server at home running Samba 3.x. Read and write access from NetBSD and Windows XP clients is fast (although, under the NetBSD clients, NFS performance wins). Unfortunately, reading large files from Mac OS X is incredibly slow. Adding the following to /etc/sysctl.conf solves this annoying problem:net.inet.tcp.delayed_ack=0This configuration file does not exist in a default installation so simply create it from scratch. rc(8) takes care of it automatically.

  • Calling the BIOS from within the kernel

    NetBSD/i386's bioscall(9) trampoline is one of those interesting and tricky things you come across from time to time when reading kernel code. This apparently simple kernel function lets the caller execute BIOS functions and retrieve their results. The BIOS (Basic Input/Output System) is the PCs "firmware". It initializes the hardware, starts the boot process (in a primitive way) and provides a set of utility functions in the form of software interrupts.

  • Toying with KDE

    Some days ago I was "forced" to remove all packages in my workstation due to massive revision bumps in pkgsrc. Since I had to install an environment for X, I decided to give KDE 3.5.1 a try. The thing is that I hadn't used KDE seriously since I switched to GNOME 2.6 (ouch, that was two years ago... time passes really fast). Of course I installed it several times in this period and tried to use it, but I stopped the evaluation after a 5-minute ride.

  • The RAII model

    Resource Acquisition Is Initialization (RAII) is a programming idiom that attempts to prevent the risk of leaking memory and other resources. It is only applicable to languages that have predictable object destroyment, and among these is C++ (an object's destroyer method is always called when it goes out of scope). The basic idea behind RAII is to wrap any resource subject to be leaked in a thin class. This class acquires the resource during its construction and releases it upon destroyment, thus hiding all the internal details from the user.

  • SoC: Introductory article to tmpfs

    Dr. Dobb's Journal is running a set of mini-articles promoting Summer of Code projects. Next month's issue includes the tmpfs' introductory article, written by me and William Studenmund, the project's mentor. Looks like you have to register to access the full article; previous issues used to have them publically available. Personally, I'm going to wait for the printed version :-)