![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-01 22:05 |
48,037 topics / 350,122 posts / today 2 new / 48,250 members |
| DOS开发编程 & 发展交流 (开发室) » Drawing on and Reflecting on GHOST User Parameters... |
| Printable Version 2,283 / 13 |
| Floor1 GOTOmsdos | Posted 2006-08-19 21:43 |
| 铂金会员 Posts 1,827 Credits 5,154 | |
|
In the process of writing a hard disk reader-writer, I referred to the parameters for representing hard disks and partitions in GHOST, which are very concise, such as: 1:2...
However, at the same time, I feel that other parameters in GHOST, such as SRC, DST, CLONE, PDUMP, PRESTORE, SPLIT, etc., are a bit deviating from this spirit.. I saw some programming books (about user interface) introducing that when designing a program, users should not be involved in the internal things of the program, such as read mode (READ), write mode (WRITE), what type, source data (SRC), target data (TARGET), dump (DUMP), restore (RESTORE), etc., because these are the business of programmers. Programmers often involuntarily bring out these things when writing programs, which is not fully considering users. One should use one's brain to design something that is free of program traces and easy to use (user friendly)... Of course, there should also be a simple convention (for example, 1, 2 represent hard disks, 1:2 represents a partition of a hard disk....) Just now, I was thinking about what parameter mode to adopt for the mini hard disk reader-writer I just wrote? To achieve both conciseness and rich functions (of course, just for the functions contained in my program..) The initial design of the following parameter mode is for reference.. Except for TO, there is no programmer's term seen... 1 Program 1 TO 2 Naturally, it is to copy hard disk 1 to hard disk 2. There is no need for source hard disk and target hard disk. Naturally, the left is the source and the right is the target, which conforms to the thinking habit of most people. Even without TO, it is also possible... Of course, with TO, the thinking is clearer 4 (multiple hard disks) Program 1, 2 TO 3 5 (adding partition function) Program 1:2 TO 2:3 Copy partition 2 of hard disk 1 to partition 3 of hard disk 2 6 (support drive letters) Program E: TO 2:3 7 Program C: TO G: Support image files 8 Program 1 TO (1) Load hard disk 1 into image file 1 9 Program 1 TO (1=C) Load hard disk 1 into image file 1, compress, default level 10 Program 1 TO (1=C9) Load hard disk 1 into image file 1, compress, level 9 11 Program 1 TO (1=C9=K) Load hard disk 1 into image file 1, compress, level 9, encrypt 12 Program 1 TO (1=C9=K=V) Load hard disk 1 into image file 1, compress, level 9, encrypt, default volume (1000MB) 12 Program 1 TO (1=C9=K=V1500) Load hard disk 1 into image file 1, compress, level 9, encrypt, volume (1500MB) 12 Program 1 TO (1=C9=K=V1500=E) Load hard disk 1 into image file 1, compress, level 9, encrypt, volume (1500MB), each volume should be encrypted (with the same password as the first file) 12 Program 1 TO (1=C9=K=V1500=E?) Load hard disk 1 into image file 1, compress, level 9, encrypt, volume (1500MB), each volume should be encrypted (each file should prompt the user to enter a different password) 13 (restore according to image file) Program (1) TO 1 Restore image file 1 to hard disk 1, automatically check whether it is compressed, but do not automatically check whether there are volumes 14 (restore according to image file) Program (1=V) TO 1 Restore image file 1 to hard disk 1, automatically check whether it is compressed, Automatically check volumes. If not, prompt the user to enter the volume name (if the user renamed it later) If you need to enrich functions: Comprehensive: Program 1:2, 2:3, 3:4 TO 3:2, (G:\BACK.Z=C9=K=V1500=E?) If you need to specify the sector position and specify the number of sectors to operate: (- means the starting sector position to operate + means the total number of sectors to operate) 1 Program 1-100+1000 TO 2 Copy 1000 sectors from sector 100 of hard disk 1 to sector 0 of the hard disk 2 Program 1-100+1000 TO 2-200 3 Program 1:2-100+1000 TO 2:3-300 4 Program 1:2+1000, E:-300 TO G:-200, 2:4-500 5 Program 1:2+1000, E:-300 TO G:-200, (H:\BACK.Z=C9=K=V500=E?)+1000, 2:4-500 Load 1000 sectors of partition 2 of hard disk 1 and 300th sector of E: drive into sector 200 of G: drive (all remaining sectors) and file H:\BACK.Z (1000 sectors, referring to uncompressed) and 500th sector of partition 4 of hard disk 2.... My mini hard disk reader-writer will try to adopt this parameter mode.... [ Last edited by GOTOmsdos on 2006-8-19 at 21:46 ] |
|
| Floor2 wang6610 | Posted 2006-08-19 22:39 |
| 银牌会员 Posts 488 Credits 1,246 | |
|
The idea is very good. The simpler it is, the more rigorous and thorough it needs to be.
Avoid contradictions and repetitions. [ Last edited by wang6610 on 2006-8-19 at 22:41 ] |
|
| Floor3 fastslz | Posted 2006-08-19 22:48 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
1: Support drive letters! Drive letters under DOS? Or under Windows? Is there a consideration to give up backing up in the form of drive letters? After all, the birth of Vista will bring new formats. Having NTFS drive letter interleaving is already messy enough. It's better not to consider drive letter support when designing initially.
2: Will there be misoperations if the above parameters are all numbers? Is there a consideration to add core parameters to backup and restore operations? For example, use /B for backup, /R for restore, and /F for sector operations (letters can be optional). This can also avoid some misoperations. In addition, for 1 TO (1=C9=K=V1500=E), is there a consideration to use the - symbol instead of the = symbol which has been accustomed to. |
|
| Floor4 GOTOmsdos | Posted 2006-08-19 22:49 |
| 铂金会员 Posts 1,827 Credits 5,154 | |
|
My original parameters are
Program 1 -r|w -d1 -d2 -r|w -d1 -s100 -d2 -r|w -d1 -s100 -n1000 -d2 -r|w -d1 -s100 -n1000 -d2 -s200 2 -r|w -d1 -p1 -d2 -p2 -r|w -d1 -p1 -s100 -d2 -p2 -r|w -d1 -p1 -s100 -n1000 -d2 -p2 -s300 3 -r|w -d1 -ffile -r|w -d1 -p1 -ffile.z -c9 -k -v1000 -e? ....Now, I feel very annoyed. |
|
| Floor5 fastslz | Posted 2006-08-19 22:58 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
Come up with another slightly far-fetched idea
Program 1:2,2:3,3:4 TO 3:2,(?:\BACK.Z=C9=K=V1500=E?) ?:\BACK.Z This? Similar to the find function ![]() |
|
| Floor6 GOTOmsdos | Posted 2006-08-19 23:16 |
| 铂金会员 Posts 1,827 Credits 5,154 | |
|
TO fastslz
1 Since it's a DOS program, the drive letters are naturally DOS drive letters (FAT12, FAT16, FAT32). If you need to handle non-FAT partitions, the program has options to display various forms of partition table entries for users to view before operation.... It supports all partitions. 2 Regarding the issue of misoperation, there's no need to worry. Hard disk tools are very cautious. They won't make a final decision at once. The program will inform the user of some parameter information entered by the user, and wait for the user to confirm. If it's writing to the disk, there's an additional write confirmation. I think the unique keyword TO in my concept is sufficient. It clearly indicates the relationship between the source and the target. All the parameters the program needs are completely in the left and right inputs. The ones you mentioned, such as backup with /B, restore with /R, sector operation with /F, etc., although they have their uses, they go against the original intention of this thread (conciseness and efficiency). Moreover, technically, the relationship between "backup" and "restore" is already explained in TO. If it's left--disk and right--file, it's naturally called "backup"; conversely, it's naturally called "restore". Users should be very clear in their minds. If we have to mention these concepts, some users who don't understand computers may not be clear about these concepts instead. In the GHOST user interface: DISK TO DISK, DISK TO IMAGE IMAGE TO DISK PARTITION TO PARTITION PARTITION TO IMAGE IMAGE TO PARTITION That's the same principle. (It doesn't say, "backup here, restore here...") This may also be a matter of thinking habits. 3 As for the = symbol, I originally also considered using the - sign, but what if the user needs to enter a file name containing a - sign? I also considered using /, *, etc., and finally still think = is good. It doesn't need to press SHIFT at the same time, can be typed directly, and is also eye-catching.... |
|
| Floor7 GOTOmsdos | Posted 2006-08-19 23:17 |
| 铂金会员 Posts 1,827 Credits 5,154 | |
|
(?:\BACK.Z=C9=K=V1500=E?)
Okay! But it needs to have a certain use! What function do you want it to represent? Hehe The famous unique ternary operation expression in C language is like this: XXX ? A : B Meaning: Is XXX true? If it is true, then A, otherwise B Wow! So concise! Both concise, clear and aesthetic.. [ Last edited by GOTOmsdos on 2006-8-19 at 23:40 ] |
|
| Floor8 GOTOmsdos | Posted 2006-08-19 23:20 |
| 铂金会员 Posts 1,827 Credits 5,154 | |
|
Those old and excellent DOS LINUX programmers all have many parameter symbols that are both personalized and concise with rich functions!
[ Last edited by GOTOmsdos on 2006-8-19 at 23:34 ] |
|
| Floor9 fastslz | Posted 2006-08-20 00:24 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
Well, let's put it this way, I hope it can automatically search, just like the command
FOR %%A IN (1:2 1:3 1:4 1:5 1:6 1:7 1:8 1:9 1:10 2:1 2:2 2:3 2:4 2:5 2:6 2:7 2:8 2:9 2:10 3:1 3:2 3:3 3:4 3:5 3:6 3:7 3:8 3:9 3:10 4:1 4:2 4:3 4:4 4:5 4:6 4:7 4:8 4:9 4:10) DO %%A:\BACK.Z TO 1:1 That is, execute 1:2 to 4:10 at the same time without jumping out due to an error because 1:2:\BACK.Z is not found and then continue to execute 1:3:\BACK.Z TO 1:1 until any possible number is executed. It's similar to the grub parameter find --set-root /menu.lstThe above (1:2 1:3 1:4 1:5 1:6 1:7 1:8 1:9 1:10 2:1 2:2 2:3 2:4 2:5 2:6 2:7 2:8 2:9 2:10 3:1 3:2 3:3 3:4 3:5 3:6 3:7 3:8 3:9 3:10 4:1 4:2 4:3 4:4 4:5 4:6 4:7 4:8 4:9 4:10) is equal to 4 hard drives and tentatively may have 10 partitions each [ Last edited by fastslz on 2006-8-20 at 00:38 ] |
|
| Floor10 GOTOmsdos | Posted 2006-08-20 00:59 |
| 铂金会员 Posts 1,827 Credits 5,154 | |
|
Oh, this means...
You mean when (?:\BACK.Z=C9=K=V1500=E?) is on the left? That is the source file. Because it's a DOS program, so looking for FAT - formatted partitions is still worth considering, and others naturally can't be done. But the idea is quite interesting |
|
| Floor11 fastslz | Posted 2006-08-20 01:02 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
This is perfect, and there's no need to test the drive letter issue at all.
Regarding the parameter symbols, I think the occurrence of commas in filenames is less than that of hyphens, which is also within the scope of habits. And the equal sign, I'm just talking casually here! In the Ghost parameters, I'm used to customizing the compression level variable. set 压缩级别=-z2 But in your parameters, it becomes incorrect syntax. set 压缩级别==c9 Although you can use set 压缩级别=c9, this is also one of the reasons I found that the equal sign is not suitable. Just for reference. |
|
| Floor12 fastslz | Posted 2006-08-20 01:26 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
Actually, restoring the system is easier to go wrong than backing up the system. I think everyone often encounters the situation of failing to restore the system because they can't find a certain.gho during daily ghost operations. I was also inspired by grub's find. Try the grub command line: find --set-root /system.gho. Grub indeed did it, but unfortunately, it can't print the content to a file.
|
|
| Floor13 GOTOmsdos | Posted 2006-08-20 01:49 |
| 铂金会员 Posts 1,827 Credits 5,154 | |
|
1 - =
Of course, this symbol is irrelevant. If there is a better one, we can consider changing it. But, there are only so many available symbols on the keyboard, and the others don't feel appropriate. You suggested still using -, but I still think that filenames often use it. In LINUX, it's all using -, and in WIN/DOS, it's also very common. Generally, it's like XXX-A-1, YYY-2, etc., used for distinction. Also, _ is also a legal filename, and some people like to use it very much, especially those with a programmer background. Using it to separate makes the filename clearer than -. As for the confusion between = and == you mentioned, this actually doesn't matter much because after all, the use of symbols in the program is not much. Just a few times... It won't cause great confusion..(and it's all limited in parentheses) 2 Z C This can be considered a common habit. |
|
| Floor14 johnsonlam | Posted 2006-09-01 14:00 |
| 银牌会员 Posts 497 Credits 1,410 From 九龍,香港 | |
Originally posted by GOTOmsdos at 2006-8-19 10:49 PM: Drawing on the approach of LAME... --preset 1 --preset 2 |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |