#include "stat.h" /* df: how much of the cart's battery-backed disk is left. * 256-byte blocks, 128 of them (32 KiB), 32 inodes - small enough that the * numbers are worth watching. */ void main(void) { unsigned char fs[4]; unsigned int used; gfsstat(fs); used = (unsigned int)(fs[0] - fs[1]); puts("blocks "); putu(used); putc('/'); putu(fs[0]); puts(" used ("); putu((unsigned int)used * 256 / 1024); puts("K of "); putu((unsigned int)fs[0] * 256 / 1024); puts("K)"); nl(); puts("inodes "); putu((unsigned int)(fs[2] - fs[3])); putc('/'); putu(fs[2]); puts(" used"); nl(); }