bcal

bcal is my new utility to deal with regular data storage unit conversions and other storage related calculations. I felt the need of a dedicated tool as an alternative to using a regular calculator for operations like finding an address offser, base conversions, LBA-CHS conversions etc. Though I’ve started with storage related conversions, the scope of bcal isn’t limited. PRs for other domain specific calculations are welcome. The intention is to come up with an engineer’s tool.

bcal doesn’t support negative inputs as all inputs are treated as unsigned. On a 64-bit device bcal supports 64-bit  inputs and 128-bit outputs, thanks to GCC libquadmath.

Features

  • convert to IEC/SI standard data storage units
  • show the address in bytes
  • show address as LBA:OFFSET
  • convert CHS to LBA and vice versa
  • show binary, decimal and hex representation of a number
  • custom sector size, max heads/cylinder and max sectors/track
  • minimal dependencies
  • open source and free (GPLv3)

Applications

  • to calculate the offset of 100 GB
  • conversions involving variable sector size
  • find the decimal or hex value of a binary number
  • CHS to LBA calculations

Installation

bcal depends of libc and GCC libquadmath. Both are installed by default on Ubuntu. To install bcal, run the following commands:

$ sudo git clone https://github.com/jarun/bcal
$ cd bcal
$ make
$ sudo make install

Usage

bcal has an elaborate help and extensive man page with examples. The project readme is a great resource too!

Once installed, you can start with:

$ bcal -h

On GitHub: bcal

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s