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.
- 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)
- 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
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
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