-
Notifications
You must be signed in to change notification settings - Fork 1
/
flow.doc
executable file
·94 lines (75 loc) · 2.19 KB
/
flow.doc
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Things to do depending on command line:
No command line or /ASK /YES /NO /FORCE /VERBOSE /OLD alone
Display "/? for help"
print format
/? /HELP
Display help
/DOSFORMAT
Conjure other parameters
Execute depending the other parameters
/A /FATS /CLUSTER /D /DIRENTRIES /S /SECTORSIZE
format_f shows if some of these changed
init_drive()
make_newf() checks if really changed for
If different from the old
make_new_format() counts the format
disable_disk(), configure, resize or WriteNewFormat
/ERASE /UNCONDITIONAL
init_drive()
make_newf() and make_new_format()
Fresh format the disk
/DEVICETYPE /HEADS /SIDES /SECTORS /SPT
Reconfigure
/ENVIRONMENT
init_drive()
Set the environment variables and report done so
Do what other parameters might require
/WRITEPROTECT
Set the write protection flag
/M /MAXSIZES
If no size change, reallocate anyway
Function dependences and program structure by functions
main()
parse_cmdline(argc, argv)
init_drive()
format_disk()
set_env()
set_write_protect()
init_drive()
resolve_drive()
Decide on drive
Limit variables on operating system type
retrieve_old_format()
retrieve_old_format()
Scan the driver list and fill subconfs
Fill the "f" variable
format()
make_newf()
Test for changes in format
make_new_format()
count_root()
WriteNewFormat()
Resize()
WriteNewFormat()
DiskAllocate(0)
fail -> see if old disk OK and if not make old kind of disk if possible
configure_drive()
Write the disk
Resize()
FAT_open(&f) - fail -> abort
FAT_stats() - fail -> abort
packdata()
fail -> try to finnish what we are in middle of and abort
DiskAllocate(1)
fail -> if old disk not OK, try WriteNewFormat for new and then old
MoveSectors
fail -> try to continue, WriteNewFormat for new and then old format
FixFAT()
fail -> try to continue, WriteNewFormat for new and then old format
DiskAllocate(1)
fail -> WriteNewFormat for new format
FAT_close()
fail -> try to continue, WriteNewFormat for new and then old format
ClearSectors()
fail -> try to continue, WriteNewFormat for new and then old format
configure_drive()