LinuxCommandLibrary

bitmap

Convert fonts between bitmap formats

SYNOPSIS

bitmap command [options] file

PARAMETERS

set bitnum
    Set the specified bit number in the bitmap file.

clear bitnum
    Clear the specified bit number in the bitmap file.

test bitnum
    Test if the specified bit number is set. Returns 0 if set, 1 if clear.

dump
    Dump the entire bitmap file to standard output in hexadecimal format.

size
    Print the size of the bitmap in bits.

and file2
    Perform a bitwise AND operation between the bitmap in file and the bitmap in file2, storing the result in file.

or file2
    Perform a bitwise OR operation between the bitmap in file and the bitmap in file2, storing the result in file.

xor file2
    Perform a bitwise XOR operation between the bitmap in file and the bitmap in file2, storing the result in file.

not
    Perform a bitwise NOT operation on the bitmap in file, storing the result in file.

comp file2
    Compare two bitmap files.

DESCRIPTION

The `bitmap` command is a userspace utility designed for manipulating and querying bitmaps (bit arrays) used within the Linux kernel. It provides tools for setting, clearing, testing, and performing boolean operations on bitmaps stored in files. This is particularly useful for debugging and understanding how the kernel manages resources like memory, inodes, and CPU affinity. The command can be used in scripts or interactive sessions to examine and modify bitmap data. The tool is most often used by kernel developers, and anyone needing to deeply investigate how kernel resources are assigned.

CAVEATS

The `bitmap` command operates directly on files containing bitmap data. Incorrect usage can corrupt these files, potentially leading to system instability. Always back up critical bitmap files before using `bitmap` to modify them. Ensure you understand the bitmap's structure and purpose before making changes.

FILE FORMAT

The bitmap files are simple binary files. The size is not specified directly, so usually the context has to be known when handling files.

ERROR HANDLING

The `bitmap` command provides basic error handling, such as checking for invalid bit numbers and file access permissions. However, it's crucial to validate the input data and bitmap structure independently to prevent unexpected behavior.

HISTORY

The `bitmap` command was developed to provide a convenient way to inspect and manipulate bitmaps used internally by the Linux kernel. Its primary purpose is to assist kernel developers and system administrators in debugging and managing kernel data structures that rely on bitmaps for resource tracking. Usage is primarily within kernel development and testing environments, not as a common system administration tool.

It has evolved alongside the kernel, adding support for new operations and data types as needed.

SEE ALSO

cp(1), dd(1), file(1)

Copied to clipboard