File: mkfs.fat-3.0.20-replicant.lisp

package info (click to toggle)
acl2 8.5dfsg-5
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 991,452 kB
  • sloc: lisp: 15,567,759; javascript: 22,820; cpp: 13,929; ansic: 12,092; perl: 7,150; java: 4,405; xml: 3,884; makefile: 3,507; sh: 3,187; ruby: 2,633; ml: 763; python: 746; yacc: 723; awk: 295; csh: 186; php: 171; lex: 154; tcl: 49; asm: 23; haskell: 17
file content (75 lines) | stat: -rw-r--r-- 2,970 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
(include-book "../lofat")

(b*
    (((mv & disk state)
      (getenv$ "DISK" state))
     ((unless (stringp disk)) (mv fat32$c state))
     ((mv fat32$c error-code)
      (disk-image-to-lofat
       fat32$c disk state))
     ((unless (equal error-code 0)) (mv fat32$c state))
     ((mv & output_file state)
      (getenv$ "MKFS_OUTPUT" state))
     ((unless (stringp output_file)) (mv fat32$c state))
     ((mv channel state)
      (open-output-channel output_file :character state))
     (state
      (pprogn
       (princ$ "mkfs.fat 3.0.20 (12 Jun 2013)" channel state)
       (newline channel state)
       (princ$ disk channel state)
       (princ$ " has " channel state)
       (princ$ (bpb_numheads fat32$c) channel state)
       (princ$ " heads and " channel state)
       (princ$ (bpb_secpertrk fat32$c) channel state)
       (princ$ " sectors per track," channel state)
       (set-print-base 10 state)
       (newline channel state)
       (princ$ "logical sector size is " channel state)
       (princ$ (bpb_bytspersec fat32$c) channel state)
       (princ$ "," channel state)
       (newline channel state)
       (princ$ "using 0x" channel state)
       (set-print-base 16 state)
       (princ$ (logand #xf (ash (bpb_media fat32$c) -4)) channel state)
       (princ$ (logand #xf (ash (bpb_media fat32$c) 0)) channel state)
       (set-print-base 10 state)
       (princ$ " media descriptor, with " channel state)
       (princ$ (bpb_totsec32 fat32$c) channel state)
       (princ$ " sectors;" channel state)
       (newline channel state)
       (princ$ "filesystem has " channel state)
       (princ$ (bpb_numfats fat32$c) channel state)
       (princ$ " 32-bit FATs and " channel state)
       (princ$ (bpb_secperclus fat32$c) channel state)
       (princ$
        (if (<= (bpb_secperclus fat32$c) 1)
            " sector per cluster."
          " sectors per cluster.")
        channel
        state)
       (newline channel state)
       (princ$ "FAT size is " channel state)
       (princ$ (bpb_fatsz32 fat32$c) channel state)
       (princ$ " sectors, and provides " channel state)
       (princ$ (floor (- (bpb_totsec32 fat32$c)
                         (+ (bpb_rsvdseccnt fat32$c)
                            (* (bpb_numfats fat32$c)
                               (bpb_fatsz32 fat32$c))))
                      (bpb_secperclus fat32$c))
               channel
               state)
       (princ$ " clusters." channel state)
       (newline channel state)
       (princ$ "There are " channel state)
       (princ$ (bpb_rsvdseccnt fat32$c) channel state)
       (princ$ " reserved sectors." channel state)
       (newline channel state)
       (princ$ "Volume ID is " channel state)
       (set-print-base 16 state)
       (princ$ (bs_volid fat32$c) channel state)
       (set-print-base 10 state)
       (princ$ ", no volume label." channel state)
       (newline channel state)
       (close-output-channel channel state))))
  (mv fat32$c state))