Codebase list bcal / 2e313fa
Import new upstream version SZ Lin (林上智) 6 years ago
4 changed file(s) with 46 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
0 .TH "BCAL" "1" "Apr 2017" "Version 1.5" "User Commands"
0 .TH "BCAL" "1" "Jun 2017" "Version 1.6" "User Commands"
11 .SH NAME
22 bcal \- Perform storage conversions and calculations.
33 .SH SYNOPSIS
4 .B bcal [-c N] [-f FORMAT] [-s bytes] [-h]
4 .B bcal [-c N] [-f FORMAT] [-s bytes] [-d] [-h]
55 .br
6 .B " "[N unit]
6 .B " "[expression] [N [unit]]
77 .SH DESCRIPTION
88 .B bcal
99 (Byte CALculator) is a command-line utility to help with numerical calculations involving data storage units, addressing, base conversions etc.
1010 .PP
1111 .B Features
1212 .PP
13 * evaluate arithmetic expressions involving storage units
1314 * convert to IEC/SI standard data storage units
1415 * show the address in bytes
16 * evaluate arithmetic expression of storage units
1517 * show address as LBA:OFFSET
1618 * convert CHS to LBA and vice versa
1719 * show binary, decimal and hex representation of a number
2527 .SH OPERATIONAL NOTES
2628 .PP
2729 .IP 1. 4
28 \fBN unit\fR: \fIN\fR can be a decimal or '0x' prefixed hex value. \fIunit\fR can be B/KiB/MiB/GiB/TiB/kB/MB/GB/TB following Ubuntu policy. As all of these tokens are unique, \fIunit\fR is case-insensitive. \fIN\fR and \fIunit\fR must be space-separated.
30 \fBExpression\fR: An expression must be within double quotes. Inner spaces are ignored. A storage unit can only be multiplied or divided by positive integers. Only storage units can be used for addition and subtraction.
2931 .PP
3032 .IP 2. 4
31 Decimal and hex \fBnumeric representations\fR are recognized for unit conversions. Decimal, hex, binary and octal are recognized for all other operations.
33 \fBN [unit]\fR: \fIN\fR can be a decimal or '0x' prefixed hex value. \fIunit\fR can be B/KiB/MiB/GiB/TiB/kB/MB/GB/TB following Ubuntu policy. Default is byte. As all of these tokens are unique, \fIunit\fR is case-insensitive.
3234 .PP
3335 .IP 3. 4
36 Only decimal is recognized in expressions. Decimal and hex \fBnumeric representations\fR are recognized for unit conversions. Decimal, hex, binary and octal are recognized for all other operations.
37 .PP
38 .IP 4. 4
3439 \fBSyntax\fR: Prefix hex inputs with '0x', binary inputs with '0b', octal inputs with '00'.
3540 .PP
36 .IP 4. 4
41 .IP 5. 4
3742 \fBNo negative arguments\fR allowed. Input limits are \fIunsigned long long\fR and \fIdouble\fR.
3843 .PP
39 .IP 5. 4
44 .IP 6. 4
4045 \fBFractional bytes do not exist\fR, because they can't be addressed. \fBbcal\fR shows the floor value of non-integer bytes.
4146 .PP
42 .IP 6. 4
47 .IP 7. 4
4348 \fBCHS and LBA syntax\fR:
4449 - LBA: 'lLBA-MAX_HEAD-MAX_SECTOR' [NOTE: LBA starts with 'l' (case ignored)]
4550 - CHS: 'cC-H-S-MAX_HEAD-MAX_SECTOR' [NOTE: CHS starts with 'c' (case ignored)]
4651 - Format conversion arguments must be hyphen separated.
4752 - Any unspecified value, including the one preceding the first '-' to the one following the last '-', is considered '0' (zero).
4853 .PP
49 .IP 7. 4
54 .IP 8. 4
5055 \fBDefault values\fR:
5156 - sector size: 0x200 (512)
5257 - max heads per cylinder: 0x10 (16)
6873 .BI "-s=" bytes
6974 Sector size in bytes. Default value is 512.
7075 .TP
76 .BI "-m"
77 Show minimal output (e.g. decimal bytes).
78 .TP
79 .BI "-d"
80 Enable debug information and logs.
81 .TP
7182 .BI "-h"
7283 Show program help and exit.
7384 .SH EXAMPLES
7485 .PP
7586 .IP 1. 4
87 Evaluate arithmetic expression of storage units
88 .PP
89 .EX
90 .IP
91 .B $ bcal """(5kb+2mb)/3"""
92 .B $ bcal """5 tb / 12"""
93 .B $ bcal """2.5mb*3"""
94 .EE
95 .PP
96 .IP 2. 4
7697 Convert storage capacity to other units and get address, LBA.
7798 .PP
7899 .EX
81102 .B $ bcal 0x1335053 B
82103 .B $ bcal 0xaabbcc kb
83104 .B $ bcal 0xdef Gib
84
85105 Note that the units are case-insensitive.
86106 .EE
87107 .PP
88 .IP 2. 4
108 .IP 3. 4
89109 Convert storage capacity, set sector size to 4096 to calculate LBA.
90110 .PP
91111 .EX
93113 .B $ bcal 0xaabbcc kb -s 4096
94114 .EE
95115 .PP
96 .IP 3. 4
116 .IP 4. 4
97117 Convert LBA to CHS.
98118 .PP
99119 .EX
103123 .B $ bcal -f l0x300-0x12-0x7e
104124 .EE
105125 .PP
106 .IP 4. 4
126 .IP 5. 4
107127 Convert CHS to LBA.
108128 .PP
109129 .EX
115135 .B $ bcal -f c0x10-10--0x12
116136 .EE
117137 .PP
118 .IP 5. 4
138 .IP 6. 4
119139 Show binary, decimal and hex representations of a number.
120140 .PP
121141 .EX
0 bcal (1.6-1) unstable; urgency=medium
1
2 * Import new upstream version
3
4 -- SZ Lin (林上智) <szlin@debian.org> Sun, 02 Jul 2017 21:05:13 +0800
5
06 bcal (1.5-1) unstable; urgency=medium
17
28 * New upstream version
11 Section: misc
22 Priority: optional
33 Maintainer: SZ Lin (林上智) <szlin@debian.org>
4 Build-Depends: debhelper (>= 9.20160709~),
4 Build-Depends: debhelper (>= 10),
55 dh-systemd,
6 libc6-dev (>= 2.24)
7 Standards-Version: 3.9.8
6 libc6-dev (>= 2.24),
7 python3
8 Standards-Version: 4.0.0
89 Homepage: https://github.com/jarun/bcal
910 Vcs-Git: https://anonscm.debian.org/git/collab-maint/bcal.git
1011 Vcs-Browser: https://anonscm.debian.org/git/collab-maint/bcal.git
33
44 %:
55 dh $@ --parallel --with systemd
6
7 override_dh_auto_install: