[add documentation
timo.lindfors@iki.fi**20080605175409] {
hunk ./src/crcloop.c 21
-// make
-// sudo modprobe loop
-// sudo insmod crcloop.ko
-// sudo losetup -p 0 -e 7 /dev/loop0 d < /dev/null
-// sudo losetup -d /dev/loop0
-// sudo rmmod crcloop
+/*
+   Overall idea as pseudocode:
+
+   # state of the system (stored in RAM):
+   
+   checksum = []
+   checksum_present = []
+
+   # operations:
+   
+   write_block(b):
+     checksum[b] = calculate_checksum(b)     
+     write_to_disk(b)
+
+   read_block(b):
+     s = calculate_checksum(b)
+     if checksum_present[b] and s != checksum[b]:
+       print warning message
+     
+     if !checksum_present[b]:
+       checksum[b] = s
+       checksum_present[b] = True
+   
+*/
+
+/*
+   make
+   sudo modprobe loop
+   sudo insmod crcloop.ko
+   sudo losetup -p 0 -e 7 /dev/loop0 test1.img < /dev/null
+   sudo cat /dev/test1.img > /dev/null # to generate checksums
+   # ... operate on /dev/loop0 ...
+   sudo losetup -d /dev/loop0
+   sudo rmmod crcloop
+*/
}
