Posted May 07, 2018
Sometimes, you might find a piece of software that has accumulated features that not many people know about, and that people don't usually think of when using that software. Here are some examples that I know about:
screen: Can connect to a serial port. (Note that the similar program tmux does not have this feature (I believe the developers wanted to keep the program simple and avoid feature bloat, so that's one of the features that's intentionally omitted.)
QEMU: This emulator has quite a few features it has accumulated over the years:
* vvfat: A reverse FAT driver. You can make a directory on the host appear as a FAT filesystem in the guest, providing an easy way to transfer files (though it isn't perfect; there's the old 4GB file size limitation, for example).
* tftp server: Allows the guest to network boot off the host, and also provides a way to transfer files from the host to the guest (going the other way didn't work when I tried it).
* QEMU can emulate a bluetooth keyboard. (I suspect someone wanted to be able to use QEMU to test some bluetooth code, and decided to write a driver for QEMU to emulate, and it got accepted upstream.)
Linux (the kernel):
* Has support for Amiga formatted disks; yes, you can mount Amiga disk images and even actual Amiga hard drives on a Linux system (provided the appropriate kernel module is included with the distribution).
* Can be compiled to run as a user mode application (user-mode Linux (UML), which provides something similar to virtualization, but was around before x86 hardware virtualization became an option).
* There's a driver (actually two) that allows you to take an area of RAM (specified by address) and have the kernel treat it as a disk drive.
* You can have Linux load another kernel at runtime, and then execute it (kexec); this allows Linux to act like a bootloader. (This can, for example, be used to load an alternate kernel on a Raspberry Pi without chaning the kernel that initially loads at boot.)
* There exists a module that creates two virtual USB ports, one host and one device side. You can then use it to load USB gadget drivers and play with them without actually needing to have a device side port (not common for PCs, but the Raspberry Pi Zero (W) has one).
* There are multiple ways to create a writeable filesystem from a read-only one, so you can have a system that boots from a CD-ROM, but still has a writable filesystem. (Of course, you need somewhere to store the files; storing them in RAM is one option, and there's multiple ways to do this.)
* There are tons of makefile targets. For example, "make randconfig" will generate a kernel with a randomly generated configuration (probably meant for testing). There's "make rpm-pkg" and "make deb-pkg", for making packages that allow for easy installations on certain Linux distributions (if you're using Ubuntu, "make deb-pkg" is what you want here).
Any other examples of programs having obscure features you might not expect?
screen: Can connect to a serial port. (Note that the similar program tmux does not have this feature (I believe the developers wanted to keep the program simple and avoid feature bloat, so that's one of the features that's intentionally omitted.)
QEMU: This emulator has quite a few features it has accumulated over the years:
* vvfat: A reverse FAT driver. You can make a directory on the host appear as a FAT filesystem in the guest, providing an easy way to transfer files (though it isn't perfect; there's the old 4GB file size limitation, for example).
* tftp server: Allows the guest to network boot off the host, and also provides a way to transfer files from the host to the guest (going the other way didn't work when I tried it).
* QEMU can emulate a bluetooth keyboard. (I suspect someone wanted to be able to use QEMU to test some bluetooth code, and decided to write a driver for QEMU to emulate, and it got accepted upstream.)
Linux (the kernel):
* Has support for Amiga formatted disks; yes, you can mount Amiga disk images and even actual Amiga hard drives on a Linux system (provided the appropriate kernel module is included with the distribution).
* Can be compiled to run as a user mode application (user-mode Linux (UML), which provides something similar to virtualization, but was around before x86 hardware virtualization became an option).
* There's a driver (actually two) that allows you to take an area of RAM (specified by address) and have the kernel treat it as a disk drive.
* You can have Linux load another kernel at runtime, and then execute it (kexec); this allows Linux to act like a bootloader. (This can, for example, be used to load an alternate kernel on a Raspberry Pi without chaning the kernel that initially loads at boot.)
* There exists a module that creates two virtual USB ports, one host and one device side. You can then use it to load USB gadget drivers and play with them without actually needing to have a device side port (not common for PCs, but the Raspberry Pi Zero (W) has one).
* There are multiple ways to create a writeable filesystem from a read-only one, so you can have a system that boots from a CD-ROM, but still has a writable filesystem. (Of course, you need somewhere to store the files; storing them in RAM is one option, and there's multiple ways to do this.)
* There are tons of makefile targets. For example, "make randconfig" will generate a kernel with a randomly generated configuration (probably meant for testing). There's "make rpm-pkg" and "make deb-pkg", for making packages that allow for easy installations on certain Linux distributions (if you're using Ubuntu, "make deb-pkg" is what you want here).
Any other examples of programs having obscure features you might not expect?