summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/FDISK
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/CMD/FDISK
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/CMD/FDISK')
-rw-r--r--v4.0/src/CMD/FDISK/BOOTREC.ASM36
-rw-r--r--v4.0/src/CMD/FDISK/CONVERT.C478
-rw-r--r--v4.0/src/CMD/FDISK/C_MENUS.C1067
-rw-r--r--v4.0/src/CMD/FDISK/DISKOUT.C354
-rw-r--r--v4.0/src/CMD/FDISK/DISPLAY.C406
-rw-r--r--v4.0/src/CMD/FDISK/DOS.H81
-rw-r--r--v4.0/src/CMD/FDISK/DOSCALL.H2811
-rw-r--r--v4.0/src/CMD/FDISK/D_MENUS.C941
-rw-r--r--v4.0/src/CMD/FDISK/EXTERN.H82
-rw-r--r--v4.0/src/CMD/FDISK/FDBOOT.ASM119
-rw-r--r--v4.0/src/CMD/FDISK/FDCHNG.INC88
-rw-r--r--v4.0/src/CMD/FDISK/FDISK.C1121
-rw-r--r--v4.0/src/CMD/FDISK/FDISK.H224
-rw-r--r--v4.0/src/CMD/FDISK/FDISK.LNK31
-rw-r--r--v4.0/src/CMD/FDISK/FDISK.MSG1177
-rw-r--r--v4.0/src/CMD/FDISK/FDISK.SKL18
-rw-r--r--v4.0/src/CMD/FDISK/FDISK5.SKL15
-rw-r--r--v4.0/src/CMD/FDISK/FDISKMSG.C1181
-rw-r--r--v4.0/src/CMD/FDISK/FDISKMSG.H131
-rw-r--r--v4.0/src/CMD/FDISK/FDPARSE.C312
-rw-r--r--v4.0/src/CMD/FDISK/GLOBAL.C84
-rw-r--r--v4.0/src/CMD/FDISK/INPUT.C673
-rw-r--r--v4.0/src/CMD/FDISK/INT13.C443
-rw-r--r--v4.0/src/CMD/FDISK/MAIN.C332
-rw-r--r--v4.0/src/CMD/FDISK/MAINMENU.C231
-rw-r--r--v4.0/src/CMD/FDISK/MAKEFILE114
-rw-r--r--v4.0/src/CMD/FDISK/MAKEPART.C282
-rw-r--r--v4.0/src/CMD/FDISK/MESSAGES.C162
-rw-r--r--v4.0/src/CMD/FDISK/MSGRET.H55
-rw-r--r--v4.0/src/CMD/FDISK/PARSE.H188
-rw-r--r--v4.0/src/CMD/FDISK/PARTINFO.C262
-rw-r--r--v4.0/src/CMD/FDISK/PRINT.H15
-rw-r--r--v4.0/src/CMD/FDISK/PROFILE.C802
-rw-r--r--v4.0/src/CMD/FDISK/PROFILE.H44
-rw-r--r--v4.0/src/CMD/FDISK/REBOOT.ASM43
-rw-r--r--v4.0/src/CMD/FDISK/SPACE.C439
-rw-r--r--v4.0/src/CMD/FDISK/SUBTYPE.H158
-rw-r--r--v4.0/src/CMD/FDISK/TDISPLAY.C134
-rw-r--r--v4.0/src/CMD/FDISK/TEST.H26
-rw-r--r--v4.0/src/CMD/FDISK/VDISPLAY.C180
-rw-r--r--v4.0/src/CMD/FDISK/VIDEO.C146
-rw-r--r--v4.0/src/CMD/FDISK/_MSGRET.ASM263
-rw-r--r--v4.0/src/CMD/FDISK/_PARSE.ASM165
43 files changed, 15914 insertions, 0 deletions
diff --git a/v4.0/src/CMD/FDISK/BOOTREC.ASM b/v4.0/src/CMD/FDISK/BOOTREC.ASM
new file mode 100644
index 0000000..0802495
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/BOOTREC.ASM
@@ -0,0 +1,36 @@
1; Static Name Aliases
2;
3 TITLE bootrec.asm - master boot record images for fdisk
4
5_TEXT SEGMENT BYTE PUBLIC 'CODE'
6_TEXT ENDS
7_DATA SEGMENT WORD PUBLIC 'DATA'
8_DATA ENDS
9CONST SEGMENT WORD PUBLIC 'CONST'
10CONST ENDS
11_BSS SEGMENT WORD PUBLIC 'BSS'
12_BSS ENDS
13
14DGROUP GROUP CONST, _BSS, _DATA
15 ASSUME CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP
16
17_DATA SEGMENT WORD PUBLIC 'DATA'
18
19;
20; extern struct struct-name BootRecordData;
21;
22;
23;
24
25
26PUBLIC _master_boot_record
27 public _master_boot_record
28_master_boot_record label byte
29
30include fdboot.inc
31include fdboot.inc
32
33_DATA ENDS
34
35END
36 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/CONVERT.C b/v4.0/src/CMD/FDISK/CONVERT.C
new file mode 100644
index 0000000..60ec6a1
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/CONVERT.C
@@ -0,0 +1,478 @@
1
2#include "fdisk.h" /* AN000 */
3#include "subtype.h" /* AN000 */
4#include "dos.h" /* AN000 */
5#include "extern.h" /* AN000 */
6#include "string.h"
7#include "ctype.h"
8
9
10/******************************************************************************/
11/*Routine name: MBYTES_TO_CYLINDERS */
12/******************************************************************************/
13/* */
14/*Description: This routine will take input of MBtes and */
15/* convert it to cylinders rounding up to the next largest */
16/* cylinder boundry. Rounding up is done to make sure the */
17/* requester is getting at least what he asked for to the */
18/* next cylinder boundry. */
19/* */
20/*Called Procedures: none */
21/* */
22/* */
23/*Change History: Created 5/30/87 DRM */
24/* */
25/*Input: Input */
26/* */
27/*Output: Cylinders_out */
28/* */
29/******************************************************************************/
30
31
32unsigned mbytes_to_cylinders(mbytes_in,which_disk) /* AN004 */
33
34XFLOAT mbytes_in; /* AN000 */
35char which_disk; /* AN004 */
36
37
38
39BEGIN /* AN000 */
40
41unsigned cylinders_out; /* AN000 */
42unsigned long cylinders_out1; /* AN000 */
43unsigned long number_of_sectors; /* AN000 */
44unsigned long number_of_tracks; /* AN000 */
45unsigned long divide_by; /* AN000 */
46
47 /* If trying to create a 3.30 compatible 32 MB partition */
48 /* Set the 32mb limit - round down */
49 if (mbytes_in == (XFLOAT)32)
50 BEGIN
51 cylinders_out1 = ul(DOS_MAX - max_sector[which_disk]); /* AN004 */
52 divide_by = ul((max_head[which_disk]) * ul(max_sector[which_disk])); /* AN004 */
53 cylinders_out = u(cylinders_out1 / divide_by); /* AN000 */
54 END
55 else
56 BEGIN
57 number_of_sectors = ul(((mbytes_in * ONE_MEG)/BYTES_PER_SECTOR)); /* AN000 */
58 if (((int)(mbytes_in * ONE_MEG) % BYTES_PER_SECTOR) != (int)0) /* AN000 */
59 number_of_sectors++; /* AN000 */
60 number_of_tracks = ul((number_of_sectors / max_sector[which_disk])); /* AN004 */
61 if (((int)number_of_sectors % max_sector[which_disk]) != (int)0) /* AN004 */
62 number_of_tracks++; /* AN000 */
63 cylinders_out = u((number_of_tracks / max_head[which_disk])); /* AN004 */
64 if (((int)number_of_tracks % max_head[which_disk]) != (int)0) /* AN004 */
65 cylinders_out++; /* AN000 */
66 END
67
68 return(cylinders_out); /* AN000 */
69END /* AN000 */
70
71
72
73/* */
74/*******************************************************************************/
75/*Routine name: CYLINDERS_TO_MBYTES */
76/*******************************************************************************/
77/* */
78/*Description: This routine will take input of cylinders and convert */
79/* it to MBytes. */
80/* */
81/* */
82/*Called Procedures: */
83/* */
84/* */
85/*Change History: Created 5/16/87 DRM */
86/* */
87/*Input: Cylinders_in */
88/* */
89/*Output: MBytes_out */
90/* */
91/* */
92/* */
93/*******************************************************************************/
94
95XFLOAT cylinders_to_mbytes(cylinders_in,which_disk) /* AN004 */
96
97unsigned cylinders_in; /* AN000 */
98char which_disk; /* AN004 */
99
100BEGIN /* AN000 */
101
102unsigned mbytes_out; /* AN000 */
103unsigned long number_of_bytes; /* AN000 */
104unsigned long number_of_sectors; /* AN000 */
105unsigned long number_of_tracks; /* AN000 */
106unsigned long bytes_in_one_sector; /* AN004 */
107
108 bytes_in_one_sector = BYTES_PER_SECTOR; /* AN004 */
109 number_of_tracks = (ul(cylinders_in) * ul(max_head[which_disk])); /* AN004 */
110 number_of_sectors = (number_of_tracks * ul(max_sector[which_disk])); /* AN004 */
111 number_of_bytes = (ul(number_of_sectors) * ul(bytes_in_one_sector)); /* AN004 */
112 mbytes_out = f(number_of_bytes / ONE_MEG); /* AN000 */
113 if ((number_of_bytes % ONE_MEG) >= (ONE_MEG / 2)) mbytes_out++; /* AN000 */
114 return(mbytes_out); /* AN000 */
115
116END /* AN000 */
117
118
119
120
121/* */
122/*******************************************************************************/
123/*Routine name: CYLINDERS_TO_PERCENT */
124/*******************************************************************************/
125/* */
126/*Description: This routine will take input of cylinders and convert */
127/* it to Percent. */
128/* */
129/* */
130/*Called Procedures: */
131/* */
132/* */
133/*Change History: Created 5/16/87 DRM */
134/* */
135/*Input: Cylinders_in */
136/* */
137/*Output: percent_out */
138/* */
139/* */
140/* */
141/*******************************************************************************/
142
143unsigned cylinders_to_percent(cylinders_in,total_cylinders) /* AN000 */
144
145unsigned cylinders_in; /* AN000 */
146unsigned total_cylinders; /* AN000 */
147
148BEGIN /* AN000 */
149
150unsigned percentage_out; /* AN000 */
151double large_number; /* AN000 */
152
153 /* This is the same as (cyl_in / tot_cyl) * 100 to get the percentage */
154 /* because * 100 is really 100/1 which is (cyl_in*100)/(tot_cyl*1). */
155
156 if (total_cylinders == 0)
157 percentage_out = 0;
158 else
159 BEGIN
160 large_number = (double)((long)cylinders_in * 100l); /* AN000 */
161 percentage_out = u(large_number / total_cylinders); /* AN000 */
162 END
163 /* this should round up to the next percent if more than .5 percent */
164 if (((cylinders_in * 100) % total_cylinders) >= (total_cylinders / 2))
165 percentage_out++; /* AN000 */
166 if (percentage_out > u(100)) percentage_out = u(100); /* AN000 */
167 return(percentage_out); /* AN000 */
168END /* AN000 */
169
170
171
172/* */
173/******************************************************************************/
174/*Routine name: PERCENT_TO_CYLINDERS */
175/******************************************************************************/
176/* */
177/*Description: This routine will take input of percentage and */
178/* convert it to cylinders rounding up to the next largest */
179/* cylinder boundry. Rounding up is done to make sure the */
180/* requester is getting at least what he asked for to the */
181/* next cylinder boundry. */
182/* */
183/*Called Procedures: none */
184/* */
185/* */
186/*Change History: Created 5/30/87 DRM */
187/* */
188/*Input: Input */
189/* */
190/*Output: Cylinders_out */
191/* */
192/******************************************************************************/
193
194
195XFLOAT percent_to_cylinders(percent_in,total_cylinders) /* AN000 */
196
197unsigned percent_in; /* AN000 */
198XFLOAT total_cylinders; /* AN000 */
199
200
201BEGIN /* AN000 */
202
203 XFLOAT cylinders_out; /* AN000 */
204#if IBMCOPYRIGHT
205 cylinders_out = ((percent_in * total_cylinders) / 100); /* AN000 */
206#else
207 cylinders_out = (unsigned)((ul(percent_in) * ul(total_cylinders)) / 100);
208#endif
209 if (((percent_in * total_cylinders) % 100) != u(0)) /* AN000 */
210 cylinders_out++; /* AN000 */
211 return(cylinders_out); /* AN000 */
212END /* AN000 */
213
214
215
216
217
218
219/* */
220/*******************************************************************************/
221/*Routine name: DOS_UPPER */
222/*******************************************************************************/
223/* */
224/*Description: This routine will uppcase a character using get country */
225/* information (65H) with the capitalize single character */
226/* call (20H). */
227/* */
228/*Called Procedures: */
229/* */
230/* */
231/* */
232/*Change History: Updated 5/31/87 DRM */
233/* */
234/*Input: drive_value */
235/* */
236/*Output: input_value */
237/* */
238/*******************************************************************************/
239
240char dos_upper(drive_value) /* AN000 */
241
242char drive_value; /* AN000 */
243
244BEGIN /* AN000 */
245
246 char output; /* AN000 */
247
248 regs.x.ax = (unsigned)CAPCHAR; /* Get extended country information - AN000 */
249 regs.h.dl = (unsigned char)drive_value; /* Move input_value to register DL - AN000 */
250 int86((int)INT21,&regs,&regs); /* AN000 */
251 output = (char)regs.h.dl; /* AN000 */
252
253#ifdef DEBUG
254 output = toupper(drive_value);
255#endif
256
257 return(output); /* AN000 */
258END /* AN000 */
259
260
261
262
263
264/* */
265/*******************************************************************************/
266/*Routine name: CHECK_YN_INPUT */
267/*******************************************************************************/
268/* */
269/*Description: Get single character input, which must be a country */
270/* dependent (Y/N). Will be verified using new uppercase table */
271/* function calls. Will accept default value. */
272/* */
273/*Called Procedures: */
274/* */
275/* */
276/* */
277/*Change History: Updated 5/31/87 DRM */
278/* */
279/*Input: input_value */
280/* */
281/*Output: input */
282/* valid_input */
283/* */
284/*******************************************************************************/
285
286char check_yn_input(input_value) /* AN000 */
287
288 char input_value; /* AN000 */
289
290BEGIN
291 char input; /* AN000 */
292
293 /* Get extended country information */
294 regs.x.ax = (unsigned)CAP_YN; /* AN000 */
295 /* Move input_value to register DL */
296 regs.h.dl = (unsigned char)input_value; /* AN000 */
297 int86((int)INT21,&regs,&regs); /* AN000 */
298
299 /* check carry flag for error */
300 if ((regs.x.cflag & CARRY_FLAG) == CARRY_FLAG) /* AN000 */
301 /* input will be 0 for NO and 1 for YES in AX */
302 input = c(NO_GOOD); /* input will equal not 0 or 1 */ /* AN000 */
303 else /* AN000 */
304 input = c(regs.x.ax); /* AN000 */
305
306#ifdef DEBUG
307
308 input = NO_GOOD;
309 if ( (input_value == (char) 'Y') || (input_value == (char) 'y') ) input = c(1);
310 if ( (input_value == (char) 'N') || (input_value == (char) 'n') ) input = c(0);
311
312#endif
313
314 return(input); /* AN000 */
315END /* AN000 */
316
317
318
319
320/* */
321/*******************************************************************************/
322/*Routine name: GET_FS_AND_VOL */
323/*******************************************************************************/
324/* */
325/*Description: This routine will invoke INT21 44h (Block Generic IOCTL */
326/* Subfunction) call to get volume label and file system type. */
327/* */
328/*Called Procedures: */
329/* */
330/*Change History: Created 6/01/87 DRM */
331/* */
332/*Input: input_drive */
333/* */
334/*Output: pointer to dx register */
335/* */
336/*******************************************************************************/
337
338FLAG get_fs_and_vol(input_drive) /* AN000 */
339
340 char input_drive; /* AN000 */
341
342BEGIN /* AN000 */
343
344 char output;
345
346 /* Set up registers for Generic IOCTL INT21 (44h) get media ID */
347 regs.x.ax = u(GENERIC_IOCTL); /* AN000 */
348 regs.h.bh = uc(ZERO); /* AN000 */
349 regs.h.bl = (((unsigned char)input_drive - 'A') + 1); /* AN000 */
350 regs.x.cx = u(GET_MEDIA_ID); /* AN000 */
351 regs.x.dx = (unsigned)&dx_buff; /* AN000 */
352 segread(&segregs);
353 intdosx(&regs,&regs,&segregs); /* AN000 */
354
355 /* see if carry flag was zero or one */
356 if ((regs.x.cflag & CARRY_FLAG) == CARRY_FLAG) /* AN000 */
357 output = FALSE; /* AN000 */
358 else /* AN000 */
359 output = TRUE; /* AN000 */
360
361 return(output); /* AN000 */
362 /* AN000 */
363END
364
365
366
367/* */
368/*******************************************************************************/
369/*Routine name: GET_VOLUME_STRING */
370/*******************************************************************************/
371/* */
372/*Description: This routine will invoke INT21 4Eh (Find First Matching File) */
373/* and return the disk volume label. */
374/* */
375/*Called Procedures: */
376/* */
377/*Change History: Created 6/01/87 DRM */
378/* */
379/*Input: input_drive */
380/* */
381/*Output: volume_out */
382/* */
383/*******************************************************************************/
384void get_volume_string(input_drive,vol_label_addr) /* AN000 */
385 char input_drive; /* AN000 */
386 char *vol_label_addr; /* AN000 */
387BEGIN /* AN000 */
388
389 char first_string[13]; /* AC000 */
390 char find_first_buffer[50]; /* AN000 */
391 unsigned i,j; /* AC000 */
392
393 /* clear out any garbage in volume label field */
394 for (i = u(0); i < u(12); i++) /* AN015 */
395 BEGIN /* AN015 */
396 vol_label_addr[i] = u(0); /* AN015 */
397 END /* AN015 */
398
399 /* Point the DTA to our buffer so we can get the FindFirst output */
400 regs.h.ah = uc(0x1A); /* AN000 */
401 regs.x.dx = (unsigned)&find_first_buffer[0]; /* AN000 */
402 segread(&segregs);
403 intdosx(&regs,&regs,&segregs); /* AN000 */
404
405 /* Find the first volume id */
406 first_string[0] = input_drive; /* Find the vol label - AN000 */
407 first_string[1] = (char) '\0';
408 strcat(first_string,FILE_NAME); /* AN000 */
409 regs.h.ah = uc(FIND_FIRST_MATCH); /* AN000 */
410 regs.x.cx = u(VOL_LABEL); /* AN000 */
411 regs.x.dx = (unsigned)&first_string[0]; /* AN000 */
412 intdos(&regs,&regs); /* AN000 */
413
414/* AC000 The following is modified to take care of "." in the middle of the */
415/*name */
416
417 if ((regs.x.cflag & CARRY_FLAG) != CARRY_FLAG) /* AN000 AC015 */
418 BEGIN /* AN000 */
419 for (i=j=u(0); i < strlen (&find_first_buffer[30]) ; i++) /* AN000 */
420 BEGIN /* AN000 */
421 if (find_first_buffer[30+i] != PERIOD) /* AN003 */
422 vol_label_addr[i-j] = find_first_buffer[30+i]; /* AN000 */
423 else /* AN000 */
424 j = u(1); /* AN000 */
425 END /* AN000 */
426 END /* AN000 */
427 return; /* AN000 */
428END /* AN000 */
429
430
431/* */
432/*******************************************************************************/
433/*Routine name: CHECK_FORMAT */
434/*******************************************************************************/
435/* */
436/*Description: This routine will invoke INT21 44h (Block Generic IOCTL */
437/* Subfunction) call to see if the drive has been previously */
438/* formatted by using a undocumented call. */
439/* */
440/*Called Procedures: */
441/* */
442/*Change History: Created 2/07/88 DRM */
443/* */
444/*Input: input_drive */
445/* */
446/*Output: pointer to dx register */
447/* */
448/*******************************************************************************/
449
450FLAG check_format(input_drive) /* AN002 */
451
452 char input_drive; /* AN002 */
453
454BEGIN /* AN002 */
455
456 char formatted; /* AN002 */
457
458 /* Set up registers for Generic IOCTL INT21 (44h) check media */
459 regs.x.ax = u(GENERIC_IOCTL); /* AN002 */
460 regs.h.bh = uc(ZERO); /* AN002 */
461 regs.h.bl = (((unsigned char)input_drive - 'A') + 1); /* AN002 */
462 regs.x.cx = u(SPECIAL_FUNCTION); /* AN002 */
463 regs.x.dx = (unsigned)&disk_access; /* AN002 */
464 segread(&segregs); /* AN002 */
465 intdosx(&regs,&regs,&segregs); /* AN002 */
466
467 /* see if buffer returned good or not */
468 if (disk_access.dac_access_flag == ZERO) /* AN002 */
469 formatted = FALSE; /* AN002 */
470 else /* AN002 */
471 formatted = TRUE; /* AN002 */
472
473 return(formatted); /* AN002 */
474
475END /* AN002 */
476
477
478
diff --git a/v4.0/src/CMD/FDISK/C_MENUS.C b/v4.0/src/CMD/FDISK/C_MENUS.C
new file mode 100644
index 0000000..7516ce1
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/C_MENUS.C
@@ -0,0 +1,1067 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "extern.h" /* AN000 */
5#include "subtype.h" /* AN000 */
6#include "fdiskmsg.h" /* AN000 */
7#include "stdio.h"
8
9/* */
10/******************* START OF SPECIFICATIONS *******************/
11/* */
12/* SUBROUTINE NAME: CREATE_PARTITION */
13/* */
14/* DESCRIPTIVE NAME: Create DOS related partition(s) */
15/* */
16/* FUNCTION: */
17/* This routine verifies if there are free partitions, */
18/* posts an status message if there is not, otherwise */
19/* prints a screen asking what type of partition to */
20/* be created, and passes control to the requested */
21/* function. */
22/* */
23/* NOTES: This is a screen control module only, no data is */
24/* modified. Routine also will only allow 1 DOS and */
25/* 1 Ext DOS partitions per disk, if one already exists,*/
26/* then status message is displayed when the create */
27/* option for that type partition is selected */
28/* */
29/* The following screen in managed */
30/* */
31/* ³0000000000111111111122222222223333333333³ */
32/* ³0123456789012345678901234567890123456789³ */
33/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
34/* 00³ ³ */
35/* 01³ ³ */
36/* 02³ ³ */
37/* 03³ ³ */
38/* 04³Create DOS Partition ³ */
39/* 05³ ³ */
40/* 06³Current Fixed Disk Drive: # ³ */
41/* 07³ ³ */
42/* 08³Choose one of the following: ³ */
43/* 09³ ³ */
44/* 10³ 1. Create Primary DOS partition ³ */
45/* 11³ 2. Create EXTENDED DOS partition ³ */
46/* 12³ 3. Create logical DOS drive(s) in ³ */
47/* 13³ the EXTENDED DOS partition ³ */
48/* 14³ ³ */
49/* 15³ ³ */
50/* 16³ ³ */
51/* 17³ ³ */
52/* 18³Enter choice: [ ] ³ */
53/* 19³ ³ */
54/* 20³ ³ */
55/* 21³ ³ */
56/* 22³ ³ */
57/* 23³Press ESC to return to FDISK Options ³ */
58/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
59/* */
60/* ENTRY POINTS: create_partition */
61/* LINKAGE: create_partition(); */
62/* */
63/* INPUT: None */
64/* */
65/* EXIT-NORMAL: ERROR=FALSE */
66/* */
67/* EXIT-ERROR: ERROR=TRUE */
68/* GOTO internal_program_error if case statement */
69/* failure when branching to requested function */
70/* */
71/* EFFECTS: No data directly modified by this routine, but */
72/* child routines will modify data. */
73/* */
74/* INTERNAL REFERENCES: */
75/* ROUTINES: */
76/* find_free_partition */
77/* dos_create_partition */
78/* ext_create_partition */
79/* volume_create */
80/* internal_program_error */
81/* find_partition_type */
82/* get_num_input */
83/* display */
84/* wait_for_ESC */
85/* clear_screen */
86/* */
87/* EXTERNAL REFERENCES: */
88/* ROUTINES: */
89/* */
90/******************** END OF SPECIFICATIONS ********************/
91
92/* */
93void create_partition()
94
95BEGIN
96
97char input;
98char default_value;
99char max_input;
100
101
102
103
104 input = c(NUL); /* AC000 */
105 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
106 /* put up heading and ESC */
107 display(menu_8);
108 display(menu_11);
109
110 /* Setup current drive msg */
111 insert[0]=cur_disk+1+'0';
112 display(menu_5);
113
114 /* See if there are free partitions */
115 if (find_free_partition() != ((char)(NOT_FOUND))) /* AC000 */
116 BEGIN
117 /* display menu */
118 display(menu_3); /* AN000 */
119 display(menu_9);
120
121 /* ############# ADD CODE HERE FOR THIS FUNCTION ############## */
122 /* Do something about highlighting the available options and */
123 /* setting up defaults */
124 default_value = c(1); /* AC000 */
125 /* ############################################################ */
126 /* setup default for prompt */
127 insert[0] = c('1'); /* AC000 */
128 display(menu_7);
129 display(menu_10);
130
131 max_input = c(3); /* AC000 */
132
133 input = get_num_input(default_value,max_input,input_row,input_col);
134
135 /* Go branch to the requested function */
136 switch(input)
137 BEGIN
138 case '1': dos_create_partition();
139 break;
140
141 case '2':
142 if ((cur_disk == c(1)) || (find_partition_type(uc(DOS12))) || (find_partition_type(uc(DOS16))) ||
143 (find_partition_type(uc(DOSNEW)))) /* AN000 */ /* AC000 */
144 ext_create_partition();
145 else
146 BEGIN /* AN000 */
147 /* don't have a primary partition yet, can't create an ext */
148 display(error_19); /* AN000 */
149 clear_screen(u(17),u(0),u(17),u(79)); /* AN000 */
150 wait_for_ESC(); /* AN000 */
151 END /* AN000 */
152 break;
153
154 case '3':
155 BEGIN
156 if (find_partition_type(uc(EXTENDED))) /* AC000 */
157 volume_create();
158 else /* AN000 */
159 BEGIN /* AN000 */
160 display(error_35); /* AN000 */
161 clear_screen(u(17),u(0),u(17),u(79)); /* AN000 */
162 wait_for_ESC(); /* AN000 */
163 END /* AN000 */
164 break;
165 END
166
167 case ESC: break;
168
169 default: internal_program_error();
170 END
171 END
172 else
173 BEGIN
174
175 /* Display prompt telling there is no avail partition */
176 display(error_10);
177 input = wait_for_ESC();
178 END
179 /* clear the screen before going back to main menu */
180 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
181 return;
182END
183
184
185/* */
186/******************* START OF SPECIFICATIONS *******************/
187/* */
188/* SUBROUTINE NAME: DOS_CREATE_PARTITION */
189/* */
190/* DESCRIPTIVE NAME: Create default DOS partition on disk */
191/* */
192/* FUNCTION: User is prompted to see if he wishes to use to */
193/* set up a DOS partition in the maximum available */
194/* size (limited to 32mb). If option is selected */
195/* than partition is created and marked active. The */
196/* partition is scanned to insure there are enough */
197/* contiguous good sectors for DOS. */
198/* */
199/* NOTES: Screen can be exited via the ESC command before */
200/* partition is created and nothing will change */
201/* */
202/* The following screen is managed: */
203/* */
204/* ³0000000000111111111122222222223333333333³ */
205/* ³0123456789012345678901234567890123456789³ */
206/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
207/* 00³ ³ */
208/* 01³ ³ */
209/* 02³ ³ */
210/* 03³ ³ */
211/* 04³Create DOS Partition ³ */
212/* 05³ ³ */
213/* 06³Current Fixed Disk Drive: # ³ */
214/* 07³ ³ */
215/* 08³Do you wish to use the maximum size ³ */
216/* 09³for a DOS partition and make the DOS ³ */
217/* 10³partition active (Y/N).........? [Y] ³ */
218/* 11³ ³ */
219/* 12³ ³ */
220/* 13³ ³ */
221/* 14³ ³ */
222/* 15³ ³ */
223/* 16³ ³ */
224/* 17³ ³ */
225/* 18³ ³ */
226/* 19³ ³ */
227/* 20³ ³ */
228/* 21³ ³ */
229/* 22³ ³ */
230/* 23³Press ESC to return to FDISK Options ³ */
231/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
232/* */
233/* ENTRY POINTS: dos_create_partition */
234/* LINKAGE: dos_create_partition(); */
235/* NEAR CALL */
236/* */
237/* INPUT: None */
238/* */
239/* EXIT-NORMAL: ERROR=FALSE */
240/* */
241/* EXIT-ERROR: ERROR=TRUE */
242/* GOTO internal_program_error if case statement */
243/* failure when branching to requested function */
244/* */
245/* EFFECTS: No data directly modified by this routine, but */
246/* child routines will modify data. */
247/* */
248/* INTERNAL REFERENCES: */
249/* ROUTINES: */
250/* clear_screen */
251/* display */
252/* get_yn_input */
253/* wait_for_ESC */
254/* input_dos_create */
255/* make_partition */
256/* check_bad_tracks */
257/* */
258/* */
259/* EXTERNAL REFERENCES: */
260/* ROUTINES: */
261/* */
262/******************** END OF SPECIFICATIONS ********************/
263
264/* */
265void dos_create_partition()
266
267
268BEGIN
269
270 char input;
271 char temp;
272 char second_disk_flag; /* AN000 */
273
274
275
276 second_disk_flag = (FLAG)FALSE; /* AN000 */
277 input = c(NUL); /* AC000 */
278 /* clear off screen */
279 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
280
281 /* Put up header */
282 display(menu_12);
283
284 /* Set up current disk message */
285 insert[0] = cur_disk+1+'0';
286 display(menu_5);
287
288 /* Display ESC prompt */
289 display(menu_11);
290
291 /* See if already exists */
292 if ((!find_partition_type(uc(DOS12))) && (!find_partition_type(uc(DOS16))) && (!find_partition_type(uc(DOSNEW)))) /* AC000 */
293
294 BEGIN
295 /* Display prompt, depending on what disk */
296 if (cur_disk == c(0)) /* AC000 */
297 /* Put up make active partition message */
298 display(menu_13);
299 else
300 BEGIN
301 /* Second disk, so don;t put up prompt mentioning active partition */
302 second_disk_flag = (FLAG)TRUE; /* AN000 */
303 display(menu_45); /* AC000 */
304 END
305 /* Get Y/N input */
306 input = get_yn_input(c(Yes),input_row,input_col); /* AC000 AC011 */
307
308 /* Go handle input */
309 switch(input)
310 BEGIN
311 case 1: /* AC000 */
312 if ( second_disk_flag == (FLAG)FALSE)
313 BEGIN
314 /* Go get the biggest area left */
315 temp = find_part_free_space(c(PRIMARY)); /* AC000 */
316 make_partition(free_space[temp].space,temp,uc(ACTIVE),c(PRIMARY)); /* AC000 */
317 reboot_flag = (FLAG)TRUE; /* AC000 */
318 if (number_of_drives == uc(1)) /* AN000 */
319 BEGIN /* AN000 */
320 write_info_to_disk();
321 reboot_system(); /* AC000 */
322 END /* AN000 */
323 clear_screen(u(16),u(0),u(23),u(79)); /* AN000 */
324 display(status_12); /* AN000 */
325 wait_for_ESC();
326 break;
327 END
328 else
329 BEGIN /* AN000 */
330 /* Go get the biggest area left */ /* AN000 */
331 temp = find_part_free_space(c(PRIMARY)); /* AN000 */
332 make_partition(free_space[temp].space,temp,uc(NUL),c(PRIMARY)); /* AN000 */
333 reboot_flag = (FLAG)TRUE; /* AN000 */
334 clear_screen(u(16),u(0),u(23),u(79)); /* AN000 */
335 display(status_12); /* AN000 */
336 wait_for_ESC();
337 break;
338 END
339
340 case 0: input_dos_create(); /* AC000 */
341 break;
342
343 case ESC: break; /* take no action */
344
345 default : internal_program_error();
346 END
347 END
348 else
349 BEGIN
350 /* Display partition table-it will return if no partitions there */
351 table_display();
352
353 /* Primary partition already exists message */
354 display(error_8);
355 wait_for_ESC();
356 END
357 return;
358END
359
360
361/* */
362/******************* START OF SPECIFICATIONS *******************/
363/* */
364/* SUBROUTINE NAME: INPUT_DOS_CREATE */
365/* */
366/* DESCRIPTIVE NAME: Create DOS partition on disk */
367/* */
368/* FUNCTION: Gets user specified size for partition (maximum */
369/* is 32mb or largest contiguous freespace, which- */
370/* ever is smaller). Default is largest avail free */
371/* space. Partition is created to default size,unless*/
372/* user enters different size, but is not marked */
373/* active. User specified size must be smaller or */
374/* equal to the default size */
375/* */
376/* NOTES: Screen can be exited via the ESC command before */
377/* partition is created and nothing will change */
378/* */
379/* The following screen is managed */
380/* */
381/* ³0000000000111111111122222222223333333333³ */
382/* ³0123456789012345678901234567890123456789³ */
383/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
384/* 00³ ³ */
385/* 01³ ³ */
386/* 02³ ³ */
387/* 03³ ³ */
388/* 04³Create DOS partition ³ */
389/* 05³ ³ */
390/* 06³Current Fixed Disk Drive: # ³ */
391/* 07³ ³ */
392/* 08³Partition Status Type Start End Size³ */
393/* 09³ ³ */
394/* 10³ ³ */
395/* 11³ ³ */
396/* 12³ ³ */
397/* 13³ ³ */
398/* 14³Total disk space is #### cylinders. ³ */
399/* 15³Maximum space available for partition ³ */
400/* 16³is #### cylinders. ³ */
401/* 17³ ³ */
402/* 18³Enter partition size............: [####]³ */
403/* 19³ ³ */
404/* 20³ ³ */
405/* 21³ ³ */
406/* 22³ ³ */
407/* 23³Press ESC to return to FDISK Options ³ */
408/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
409/* */
410/* ENTRY POINTS: input_dos_create */
411/* LINKAGE: input_dos_create(); */
412/* NEAR CALL */
413/* */
414/* INPUT: None */
415/* */
416/* EXIT-NORMAL: ERROR=FALSE */
417/* */
418/* EXIT-ERROR: ERROR=TRUE */
419/* GOTO internal_program_error if case statement */
420/* failure when branching to requested function */
421/* */
422/* EFFECTS: No data directly modified by this routine, but */
423/* child routines will modify data. */
424/* */
425/* INTERNAL REFERENCES: */
426/* ROUTINES: */
427/* clear_screen */
428/* table_display */
429/* get_num_input */
430/* display */
431/* wait_for_ESC */
432/* make_partition */
433/* check_bad_tracks */
434/* */
435/* EXTERNAL REFERENCES: */
436/* ROUTINES: */
437/* */
438/******************** END OF SPECIFICATIONS ********************/
439
440/* */
441void input_dos_create()
442
443BEGIN
444
445 unsigned input;
446 unsigned default_entry;
447 char temp;
448 char location;
449
450 input = u(NUL); /* AC000 */
451 /* clear off screen */
452 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
453
454 /* Put up heading */
455 display(menu_12);
456
457 /* Setup and print current disk */
458 insert[0] = cur_disk+1+'0';
459 display(menu_5);
460
461 /* Print ESC prompt */
462 display(menu_11);
463
464 /* Display partition table-it will return if no partitions there */
465 table_display();
466
467 sprintf(insert,"%4.0d",total_mbytes[cur_disk]);
468 display(menu_15);
469
470 /* Get the free space */
471 temp = find_part_free_space(c(PRIMARY)); /* AC000 */
472
473 /* Is there any ?*/
474 if (free_space[temp].mbytes_unused != u(0)) /* AC000 */
475
476 BEGIN
477 /* Display disk space */
478 sprintf(insert,"%4.0d",total_mbytes[cur_disk]);
479 display(menu_15);
480
481 /* Setup and print max partition size */
482
483 sprintf(insert,"%4.0d%3.0d%%",
484 free_space[temp].mbytes_unused,
485 free_space[temp].percent_unused);
486 display(menu_16);
487
488 /* Force repeats on the input until something valid (Non-Zero return) */
489 default_entry = (unsigned)free_space[temp].mbytes_unused; /* AC000 */
490 valid_input = (FLAG)FALSE; /* AC000 */
491
492 while (!valid_input)
493
494 BEGIN
495 /* Display prompt */
496 sprintf(insert,"%4.0d",default_entry);
497 display(menu_39);
498
499 input = get_large_num_input(default_entry,free_space[temp].mbytes_unused,free_space[temp].percent_unused,menu_39,u(0),error_13); /* AC000 */
500
501 /* Update default in case of error, so it gets displayed and used */
502 /* if user presses CR only */
503
504 default_entry = input;
505 clear_screen(u(19),u(0),u(23),u(79)); /* AC000 */
506 END
507
508 if (input != ((unsigned)(ESC_FLAG))) /* AC000 */
509
510 BEGIN
511 /* Change input to cylinders */
512 /* check to see if input was in percent or mbytes */
513
514 if (PercentFlag) /* AN000 */
515 BEGIN /* AN000 */
516 if (input == free_space[temp].percent_unused)
517 input = free_space[temp].space; /* AN000 */
518 else /* AN000 */
519 input = percent_to_cylinders(input,total_disk[cur_disk]);
520 END /* AN000 */
521 else /* AN000 */
522 BEGIN /* AN000 */
523 if (input == free_space[temp].mbytes_unused)
524 input = free_space[temp].space; /* AN000 */
525 else /* AN000 */
526 input = (unsigned)mbytes_to_cylinders(input,
527 cur_disk); /* AN004 */
528 END /* AN000 */
529
530 /* Initialize PecentFlag back to FALSE */
531 PercentFlag = (FLAG)FALSE; /* AN000 */
532
533 /* Go create the partition */
534 make_partition(input,temp,uc(NUL),c(PRIMARY)); /* AC000 */
535
536 /* clear off the old prompt */
537 clear_screen(u(13),u(0),u(19),u(79)); /* AC000 */
538
539 /* Reissue the partition info */
540 table_display();
541
542 /* display the "okay, we did it" msg */
543 if (number_of_drives == uc(1)) /* AN000 */
544 display(status_5);
545 else
546 BEGIN /* AN000 */
547 clear_screen(u(16),u(0),u(23),u(79)); /* AN000 */
548 display(status_12); /* AN000 */
549 END /* AN000 */
550
551 wait_for_ESC();
552
553 reboot_flag = TRUE;
554
555 END
556 END
557 return;
558END
559
560
561/* */
562/******************* START OF SPECIFICATIONS *******************/
563/* */
564/* SUBROUTINE NAME: EXT_CREATE_PARTITION */
565/* */
566/* DESCRIPTIVE NAME: Create EXTENDED DOS partition */
567/* */
568/* FUNCTION: Gets user specified size for EXTENDED partition */
569/* (Maximum is largest contiguous freespace). The */
570/* default is the largest available freespace. */
571/* space. Partition is created to default size, */
572/* unless user enters different size, but is not */
573/* marked as active. User specified size must be */
574/* smaller or equal to default size */
575/* */
576/* NOTES: Screen can be exited via the ESC command before */
577/* partition is created and nothing will change */
578/* */
579/* The following screen is managed */
580/* */
581/* ³0000000000111111111122222222223333333333³ */
582/* ³0123456789012345678901234567890123456789³ */
583/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
584/* 00³ ³ */
585/* 01³ ³ */
586/* 02³ ³ */
587/* 03³ ³ */
588/* 04³Create EXTENDED DOS partition ³ */
589/* 05³ ³ */
590/* 06³Current Fixed Disk Drive: # ³ */
591/* 07³ ³ */
592/* 08³Partition Status Type Start End Size³ */
593/* 09³ ³ */
594/* 10³ ³ */
595/* 11³ ³ */
596/* 12³ ³ */
597/* 13³ ³ */
598/* 14³Total disk space is #### cylinders. ³ */
599/* 15³Maximum space available for partition ³ */
600/* 16³is #### cylinders. ³ */
601/* 17³ ³ */
602/* 18³Enter partition size............: [####]³ */
603/* 19³ ³ */
604/* 20³ ³ */
605/* 21³ ³ */
606/* 22³ ³ */
607/* 23³Press ESC to return to FDISK Options ³ */
608/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
609/* */
610/* ENTRY POINTS: EXTENDED_create_partition */
611/* LINKAGE: EXTENDED_create_partition(); */
612/* NEAR CALL */
613/* */
614/* INPUT: None */
615/* */
616/* EXIT-NORMAL: ERROR=FALSE */
617/* */
618/* EXIT-ERROR: ERROR=TRUE */
619/* GOTO internal_program_error if case statement */
620/* failure when branching to requested function */
621/* */
622/* EFFECTS: No data directly modified by this routine, but */
623/* child routines will modify data. */
624/* */
625/* INTERNAL REFERENCES: */
626/* ROUTINES: */
627/* clear_screen */
628/* table_display */
629/* get_num_input */
630/* display */
631/* find_partition_type */
632/* wait_for_ESC */
633/* make_partition */
634/* */
635/* EXTERNAL REFERENCES: */
636/* ROUTINES: */
637/* */
638/******************** END OF SPECIFICATIONS ********************/
639
640/* */
641void ext_create_partition()
642
643
644BEGIN
645
646 unsigned input;
647 unsigned default_entry;
648 char temp;
649
650
651 input = u(NUL); /* AC000 */
652 /* clear off screen */
653 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
654
655 /* Put up heading */
656 display(menu_17);
657
658 /* Setup and print current disk */
659 insert[0] = cur_disk+1+'0';
660 display(menu_5);
661
662 /* print ESC prompt */
663 display(menu_11);
664
665 /* Display partition table-it will return if no partitions there */
666 table_display();
667
668 /* Go see if primary already exists and ext doesn't */
669 if ((cur_disk == c(1)) || (find_partition_type(uc(DOS12))) || (find_partition_type(uc(DOS16))) ||
670 (find_partition_type(uc(DOSNEW)))) /* AC000 */
671 BEGIN
672 if (!find_partition_type(uc(EXTENDED))) /* AC000 */
673 /* We can go create one now */
674 BEGIN
675
676 /* Get the free space */
677 temp = find_part_free_space(c(EXTENDED)); /* AC000 */
678
679 /* Is there any ?*/
680 if (free_space[temp].percent_unused != u(0)) /* AC000 */
681 BEGIN
682
683 /* Display disk space */
684 sprintf(insert,"%4.0d",total_mbytes[cur_disk]);
685 display(menu_15);
686
687 /* Setup and print max partition size */
688
689 sprintf(insert,"%4.0d%3.0d%%",
690 free_space[temp].mbytes_unused,
691 free_space[temp].percent_unused);
692 display(menu_16);
693
694 /* Force repeats on the input until something valid (Non-Zero return) */
695 /* Display MBytes unless MBytes == 0, then display percent */
696 if (free_space[temp].mbytes_unused == u(0)) /* AN000 */
697 BEGIN /* AN000 */
698 default_entry = (unsigned)free_space[temp].percent_unused; /* AC000 */
699 PercentFlag = (FLAG)TRUE; /* AN000 */
700 END /* AN000 */
701 else /* AN000 */
702 BEGIN
703 default_entry = (unsigned)free_space[temp].mbytes_unused; /* AC000 */
704 PercentFlag = (FLAG)FALSE; /* AN000 */
705 END
706
707 valid_input = (FLAG)FALSE; /* AC000 */
708
709 while (!valid_input)
710 BEGIN
711 /* Display prompt */
712 if (!PercentFlag) /* AN000 */
713 sprintf(insert,"%4.0d",default_entry);
714 else /* AN000 */
715 sprintf(insert,"%3.0d%%",default_entry); /* AN000 */
716 display(menu_42); /* AC000 */
717
718 input = get_large_num_input(default_entry,free_space[temp].mbytes_unused,free_space[temp].percent_unused,menu_42,u(0),error_13); /* AC000 */
719
720 /* Update default in case of error, so it gets displayed and used */
721 /* if user presses CR only */
722
723 default_entry = input;
724 clear_screen(u(19),u(0),u(23),u(79)); /* AC000 */
725 END
726
727 if (input != ((unsigned)(ESC_FLAG))) /* AC000 */
728 BEGIN
729
730 /* Change input to cylinders */
731 if (PercentFlag) /* AN000 */
732 BEGIN /* AN000 */
733 if (input == free_space[temp].percent_unused)
734 input = free_space[temp].space; /* AN000 */
735 else /* AN000 */
736 input = percent_to_cylinders(input,total_disk[cur_disk]);
737 END /* AN000 */
738 else /* AN000 */
739 BEGIN /* AN000 */
740 if (input == free_space[temp].mbytes_unused)
741 input = free_space[temp].space; /* AN000 */
742 else /* AN000 */
743 input = (unsigned)mbytes_to_cylinders(input,
744 cur_disk); /* AN004 */
745 END /* AN000 */
746
747
748 /* Initialize PecentFlag back to FALSE */
749 PercentFlag = (FLAG)FALSE; /* AN000 */
750
751 /* Go create the partition */
752 make_partition(input,temp,uc(NUL),c(EXTENDED)); /* AC000 */
753
754 /* clear off the old prompt */
755 clear_screen(u(13),u(0),u(19),u(79)); /* AC000 */
756
757 /* Display the updated partition information */
758 table_display();
759
760 /* Hit esc to continue line */
761 clear_screen(u(24),u(0),u(24),u(79)); /* AN000 */
762 display(menu_46); /* AN000 */
763
764 /* Tell user we created it */
765 display(status_6);
766 wait_for_ESC();
767
768 reboot_flag = (FLAG)TRUE; /* AC000 */
769
770 /* Go allow him to create disk volumes */
771 volume_create();
772 END
773 END
774 else
775 BEGIN
776 /* No room */
777 display(error_10);
778 wait_for_ESC();
779 END
780 END
781 else
782 BEGIN
783 /* Already have ext partition, tell user and bow out */
784 display(error_9);
785 wait_for_ESC();
786 END
787 END
788 else
789 BEGIN
790 /* don't have a primary partition yet, can't create an ext */
791 display(error_19);
792 wait_for_ESC();
793 END
794
795 return;
796END
797
798
799/* */
800/******************* START OF SPECIFICATIONS *******************/
801/* */
802/* SUBROUTINE NAME: VOLUME_CREATE */
803/* */
804/* DESCRIPTIVE NAME: Create DOS disk volumes */
805/* */
806/* FUNCTION: Create the boot record/partition table structure */
807/* needed to support the DOS disk volume arch in */
808/* the EXTENDED partition. Volume is created to the */
809/* the default size (largest contiguous freespace or */
810/* 32mb, whichever smaller) or to the user specified */
811/* size (must be smaller or equal to default size). */
812/* The volume boot record is created, and the appro- */
813/* priate pointers in other volume partition tables */
814/* are generated. */
815/* */
816/* */
817/* NOTES: Screen can be exited via the ESC command before */
818/* partition is created and nothing will change */
819/* */
820/* The following screen is managed */
821/* */
822/* ³0000000000111111111122222222223333333333³ */
823/* ³0123456789012345678901234567890123456789³ */
824/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
825/* 00³Create DOS Disk Volume ³ */
826/* 01³ ³ */
827/* 02³Vol Start End Size ³ */
828/* 03³ # #### #### #### ³ */
829/* 04³ ³ */
830/* 05³ ³ */
831/* 06³ ³ */
832/* 07³ ³ */
833/* 08³ ³ */
834/* 09³ ³ */
835/* 10³ ³ */
836/* 11³ ³ */
837/* 12³ ³ */
838/* 13³ ³ */
839/* 14³ ³ */
840/* 15³ ³ */
841/* 16³Total partition size is #### cylinders. ³ */
842/* 17³Maximum space available for disk ³ */
843/* 18³volume is #### cylinders. ³ */
844/* 19³ ³ */
845/* 20³Enter disk volume size..........: [####]³ */
846/* 21³ ³ */
847/* 22³ ³ */
848/* 23³Press ESC to return to FDISK Options ³ */
849/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
850/* */
851/* ENTRY POINTS: Volume_Create */
852/* LINKAGE: Volume_Create () */
853/* NEAR CALL */
854/* */
855/* INPUT: None */
856/* */
857/* EXIT-NORMAL: ERROR=FALSE */
858/* */
859/* EXIT-ERROR: ERROR=TRUE */
860/* GOTO internal_program_error if case statement */
861/* failure when branching to requested function */
862/* */
863/* EFFECTS: No data directly modified by this routine, but */
864/* child routines will modify data. */
865/* */
866/* INTERNAL REFERENCES: */
867/* ROUTINES: */
868/* clear_screen */
869/* display */
870/* volume_display */
871/* get_num_input */
872/* wait_for_ESC */
873/* make_partition */
874/* */
875/* EXTERNAL REFERENCES: */
876/* ROUTINES: */
877/* */
878/******************** END OF SPECIFICATIONS ********************/
879
880/* */
881void volume_create()
882
883BEGIN
884
885 unsigned input;
886 unsigned default_entry;
887 char temp;
888 char drive_letter;
889 char default_value;
890 char location;
891 char previous_location;
892 char ext_location;
893 unsigned char i;
894 char defined_drives;
895 char temp_cur_disk;
896 unsigned ext_part_percent_unused; /* AN000 */
897 unsigned ext_part_num; /* AN000 */
898
899 input = u(NUL); /* AC000 */
900
901 /* clear off screen */
902 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
903
904 /* Display header */
905 display (menu_18);
906
907 /* print ESC prompt */
908 display(menu_11);
909
910 /* Display volume info */
911 drive_letter = volume_display();
912
913 /* Loop until done */
914 input = u(NUL); /* AC000 */
915 while (input != ((unsigned)(ESC_FLAG))) /* AC000 */
916
917 BEGIN
918 /* See if we have hit the max number of drives */
919 defined_drives = c(0); /* AC000 */
920 temp_cur_disk = cur_disk;
921
922 /* Search both drives for defined drives */
923 for (i = uc(0); i < number_of_drives; i++) /* AC000 */
924
925 BEGIN
926 cur_disk = ((char)(i));
927
928 /* See if there is a primary drive letter */
929 if ((find_partition_type(uc(DOS12))) || (find_partition_type(uc(DOS16))) || (find_partition_type(uc(DOSNEW)))) /*AC000*/
930 defined_drives++;
931
932 /* See if extended partition on disk */
933 if (find_partition_type(uc(EXTENDED))) /* AC000 */
934 BEGIN
935 /* Get number of logical drives */
936 defined_drives = defined_drives + get_num_logical_dos_drives();
937 END
938 END
939 /* Restore cur_disk to original */
940 cur_disk = temp_cur_disk;
941
942 /* See if 26 or less drives total */
943 if (defined_drives < c(24)) /* AC000 */
944 BEGIN
945 location = find_ext_free_space();
946
947 /* find the number of the extended partiton to figure out percent */
948 ext_part_num = find_partition_location(uc(EXTENDED)); /* AN000 */
949
950 /* Set the percent used */
951 ext_part_percent_unused =
952 cylinders_to_percent(free_space[location].space,
953 ((part_table[cur_disk][ext_part_num].end_cyl-part_table[cur_disk][ext_part_num].start_cyl)+1)); /* AN000 */
954
955 /* Is there any ?*/
956 if (ext_part_percent_unused != u(0)) /* AC000 */
957 BEGIN
958
959 /* Display disk space */
960 sprintf(insert,"%4.0d",get_partition_size(uc(EXTENDED)) );
961 display(menu_21);
962
963 /* Setup and print max partition size */
964
965 sprintf(insert,"%4.0d%3.0d%%",
966 free_space[location].mbytes_unused,
967 ext_part_percent_unused);
968 display(menu_22);
969
970 /* Force repeats on the input until something valid (Non-Zero return) */
971 /* If MBytes unused is equel to zero, display percent unused */
972 if (free_space[location].mbytes_unused == u(0)) /* AN000 */
973 BEGIN /* AN000 */
974 default_entry = (unsigned)ext_part_percent_unused; /* AN000 */
975 PercentFlag = (FLAG)TRUE; /* AN000 */
976 END /* AN000 */
977 else /* AN000 */
978 BEGIN /* AN000 */
979 default_entry = (unsigned)free_space[location].mbytes_unused; /* AC000 */
980 PercentFlag = (FLAG)FALSE; /* AN000 */
981 END /* AN000 */
982
983 valid_input = (FLAG)FALSE; /* AC000 */
984
985 while (!valid_input)
986 BEGIN
987 /* Display prompt */
988 if (!PercentFlag) /* AN000 */
989 sprintf(insert,"%4.0d",default_entry);
990 else /* AN000 */
991 sprintf(insert,"%3.0d%%",default_entry); /* AN000 */
992
993 display(menu_40);
994
995 input = get_large_num_input(default_entry,free_space[location].mbytes_unused,ext_part_percent_unused,menu_40,u(0),error_12); /* AC000*/
996
997 /* Update default in case of error, so it gets displayed and used */
998 /* if user presses CR only */
999
1000 default_entry = input;
1001 clear_screen(u(19),u(0),u(23),u(79)); /* AC000 */
1002 END
1003
1004 if (input != ((unsigned)(ESC_FLAG))) /* AC000 */
1005 BEGIN
1006
1007 /* Change input to cylinders */
1008 if (PercentFlag) /* AN000 */
1009 BEGIN /* AN000 */
1010 if (input == ext_part_percent_unused)
1011 input = free_space[location].space; /* AN000 */
1012 else /* AN000 */
1013 input = percent_to_cylinders(input,((part_table[cur_disk][ext_part_num].end_cyl-part_table[cur_disk][ext_part_num].start_cyl)+1));
1014 END /* AN000 */
1015 else /* AN000 */
1016 BEGIN /* AN000 */
1017 if (input == free_space[location].mbytes_unused)
1018 input = free_space[location].space; /* AN000 */
1019 else /* AN000 */
1020 input = (unsigned)mbytes_to_cylinders(input,
1021 cur_disk); /* AN004 */
1022 END /* AN000 */
1023
1024 /* Initialize PecentFlag back to FALSE */
1025 PercentFlag = (FLAG)FALSE; /* AN000 */
1026
1027 /* go create the entry and find out where it put it */
1028 ext_location = make_volume(input,location);
1029
1030 /* clear off the old prompt */
1031 clear_screen(u(15),u(0),u(19),u(79)); /* AC000 */
1032
1033 reboot_flag = (FLAG)TRUE; /* AC000 */
1034
1035 /* Display the updated partition information */
1036 drive_letter = volume_display();
1037
1038 /* Tell user we created it */
1039 display(status_7);
1040 END
1041 END
1042 else
1043 BEGIN
1044 /* No space left or already max'd on the devices */
1045 /* Get rid of the size prompts */
1046 clear_screen(u(17),u(0),u(21),u(79)); /* AC000 */
1047 display(error_20);
1048 volume_display();
1049 wait_for_ESC(); /* KWC, 11-01-87 */
1050 input = u(ESC_FLAG); /* KWC, 11-01-87 */
1051 END
1052 END
1053 else
1054 BEGIN
1055 /* Reached the maximum */
1056 /* Get rid of the size prompts */
1057 clear_screen(u(17),u(0),u(21),u(79)); /* AC000 */
1058 display(error_27);
1059 /* Force an exit with ESC */
1060 wait_for_ESC(); /* KWC, 11-01-87 */
1061 input = u(ESC_FLAG); /* KWC, 11-01-87 */
1062 END
1063 END
1064 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
1065 return;
1066END
1067
diff --git a/v4.0/src/CMD/FDISK/DISKOUT.C b/v4.0/src/CMD/FDISK/DISKOUT.C
new file mode 100644
index 0000000..189795e
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/DISKOUT.C
@@ -0,0 +1,354 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "subtype.h" /* AN000 */
5#include "extern.h" /* AN000 */
6
7
8/* */
9void write_info_to_disk()
10
11BEGIN
12
13char i;
14unsigned char j;
15unsigned extended_location;
16char extended_index;
17char temp;
18char first_found;
19char changed_flag;
20char temp_disk;
21
22
23 temp = c(NUL); /* AN009 */
24 temp_disk = cur_disk;
25 /* See if need to update the master boot record */
26 for (j = uc(0); j < number_of_drives; j++) /* AC000 */
27 BEGIN
28
29 /* Save disk number */
30 cur_disk = ((char)(j));
31
32 /* See if there were any errors on that drive */
33 if (good_disk[j])
34 BEGIN
35 for (i=c(0); i < c(4); i++) /* AC000 */
36 BEGIN
37 if (part_table[j][i].changed)
38 BEGIN
39 write_master_boot_to_disk(j);
40 break;
41 END
42 END
43 /* See if the extended partition exists - if not, don't fool with the logical*/
44 /* drives - there is nothing to point to thier structures. Otherwise you get into */
45 /* a chicken and the egg situation, where you are trying to write out 'deletes' of */
46 /* the logical drive based on the start of the extended partition, but there isn't one */
47 /* because it has already been deleted already. Bad things happen - PTM P941 */
48
49 if (find_partition_type(uc(EXTENDED))); /* AC000 */
50 BEGIN
51 /* See if any extended partitions need to be updated */
52 changed_flag = FALSE;
53
54 for (i=c(0);i <c(23); i++) /* AC000 */
55 BEGIN
56 if (ext_table[j][i].changed)
57 BEGIN
58 changed_flag = TRUE;
59 break;
60 END
61 END
62 if (changed_flag)
63 BEGIN
64 /* First,get them in order - drive letters are assigned in the order */
65 /* that they exist on the disk */
66 sort_ext_table(c(23)); /* AC000 */
67
68 for (i=c(0);i < c(23); i++) /* AC000 */
69
70 BEGIN
71 /* If there is a valid drive existing, write it out */
72 if (ext_table[j][sort[i]].sys_id != uc(0)) /* AC000 */
73 BEGIN
74 write_ext_boot_to_disk(i,j);
75 END
76 END
77
78 /* Find start of extended partition */
79 extended_index = find_partition_location(uc(EXTENDED)); /* AC000 */
80 extended_location = part_table[j][extended_index].start_cyl;
81
82 /* See if the first entry in EXTENDED DOS partition will be written out */
83 /* Need to find the first drive in the sorted list */
84 for (i=c(0);i < c(23); i++) /* AC000 */
85 BEGIN
86 if (ext_table[j][sort[i]].sys_id != uc(0)) /* AC000 */
87 BEGIN
88 temp = sort[i];
89 break;
90 END
91 END
92 /* See if drive written out */
93 if ((temp != c(NUL)) &&
94 (extended_location != ext_table[j][temp].start_cyl)) /* AC009 */
95 BEGIN
96 /* If not, make a special case and go do it */
97 /* Use the 24 entry in the array to set up a dummy entry */
98 /* This one isn't used for anything else */
99 /* Indicate this is special by passing along a deleted entry - the subroutine will catch it and handle correctly */
100 ext_table[j][23].sys_id = uc(0); /* AC000 */
101 ext_table[j][23].start_cyl = part_table[j][extended_index].start_cyl;
102 ext_table[j][23].start_head = uc(0); /* AC000 */
103 ext_table[j][23].start_sector = uc(1); /* AC000 */
104
105 /* Write out our modified first location - only pointer info will be sent to the disk*/
106 write_ext_boot_to_disk(c(23),j); /* AC000 */
107 END
108 END
109 END
110 END
111 END
112 cur_disk = temp_disk;
113 return;
114END
115
116/* */
117char write_master_boot_to_disk(disk)
118
119unsigned char disk;
120
121BEGIN
122
123unsigned char i;
124unsigned j;
125unsigned x;
126unsigned temp;
127unsigned long long_temp;
128unsigned index;
129char location;
130unsigned byte_temp;
131
132 /* Clean out the boot_record */
133 for (j=u(0);j < u(BYTES_PER_SECTOR); j++) /* AC000 */
134 BEGIN
135 boot_record[j] = uc(0); /* AC000 */
136 END
137
138 /* Copy the master boot record to boot_record */
139 for (j=u(0); j < u(BYTES_PER_SECTOR); j++) /* AC000 */
140 BEGIN
141 boot_record[j] = master_boot_record[disk][j];
142 END
143
144 /* Copy the partition tables over - only bother with the changed ones */
145 for (i=uc(0); i < uc(4); i++) /* AC000 */
146 BEGIN
147 index = ((unsigned)i)*16;
148 if (part_table[disk][i].changed)
149 BEGIN
150 /* Get boot ind */
151 boot_record[0x1BE+(index)] = part_table[disk][i].boot_ind;
152
153 /* Start head */
154 boot_record[0x1BF+(index)] = part_table[disk][i].start_head;
155
156 /* Start sector - scramble it to INT 13 format*/
157 boot_record[0x1C0+(index)] = (part_table[disk][i].start_sector & 0x3F) |
158 ((unsigned char)((part_table[disk][i].start_cyl/256) << 6));
159
160 /* Start cyl - scramble it to INT 13 format*/
161 boot_record[0x1C1+(index)] = ((unsigned char)(part_table[disk][i].start_cyl%256));
162
163 /* System id */
164 boot_record[0x1C2+(index)]= part_table[disk][i].sys_id;
165
166 /* End head */
167 boot_record[0x1C3+(index)] = part_table[disk][i].end_head;
168
169 /* End sector - scramble it to INT 13 format*/
170 boot_record[0x1C4+(index)] = (part_table[disk][i].end_sector & 0x3F) |
171 ((unsigned char)((part_table[disk][i].end_cyl/256) << 6));
172
173 /* End cyl - scramble it to INT 13 format*/
174 boot_record[0x1C5+(index)] = ((unsigned char)(part_table[disk][i].end_cyl%256));
175
176 /* Relative sectors */
177 long_temp = part_table[disk][i].rel_sec;
178 boot_record[0x1C9+(index)] = uc((long_temp >> 24)); /* AC000 */
179 boot_record[0x1C8+(index)] = uc(((long_temp & 0x00FF0000l) >> 16)); /* AC000 */
180 boot_record[0x1C7+(index)] = uc(((long_temp & 0x0000FF00l) >> 8)); /* AC000 */
181 boot_record[0x1C6+(index)] = uc((long_temp & 0x000000FFl)); /* AC000 */
182
183
184 /* Number of sectors */
185 long_temp = part_table[disk][i].num_sec;
186 boot_record[0x1CD+(index)] = uc(long_temp >> 24); /* AC000 */
187 boot_record[0x1CC+(index)] = uc((long_temp & 0x00FF0000l) >> 16); /* AC000 */
188 boot_record[0x1CB+(index)] = uc((long_temp & 0x0000FF00l) >> 8); /* AC000 */
189 boot_record[0x1CA+(index)] = uc(long_temp & 0x000000FFl); /* AC000 */
190 END
191 END
192 boot_record[510] = uc(0x55); /* AC000 */
193 boot_record[511] = uc(0xAA); /* AC000 */
194
195 return(write_boot_record(u(0),disk)); /* AC000 */
196END
197
198/* */
199char write_ext_boot_to_disk(entry,disk)
200
201char entry;
202unsigned char disk;
203BEGIN
204
205char i;
206unsigned j;
207unsigned long long_temp;
208unsigned index;
209char location;
210char next_drive;
211char pointer;
212char write;
213
214 /* Clean out the boot_record */
215 for (j=u(0);j < u(BYTES_PER_SECTOR); j++) /* AC000 */
216 BEGIN
217 boot_record[j] = uc(0); /* AC000 */
218 END
219
220 /* First - setup the logical devices */
221 /* See if it has been deleted - if so, leave entries as zero */
222 /* Otherwise - go unscramble everything out of the arrays */
223
224 if (ext_table[disk][sort[entry]].sys_id != uc(0)) /* AC000 */
225 BEGIN
226 /* Get boot ind */
227 boot_record[0x1BE] = ext_table[disk][sort[entry]].boot_ind;
228
229 /* Start head */
230 boot_record[0x1BF] = ext_table[disk][sort[entry]].start_head;
231
232 /* Start sector - scramble it to INT 13 format*/
233 boot_record[0x1C0] = (ext_table[disk][sort[entry]].start_sector & 0x3F) |
234 ((ext_table[disk][sort[entry]].start_cyl/256) << 6);
235
236 /* Start cyl - scramble it to INT 13 format*/
237 boot_record[0x1C1] = ((unsigned char)(ext_table[disk][sort[entry]].start_cyl%256));
238
239 /* System id */
240 boot_record[0x1C2]= ext_table[disk][sort[entry]].sys_id;
241
242 /* End head */
243 boot_record[0x1C3] = ext_table[disk][sort[entry]].end_head;
244
245 /* End sector - scramble it to INT 13 format*/
246 boot_record[0x1C4] = (ext_table[disk][sort[entry]].end_sector & 0x3F) |
247 ((ext_table[disk][sort[entry]].end_cyl/256) << 6);
248
249 /* End cyl - scramble it to INT 13 format*/
250 boot_record[0x1C5] = ((unsigned char)(ext_table[disk][sort[entry]].end_cyl%256));
251
252 /* Relative sectors */
253 long_temp = ext_table[disk][sort[entry]].rel_sec;
254 boot_record[0x1C9] = uc((long_temp >> 24)); /* AC000 */
255 boot_record[0x1C8] = uc(((long_temp & 0x00FF0000l) >> 16)); /* AC000 */
256 boot_record[0x1C7] = uc(((long_temp & 0x0000FF00l) >> 8)); /* AC000 */
257 boot_record[0x1C6] = uc((long_temp & 0x000000FFl)); /* AC000 */
258
259 /* Number of sectors */
260 long_temp = ext_table[disk][sort[entry]].num_sec;
261 boot_record[0x1CD] = uc((long_temp >> 24)); /* AC000 */
262 boot_record[0x1CC] = uc(((long_temp & 0x00FF0000l) >> 16)); /* AC000 */
263 boot_record[0x1CB] = uc(((long_temp & 0x0000FF00l) >> 8)); /* AC000 */
264 boot_record[0x1CA] = uc((long_temp & 0x000000FFl)); /* AC000 */
265 END
266
267 /* set up pointer to next logical drive unless this is # 23 */
268 if (entry != c(22)) /* AC000 */
269 BEGIN
270 /* Find the drive to be pointed to */
271 pointer = entry+1;
272
273 /* Handle the special case of a deleted or empty first entry in partition*/
274 if (entry == c(23)) /* AC000 */
275 BEGIN
276 pointer = c(0); /* AC000 */
277 END
278 for (i = pointer; i <c(23); i++) /* AC000 */
279 BEGIN
280 next_drive = ((char)(INVALID));
281
282 /* Go look for the next valid drive */
283 if (ext_table[disk][sort[i]].sys_id != uc(0)) /* AC000 */
284 BEGIN
285 next_drive = sort[i];
286 break;
287 END
288 END
289 if (next_drive != ((char)(INVALID)))
290 BEGIN
291 /* Get boot ind */
292 boot_record[0x1CE] = uc(0); /* AC000 */
293
294 /* Start head */
295 boot_record[0x1CF] = uc(0); /* AC000 */
296
297 /* Start sector - scramble it to INT 13 format*/
298 boot_record[0x1D0] = uc(0x01) | ((ext_table[disk][next_drive].start_cyl/256) << 6); /* AC000 */
299
300
301 /* System id */
302 boot_record[0x1D2]= uc(EXTENDED); /* AC000 */
303
304 /* End head */
305 boot_record[0x1D3] = uc(max_head[disk] -1); /* AC004 */
306
307 /* End sector - scramble it to INT 13 format*/
308 boot_record[0x1D4] =(max_sector[disk] & 0x3F) | ((ext_table[disk][next_drive].end_cyl/256) << 6);
309
310
311 /* Start cyl - scramble it to INT 13 format*/
312 boot_record[0x1D1] = ((unsigned char)(ext_table[disk][next_drive].start_cyl%256));
313
314 /* End cyl - scramble it to INT 13 format*/
315 boot_record[0x1D5] = ((unsigned char)(ext_table[disk][next_drive].end_cyl%256));
316
317 /* Relative sectors - this is from the front of the extended volume */
318 /* Find the extended partition */
319 location = find_partition_location(uc(EXTENDED));
320 long_temp = ((unsigned long)(ext_table[disk][next_drive].start_cyl - part_table[disk][location].start_cyl))
321 * max_head[disk] * max_sector[disk];
322 boot_record[0x1D9] = uc((long_temp >> 24)); /* AC000 */
323 boot_record[0x1D8] = uc(((long_temp & 0x00FF0000l) >> 16)); /* AC000 */
324 boot_record[0x1D7] = uc(((long_temp & 0x0000FF00l) >> 8)); /* AC000 */
325 boot_record[0x1D6] = uc((long_temp & 0x000000FFl)); /* AC000 */
326
327 /* Number of sectors in the next volume*/
328 long_temp = ((unsigned long)(ext_table[disk][next_drive].end_cyl - ext_table[disk][next_drive].start_cyl+1))
329 * max_head[disk] * max_sector[disk];
330 boot_record[0x1DD] = uc((long_temp >> 24)); /* AC000 */
331 boot_record[0x1DC] = uc(((long_temp & 0x00FF0000l) >> 16)); /* AC000 */
332 boot_record[0x1DB] = uc(((long_temp & 0x0000FF00l) >> 8)); /* AC000 */
333 boot_record[0x1DA] = uc((long_temp & 0x000000FFl)); /* AC000 */
334 END
335 END
336 boot_record[510] = uc(0x55); /* AC000 */
337 boot_record[511] = uc(0xAA); /* AC000 */
338
339 /* Write the boot record out */
340 if (entry != c(23)) /* AC000 */
341 BEGIN
342 write = write_boot_record(ext_table[disk][sort[entry]].start_cyl,disk);
343 END
344 else
345 BEGIN
346 /* Write the special case of the first entry only having a pointer */
347 write = write_boot_record(ext_table[disk][23].start_cyl,disk);
348 END
349 return(write);
350END
351
352
353
354
diff --git a/v4.0/src/CMD/FDISK/DISPLAY.C b/v4.0/src/CMD/FDISK/DISPLAY.C
new file mode 100644
index 0000000..fed2393
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/DISPLAY.C
@@ -0,0 +1,406 @@
1
2
3#include "dos.h" /* AN000 */
4#include "fdisk.h" /* AN000 */
5#include "subtype.h" /* AN000 */
6#include "stdio.h" /* AN000 */
7#include "extern.h" /* AN000 */
8#include "doscall.h" /* AN000 */
9#include "fdiskmsg.h" /* AN000 */
10#include "ctype.h" /* AN000 */
11
12/* */
13/******************* START OF SPECIFICATIONS *******************/
14/* */
15/* SUBROUTINE NAME: DISPLAY */
16/* */
17/* DESCRIPTIVE NAME: Display full screen interface messages */
18/* */
19/* FUNCTION: Displays messages and handles control characters */
20/* */
21/* NOTES: */
22/* FDISK MESSAGES */
23/* Portions of the screen that are handled in the msg are */
24/* indicated on the listing of the screen with the message */
25/* name given. If the text message is defined in another */
26/* screen, then the name is followed by a "#" character */
27/* */
28/* NOTE TO TRANSLATORS The characters inside the <> and the [] */
29/* are control characters and should not be translated. The */
30/* Control characters are defined as follows: */
31/* */
32/* <H> - Highlight the following text */
33/* <R> - Regular text */
34/* <B> - Blink the following text */
35/* <O> - Turn blinking off */
36/* <Y> - Print YES character, as set by define */
37/* <N> - Print NO character, as set by define */
38/* <W> - Sound the beep */
39/* <S> - Save cursor position for later use */
40/* <I> - Insert character from insert[] string. This string */
41/* must be set up prior to displaying the message. The */
42/* first <I> will insert Insert[0], the second */
43/* insert[1], etc....This will move the cursor one */
44/* postition. The insert[] string will be initialized */
45/* */
46/* Multiple control characters can be between the <>. */
47/* */
48/* The ^####^indicates Row and column for the text and has the */
49/* format of [rrcc] where the numbers are decimal and zero */
50/* based (first row/col is 00. The numbers are in decimal, */
51/* and must be 2 characters, which means rows/cols 0-9 should */
52/* be listed as 00-09. For example, the 5th row, 3rd column */
53/* on the screen would be listed as ^0402^. */
54/* */
55/* The column number is always the column desired. The row */
56/* number is an offset from the previous row. For example, if */
57/* the text just printed is on row 6, and the next text should */
58/* be printed 2 rows down in column 0, then the control strin */
59/* would be ^0201^. The first row specified in the message is */
60/* assumed to be based off of row 0, it would actually specify */
61/* the actual row for the start of the msg to be printed. */
62/* */
63/* ENTRY POINTS: display(*message_name); */
64/* LINKAGE: Near call */
65/* */
66/* INPUT: char *message_name */
67/* */
68/* EXIT-NORMAL: */
69/* */
70/* EXIT-ERROR: */
71/* */
72/* EFFECTS: */
73/* input_row changed if <S> control character in message */
74/* input_col changed if <S> control character in message */
75/* */
76/* INTERNAL REFERENCES: */
77/* ROUTINES: */
78/* */
79/* EXTERNAL REFERENCES: */
80/* ROUTINES: */
81/* */
82/* viowrtcharstratt(); */
83/******************** END OF SPECIFICATIONS ********************/
84/* */
85void display(s)
86
87char far *s;
88
89BEGIN
90 unsigned row;
91 unsigned col;
92 char attribute;
93 char far *attribute_ptr = &attribute;
94 unsigned insert_count;
95
96
97 /* Initialize row and col, and index into array */
98 row = u(0); /* AC000 */
99 col = u(0); /* AC000 */
100 insert_count = u(0); /* AC000 */
101 /* check for a request to display a null string */
102 if (*s == c('\0')) /* AC000 */
103 BEGIN
104 /* Message string error */
105 insert[0] = c('1'); /* AC000 */
106 display(debug_msg);
107 END
108 else
109 BEGIN
110 /* There is data there, lets go handle it */
111
112 attribute = c(0x00); /* AC000 */
113 /* Go until end of string */
114 while (*s != c('\0')) /* AC000 */
115 BEGIN
116
117 /* Check for any imbedded control strings */
118 switch (*s)
119 BEGIN
120 /* Check for control characters */
121 case '<':
122 BEGIN
123 s++;
124 while ( (*s != c('>')) && (*s != c('\0')) ) /* AC000 */
125 BEGIN
126 switch (*s++)
127 BEGIN
128 case 'H': if (mono_flag == TRUE) /* AN006 */
129 attribute = (attribute & 0x80) | HIWHITE_ON_BLACK; /* AN006 */
130 else /* AN006 */
131 attribute = (attribute & 0x80) | HIWHITE_ON_BLUE; /* AC006 */
132 break;
133
134
135 case 'R': if (mono_flag == TRUE) /* AN006 */
136 attribute = (attribute & 0x80) | GRAY_ON_BLACK; /* AN006 */
137 else /* AN006 */
138 attribute = (attribute & 0x80) | WHITE_ON_BLUE; /* AC006 */
139 break;
140
141 case 'B': attribute |= 0x80;
142 break;
143
144 case 'O': attribute &= 0x7F;
145 break;
146
147 case 'W': DOSBEEP(u(900),u(400)); /* AC000 */
148 break;
149
150 case 'I':
151 BEGIN
152 /* display next element in the array */
153 if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
154 attribute = c(GRAY_ON_BLACK); /* AN006 */
155 if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
156 attribute = c(WHITE_ON_BLUE); /* AC006 */
157 VIOWRTCHARSTRATT(pinsert+insert_count++,u(1),row,col++,attribute_ptr,u(0));
158 break;
159 END
160
161
162 case 'Y': /* AC011 */
163 BEGIN
164 /* display YES character in next location */
165 *--s = c(Yes); /* AC000 */
166 if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
167 attribute = c(GRAY_ON_BLACK); /* AN006 */
168 if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
169 attribute = c(WHITE_ON_BLUE); /* AC006 */
170 VIOWRTCHARSTRATT(s,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */
171 *s++ = c(Yes); /* AC000 AC011 */
172 break;
173 END
174
175 case 'N': /* AC011 */
176 BEGIN
177 /* display NO character in next location */
178 *--s = c(No); /* AC000 */
179 if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
180 attribute = c(GRAY_ON_BLACK); /* AN006 */
181 if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
182 attribute = c(WHITE_ON_BLUE); /* AC006 */
183 VIOWRTCHARSTRATT(s,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */
184 *s++ = c(No); /* AC000 AC011 */
185 break;
186 END
187
188
189 case 'S':
190 BEGIN
191 input_row = row;
192 input_col = col;
193 break;
194 END
195
196
197 case 'C':
198 BEGIN
199 /* Clear from current position to end of line */
200 clear_screen(row,col,row,u(79)); /* AC000 */
201 break;
202 END
203
204 case '\0':
205 BEGIN
206 /* Message string error - string ended in the middle of control string*/
207 insert[0] = c('7'); /* AC000 */
208 display(debug_msg);
209 break;
210 END
211
212 default:
213 BEGIN
214 /* Message string error - no valid control char found */
215 insert[0] = c('6'); /* AC000 */
216 display(debug_msg);
217 break;
218 END
219 END /* Switch */
220 END /* While */
221 /* Get the pointer past the '>' */
222 s++;
223 break;
224 END /* control characters */
225
226 /* Check for row,col */
227 case '^': /* AC000 */
228 BEGIN
229 s++;
230 /* determine the row to put the message on */
231 if ( !isdigit(*s) )
232 BEGIN
233 /* Message string error */
234 insert[0] = c('2'); /* AC000 */
235 display(debug_msg);
236 END
237 else
238 BEGIN
239 row = row+((unsigned)(((*s++ - '0')*10)));
240 if ( !isdigit(*s) )
241 BEGIN
242 /* Message string error */
243 insert[0] = c('2'); /* AC000 */
244 display(debug_msg);
245 END
246 else
247 BEGIN
248 row = row+((unsigned)(*s++ - '0'));
249 /* determine the col to put the message on */
250 if ( !isdigit(*s) )
251 BEGIN
252 /* Message string error */
253 insert[0] = c('3'); /* AC000 */
254 display(debug_msg);
255 END
256 else
257 BEGIN
258 col = ((unsigned)(*s++ - '0'));
259 if ( !isdigit(*s) )
260 BEGIN
261 /* Message string error */
262 insert[0] = c('3'); /* AC000 */
263 display(debug_msg);
264 END
265 else
266 BEGIN
267 col = ((unsigned)((col* 10) + (*s++ - '0')));
268 if (*s++ != c('^')) /* AC000 */
269 BEGIN
270 /* Message string error */
271 insert[0] = c('4'); /* AC000 */
272 display(debug_msg);
273 END /* 2nd sq bracket */
274 END /* 2nd digit col */
275 END /* 1st digit col */
276 END /* 2nd digit row */
277 END /* 1st digit row */
278 break;
279 END
280 /* Handle anything else */
281
282
283 default:
284 BEGIN
285 /* See if attribute set to anything */
286 if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */
287 attribute = c(WHITE_ON_BLUE); /* AC006 */
288 if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */
289 attribute = c(GRAY_ON_BLACK); /* AN006 */
290 VIOWRTCHARSTRATT(s++,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */
291 break;
292 END
293 END
294 END /* End of string check */
295 END /* No characters in string check */
296 return;
297
298END
299
300/* */
301
302void number_in_msg(number,start)
303
304XFLOAT number;
305unsigned start;
306
307BEGIN
308
309char mbytes[32];
310
311 /* Divide the space down and get it into decimal */
312 sprintf(mbytes,"%4.0d",number);
313 insert[start+0] = mbytes[0];
314 insert[start+1] = mbytes[1];
315 insert[start+2] = mbytes[2];
316 insert[start+3] = mbytes[3];
317
318 return;
319
320END
321
322
323/* */
324void percent_in_msg(number,start) /* AN000 */
325
326unsigned number; /* AN000 */
327unsigned start; /* AN000 */
328
329BEGIN /* AN000 */
330
331
332char percent[32];
333
334 /* Divide the space down and get it into decimal */
335 sprintf(percent,"%3.0d%%",number); /* AC000 */
336 insert[start+0] = percent[0]; /* AC000 */
337 insert[start+1] = percent[1]; /* AC000 */
338 insert[start+2] = percent[2]; /* AC000 */
339 insert[start+3] = percent[3]; /* AC000 */
340
341 return;
342
343END /* AN000 */
344
345/* */
346void string_in_msg(string_ptr,start) /* AN000 */
347
348char far *string_ptr; /* AN000 */
349unsigned start; /* AN000 */
350
351BEGIN /* AN000 */
352
353unsigned i; /* AN000 */
354
355 /* init the 8 spots to blanks */
356 for (i = u(0); i < u(8);i++) /* AN000 */
357 BEGIN /* AN000 */
358 insert[start+i] = c(' '); /* AN000 */
359 END /* AN000 */
360 /* Put characters into the array */
361 BEGIN /* AN000 */
362 insert[start+0] = *(string_ptr+0); /* AN000 */
363 insert[start+1] = *(string_ptr+1); /* AN000 */
364 insert[start+2] = *(string_ptr+2); /* AN000 */
365 insert[start+3] = *(string_ptr+3); /* AN000 */
366 insert[start+4] = *(string_ptr+4); /* AN000 */
367 insert[start+5] = *(string_ptr+5); /* AN000 */
368 insert[start+6] = *(string_ptr+6); /* AN000 */
369 insert[start+7] = *(string_ptr+7); /* AN000 */
370 END /* AN000 */
371 return; /* AN000 */
372END /* AN000 */
373
374
375/* */
376void volume_in_msg(string_ptr,start) /* AN000 */
377
378char far *string_ptr; /* AN000 */
379unsigned start; /* AN000 */
380
381BEGIN /* AN000 */
382
383unsigned i; /* AN000 */
384
385 /* init the 11 spots to blanks */
386 for (i = u(0); i < u(11);i++) /* AN000 */
387 BEGIN /* AN000 */
388 insert[start+i] = c(' '); /* AN000 */
389 END /* AN000 */
390 /* Put characters into the array */
391 BEGIN /* AN000 */
392 insert[start+0] = *(string_ptr+0); /* AN000 */
393 insert[start+1] = *(string_ptr+1); /* AN000 */
394 insert[start+2] = *(string_ptr+2); /* AN000 */
395 insert[start+3] = *(string_ptr+3); /* AN000 */
396 insert[start+4] = *(string_ptr+4); /* AN000 */
397 insert[start+5] = *(string_ptr+5); /* AN000 */
398 insert[start+6] = *(string_ptr+6); /* AN000 */
399 insert[start+7] = *(string_ptr+7); /* AN000 */
400 insert[start+8] = *(string_ptr+8); /* AN000 */
401 insert[start+9] = *(string_ptr+9); /* AN000 */
402 insert[start+10] = *(string_ptr+10); /* AN000 */
403 END /* AN000 */
404 return; /* AN000 */
405END /* AN000 */
406
diff --git a/v4.0/src/CMD/FDISK/DOS.H b/v4.0/src/CMD/FDISK/DOS.H
new file mode 100644
index 0000000..6d622b6
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/DOS.H
@@ -0,0 +1,81 @@
1/* dos.h
2 *
3 * Defines the structs and unions used to handle the input and output
4 * registers for the DOS interface routines defined in the V2.0 to V3.0
5 * compatability package. It also includes macros to access the segment
6 * and offset values of MS C "far" pointers, so that they may be used by
7 * these routines.
8 *
9 */
10
11/* word registers */
12
13struct WORDREGS {
14 unsigned ax;
15 unsigned bx;
16 unsigned cx;
17 unsigned dx;
18 unsigned si;
19 unsigned di;
20 unsigned cflag;
21 };
22
23/* byte registers */
24
25struct BYTEREGS {
26 unsigned char al, ah;
27 unsigned char bl, bh;
28 unsigned char cl, ch;
29 unsigned char dl, dh;
30 };
31
32/* general purpose registers union - overlays the corresponding word and
33 * byte registers.
34 */
35
36union REGS {
37 struct WORDREGS x;
38 struct BYTEREGS h;
39 };
40
41/* segment registers */
42
43struct SREGS {
44 unsigned es;
45 unsigned cs;
46 unsigned ss;
47 unsigned ds;
48 };
49
50/* dosexterror struct */
51
52struct DOSERROR {
53 int exterror;
54 char class;
55 char action;
56 char locus;
57 };
58
59/* macros to break MS C "far" pointers into their segment and offset
60 * components
61 */
62
63#define FP_SEG(fp) (*((unsigned *)&(fp) + 1))
64#define FP_OFF(fp) (*((unsigned *)&(fp)))
65
66/* function declarations for those who want strong type checking
67 * on arguments to library function calls
68 */
69
70#ifdef LINT_ARGS /* arg. checking enabled */
71
72int bdos(int, unsigned int, unsigned int);
73int dosexterr(struct DOSERROR *);
74int intdos(union REGS *, union REGS *);
75int intdosx(union REGS *, union REGS *, struct SREGS *);
76int int86(int, union REGS *, union REGS *);
77int int86x(int, union REGS *, union REGS *, struct SREGS *);
78void segread(struct SREGS *);
79
80#endif /* LINT_ARGS */
81 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/DOSCALL.H b/v4.0/src/CMD/FDISK/DOSCALL.H
new file mode 100644
index 0000000..295cec6
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/DOSCALL.H
@@ -0,0 +1,2811 @@
1/*static char *SCCSID = "@(#)doscall.h 6.25 86/06/03";*/
2/*** doscall.h
3 *
4 * Shirleyd
5 * (C) Copyright 1988 Microsoft Corporation
6 * 12/13/85
7 *
8 * Description:
9 *
10 * Function declarations to provide strong type checking
11 * on arguments to DOS 4.0 function calls
12 *
13 * Major Modifications 04/28/86 by S. S.
14 * Major Modifications 04/30/86 by K. D.
15 * Minor Modifications 04/30/86 by S. S. (DosTimerAsync/Start)
16 * Major Modifications 05/01/86 by S. S. (fix Sems,add Queues)
17 * Minor Modifications 05/14/86 by K. D. (DosFileLocks)
18 * Minor Modifications 05/16/86 by S. S. (NLS routines)
19 * Minor Modifications 05/20/86 by S. S. (Get/SetPrty,CreateThread)
20 * Minor Modifications 05/20/86 by S. S. (add DosSetVector)
21 * Minor Modifications 06/02/86 by S. S. (GetHugeShift, MuxSemWait)
22 * Major Modifications 06/03/86 by S. S. (Mouse calls)
23 */
24
25
26
27/*** CursorData - structure that contains the characteristics
28 * of the cursor
29 */
30
31struct CursorData {
32 unsigned cur_start; /* Cursor start line */
33 unsigned cur_end; /* Cursor end line */
34 unsigned cur_width; /* Cursor width */
35 unsigned cur_attribute; /* Cursor attribute */
36 };
37
38
39
40/*** DateTime - structure for date and time */
41
42struct DateTime {
43 unsigned char hour; /* current hour */
44 unsigned char minutes; /* current minute */
45 unsigned char seconds; /* current second */
46 unsigned char hundredths; /* current hundredths of a second */
47 unsigned char day; /* current day */
48 unsigned char month; /* current month */
49 unsigned year; /* current year */
50 unsigned timezone; /* minutes of time west of GMT */
51 unsigned char day_of_week; /* current day of week */
52 };
53
54
55
56/*** FileFindBuf - structure of area where the filesystem driver
57 * returns the results of the search
58 */
59
60struct FileFindBuf {
61 unsigned create_date; /* date of file creation */
62 unsigned create_time; /* time of file creation */
63 unsigned access_date; /* date of last access */
64 unsigned access_time; /* time of last access */
65 unsigned write_date; /* date of last write */
66 unsigned write_time; /* time of last write */
67 unsigned long file_size; /* file size (end of data) */
68 unsigned long falloc_size; /* file allocated size */
69 unsigned attributes; /* attributes of the file */
70 char string_len; /* returned length of ascii name str. */
71 /* length does not include null byte */
72 char file_name[12]; /* name string */
73 };
74
75
76/*** FileStatus - structure of information list used by DosQFileInfo */
77
78struct FileStatus {
79 unsigned create_date; /* date of file creation */
80 unsigned create_time; /* time of file creation */
81 unsigned access_date; /* date of last access */
82 unsigned access_time; /* time of last access */
83 unsigned write_date; /* date of last write */
84 unsigned write_time; /* time of last write */
85 unsigned long file_size; /* file size (end of data) */
86 unsigned long falloc_size; /* file allocated size */
87 unsigned block_size; /* blocking factor */
88 unsigned attributes; /* attributes of the file */
89 };
90
91
92/*** FSAllocate - structure of file system allocation */
93
94struct FSAllocate {
95 unsigned long filsys_id; /* file system ID */
96 unsigned long sec_per_unit; /* number sectors per allocation unit */
97 unsigned long num_units; /* number of allocation units */
98 unsigned long avail_units; /* avaliable allocation units */
99 unsigned bytes_sec; /* bytes per sector */
100 };
101
102
103
104/*** KbdStatus - structure in which the keyboard support will information */
105
106struct KbdStatus {
107 unsigned length; /* length in words of data structure */
108 unsigned bit_mask; /* bit mask */
109 unsigned turn_around_char; /* turnaround character */
110 unsigned interim_char_flags; /* interim character flags */
111 unsigned shift_state; /* shift state */
112 };
113
114
115
116/*** KeyData - structure that contains character data */
117
118struct KeyData {
119 char char_code; /* ASCII character code */
120 char scan_code; /* scan code */
121 char status; /* indicates state of the character */
122 unsigned shift_state; /* state of the shift keys */
123 unsigned long time; /* time stamp of the keystroke */
124 };
125
126
127
128/*** ModeData - structure that contains characteristics of the mode */
129
130struct ModeData {
131 unsigned length; /* Length of structure */
132 char type; /* Text or graphics */
133 char color; /* Color or monochrome */
134 unsigned col; /* Column resolution */
135 unsigned row; /* Row resolution */
136 unsigned hres; /* horizontal resolution */
137 unsigned vres; /* vertical resolution */
138 };
139
140
141
142
143/*** ProcIDsArea - structure of the address of the area where the
144 * ID's will be placed
145 */
146
147struct ProcIDsArea {
148 unsigned procid_cpid; /* current process' process ID */
149 unsigned procid_ctid; /* current process' thread ID */
150 unsigned procid_ppid; /* process ID of the parent */
151 };
152
153
154
155/*** PVBData - structure that contains information about the
156 * physical video buffer
157 */
158
159struct PVBData {
160 unsigned pvb_size; /* size of the structure */
161 unsigned long pvb_ptr; /* returns pointer to the pvb buffer */
162 unsigned pvb_length; /* length of PVB */
163 unsigned pvb_rows; /* buffer dimension (rows) */
164 unsigned pvb_cols; /* buffer dimension (cols) */
165 char pvb_type; /* color or mono */
166 };
167
168
169
170/*** SchedParmsArea - structure of address in which the scheduler
171 * parms will be placed
172 */
173
174struct SchedParmsArea {
175 char dynvar_flag; /* dynamic variation flag, 1=enabled */
176 char maxwait; /* maxwait (sec) */
177 unsigned mintime; /* minimum timeslice (ms) */
178 unsigned maxtime; /* maximum timeslice (ms) */
179 };
180
181
182
183/*** Tasking Processes:
184 *
185 * DosCreateThread
186 * DosCwait
187 * DosEnterCritSec
188 * DosExecPgm
189 * DosExit
190 * DosExitCritSec
191 * DosExitList
192 * DosGetPID
193 * DosGetPrty
194 * DosGetSchedParms
195 * DosSetFgnd
196 * DosSetPrty
197 * DosKillProcess
198 */
199
200
201
202/*** DosCreateThread - Create another thread of execution
203 *
204 * Creates an asynchronous thread of execution under the
205 * current process
206 */
207
208extern unsigned far pascal DOSCREATETHREAD (
209 void (far *)(void), /* Starting Address for new thread */
210 unsigned far *, /* Address to put new thread ID */
211 unsigned char far * ); /* Address of stack for new thread */
212
213
214
215/*** DosCwait - Wait for child termination
216 *
217 * Places the current thread in a wait state until a child process
218 * has terminated, then returns the ending process' process ID and
219 * termination code.
220 */
221
222extern unsigned far pascal DOSCWAIT (
223 unsigned, /* Action (execution) codes */
224 unsigned, /* Wait options */
225 unsigned far *, /* Address to put result code */
226 unsigned far *, /* Address to put process ID */
227 unsigned ); /* ProcessID of process to wait for */
228
229
230
231/*** DosEnterCritSec - Enter critical section of execution
232 *
233 * Disables thread switching for the current process
234 */
235
236extern void far pascal DOSENTERCRITSEC (void);
237
238
239
240/*** DosExecPgm - Execute a program
241 *
242 * Allows a program to request another program be executed as a
243 * child process. The requestor's process may optionally continue
244 * to execute asynchronous to the new program
245 */
246
247extern unsigned far pascal DOSEXECPGM (
248 unsigned, /* 0=synchronous, 1=asynchronous with */
249 /* return code discarded, 2=async */
250 /* with return code saved */
251 unsigned, /* Trace process */
252 char far *, /* Address of argument string */
253 char far *, /* Address of environment string */
254 unsigned far *, /* Address to put Process ID */
255 char far * ); /* Address of program filename */
256
257
258
259/*** DosExit - Exit a program
260 *
261 * This call is issued when a thread completes its execution.
262 * The current thread is ended.
263 */
264
265extern void far pascal DOSEXIT (
266 unsigned, /* 0=end current thread, 1=end all */
267 unsigned ); /* Result Code to save for DosCwait */
268
269
270
271/*** DosExitCritSec - Exit critical section of execution
272 *
273 * Re-enables thread switching for the current process
274 */
275
276extern void far pascal DOSEXITCRITSEC (void);
277
278
279
280/*** DosExitList - Routine list for process termination
281 *
282 * Maintains a list of routines which are to be executed when the
283 * current process ends, normally or otherwise
284 */
285
286extern unsigned far pascal DOSEXITLIST (
287 unsigned, /* Function request code */
288 void (far *)(void) ); /* Address of routine to be executed */
289
290
291
292/*** DosGetPID - Return process ID
293 *
294 * Returns the current process's process ID (PID), thread ID,
295 * and the PID of the process that spawned it
296 */
297
298extern void far pascal DOSGETPID (
299 struct ProcIDsArea far *); /* ProcID structure */
300
301
302
303/*** DosGetPrty - Get Process's Priority
304 *
305 * Allows the caller to learn the priority of a process or thread
306 */
307
308extern unsigned far pascal DOSGETPRTY (
309 unsigned, /* Indicate thread or process ID */
310 unsigned far *, /* Address to put priority */
311 unsigned ); /* PID of process/thread of interest */
312
313
314
315/*** DosGetSchedParms - Get scheduler's parameters
316 *
317 * Gets the scheduler's current configuration parameters
318 */
319
320extern void far pascal DOSGETSCHEDPARMS (
321 struct SchedParmsArea far * ); /* Address to put parameters */
322
323
324
325/*** DosSetFgnd - Set Foreground Process
326 *
327 * Allows the session manager to designate which process
328 * is to receive favored dispatching
329 */
330
331extern unsigned far pascal DOSSETFGND (
332 unsigned ); /* Process ID of target process */
333
334
335
336/*** DosSetPrty - Set Process Priority
337 *
338 * Allows the caller to change the base priority or priority
339 * class of a child process or a thread in the current process
340 */
341
342extern unsigned far pascal DOSSETPRTY (
343 unsigned, /* Indicate scope of change */
344 unsigned, /* Priority class to set */
345 unsigned, /* Priority delta to apply */
346 unsigned ); /* Process or Thread ID of target */
347
348
349
350/*** DosKillProcess - Terminate a Process
351 *
352 * Terminates a child process and returns its termination code
353 * to its parent (if any)
354 */
355
356extern unsigned far pascal DOSKILLPROCESS (
357 unsigned, /* 0=kill child processes also, */
358 /* 1=kill only indicated process */
359 unsigned ); /* Process ID of process to end */
360
361
362
363
364/*** Asynchronous Notification (Signals):
365 *
366 * DosHoldSignal
367 * DosSendSignal
368 * DosSetSigHandler
369 */
370
371
372
373/*** DosHoldSignal - Disable / Enable signals
374 *
375 * Used to termporarily disable or enable signal processing
376 * for the current process.
377 */
378
379extern void far pascal DOSHOLDSIGNAL (
380 unsigned ); /* 0=enable signal, 1=disable signal */
381
382
383
384/*** DosSendSignal - Issue signal
385 *
386 * Used to send a signal event to an arbitrary process or
387 * command subtree.
388 */
389
390extern unsigned far pascal DOSSENDSIGNAL (
391 unsigned, /* Process ID to signal */
392 unsigned, /* 0=notify entire subtree, 1=notify */
393 /* only the indicated process */
394 unsigned, /* Signal argument */
395 unsigned ); /* Signal number */
396
397
398
399/*** DosSetSigHandler - Handle Signal
400 *
401 * Notifies CP/DOS of a handler for a signal. It may also be used
402 * to ignore a signal or install a default action for a signal.
403 */
404
405extern unsigned far pascal DOSSETSIGHANDLER (
406 void (far *)(), /* Signal handler address */
407 unsigned long far *, /* Address of previous handler */
408 unsigned far *, /* Address of previous action */
409 unsigned, /* Indicate request type */
410 unsigned ); /* Signal number */
411
412
413
414
415/*** Pipes:
416 *
417 * DosMakePipe
418 */
419
420
421
422/*** DosMakePipe - Create a Pipe */
423
424extern unsigned far pascal DOSMAKEPIPE (
425 unsigned far *, /* Addr to place the read handle */
426 unsigned far *, /* Addr to place the write handle */
427 unsigned ); /* Size to reserve for the pipe */
428
429
430
431
432/*** Queues:
433 *
434 * DosCloseQueue
435 * DosCreateQueue
436 * DosOpenQueue
437 * DosPeekQueue
438 * DosPurgeQueue
439 * DosQueryQueue
440 * DosReadQueue
441 * DosWriteQueue
442 */
443
444/*** DosCloseQueue - Close a Queue
445 *
446 * close a queue which is in use by the requesting process
447 *
448 */
449
450extern unsigned far pascal DOSCLOSEQUEUE (
451 unsigned ) ; /* queue handle */
452
453
454/*** DosCreateQueue - Create a Queue
455 *
456 * creates a queue to be owned by the requesting process
457 *
458 */
459
460extern unsigned far pascal DOSCREATEQUEUE (
461 unsigned far *, /* queue handle */
462 unsigned, /* queue priority */
463 char far * ) ; /* queue name */
464
465
466/*** DosOpenQueue - Open a Queue
467 *
468 * opens a queue for the current process
469 *
470 */
471
472extern unsigned far pascal DOSOPENQUEUE (
473 unsigned far *, /* PID of queue owner */
474 unsigned far *, /* queue handle */
475 char far * ) ; /* queue name */
476
477
478
479/*** DosPeekQueue - Peek at a Queue
480 *
481 * retrieves an element from a queue without removing it from the queue
482 *
483 */
484
485extern unsigned far pascal DOSPEEKQUEUE (
486 unsigned, /* queue handle */
487 unsigned long far *, /* pointer to request */
488 unsigned far *, /* length of datum returned */
489 unsigned long far *, /* pointer to address of datum */
490 unsigned far *, /* indicator of datum returned */
491 unsigned char, /* wait indicator for empty queue */
492 unsigned char far *, /* priority of element */
493 unsigned long ) ; /* semaphore handle */
494
495
496
497/*** DosPurgeQueue - Purge a Queue
498 *
499 * purges all elements from a queue
500 *
501 */
502
503extern unsigned far pascal DOSPURGEQUEUE (
504 unsigned ) ; /* queue handle */
505
506
507
508/*** DosQueryQueue - Query size of a Queue
509 *
510 * returns the number of elements in a queue
511 *
512 */
513
514extern unsigned far pascal DOSQUERYQUEUE (
515 unsigned, /* queue handle */
516 unsigned far * ); /* pointer for number of elements */
517
518
519
520/*** DosReadQueue - Read from a Queue
521 *
522 * retrieves an element from a queue
523 *
524 */
525
526extern unsigned far pascal DOSREADQUEUE (
527 unsigned, /* queue handle */
528 unsigned long far *, /* pointer to request */
529 unsigned far *, /* length of datum returned */
530 unsigned long far *, /* pointer to address of datum */
531 unsigned, /* indicator of datum returned */
532 unsigned char, /* wait indicator for empty queue */
533 unsigned char far *, /* priority of element */
534 unsigned long ) ; /* semaphore handle */
535
536
537
538/*** DosWriteQueue - Write to a Queue
539 *
540 * adds an element to a queue
541 *
542 */
543
544extern unsigned far pascal DOSWRITEQUEUE (
545 unsigned, /* queue handle */
546 unsigned, /* request */
547 unsigned, /* length of datum */
548 unsigned char far *, /* address of datum */
549 unsigned char ); /* priority of element */
550
551
552
553
554
555/*** Semaphores:
556 *
557 * DosSemClear
558 * DosSemRequest
559 * DosSemSet
560 * DosSemWait
561 * DosSemSetWait
562 * DosMuxSemWait
563 * DosCloseSem
564 * DosCreatSem
565 * DosOpenSem
566 */
567
568
569
570/*** DosSemClear - Unconditionally clears a semaphore
571 *
572 * Unconditionally clears a semaphore; i.e., sets the
573 * state of the specified semaphore to unowned.
574 */
575
576extern unsigned far pascal DOSSEMCLEAR (
577 unsigned long ); /* semaphore handle */
578
579
580
581/*** DosSemRequest - Wait until next DosSemClear
582 *
583 * Blocks the current thread until the next DosSemClear is
584 * issued to the indicated semaphore
585 */
586
587extern unsigned far pascal DOSSEMREQUEST (
588 unsigned long, /* semaphore handle */
589 unsigned long ); /* Timeout, -1=no timeout, */
590 /* 0=immediate timeout, >1=number ms */
591
592
593/*** DosSemSet - Unconditionally take a semaphore
594 *
595 * Unconditionally takes a semaphore; i.e., sets the status
596 * of the specified semaphore to owned.
597 */
598
599extern unsigned far pascal DOSSEMSET (
600 unsigned long ); /* semaphore handle */
601
602
603
604/*** DosSemSetWait - Wait for a semaphore to be cleared and set it
605 *
606 * Blocks the current thread until the indicated semaphore is
607 * cleared and then establishes ownership of the semaphore
608 */
609
610extern unsigned far pascal DOSSEMSETWAIT (
611 unsigned long, /* semaphore handle */
612 unsigned long ); /* Timeout, -1=no timeout, */
613 /* 0=immediate timeout, >1=number ms */
614
615
616/*** DosSemWait - Wait for a semaphore to be cleared
617 *
618 * Blocks the current thread until the indicated semaphore is
619 * cleared but does not establish ownership of the semaphore
620 */
621
622extern unsigned far pascal DOSSEMWAIT (
623 unsigned long, /* semaphore handle */
624 unsigned long ); /* Timeout, -1=no timeout, */
625 /* 0=immediate timeout, >1=number ms */
626
627
628/*** DosMuxSemWait - Wait for 1 of N semaphores to be cleared
629 *
630 * Blocks the current thread until the indicated semaphore is
631 * cleared but does not establish ownership of the semaphore
632 */
633
634extern unsigned far pascal DOSMUXSEMWAIT (
635 unsigned far *, /* address for event index number */
636 unsigned far *, /* list of semaphores */
637 unsigned long ); /* Timeout, -1=no timeout, */
638 /* 0=immediate timeout, >1=number ms */
639
640
641
642/*** DosCloseSem - Close a system semaphore
643 *
644 * closed the specified system semaphore
645 */
646
647extern unsigned far pascal DOSCLOSESEM (
648 unsigned long ); /* semaphore handle */
649
650
651
652/*** DosCreateSem - Create a system semaphore
653 *
654 * create a system semaphore
655 */
656
657extern unsigned far pascal DOSCREATESEM (
658 unsigned, /* =0 indicates exclusive ownership */
659 unsigned long far *, /* address for semaphore handle */
660 char far * ); /* name of semaphore */
661
662
663/*** DosOpenSem - Open a system semaphore
664 *
665 * open a system semaphore
666 */
667
668extern unsigned far pascal DOSOPENSEM (
669 unsigned long far *, /* address for semaphore handle */
670 char far * ); /* name of semaphore */
671
672
673
674
675/*** Timer Services:
676 *
677 * DosGetDateTime
678 * DosSetDateTime
679 * DosSleep
680 * DosGetTimerInt
681 * DosTimerAsync
682 * DosTimerStart
683 * DosTimerStop
684 */
685
686
687
688/*** DosGetDateTime - Get the current date and time
689 *
690 * Used to get the current date and time that are maintained by
691 * the operating system
692 */
693
694extern unsigned far pascal DOSGETDATETIME (
695 struct DateTime far * );
696
697
698
699/*** DosSetDateTime - Set the current date and time
700 *
701 * Used to set the date and time that are maintained by the
702 * operating system
703 */
704
705extern unsigned far pascal DOSSETDATETIME (
706 struct DateTime far * );
707
708
709
710/*** DosSleep - Delay Process Execution
711 *
712 * Suspends the current thread for a specified interval of time,
713 * or if the requested interval is '0', simply gives up the
714 * remainder of the current time slice.
715 */
716
717extern unsigned far pascal DOSSLEEP (
718 unsigned long ); /* TimeInterval - interval size */
719
720
721
722/*** DosGetTimerInt - Get the timer tick interval in 1/10000 sec.
723 *
724 * Gets a word that contains the timer tick interval in ten
725 * thousandths of a second. This is the amount of time that
726 * elapses with every timer tick
727 */
728
729extern unsigned far pascal DOSGETTIMERINT (
730 unsigned far * ); /* interval size */
731
732
733
734/*** DosTimerAsync - Start an asynchronous time delay
735 *
736 * Starts a timer that runs asynchronously to the thread issuing
737 * the request. It sets a RAM semaphore which can be used by the
738 * wait facility
739 */
740
741extern unsigned far pascal DOSTIMERASYNC (
742 unsigned long, /* Interval size */
743 unsigned long, /* handle of semaphore */
744 unsigned far * ); /* handle of timer */
745
746
747
748/*** DosTimerStart - Start a Periodic Interval Timer
749 *
750 * Starts a periodic interval timer that runs asynchronously to
751 * the thread issuing the request. It sets a RAM semaphore which
752 * can be used by the wait facility. The semaphore is continually
753 * signalled at the specified time interval until the timer is
754 * turned off by DosTimerStop
755 */
756
757extern unsigned far pascal DOSTIMERSTART (
758 unsigned long, /* Interval size */
759 unsigned long, /* handle of semaphore */
760 unsigned far * ); /* handle of timer */
761
762
763
764/*** DosTimerStop - Stop an interval timer
765 *
766 * Stops an interval timer that was started by DosTimerStart
767 */
768
769extern unsigned far pascal DOSTIMERSTOP (
770 unsigned ); /* Handle of the timer */
771
772
773
774
775/*** Memory Management:
776 *
777 * DosAllocSeg
778 * DosAllocShrSeg
779 * DosGetShrSeg
780 * DosReallocSeg
781 * DosFreeSeg
782 * DosAllocHuge
783 * DosGetHugeShift
784 * DosReallocHuge
785 * DosCreateCSAlias
786 */
787
788
789
790/*** DosAllocSeg - Allocate Segment
791 *
792 * Allocates a segment of memory to the requesting process.
793 */
794
795extern unsigned far pascal DOSALLOCSEG (
796 unsigned, /* Number of bytes requested */
797 unsigned far *, /* Selector allocated (returned) */
798 unsigned ); /* Indicator for sharing */
799
800
801
802/*** DosAllocShrSeg - Allocate Shared Segment
803 *
804 * Allocates a shared memory segment to a process.
805 */
806
807extern unsigned far pascal DOSALLOCSHRSEG (
808 unsigned, /* Number of bytes requested */
809 char far *, /* Name string */
810 unsigned far * ); /* Selector allocated (returned) */
811
812
813
814/*** DosGetShrSeg - Access Shared Segment
815 *
816 * Allows a process to access a shared memory segment previously
817 * allocated by another process. The reference count for the
818 * shared segment is incremented.
819 */
820
821extern unsigned far pascal DOSGETSHRSEG (
822 char far *, /* Name string */
823 unsigned far * ); /* Selector (returned) */
824
825
826
827/*** DosGiveSeg - Give access to Segment
828 *
829 * Gives another process access to a shares memory segment
830 */
831
832extern unsigned far pascal DOSGIVESEG (
833 unsigned, /* Caller's segment handle */
834 unsigned, /* Process ID of recipient */
835 unsigned far * ); /* Recipient's segment handle */
836
837
838
839/*** DosReallocSeg - Change Segment Size
840 *
841 * Changes the size of a segment already allocated.
842 */
843
844extern unsigned far pascal DOSREALLOCSEG (
845 unsigned, /* New size requested in bytes */
846 unsigned ); /* Selector */
847
848
849
850/*** DosFreeSeg - Free a Segment
851 *
852 * Deallocates a segment
853 */
854
855extern unsigned far pascal DOSFREESEG (
856 unsigned ); /* Selector */
857
858
859
860/*** DosAllocHuge - Allocate Huge Memory
861 *
862 * Allocates memory greater than the maximum segment size
863 */
864
865extern unsigned far pascal DOSALLOCHUGE (
866 unsigned, /* Number of 65536 byte segments */
867 unsigned, /* Number of bytes in last segment */
868 unsigned far *, /* Selector allocated (returned) */
869 unsigned ); /* Max number of 65536-byte segments */
870
871
872
873/*** DosGetHugeShift - Get shift count used with Huge Segments
874 *
875 * Returns the shift count used in deriving selectors
876 * to address memory allocated by DosAllocHuge.
877 */
878
879extern unsigned far pascal DOSGETHUGESHIFT (
880 unsigned far *); /* Shift Count (returned) */
881
882
883
884/*** DosReallocHuge - Change Huge Memory Size
885 *
886 * Changes the size of memory originally allocated by DosAllocHuge
887 */
888
889extern unsigned far pascal DOSREALLOCHUGE (
890 unsigned, /* Number of 65536 byte segments */
891 unsigned, /* Number of bytes in last segment */
892 unsigned ); /* Selector */
893
894
895
896/*** DosCreateCSAlias - Create CS Alias
897 *
898 * Creates an alias descriptor for a data type descriptor passed
899 * as input. The type of the new descriptor is executable.
900 */
901
902extern unsigned far pascal DOSCREATECSALIAS (
903 unsigned, /* Data segment selector */
904 unsigned far * ); /* Code segment selector (returned) */
905
906
907
908
909/*** Memory Sub-Allocation Package (MSP)
910 *
911 * DosSubAlloc
912 * DosSubFree
913 * DosSubSet
914 */
915
916
917
918/*** DosSubAlloc - Allocate Memory
919 *
920 * Allocates memory from a segment previously allocated by
921 * DosAllocSeg or DosAllocShrSeg and initialized by DosSubSet
922 */
923
924extern unsigned far pascal DOSSUBALLOC (
925 unsigned, /* Segment selector */
926 unsigned far *, /* Address of block offset */
927 unsigned ); /* Size of requested block */
928
929
930
931/*** DosSubFree - Free Memory
932 *
933 * Frees memory previously allocated by DosSubAlloc
934 */
935
936extern unsigned far pascal DOSSUBFREE (
937 unsigned, /* Segment selector */
938 unsigned, /* Offset of memory block to free */
939 unsigned ); /* Size of block in bytes */
940
941
942
943/*** DosSubSet - Initialize or Set Allocated Memory
944 *
945 * Can be used either to initialize a segment for sub-allocation
946 * of to notify MSP of a change in the size of a segment already
947 * initialized.
948 */
949
950extern unsigned far pascal DOSSUBSET (
951 unsigned, /* Segment selector */
952 unsigned, /* Parameter flags */
953 unsigned ); /* New size of the block */
954
955
956
957
958/*** Program Execution Control:
959 *
960 * DosLoadModule
961 * DosFreeModule
962 * DosGetProcAddr
963 * DosGetModHandle
964 * DosGetModName
965 */
966
967
968
969/*** DosLoadModule - Load Dynamic Link Routines
970 *
971 * Loads a dynamic link module and returns a handle for the module
972 */
973
974extern unsigned far pascal DOSLOADMODULE (
975 char far *, /* Module name string */
976 unsigned far * ); /* Module handle (returned) */
977
978
979
980/*** DosFreeModule - Free Dynamic Link Routines
981 *
982 * Frees the reference to the dynamic link module for this process.
983 * If the dynamic link module is no longer used by any process, the
984 * module will be freed from system memory.
985 */
986
987extern unsigned far pascal DOSFREEMODULE (
988 unsigned ); /* Module handle */
989
990
991
992/*** DosGetProcAddr - Get Dynamic Link Procedure Address
993 *
994 * Retruns a far address to the desired procedure within a dynamic
995 * link module.
996 */
997
998extern unsigned far pascal DOSGETPROCADDR (
999 unsigned, /* Module handle */
1000 char far *, /* Module name string */
1001 unsigned long far * ); /* Procedure address (returned) */
1002
1003
1004
1005/*** DosGetModHandle - Get Dynamic Link Module Handle
1006 *
1007 * Returns the handle to a dynamic link module that was previously
1008 * loaded. The interface provides a mechanism for testing whether
1009 * a dynamic link module is already loaded.
1010 */
1011
1012extern unsigned far pascal DOSGETMODHANDLE (
1013 char far *, /* Module name string */
1014 unsigned far *); /* Module handle (returned) */
1015
1016
1017
1018/*** DosGetModName - Get Dynamic Link Module Name
1019 *
1020 * returns the fully qualified drive, path, filename, and
1021 * extension associated with the referenced modul handle
1022 */
1023
1024extern unsigned far pascal DOSGETMODNAME (
1025 unsigned, /* Module handle */
1026 unsigned, /* Maximum buffer length */
1027 unsigned far * ); /* Buffer (returned) */
1028
1029
1030
1031
1032/*** Device I/O Services:
1033 *
1034 * DosBeep
1035 * DosDevConfig
1036 * DosDevIOCtl
1037 * DosScrDirectIO
1038 * DosScrRedrawWait
1039 * DosScrLock
1040 * DosScrUnLock
1041 * DosSGInit
1042 * DosSGNum
1043 * DosSGRestore
1044 * DosSGSave
1045 * DosSGSwitch
1046 * DosSGSwitchMe
1047 * DosVioAttach
1048 * DosVioRegister
1049 * KbdCharIn
1050 * KbdFlushBuffer
1051 * KbdGetStatus
1052 * KbdPeek
1053 * KbdSetStatus
1054 * KbdStringIn
1055 * VioRegister
1056 * VioFreePhysBuf
1057 * VioGetBuf
1058 * VioGetCurPos
1059 * VioGetCurType
1060 * VioGetMode
1061 * VioGetPhysBuf
1062 * VioReadCellStr
1063 * VioReadCharStr
1064 * VioScrollDn
1065 * VioScrollUp
1066 * VioScrollLf
1067 * VioScrollRt
1068 * VioSetCurPos
1069 * VioSetCurType
1070 * VioSetMode
1071 * VioShowBuf
1072 * VioWrtCellStr
1073 * VioWrtCharStr
1074 * VioWrtCharStrAtt
1075 * VioWrtNAttr
1076 * VioWrtNCell
1077 * VioWrtNChar
1078 * VioWrtTTY
1079 * VioSetANSI
1080 * VioGetANSI
1081 * VioPrtScreen
1082 * VioSaveRedrawWait
1083 * VioSaveRedrawWaitUndo
1084 * VioScrLock
1085 * VioScrUnlock
1086 * VioSetMnLockTime
1087 * VioSetMXSaveTime
1088 * VioGetTimes
1089 * VioPopUp
1090 * VioEndPopUp
1091 */
1092
1093
1094
1095/*** DosBeep - Generate Sound From Speaker */
1096
1097extern unsigned far pascal DOSBEEP (
1098 unsigned, /* Hertz (25H-7FFFH) */
1099 unsigned ); /* Length of sound in ms */
1100
1101
1102
1103/*** DosDevConfig - Get Device Configurations
1104 *
1105 * Get information about attached devices
1106 */
1107
1108extern unsigned far pascal DOSDEVCONFIG (
1109 unsigned char far *, /* Returned information */
1110 unsigned, /* Item number */
1111 unsigned ); /* Reserved */
1112
1113
1114
1115/*** DosDevIOCtl - Preform Control Functions Directly On Device
1116 *
1117 * Control functions on the device specified by the opened
1118 * handle
1119 */
1120
1121extern unsigned far pascal DOSDEVIOCTL (
1122 char far *, /* Data area */
1123 char far *, /* Command-specific argument list */
1124 unsigned, /* Device-specific function code */
1125 unsigned, /* Device category */
1126 unsigned ); /* Device handle returned by Open */
1127
1128
1129
1130/*** DosScrDirectIO - Direct Screen I/O
1131 *
1132 * Indicate direct screen I/O
1133 */
1134
1135extern unsigned far pascal DOSSCRDIRECTIO (
1136 unsigned ); /* Indicates state of direct I/O */
1137 /* 0=on, 1=off */
1138
1139
1140
1141/*** DosScrRedrawWait - Screen Refresh
1142 *
1143 * Wait for notification to refresh or redraw screen
1144 */
1145
1146extern unsigned far pascal DOSSCRREDRAWWAIT (void);
1147
1148
1149
1150/*** DosScrLock - Lock Screen
1151 *
1152 * Lock the screen for I/O
1153 */
1154
1155extern unsigned far pascal DOSSCRLOCK (
1156 unsigned, /* Block or not - 0=return if */
1157 /* screen unavailable, 1=wait */
1158 unsigned far *); /* Return status of lock - */
1159 /* 0=sucessful, 1=unsuccessful */
1160
1161
1162
1163/*** DosScrUnLock - Unlock Screen
1164 *
1165 * Unlock the screen for I/O
1166 */
1167
1168extern unsigned far pascal DOSSCRUNLOCK (void) ;
1169
1170
1171
1172/*** DosSGInit - Initialize Screen Group
1173 *
1174 * Initialize the specified screen group
1175 */
1176
1177extern unsigned far pascal DOSSGINIT (
1178 unsigned ); /* Number of screen group */
1179
1180
1181
1182/*** DosSGNum - Get Number of Screen Groups
1183 *
1184 * Get the number of screen groups
1185 */
1186
1187extern unsigned far pascal DOSSGNUM (
1188 unsigned far *); /* Total number of screen groups */
1189
1190
1191
1192/*** DosSGRestore - Restore Screen Group
1193 *
1194 * Restore the current screen group
1195 */
1196
1197extern unsigned far pascal DOSSGRESTORE (void);
1198
1199
1200
1201/*** DosSGSave - Save Screen Group
1202 *
1203 * Save the current screen group
1204 */
1205
1206extern unsigned far pascal DOSSGSAVE (void);
1207
1208
1209
1210/*** DosSGSwitch - Switch Screen Groups
1211 *
1212 * Switch the specified screen group to the active screen group
1213 */
1214
1215extern unsigned far pascal DOSSGSWITCH (
1216 unsigned ); /* Number of screen group */
1217
1218
1219
1220/*** DosSGSwitchMe - Put Process in Screen Group
1221 *
1222 * Switch the caller into the specified screen group
1223 */
1224
1225extern unsigned far pascal DOSSGSWITCHME (
1226 unsigned ); /* Number of screen groups */
1227
1228
1229
1230/*** DosVioAttach - Attach to Video Subsystem
1231 *
1232 * Attach to the current video subsystem for the current screen
1233 * group. This must be done prior to using any VIO functions.
1234 */
1235
1236extern unsigned far pascal DOSVIOATTACH (void);
1237
1238
1239
1240/*** DosVioRegister - Register Video Subsystem
1241 *
1242 * Register a video subsystem for a screen group
1243 */
1244
1245extern unsigned far pascal DOSVIOREGISTER (
1246 char far *, /* Module name */
1247 char far * ); /* Table of entries supported by */
1248 /* the VIO dynamic link module */
1249
1250
1251
1252/*** KbdCharIn - Read Character, Scan Code
1253 *
1254 * Return a character and scan code from the standard input device
1255 */
1256
1257extern unsigned far pascal KBDCHARIN (
1258 struct KeyData far *, /* Buffer for character code */
1259 unsigned, /* I/O wait - 0=wait for a */
1260 /* character, 1=no wait */
1261 unsigned ); /* keyboard handle */
1262
1263
1264
1265/*** KbdFlushBuffer - Flush Keystroke Buffer
1266 *
1267 * Clear the keystroke buffer
1268 */
1269
1270extern unsigned far pascal KBDFLUSHBUFFER (
1271 unsigned ); /* keyboard handle */
1272
1273
1274
1275/*** KbdGetStatus - Get Keyboard Status
1276 *
1277 * Gets the current state of the keyboard.
1278 */
1279
1280extern unsigned far pascal KBDGETSTATUS (
1281 struct KbdStatus far *, /* data structure */
1282 unsigned ); /* Keyboard device handle */
1283
1284
1285
1286/*** KbdPeek - Peek at Character, Scan Code
1287 *
1288 * Return the character/scan code, if available, from the
1289 * standard input device without removing it from the buffer.
1290 */
1291
1292extern unsigned far pascal KBDPEEK (
1293 struct KeyData far *, /* buffer for data */
1294 unsigned ); /* keyboard handle */
1295
1296
1297
1298/*** KbdSetStatus - Set Keyboard Status
1299 *
1300 * Sets the characteristics of the keyboard.
1301 */
1302
1303extern unsigned far pascal KBDSETSTATUS (
1304 struct KbdStatus far *, /* data structure */
1305 unsigned ); /* device handle */
1306
1307
1308
1309/*** KbdStringIn - Read Character String
1310 *
1311 * Read a character string (character codes only) from the
1312 * standard input device. The character string may optionally
1313 * be echoed at the standard output device if the echo mode
1314 * is set (KbdSetEchoMode)
1315 */
1316
1317extern unsigned far pascal KBDSTRINGIN (
1318 char far *, /* Char string buffer */
1319 unsigned far *, /* Length of buffer */
1320 unsigned, /* I/O wait- 0=wait for a */
1321 /* character, 1=no wait */
1322 unsigned ); /* keyboard handle */
1323
1324
1325
1326/*** VioRegister - Register Video Subsystem
1327 *
1328 * Register a video subsystem within a screen group
1329 *
1330 */
1331
1332extern unsigned far pascal VIOREGISTER (
1333 char far *, /* Module name */
1334 char far *, /* Entry Point name */
1335 unsigned long, /* Function mask 1 */
1336 unsigned long ); /* Function mask 2 */
1337
1338
1339
1340/*** VioFreePhysBuf - Free Physical Video Buffer
1341 *
1342 * Release the physical video buffer
1343 */
1344
1345extern unsigned far pascal VIOFREEPHYSBUF (
1346 char far * ); /* Physical video buffer */
1347
1348
1349
1350/*** VioGetBuf - Get Logical Video Buffer
1351 *
1352 * Return the address of the logical video buffer
1353 */
1354
1355extern unsigned far pascal VIOGETBUF (
1356 unsigned long far *, /* Will point to logical video buffer */
1357 unsigned far *, /* Length of Buffer */
1358 unsigned ); /* Vio Handle */
1359
1360
1361
1362/*** VioGetCurPos - Get Cursor Position
1363 *
1364 * Return the cursor position
1365 */
1366
1367extern unsigned far pascal VIOGETCURPOS (
1368 unsigned far *, /* Current row position */
1369 unsigned far *, /* Current column position */
1370 unsigned ); /* Vio Handle */
1371
1372
1373
1374/*** VioGetCurType - Get Cursor Type
1375 *
1376 * Return the cursor type
1377 */
1378
1379extern unsigned far pascal VIOGETCURTYPE (
1380 struct CursorData far *, /* Cursor characteristics */
1381 unsigned ); /* Vio Handle */
1382
1383
1384
1385/*** VioGetMode - Get Display Mode
1386 *
1387 * Return the mode of the display
1388 */
1389
1390extern unsigned far pascal VIOGETMODE (
1391 struct ModeData far *, /* Length of Buffer */
1392 unsigned ); /* Vio Handle */
1393
1394
1395
1396/*** VioGetPhysBuf - Get Physical Video Buffer
1397 *
1398 * Return the address of the physical video buffer
1399 */
1400
1401extern unsigned far pascal VIOGETPHYSBUF (
1402 char far *, /* Buffer start address */
1403 char far *, /* Buffer end address */
1404 unsigned far *, /* Address of selector list */
1405 unsigned ); /* Length of selector list */
1406
1407
1408
1409/*** VioReadCellStr - Read Character/Attributes String
1410 *
1411 * Read a string of character/attributes (or cells) from the
1412 * screen starting at the specified location.
1413 */
1414
1415extern unsigned far pascal VIOREADCELLSTR (
1416 char far *, /* Character Buffer */
1417 unsigned far *, /* Length of cell string buffer */
1418 unsigned, /* Starting location (row) */
1419 unsigned, /* Starting location (col) */
1420 unsigned ); /* Vio Handle */
1421
1422
1423
1424/*** VioReadCharStr - Read Character String
1425 *
1426 * Read a character string from the display starting at the
1427 * current cursor position
1428 */
1429
1430extern unsigned far pascal VIOREADCHARSTR (
1431 char far *, /* Character Buffer */
1432 unsigned far *, /* Length of cell string buffer */
1433 unsigned, /* Starting location (row) */
1434 unsigned, /* Starting location (col) */
1435 unsigned ); /* Vio Handle */
1436
1437
1438
1439/*** VioScrollDn - Scroll Screen Down
1440 *
1441 * Scroll the current screen down
1442 */
1443
1444extern unsigned far pascal VIOSCROLLDN (
1445 unsigned, /* Top row of section to scroll */
1446 unsigned, /* Left column of section to scroll */
1447 unsigned, /* Bottom row of section to scroll */
1448 unsigned, /* Right column of section to scroll */
1449 unsigned, /* Number of blank lines at bottom */
1450 char far *, /* pointer to blank Char,Attr */
1451 unsigned ); /* Vio Handle */
1452
1453
1454
1455/*** VioScrollUp - Scroll Screen Up
1456 *
1457 * Scroll the active page (or display) up
1458 */
1459
1460extern unsigned far pascal VIOSCROLLUP (
1461 unsigned, /* Top row of section to scroll */
1462 unsigned, /* Left column of section to scroll */
1463 unsigned, /* Bottom row of section to scroll */
1464 unsigned, /* Right column of section to scroll */
1465 unsigned, /* Number of blank lines at bottom */
1466 char far *, /* pointer to blank Char,Attr */
1467 unsigned ); /* Vio Handle */
1468
1469
1470
1471/*** VioScrollLf - Scroll Screen Left
1472 *
1473 * Scroll the current screen left
1474 */
1475
1476extern unsigned far pascal VIOSCROLLLF (
1477 unsigned, /* Top row of section to scroll */
1478 unsigned, /* Left column of section to scroll */
1479 unsigned, /* Bottom row of section to scroll */
1480 unsigned, /* Right column of section to scroll */
1481 unsigned, /* Number of blank columsn at right */
1482 char far *, /* pointer to blank Char,Attr */
1483 unsigned ); /* Vio Handle */
1484
1485
1486
1487/*** VioScrollLf - Scroll Screen Right
1488 *
1489 * Scroll the current screen right
1490 */
1491
1492extern unsigned far pascal VIOSCROLLRT (
1493 unsigned, /* Top row of section to scroll */
1494 unsigned, /* Left column of section to scroll */
1495 unsigned, /* Bottom row of section to scroll */
1496 unsigned, /* Right column of section to scroll */
1497 unsigned, /* Number of blank columsn at left */
1498 char far *, /* pointer to blank Char,Attr */
1499 unsigned ); /* Vio Handle */
1500
1501
1502
1503/*** VioSetCurPos - Set Cursor Position
1504 *
1505 * Set the cursor position
1506 */
1507
1508extern unsigned far pascal VIOSETCURPOS (
1509 unsigned, /* Row return data */
1510 unsigned, /* Column return data */
1511 unsigned ); /* Vio Handle */
1512
1513
1514
1515/*** VioSetCurType - Set Cursor Type
1516 *
1517 * Set the cursor type
1518 */
1519
1520extern unsigned far pascal VIOSETCURTYPE (
1521 struct CursorData far *, /* Cursor characteristics */
1522 unsigned ); /* Vio Handle */
1523
1524
1525
1526/*** VioSetMode - Set Display Mode
1527 *
1528 * Set the mode of the display
1529 */
1530
1531extern unsigned far pascal VIOSETMODE (
1532 struct ModeData far *, /* Mode characteristics */
1533 unsigned ); /* Vio Handle */
1534
1535
1536
1537/*** VioShowBuf - Display Logical Buffer
1538 *
1539 * Update the display with the logical video buffer
1540 */
1541
1542extern unsigned far pascal VIOSHOWBUF (
1543 unsigned, /* Offset into buffer */
1544 unsigned, /* Length of area to be updated */
1545 unsigned ); /* Vio Handle */
1546
1547
1548
1549/*** VioWrtCellStr - Write Character/Attribute String
1550 *
1551 * Write a character,attribute string to the display
1552 */
1553
1554extern unsigned far pascal VIOWRTCELLSTR (
1555 char far *, /* String to be written */
1556 unsigned, /* Length of string */
1557 unsigned, /* Starting position for output (row) */
1558 unsigned, /* Starting position for output (col) */
1559 unsigned ); /* Vio Handle */
1560
1561
1562
1563/*** VioWrtCharStr - Write Character String
1564 *
1565 * Write a character string to the display
1566 */
1567
1568extern unsigned far pascal VIOWRTCHARSTR (
1569 char far *, /* String to be written */
1570 unsigned, /* Length of string */
1571 unsigned, /* Starting position for output (row) */
1572 unsigned, /* Starting position for output (col) */
1573 unsigned ); /* Vio Handle */
1574
1575
1576
1577/*** VioWrtCharStrAtt - Write Character String With Attribute
1578 *
1579 * Write a character string with repeated attribute to the display
1580 */
1581
1582extern unsigned far pascal VIOWRTCHARSTRATT (
1583 char far *, /* String to be written */
1584 unsigned, /* Length of string */
1585 unsigned, /* Starting position for output (row) */
1586 unsigned, /* Starting position for output (col) */
1587 char far *, /* Attribute to be replicated */
1588 unsigned ); /* Vio Handle */
1589
1590
1591
1592/*** VioWrtNAttr - Write N Attributes
1593 *
1594 * Write an attribute to the display a specified number of times
1595 */
1596
1597extern unsigned far pascal VIOWRTNATTR (
1598 char far *, /* Attribute to be written */
1599 unsigned, /* Length of write */
1600 unsigned, /* Starting position for output (row) */
1601 unsigned, /* Starting position for output (col) */
1602 unsigned ); /* Vio Handle */
1603
1604
1605
1606/*** VioWrtNCell - Write N Character/Attributes
1607 *
1608 * Write a cell (or character/attribute) to the display a
1609 * specified number of times
1610 */
1611
1612extern unsigned far pascal VIOWRTNCELL (
1613 char far *, /* Cell to be written */
1614 unsigned, /* Length of write */
1615 unsigned, /* Starting position for output (row) */
1616 unsigned, /* Starting position for output (col) */
1617 unsigned ); /* Vio Handle */
1618
1619
1620
1621/*** VioWrtNChar - Write N Characters
1622 *
1623 * Write a character to the display a specified number of times
1624 */
1625
1626extern unsigned far pascal VIOWRTNCHAR (
1627 unsigned, /* Character to be written */
1628 unsigned, /* Length of write */
1629 unsigned, /* Starting position for output (row) */
1630 unsigned, /* Starting position for output (col) */
1631 unsigned ); /* Vio Handle */
1632
1633
1634
1635/*** VioWrtTTY - Write TTY String
1636 *
1637 * Write a character string from the current cursor position in
1638 * TTY mode to the display. The cursor will be positioned at the
1639 * end of the string+1 at the end of the write.
1640 */
1641
1642extern unsigned far pascal VIOWRTTTY (
1643 char far *, /* String to be written */
1644 unsigned, /* Length of string */
1645 unsigned ); /* Vio Handle */
1646
1647
1648
1649/*** VioSetAnsi - Set ANSI On or Off
1650 *
1651 * Activates or deactivates ANSI support
1652 *
1653 */
1654
1655extern unsigned far pascal VIOSETANSI (
1656 unsigned, /* ON (=1) or OFF (=0) indicator */
1657 unsigned ); /* Vio Handle */
1658
1659
1660
1661/*** VioGetAnsi - Get ANSI State
1662 *
1663 * Returns the current ANSI state (0=inactive, 1=active)
1664 *
1665 */
1666
1667extern unsigned far pascal VIOGETANSI (
1668 unsigned far *, /* ANSI state (returned) */
1669 unsigned ); /* Vio Handle */
1670
1671
1672
1673/*** VioPrtScreen - Print Screen
1674 *
1675 * Copies the screen to the printer
1676 *
1677 */
1678
1679extern unsigned far pascal VIOPRTSCREEN (
1680 unsigned ); /* Vio Handle */
1681
1682
1683
1684/*** VioSaveRedrWait - Screen Save Redraw Wait
1685 *
1686 * Allows a process to be notified when it must
1687 * save or redraw its screen
1688 *
1689 */
1690
1691extern unsigned far pascal VIOSAVEREDRAWWAIT (
1692 unsigned, /* Save/Redraw Indicator */
1693 unsigned far *, /* Notify type (returned) */
1694 unsigned ); /* Vio Handle */
1695
1696
1697
1698/*** VioSaveRedrWaitUndo - Undo Screen Save Redraw Wait
1699 *
1700 * Allows a one thread within a process to cancel a
1701 * VIOSAVREDRAWWAIT issued by another thread within
1702 * that same process. Ownership of the VIOSAVREDRAWWAIT
1703 * can either be reserved or given up.
1704 *
1705 */
1706
1707extern unsigned far pascal VIOSAVEREDRAWWAITUNDO (
1708 unsigned, /* Ownership Indicator */
1709 unsigned, /* Terminate Indicator */
1710 unsigned ); /* Vio Handle */
1711
1712
1713
1714/*** VioScrLock - Lock Screen
1715 *
1716 * Tells a process if I/O to the physical screen buffer can occur.
1717 *
1718 */
1719
1720extern unsigned far pascal VIOSCRLOCK (
1721 unsigned, /* Wait Flag */
1722 unsigned char far *, /* Status of lock (returned) */
1723 unsigned ); /* Vio Handle */
1724
1725
1726
1727/*** VioScrUnlock - Unlock Screen
1728 *
1729 * Unlocks the physical screen buffer for I/O.
1730 *
1731 */
1732
1733extern unsigned far pascal VIOSCRUNLOCK (
1734 unsigned ); /* Vio Handle */
1735
1736
1737
1738/*** VioSetMnLockTime - Set Minimum Screen Lock Time
1739 *
1740 * Sets the minimum amount of time that the system will allow a
1741 * process to have exclusive use of the screen via VIOSCRLOCK.
1742 *
1743 */
1744
1745extern unsigned far pascal VIOSETMNLOCKTIME (
1746 unsigned, /* Number of seconds */
1747 unsigned ); /* Vio Handle */
1748
1749
1750
1751/*** VioSetMxSaveTime - Set Maximum Screen Save/Restore Time
1752 *
1753 * Sets the maximum amount of time (in msec) that the system will
1754 * allow a process to take before issuing a VIOSAVREDRWAIT call
1755 * after being notified by the Session Mgr that one is needed.
1756 *
1757 */
1758
1759extern unsigned far pascal VIOSETMXSAVETIME (
1760 unsigned, /* Number of milliseconds */
1761 unsigned ); /* Vio Handle */
1762
1763
1764
1765/*** VioGetTimes - Return VIO Lock and Save/Redraw Times
1766 *
1767 * Returns the 2 word values set by the calls
1768 * VIOSETMNLOCKTIME and VIOSETMXSAVETIME.
1769 *
1770 */
1771
1772extern unsigned far pascal VIOGETTIMES (
1773 unsigned far *, /* Min. Lock time (in seconds) */
1774 unsigned far *, /* Max. Save time (in msec) */
1775 unsigned ); /* Vio Handle */
1776
1777
1778
1779/*** VioPopUp - Allocate a PopUp Display Screen
1780 *
1781 * Creates a temporary window to display a momentary message
1782 *
1783 */
1784
1785extern unsigned far pascal VIOPOPUP (
1786 unsigned far *, /* Wait/Nowait Bit flags */
1787 unsigned ); /* Vio Handle */
1788
1789
1790
1791/*** VioEndPopUp - Deallocate a PopUp Display Screen
1792 *
1793 * Closes a PopUp window
1794 *
1795 */
1796
1797extern unsigned far pascal VIOENDPOPUP (
1798 unsigned ); /* Vio Handle */
1799
1800
1801
1802
1803/*** Mouse Services
1804 *
1805 * MouRegister
1806 * MouGetNumButtons
1807 * MouGetNumMickeys
1808 * MouGetDevStatus
1809 * MouReadEventQueue
1810 * MouGetNumQueEl
1811 * MouGetEventMask
1812 * MouGetScaleFact
1813 * MouSetScaleFact
1814 * MouSetEventMask
1815 * MouOpen
1816 * MouClose
1817 * MouSetPtrShape
1818 * MouRemovePtr
1819 * MouDrawPtr
1820 * MouSetHotKey
1821 */
1822
1823
1824/*** MouRegister - Register a Mouse Subsystem or Environment Manager
1825 *
1826 */
1827
1828extern unsigned far pascal MOUREGISTER (
1829 char far *, /* Module name */
1830 char far *, /* Entry Point name */
1831 unsigned long, /* Function mask */
1832 unsigned ); /* Mouse Device Handle */
1833
1834
1835
1836/*** MouGetNumButtons - returns the number of mouse buttons supported
1837 *
1838 */
1839
1840extern unsigned far pascal MOUGETNUMBUTTONS (
1841 unsigned far *, /* Number of mouse buttons (returned) */
1842 unsigned ); /* Mouse Device Handle */
1843
1844
1845
1846/*** MouGetNumMickeys - returns the number of mickeys per centimeter
1847 *
1848 */
1849
1850extern unsigned far pascal MOUGETNUMMICKEYS (
1851 unsigned far *, /* Number of Mickeys/cm (returned) */
1852 unsigned ); /* Mouse Device Handle */
1853
1854
1855
1856/*** MouGetDevStatus - returns the mouse driver status flags
1857 *
1858 */
1859
1860extern unsigned far pascal MOUGETDEVSTATUS (
1861 unsigned far *, /* Device Status (returned) */
1862 unsigned ); /* Mouse Device Handle */
1863
1864
1865
1866/*** MouReadEventQueue - reads an event from the mouse event queue
1867 *
1868 */
1869
1870extern unsigned far pascal MOUREADEVENTQUEUE (
1871 unsigned, /* Type of read operation */
1872 unsigned char far *, /* Event Queue Entry (returned) */
1873 unsigned ); /* Mouse Device Handle */
1874
1875
1876
1877/*** MouGetNumQueEl - returns the status of the Mouse Event Queue
1878 *
1879 */
1880
1881extern unsigned far pascal MOUGETNUMQUEEL (
1882 unsigned far *, /* Maximum # of Elements in Queue */
1883 unsigned far *, /* Current # of Elements in Queue */
1884 unsigned ); /* Mouse Device Handle */
1885
1886
1887
1888/*** MouGetEventMask - Returns the current mouse 1-word event mask
1889 *
1890 */
1891
1892extern unsigned far pascal MOUGETEVENTMASK (
1893 unsigned far *, /* Event Mask (returned) */
1894 unsigned ); /* Mouse Device Handle */
1895
1896
1897
1898/*** MouGetScaleFact - Returns the current mouse scaling factors
1899 *
1900 */
1901
1902extern unsigned far pascal MOUGETSCALEFACT (
1903 unsigned far *, /* Y Coordinate Scaling Factor */
1904 unsigned far *, /* X Coordinate Scaling Factor */
1905 unsigned ); /* Mouse Device Handle */
1906
1907
1908
1909/*** MouSetScaleFact - Sets the current mouse scaling factors
1910 *
1911 */
1912
1913extern unsigned far pascal MOUSETSCALEFACT (
1914 unsigned, /* Y Coordinate Scaling Factor */
1915 unsigned, /* X Coordinate Scaling Factor */
1916 unsigned ); /* Mouse Device Handle */
1917
1918
1919
1920/*** MouSetEventMask - Set the current mouse 1-word event mask
1921 *
1922 */
1923
1924extern unsigned far pascal MOUSETEVENTMASK (
1925 unsigned, /* Event Mask */
1926 unsigned ); /* Mouse Device Handle */
1927
1928
1929
1930/*** MouOpen - Open the mouse device
1931 *
1932 */
1933
1934extern unsigned far pascal MOUOPEN (
1935 unsigned far * ); /* Mouse Device Handle (returned) */
1936
1937
1938
1939/*** MouClose - Close the mouse device
1940 *
1941 */
1942
1943extern unsigned far pascal MOUCLOSE (
1944 unsigned ); /* Mouse Device Handle */
1945
1946
1947
1948/*** MouSetPtrShape - Set the shape and size of the mouse pointer image
1949 *
1950 */
1951
1952extern unsigned far pascal MOUSETPTRSHAPE (
1953 unsigned char far *, /* Pointer Shape (returned) */
1954 unsigned long, /* Size of data passed */
1955 unsigned, /* Height of Ptr Shape */
1956 unsigned, /* Width of Ptr Shape */
1957 unsigned, /* Offset to Ptr Column Center */
1958 unsigned, /* Offset to Ptr Row Center */
1959 unsigned ); /* Mouse Device Handle */
1960
1961
1962
1963/*** MouRemovePtr - Restricts the Mouse Ptr from occurring in a region
1964 *
1965 */
1966
1967extern unsigned far pascal MOUREMOVEPTR (
1968 unsigned far *, /* Pointer Area */
1969 unsigned ); /* Mouse Device Handle */
1970
1971
1972
1973/*** MouDrawPtr - Unrestricts the Mouse Ptr
1974 *
1975 */
1976
1977extern unsigned far pascal MOUDRAWPTR (
1978 unsigned ); /* Mouse Device Handle */
1979
1980
1981/*** MouSetHotKey - Determines which Mouse Key is the system hot key
1982 *
1983 */
1984
1985extern unsigned far pascal MOUSETHOTKEY (
1986 unsigned, /* Mouse Button Mask */
1987 unsigned ); /* Mouse Device Handle */
1988
1989
1990
1991
1992/*** Device Monitor Services
1993 *
1994 * DosMonOpen
1995 * DosMonClose
1996 * DosMonReg
1997 * DosMonRead
1998 * DosMonWrite
1999 */
2000
2001
2002
2003/*** DosMonOpen - Open a Connection to a CP/DOS Device Monitor
2004 *
2005 * This call is issued once by a process which wishes to use
2006 * device monitors
2007 */
2008
2009extern unsigned far pascal DOSMONOPEN (
2010 char far *, /* Ascii string of device name */
2011 unsigned far * ); /* Address for handle return value */
2012
2013
2014
2015/*** DosMonClose - Close a Connection to a CP/DOS Device Monitor
2016 *
2017 * This call is issued once by a process which wishes to terminate
2018 * monitoring. This call causes all monitor buffers associated to
2019 * be flushed and closed.
2020 */
2021
2022extern unsigned far pascal DOSMONCLOSE (
2023 unsigned ); /* Handle from DosMonOpen */
2024
2025
2026
2027/*** DosMonReg - Register a Set of Buffers as a Monitor
2028 *
2029 * This call is issued to establish a pair of buffer structures -
2030 * one input and one output - to monitor an I/O stream
2031 */
2032
2033extern unsigned far pascal DOSMONREG (
2034 unsigned, /* Handle from DosMonOpen */
2035 unsigned char far *, /* Address of monitor input buffer */
2036 unsigned char far *, /* Address of monitor output buffer */
2037 unsigned, /* Position flag - 0=no positional */
2038 /* preference, 1=front of list, */
2039 /* 2=back of the list */
2040 unsigned ); /* Index */
2041
2042
2043
2044/*** DosMonRead - Read Input From Monitor Structure
2045 *
2046 * This call is issued to wait for and read input records from
2047 * the monitor buffer structure
2048 */
2049
2050extern unsigned far pascal DOSMONREAD (
2051 unsigned char far *, /* Address of monitor input buffer */
2052 unsigned char, /* Block/Run indicator - 0=block */
2053 /* input ready, 1=return */
2054 unsigned char far *, /* Address of data buffer */
2055 unsigned far * ); /* Number of bytes in the data record */
2056
2057
2058
2059/*** DosMonWrite - Write Output to Monitor Structure
2060 *
2061 * Writes data to the monitor output buffer structure
2062 */
2063
2064extern unsigned far pascal DOSMONWRITE (
2065 unsigned char far *, /* Address of monitor output buffer */
2066 unsigned char far *, /* Address of data buffer */
2067 unsigned ); /* Number of bytes in data record */
2068
2069
2070
2071
2072/*** File I/O Services:
2073 *
2074 * DosBufReset
2075 * DosChdir
2076 * DosChgFilePtr
2077 * DosClose
2078 * DosCreateUn
2079 * DosDelete
2080 * DosDupHandle
2081 * DosFindClose
2082 * DosFindFirst
2083 * DosFindNext
2084 * DosFileLocks
2085 * DosGetInfoSeg
2086 * DosMkdir
2087 * DosMove
2088 * DosNewSize
2089 * DosOpen
2090 * DosQCurDir
2091 * DosQCurDisk
2092 * DosQFHandState
2093 * DosQFileInfo
2094 * DosQFileMode
2095 * DosQFSInfo
2096 * DosQHandType
2097 * DosQSwitChar
2098 * DosQVerify
2099 * DosRead
2100 * DosReadAsync
2101 * DosRmdir
2102 * DosSelectDisk
2103 * DosSetFileInfo
2104 * DosSetFileMode
2105 * DosSetFHandState
2106 * DosSetFSInfo
2107 * DosSetMaxFH
2108 * DosSetVerify
2109 * DosWrite
2110 * DosWriteAsync
2111 */
2112
2113
2114
2115/*** DosBufReset - Commit File's Cache Buffers
2116 *
2117 * Flushes requesting process's cache buffers for the specified
2118 * format
2119 */
2120
2121extern unsigned far pascal DOSBUFRESET (
2122 unsigned ); /* File handle */
2123
2124
2125
2126/*** DosChdir - Change The Current Directory
2127 *
2128 * Define the current directory for the requesting process
2129 */
2130
2131extern unsigned far pascal DOSCHDIR (
2132 char far *, /* Directory path name */
2133 unsigned long ); /* Reserved (must be 0) */
2134
2135
2136
2137/*** DosChgFilePtr - Change (Move) File Read Write Pointer
2138 *
2139 * Move the read/write pointer according to the method specified
2140 */
2141
2142extern unsigned far pascal DOSCHGFILEPTR (
2143 unsigned, /* File handle */
2144 long, /* Distance to move in bytes */
2145 unsigned, /* Method of moving (0,1,2) */
2146 unsigned long far * ); /* New pointer location */
2147
2148
2149
2150/*** DosClose - Close a File Handle
2151 *
2152 * Closes the specified file handle
2153 */
2154
2155extern unsigned far pascal DOSCLOSE (
2156 unsigned ); /* File handle */
2157
2158
2159
2160/*** DosCreateUn - Create a Unique File Path Name
2161 *
2162 * Generates a unique file path name
2163 */
2164
2165extern unsigned far pascal DOSCREATEUN (
2166 char far * ); /* File path name area */
2167
2168
2169
2170/*** DosDelete - Delete a File
2171 *
2172 * Removes a directory entry associated with a filename
2173 */
2174
2175extern unsigned far pascal DOSDELETE (
2176 char far *, /* Filename path */
2177 unsigned long ); /* Reserved (must be 0) */
2178
2179
2180
2181/*** DosDupHandle - Duplicate a File Handle
2182 *
2183 * Returns a new file handle for an open file that refers to the
2184 * same file at the same position
2185 */
2186
2187extern unsigned far pascal DOSDUPHANDLE (
2188 unsigned, /* Existing file handle */
2189 unsigned far * ); /* New file handle */
2190
2191
2192
2193/*** DosFindClose - Close Find Handle
2194 *
2195 * Closes the association between a directory handle and a
2196 * DosFindFirst or DosFindNext directory search function
2197 */
2198
2199extern unsigned far pascal DOSFINDCLOSE (
2200 unsigned ); /* Directory search handle */
2201
2202
2203
2204/*** DosFindFirst - Find First Matching File
2205 *
2206 * Finds the first filename that matches the specified file
2207 * specification
2208 */
2209
2210extern unsigned far pascal DOSFINDFIRST (
2211 char far *, /* File path name */
2212 unsigned far *, /* Directory search handle */
2213 unsigned, /* Search attribute */
2214 struct FileFindBuf far *, /* Result buffer */
2215 unsigned, /* Result buffer length */
2216 unsigned far *, /* Number of entries to find */
2217 unsigned long ); /* Reserved (must be 0) */
2218
2219
2220
2221/*** DosFindNext - Find Next Matching File
2222 *
2223 * Finds the next directory entry matching the name that was
2224 * specified on the previous DosFindFirst or DosFindNext function
2225 * call
2226 */
2227
2228extern unsigned far pascal DOSFINDNEXT (
2229 unsigned, /* Directory handle */
2230 struct FileFindBuf far *, /* Result buffer */
2231 unsigned, /* Result buffer length */
2232 unsigned far * ); /* Number of entries to find */
2233
2234
2235
2236/*** DosFileLocks - File Lock Manager
2237 *
2238 * Unlock and/or lock multiple ranges in an opened file
2239 */
2240
2241extern unsigned far pascal DOSFILELOCKS (
2242 unsigned, /* File handle */
2243 long far *, /* Unlock Range */
2244 long far * ); /* Lock Range */
2245
2246
2247
2248/*** DosGetInfoSeg - Get addresses of system variable segments
2249 *
2250 * Returns 2 selectors: one for the global information segment,
2251 * the other for a process information segment
2252 */
2253
2254extern unsigned far pascal DOSGETINFOSEG (
2255 unsigned far *, /* Selector for Global Info Seg */
2256 unsigned far * ); /* Selector for Process Info Seg */
2257
2258
2259
2260/*** DosMkdir - Make Subdirectory
2261 *
2262 * Creates the specified directory
2263 */
2264
2265extern unsigned far pascal DOSMKDIR (
2266 char far *, /* New directory name */
2267 unsigned long ); /* Reserved (must be 0) */
2268
2269
2270
2271/*** DosMove - Move a file or SubDirectory
2272 *
2273 * Moves the specified file or directory
2274 */
2275
2276extern unsigned far pascal DOSMOVE (
2277 char far *, /* Old path name */
2278 char far *, /* New path name */
2279 unsigned long ); /* Reserved (must be 0) */
2280
2281
2282
2283/*** DosNewSize - Change File's Size
2284 *
2285 * Changes a file's size
2286 */
2287
2288extern unsigned far pascal DOSNEWSIZE (
2289 unsigned, /* File handle */
2290 unsigned long ); /* File's new size */
2291
2292
2293
2294/*** DosOpen - Open a File
2295 *
2296 * Creates the specified file (if necessary) and opens it
2297 */
2298
2299extern unsigned far pascal DOSOPEN (
2300 char far *, /* File path name */
2301 unsigned far *, /* New file's handle */
2302 unsigned far *, /* Action taken - 1=file existed, */
2303 /* 2=file was created */
2304 unsigned long, /* File primary allocation */
2305 unsigned, /* File attributes */
2306 unsigned, /* Open function type */
2307 unsigned, /* Open mode of the file */
2308 unsigned long ); /* Reserved (must be zero) */
2309
2310
2311
2312/*** DosQCurDir - Query Current Directory
2313 *
2314 * Get the full path name of the current directory for the
2315 * requesting process for the specified drive
2316 */
2317
2318extern unsigned far pascal DOSQCURDIR (
2319 unsigned, /* Drive number - 1=A, etc */
2320 char far *, /* Directory path buffer */
2321 unsigned far * ); /* Directory path buffer length */
2322
2323
2324
2325/*** DosQCurDisk - Query Current Disk
2326 *
2327 * Determine the current default drive for the requesting process
2328 */
2329
2330extern unsigned far pascal DOSQCURDISK (
2331 unsigned far *, /* Default drive number */
2332 unsigned long far * ); /* Drive-map area */
2333
2334
2335
2336
2337/*** DosQFHandState - Query file handle state
2338 *
2339 * Query the state of the specified handle
2340 */
2341
2342extern unsigned far pascal DOSQFHANDSTATE (
2343 unsigned, /* File Handle */
2344 unsigned far * ); /* File handle state */
2345
2346
2347
2348/*** DosQFileInfo - Query a File's Information
2349 *
2350 * Returns information for a specific file
2351 */
2352
2353extern unsigned far pascal DOSQFILEINFO (
2354 unsigned, /* File handle */
2355 unsigned, /* File data required */
2356 char far *, /* File data buffer */
2357 unsigned ); /* File data buffer size */
2358
2359
2360/*** DosQFileMode - Query File Mode
2361 *
2362 * Get the mode (attribute) of the specified file
2363 */
2364
2365extern unsigned far pascal DOSQFILEMODE (
2366 char far *, /* File path name */
2367 unsigned far *, /* Data area */
2368 unsigned long ); /* Reserved (must be zero) */
2369
2370
2371
2372/*** DosQFSInfo - Query File System Information
2373 *
2374 * Gets information from a file system device
2375 */
2376
2377extern unsigned far pascal DOSQFSINFO (
2378 unsigned, /* Drive number - 0=default, 1=A, etc */
2379 unsigned, /* File system info required */
2380 char far *, /* File system info buffer */
2381 unsigned ); /* File system info buffer size */
2382
2383
2384
2385/*** DosQHandType - Query Handle type
2386 *
2387 * Returns a flag as to whether a handle references a device or
2388 * a file, and if a device, returns device driver attribute word
2389 */
2390
2391extern unsigned far pascal DOSQHANDTYPE (
2392 unsigned, /* File Handle */
2393 unsigned far *, /* Handle Type (0=file, 1=device) */
2394 unsigned far * ); /* Device Driver Attribute Word */
2395
2396
2397
2398/*** DosQSwitChar - Query Switch Character
2399 *
2400 * Returns the system switch character
2401 */
2402
2403extern unsigned far pascal DOSQSWITCHAR (
2404 unsigned char far * ); /* Switch Character (returned) */
2405
2406
2407
2408/*** DosQVerify - Query Verify Setting
2409 *
2410 * Returns the value of the Verify flag
2411 */
2412
2413extern unsigned far pascal DOSQVERIFY (
2414 unsigned far * ); /* Verify setting - 0=verify mode */
2415 /* not active, 1=verify mode active */
2416
2417
2418
2419/*** DosRead - Read from a File
2420 *
2421 * Reads the specified number of bytes from a file to a
2422 * buffer location
2423 */
2424
2425extern unsigned far pascal DOSREAD (
2426 unsigned, /* File handle */
2427 char far *, /* Address of user buffer */
2428 unsigned, /* Buffer length */
2429 unsigned far * ); /* Bytes read */
2430
2431
2432
2433/*** DosReadAsync - Async Read from a File
2434 *
2435 * Reads the specified number of bytes from a file to a buffer
2436 * location asynchronously with respect to the requesting process's
2437 * execution
2438 */
2439
2440extern unsigned far pascal DOSREADASYNC (
2441 unsigned, /* File handle */
2442 unsigned long far *, /* Address of Ram semaphore */
2443 unsigned far *, /* Address of I/O error return code */
2444 char far *, /* Address of user buffer */
2445 unsigned, /* Buffer length */
2446 unsigned far * ); /* Number of bytes actually read */
2447
2448
2449
2450/*** DosRmDir - Remove Subdirectory
2451 *
2452 * Removes a subdirectory from the specified disk
2453 */
2454
2455extern unsigned far pascal DOSRMDIR (
2456 char far *, /* Directory name */
2457 unsigned long ); /* Reserved (must be zero) */
2458
2459
2460
2461/*** DosSelectDisk - Select Default Drive
2462 *
2463 * Select the drive specified as the default drive for the
2464 * calling process
2465 */
2466
2467extern unsigned far pascal DOSSELECTDISK (
2468 unsigned ); /* Default drive number */
2469
2470
2471
2472/*** DosSetFHandState - Set File Handle State
2473 *
2474 * Get the state of the specified file
2475 */
2476
2477extern unsigned far pascal DOSSETFHANDSTATE (
2478 unsigned, /* File handle */
2479 unsigned); /* File handle state */
2480
2481
2482/*** DosSetFSInfo - Set File System Information
2483 *
2484 * Set information for a file system device
2485 */
2486
2487extern unsigned far pascal DOSSETFSINFO (
2488 unsigned, /* Drive number - 0=default, 1=A, etc */
2489 unsigned, /* File system info required */
2490 char far *, /* File system info buffer */
2491 unsigned ); /* File system info buffer size */
2492
2493
2494
2495/*** DosSetFileInfo - Set a File's Information
2496 *
2497 * Specifies information for a file
2498 */
2499
2500extern unsigned far pascal DOSSETFILEINFO (
2501 unsigned, /* File handle */
2502 unsigned, /* File info data required */
2503 char far *, /* File info buffer */
2504 unsigned ); /* File info buffer size */
2505
2506
2507
2508/*** DosSetFileMode - Set File Mode
2509 *
2510 * Change the mode (attribute) of the specified file
2511 */
2512
2513extern unsigned far pascal DOSSETFILEMODE (
2514 char far *, /* File path name */
2515 unsigned, /* New attribute of file */
2516 unsigned long ); /* Reserved (must be zero) */
2517
2518
2519
2520/*** DosSetMaxFH - Set Maximum File Handles
2521 *
2522 * Defines the maximum number of file handles for the
2523 * current process
2524 */
2525
2526extern unsigned far pascal DOSSETMAXFH (
2527 unsigned ); /* Number of file handles */
2528
2529
2530
2531/*** DosSetVerify - Set/Reset Verify Switch
2532 *
2533 * Sets the verify switch
2534 */
2535
2536extern unsigned far pascal DOSSETVERIFY (
2537 unsigned ); /* New value of verify switch */
2538
2539
2540
2541/*** DosWrite - Synchronous Write to a File
2542 *
2543 * Transfers the specified number of bytes from a buffer to
2544 * the specified file, synchronously with respect to the
2545 * requesting process's execution
2546 */
2547
2548extern unsigned far pascal DOSWRITE (
2549 unsigned, /* File handle */
2550 char far *, /* Address of user buffer */
2551 unsigned, /* Buffer length */
2552 unsigned far * ); /* Bytes written */
2553
2554
2555
2556/*** DosWriteAsync - Asynchronous Write to a File
2557 *
2558 * Transfers the specified number of bytes from a buffer to
2559 * the specified file, asynchronously with respect to the
2560 * requesting process's execution
2561 */
2562
2563extern unsigned far pascal DOSWRITEASYNC (
2564 unsigned, /* File handle */
2565 unsigned long far *, /* Address of RAM semaphore */
2566 unsigned far *, /* Address of I/O error return code */
2567 char far *, /* Address of user buffer */
2568 unsigned, /* Buffer length */
2569 unsigned far * ); /* Bytes written */
2570
2571
2572
2573
2574/*** Hard Error Handling
2575 *
2576 * DosError
2577 */
2578
2579
2580
2581/*** DosError - Enable Hard Error Processing
2582 *
2583 * Allows a CP/DOS process to receive hard error notification
2584 * without generating a hard error signal. Hard errors generated
2585 * under a process which has issued a DosError call are FAILed and
2586 * the appropriate error code is returned.
2587 */
2588
2589extern unsigned far pascal DOSERROR (
2590 unsigned ); /* Action flag */
2591
2592
2593
2594/*** Machine Exception Handling
2595 *
2596 * DosSetVector
2597 */
2598
2599
2600
2601/*** DosSetVec - Establish a handler for an Exception
2602 *
2603 * Allows a process to register an address to be
2604 * called when a 286 processor exception occurs.
2605 */
2606
2607extern unsigned far pascal DOSSETVEC (
2608 unsigned, /* Exception Vector */
2609 void (far *)(void), /* Address of exception handler */
2610 void (far * far *)(void) ); /* Address to store previous handler */
2611
2612
2613
2614/*** Message Functions
2615 *
2616 * DosGetMessage
2617 * DosInsMessage
2618 * DosPutMessage
2619 */
2620
2621
2622
2623/*** DosGetMessage - Return System Message With Variable Text
2624 *
2625 * Retrieves a message from the specified system message file
2626 * and inserts variable information into the body of the message
2627 */
2628
2629extern unsigned far pascal DOSGETMESSAGE (
2630 char far * far *, /* Table of variables to insert */
2631 unsigned, /* Number of variables */
2632 char far *, /* Address of message buffer */
2633 unsigned, /* Length of buffer */
2634 unsigned, /* Number of the message */
2635 char far *, /* Message file name */
2636 unsigned far * ); /* Length of returned message */
2637
2638
2639
2640/*** DosInsMessage - Insert Variable Text into Message
2641 *
2642 * Inserts variable text string information into the body ofa message.
2643 */
2644
2645extern unsigned far pascal DOSINSMESSAGE (
2646 char far * far *, /* Table of variables to insert */
2647 unsigned, /* Number of variables */
2648 char far *, /* Address of output buffer */
2649 unsigned, /* Length of output buffer */
2650 unsigned, /* Length of message */
2651 char far *, /* Address of input string */
2652 unsigned far * ); /* Length of returned message */
2653
2654
2655
2656/*** DosPutMessage - Output Message Text to Indicated Handle
2657 *
2658 * Outputs a message in a buffer passed by a caller to the
2659 * specified handle. The function formats the buffer to
2660 * prevent words from wrapping if displayed to a screen.
2661 */
2662
2663extern unsigned far pascal DOSPUTMESSAGE (
2664 unsigned, /* Handle of output file/device */
2665 unsigned, /* Length of message buffer */
2666 char far * ); /* Message buffer */
2667
2668
2669
2670/*** RAS Services
2671 *
2672 * DosSysTrace
2673 */
2674
2675
2676
2677/*** DosSysTrace - Add a Trace record to the System Trace Buffer
2678 *
2679 * Allows a subsystem or system extension to add information to the
2680 * System trace buffer. This call can only be made from protected
2681 * mode.
2682 */
2683
2684extern unsigned far pascal DOSSYSTRACE (
2685 unsigned, /* Major trace event code (0-255) */
2686 unsigned, /* Length of area to be recorded */
2687 unsigned, /* Minor trace event code (0-FFFFH) */
2688 char far * ); /* Pointer to area to be traced */
2689
2690
2691
2692/*** Program Startup Conventions
2693 *
2694 * DosGetEnv
2695 * DosGetVersion
2696 */
2697
2698
2699
2700/*** DosGetEnv - Get the Address of Process' Environment String
2701 *
2702 * Return the address of the current process' environment string
2703 */
2704
2705extern unsigned far pascal DOSGETENV (
2706 unsigned far *, /* Address to place segment handle */
2707 unsigned far * ); /* Address for command line start */
2708
2709
2710
2711/*** DosGetVersion - Get DOS Version
2712 *
2713 * Returns the DOS version number
2714 */
2715
2716extern unsigned far pascal DOSGETVERSION (
2717 unsigned far * ); /* Address to put version number */
2718
2719
2720
2721/*** World Trade Support
2722 *
2723 * All of these functions declarations have the string NLS in a comment.
2724 * This is required in the generation of the Imports Library DOSCALLS.LIB
2725 *
2726 * DosGetCtryInfo
2727 * DosSetCtryCode
2728 * DosGetDBCSEv
2729 * DosCaseMap
2730 * DosGetSpecChar
2731 * DosCollate
2732 */
2733
2734
2735
2736/*** DosGetCtryInfo
2737 *
2738 * Returns the country dependant formatting information that
2739 * resides in the NLSCDIT.SYS World Trade Support file
2740 */
2741
2742extern unsigned far pascal DOSGETCTRYINFO ( /*<NLS>*/
2743 unsigned, /* Length of data area provided */
2744 unsigned long far *, /* Country code */
2745 char far *, /* Memory buffer */
2746 unsigned far * ); /* Length of returned data */
2747
2748
2749
2750/*** DosSetCrtyCode
2751 *
2752 * Sets the current country code for the system
2753 */
2754
2755extern unsigned far pascal DOSSETCTRYCODE ( /*<NLS>*/
2756 unsigned long far * ); /* Country code */
2757
2758
2759
2760/*** DosGetDBCSEv - Get the DBCS Environment Vector
2761 *
2762 * Used to obtain the DBCS environmental vector that resides in
2763 * the NLSDBCS.SYS World Trade Support file.
2764 */
2765
2766extern unsigned far pascal DOSGETDBCSEV ( /*<NLS>*/
2767 unsigned, /* Length of data area provided */
2768 unsigned long far *, /* Country code */
2769 char far * ); /* Pointer to data area */
2770
2771
2772
2773/*** DosCaseMap
2774 *
2775 * Used to perform case mapping on a string of binary values which
2776 * represent ASCII characters.
2777 */
2778
2779extern unsigned far pascal DOSCASEMAP ( /*<NLS>*/
2780 unsigned, /* Length of string to case map */
2781 unsigned long far *, /* Country code */
2782 char far * ); /* Address of string of binary values */
2783
2784
2785
2786/*** DosGetSpecChar
2787 *
2788 * Gets a list of special characters that are valid in file names, etc.
2789 * The list corresponds to the byte values 128-255.
2790 */
2791
2792extern unsigned far pascal DOSGETSPECCHAR ( /*<NLS>*/
2793 unsigned, /* Length of data area provided */
2794 unsigned long far *, /* Country Code */
2795 unsigned char far * ); /* Data area */
2796
2797
2798
2799/*** DosCollate
2800 *
2801 * Undocumented NLS feature
2802 */
2803
2804extern unsigned far pascal DOSCOLLATE ( /*<NLS>*/
2805 unsigned, /* Buffer Length */
2806 unsigned long far *, /* Country Code */
2807 char far * ); /* Buffer Address */
2808
2809
2810
2811/* End of File */
diff --git a/v4.0/src/CMD/FDISK/D_MENUS.C b/v4.0/src/CMD/FDISK/D_MENUS.C
new file mode 100644
index 0000000..3ebfff9
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/D_MENUS.C
@@ -0,0 +1,941 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "extern.h" /* AN000 */
5#include "subtype.h" /* AN000 */
6#include "fdiskmsg.h" /* AN000 */
7#include "string.h" /* AN000 */
8#include "ctype.h" /* AN000 */
9#include "stdio.h" /* AN000 */
10
11/* */
12/******************* START OF SPECIFICATIONS *******************/
13/* */
14/* SUBROUTINE NAME: DELETE_PARTITION */
15/* */
16/* DESCRIPTIVE NAME: Delete partition selection menu */
17/* */
18/* FUNCTION: User is prompted as to what type of DOS partition */
19/* he wishes to delete. */
20/* */
21/* NOTES: The delete volume option is only displayed if some */
22/* disk volumes exist */
23/* */
24/* The following screen is managed */
25/* */
26/* ³0000000000111111111122222222223333333333³ */
27/* ³0123456789012345678901234567890123456789³ */
28/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
29/* 00³ ³ */
30/* 01³ ³ */
31/* 02³ ³ */
32/* 03³ ³ */
33/* 04³Delete DOS Partition ³ */
34/* 05³ ³ */
35/* 06³Current Fixed Disk Drive: # ³ */
36/* 07³ ³ */
37/* 08³Enter the type of DOS partition you ³ */
38/* 09³wish to delete..............? ³ */
39/* 10³ ³ */
40/* 11³ 1. Normal DOS partition ³ */
41/* 12³ 2. EXTENDED DOS Partition ³ */
42/* 13³ 3. Disk volume in the EXTENDED ³ */
43/* 14³ DOS Partition ³ */
44/* 15³ ³ */
45/* 16³ ³ */
46/* 17³ ³ */
47/* 18³Enter choice: [#] ³ */
48/* 19³ ³ */
49/* 20³ ³ */
50/* 21³ ³ */
51/* 22³ ³ */
52/* 23³Press ESC to return to FDISK Options ³ */
53/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
54/* */
55/* ENTRY POINTS: Delete_Partition */
56/* LINKAGE: delete_partition() */
57/* NEAR CALL */
58/* */
59/* INPUT: None */
60/* */
61/* EXIT-NORMAL: ERROR=FALSE */
62/* */
63/* EXIT-ERROR: ERROR=TRUE */
64/* GOTO internal_program_error if case statement */
65/* failure when branching to requested function */
66/* */
67/* EFFECTS: No data directly modified by this routine, but */
68/* child routines will modify data. */
69/* */
70/* INTERNAL REFERENCES: */
71/* ROUTINES: */
72/* clear_screen */
73/* wait_for_ESC */
74/* get_num_input */
75/* internal_program_error */
76/* dos_delete */
77/* ext_delete */
78/* vol_delete */
79/* */
80/* EXTERNAL REFERENCES: */
81/* ROUTINES: */
82/* */
83/******************** END OF SPECIFICATIONS ********************/
84
85/* */
86void delete_partition()
87
88BEGIN
89
90 unsigned i;
91 char input;
92 char temp;
93 char max_input;
94
95
96 input = c(NUL); /* AC000 */
97 /* clear_screen */
98 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
99
100 /* Display header */
101 display(menu_25);
102
103 /* Setup and print current disk */
104 insert[0] = cur_disk+1+'0';
105 display(menu_5);
106
107 /* print ESC prompt */
108 display(menu_11);
109
110 /* check to see if there is an avail partition */
111 temp = c(0); /* AC000 */
112 for (i = u(0); i < u(4);i++) /* AC000 */
113 BEGIN
114
115 /* See if any non - zero system id bytes */
116 temp = temp | part_table[cur_disk][i].sys_id ;
117 END
118 /* Any entry that isn't zero means */
119 if (temp != c(0)) /* AC000 */
120 BEGIN
121 /* ############# ADD CODE HERE FOR THIS FUNCTION ############## */
122 /* Do something about defaults and highlighting */
123 /* */
124 /* ############################################################ */
125
126 /* Display enter prompts */
127 /* display dos delete menu without input prompt */
128 display(menu_3);
129 display(menu_25);
130 display(menu_26);
131 display(menu_7);
132
133 display(menu_27); /* AC000 */
134 max_input = c(3); /* AC000 */
135
136 input = get_num_input(c(NUL),max_input,input_row,input_col); /* AC000 */
137 /* Go branch to the requested function */
138 switch(input)
139 BEGIN
140 case '1':
141 if (find_partition_type(uc(DOS12)) || /* AN016 AC016 */
142 find_partition_type(uc(DOS16)) || /* AN016 AC016 */
143 find_partition_type(uc(DOSNEW))) /* AN016 AC016 */
144 dos_delete();
145 else /* AN000 */
146 BEGIN /* AN000 */
147 /* No Pri partition to delete */
148 clear_screen(u(17),u(0),u(17),u(79)); /* AN000 */
149 display(error_6); /* AN000 */
150 wait_for_ESC(); /* AN000 */
151 END /* AN000 */
152 break;
153
154 case '2':
155 if (find_partition_type(uc(EXTENDED))) /* AN000 */
156 ext_delete();
157 else /* AN000 */
158 BEGIN /* AN000 */
159 /* No Ext partition to delete */
160 clear_screen(u(17),u(0),u(17),u(79)); /* AN000 */
161 display(error_7); /* AN000 */
162 wait_for_ESC(); /* AN000 */
163 END /* AN000 */
164 break;
165
166 case '3':
167 if ((find_partition_type(uc(EXTENDED))) && (find_logical_drive())) /* AC000 */
168 volume_delete();
169 else
170 BEGIN
171 clear_screen(u(17),u(0),u(17),u(79)); /* AN000 */
172 display(error_36); /* AN000 */
173 wait_for_ESC(); /* AN000 */
174 END /* AN000 */
175 break;
176
177 case ESC: break;
178
179 default : internal_program_error();
180 break;
181 END
182 END
183 else
184 BEGIN
185 display(error_14);
186 wait_for_ESC();
187 END
188 /* clear the screen before going back to main menu */
189 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
190 return;
191END
192
193
194/* */
195/******************* START OF SPECIFICATIONS *******************/
196/* */
197/* SUBROUTINE NAME: DOS_DELETE */
198/* */
199/* DESCRIPTIVE NAME: Delete DOS partition */
200/* */
201/* FUNCTION: Delete the DOS partition. Prompt user with dire */
202/* warning first. Default entry on prompt is (N) */
203/* */
204/* NOTES: Screen can be exited via the ESC command before */
205/* partition is deleted and nothing will change */
206/* */
207/* The following screen is managed */
208/* */
209/* ³0000000000111111111122222222223333333333³ */
210/* ³0123456789012345678901234567890123456789³ */
211/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
212/* 00³ ³ */
213/* 01³ ³ */
214/* 02³ ³ */
215/* 03³ ³ */
216/* 04³Delete DOS Partition ³ */
217/* 05³ ³ */
218/* 06³Current Fixed Disk Drive: # ³ */
219/* 07³ ³ */
220/* 08³Partition Status Type Start End Size³ */
221/* 09³ # # ####### #### #### ####³ */
222/* 10³ ³ */
223/* 11³ ³ */
224/* 12³ ³ */
225/* 13³ ³ */
226/* 14³Total disk space is #### cylinders. ³ */
227/* 15³ ³ */
228/* 16³ ³ */
229/* 17³ ³ */
230/* 18³Warning! Data in the DOS partition ³ */
231/* 19³will be lost. Do you wish to ³ */
232/* 20³continue..........................? [N] ³ */
233/* 21³ ³ */
234/* 22³ ³ */
235/* 23³Press ESC to return to FDISK Options ³ */
236/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
237/* */
238/* ENTRY POINTS: DOS_Delete */
239/* LINKAGE: dos_delete */
240/* NEAR CALL */
241/* */
242/* INPUT: None */
243/* */
244/* EXIT-NORMAL: ERROR=FALSE */
245/* */
246/* EXIT-ERROR: ERROR=TRUE */
247/* GOTO internal_program_error if invalid input */
248/* returned to this level */
249/* */
250/* EFFECTS: No data directly modified by this routine, but */
251/* child routines will modify data. */
252/* */
253/* INTERNAL REFERENCES: */
254/* ROUTINES */
255/* table_display */
256/* clear_screen */
257/* wait_for_ESC */
258/* get_yn_input */
259/* display */
260/* Write_Boot_Record */
261/* find_part_free_space */
262/* */
263/* EXTERNAL REFERENCES: */
264/* ROUTINES: */
265/* */
266/******************** END OF SPECIFICATIONS ********************/
267
268/* */
269void dos_delete()
270
271BEGIN
272
273 char input;
274 unsigned i;
275
276
277 input = c(NUL); /* AC000 */
278 /* clear screen */
279 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
280
281 /* Display header */
282 display(menu_28);
283
284 /* Setup and print current disk */
285 insert[0] = cur_disk+1+'0';
286 display(menu_5);
287
288 /* print ESC prompt */
289 display(menu_11);
290
291 /* Display partition data and double check if partition exists*/
292 if (table_display())
293 BEGIN
294
295 sprintf(insert,"%4.0d",total_mbytes[cur_disk]);
296 display(menu_15);
297
298 /* See if drive 1 and extended partition exists */
299
300 if (!(find_partition_type(uc(EXTENDED)) && (cur_disk == c(0)))) /* AC000 */
301 BEGIN
302
303 /* Nope, we can keep going */
304 /* Display Y/N prompt */
305 display(menu_29);
306
307 /* Get yes/no prompt */
308 input = get_yn_input(c(No),input_row,input_col); /* AC000 AC011 */
309 switch(input)
310 BEGIN
311 case 1: /* AC000 */
312 BEGIN
313 for (i=u(0); i < u(4); i++) /* AC000 */
314 BEGIN
315
316 if ( (part_table[cur_disk][i].sys_id==uc(DOS12)) ||
317 (part_table[cur_disk][i].sys_id==uc(DOS16)) ||
318 (part_table[cur_disk][i].sys_id==uc(DOSNEW)) ) /* AC000 */
319
320 BEGIN
321 /* Set Partition entry to zero */
322 part_table[cur_disk][i].boot_ind = uc(0); /* AC000 */
323 part_table[cur_disk][i].start_head = uc(0); /* AC000 */
324 part_table[cur_disk][i].start_sector = uc(0); /* AC000 */
325 part_table[cur_disk][i].start_cyl = u(0); /* AC000 */
326 part_table[cur_disk][i].sys_id = uc(0); /* AC000 */
327 part_table[cur_disk][i].end_head = uc(0); /* AC000 */
328 part_table[cur_disk][i].end_sector = uc(0); /* AC000 */
329 part_table[cur_disk][i].end_cyl = u(0); /* AC000 */
330 part_table[cur_disk][i].rel_sec = ul(0); /* AC000 */
331 part_table[cur_disk][i].num_sec = ul(0); /* AC000 */
332 part_table[cur_disk][i].changed = (FLAG)TRUE; /* AC000 */
333 part_table[cur_disk][i].mbytes_used = f(0); /* AN000 */
334 part_table[cur_disk][i].percent_used = u(0); /* AN000 */
335
336 strcpy(part_table[cur_disk][i].system,c(NUL)); /* AN000 */
337 strcpy(part_table[cur_disk][i].vol_label,c(NUL)); /* AN000 */
338
339 /* Redisplay the partition info */
340 table_display();
341
342 /* clear the prompt off */
343 clear_screen(u(16),u(0),u(23),u(79)); /* AC000 */
344
345 /* Set the reboot flag */
346 reboot_flag = (FLAG)TRUE; /* AC000 */
347
348 /* Say that you deleted it */
349 display(status_1);
350
351 wait_for_ESC();
352 break;
353 END
354 END
355 END
356 break;
357
358 case 0: break; /* AC000 */
359
360 case ESC: break;
361
362 default:
363 BEGIN
364 internal_program_error();
365 break;
366 END
367 END
368 END
369 else
370 BEGIN
371 /* Tell user he can't do it while extended exists on drive 1 */
372 display(error_32);
373 wait_for_ESC();
374 END
375 END
376
377 else
378 BEGIN
379 internal_program_error();
380 END
381 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
382 return;
383END
384
385
386/* */
387/******************* START OF SPECIFICATIONS *******************/
388/* */
389/* SUBROUTINE NAME: EXT_DELETE */
390/* */
391/* DESCRIPTIVE NAME: Delete EXTENDED DOS partition */
392/* */
393/* FUNCTION: Delete the EXTENDED DOS partition. Prompt with */
394/* warning first. Default entry on prompt is (N) */
395/* */
396/* NOTES: Screen can be exited via the ESC command before */
397/* partition is deleted and nothing will change */
398/* */
399/* The following screen is managed */
400/* */
401/* ³0000000000111111111122222222223333333333³ */
402/* ³0123456789012345678901234567890123456789³ */
403/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
404/* 00³ ³ */
405/* 01³ ³ */
406/* 02³ ³ */
407/* 03³ ³ */
408/* 04³Delete EXTENDED DOS Partition ³ */
409/* 05³ ³ */
410/* 06³Current Fixed Disk Drive: # ³ */
411/* 07³ ³ */
412/* 08³Partition Status Type Start End Size³ */
413/* 09³ # # ####### #### #### ####³ */
414/* 10³ ³ */
415/* 11³ ³ */
416/* 12³ ³ */
417/* 13³ ³ */
418/* 14³Total disk space is #### cylinders. ³ */
419/* 15³ ³ */
420/* 16³ ³ */
421/* 17³ ³ */
422/* 18³Warning! Data in the EXTENDED DOS ³ */
423/* 19³partition will be lost. Do you wish ³ */
424/* 20³to continue.......................? [N] ³ */
425/* 21³ ³ */
426/* 22³ ³ */
427/* 23³Press ESC to return to FDISK Options ³ */
428/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
429/* */
430/* ENTRY POINTS: Ext_Delete */
431/* LINKAGE: ext_delete () */
432/* NEAR CALL */
433/* */
434/* INPUT: None */
435/* */
436/* EXIT-NORMAL: ERROR=FALSE */
437/* */
438/* EXIT-ERROR: ERROR=TRUE */
439/* GOTO internal_program_error if invalid input */
440/* returned to this routine */
441/* */
442/* EFFECTS: No data directly modified by this routine, but */
443/* child routines will modify data. */
444/* */
445/* INTERNAL REFERENCES: */
446/* ROUTINES: */
447/* table_display */
448/* clear_screen */
449/* wait_for_ESC */
450/* get_yn_input */
451/* display */
452/* Write_Boot_Record */
453/* Internal_Program_Error */
454/* Find_Free_Space */
455/* */
456/* EXTERNAL REFERENCES: */
457/* ROUTINES: */
458/* */
459/******************** END OF SPECIFICATIONS ********************/
460
461/* */
462void ext_delete()
463
464
465BEGIN
466
467 char input;
468 unsigned i;
469 unsigned j; /* AN000 */
470
471
472 input = c(NUL); /* AC000 */
473 /* Clear the screen */
474 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
475
476 /* Display header */
477 display(menu_30);
478
479 /* Setup and print current disk */
480 insert[0] = cur_disk+1+'0';
481 display(menu_5);
482
483 /* print ESC prompt */
484 display(menu_11);
485
486 /* Display partition data and double check if partition exists*/
487 table_display(); /* AC000 */
488 sprintf(insert,"%4.0d",total_mbytes[cur_disk]);
489 display(menu_15);
490
491 BEGIN
492 /* See if there are still volumes */
493 if (!find_logical_drive())
494 BEGIN
495 /* Display Y/N prompt */
496 display(menu_31);
497
498 /* Get yes/no prompt */
499 input = get_yn_input(c(No),input_row,input_col); /* AC000 AC011 */
500 switch(input)
501 BEGIN
502 case 1: /* AC000 */
503 BEGIN
504 for (i=u(0); i < u(4); i++) /* AC000 */
505 /* Note: This will delete all occurances of EXTENDED DOS partitions found */
506 BEGIN
507 if (part_table[cur_disk][i].sys_id == uc(EXTENDED)) /* AC000 */
508 BEGIN
509 /* Set Partition entry to zero */
510 part_table[cur_disk][i].boot_ind = uc(0); /* AC000 */
511 part_table[cur_disk][i].start_head = uc(0); /* AC000 */
512 part_table[cur_disk][i].start_sector = uc(0); /* AC000 */
513 part_table[cur_disk][i].start_cyl = u(0); /* AC000 */
514 part_table[cur_disk][i].sys_id = uc(0); /* AC000 */
515 part_table[cur_disk][i].end_head = uc(0); /* AC000 */
516 part_table[cur_disk][i].end_sector = uc(0); /* AC000 */
517 part_table[cur_disk][i].end_cyl = u(0); /* AC000 */
518 part_table[cur_disk][i].rel_sec = ul(0); /* AC000 */
519 part_table[cur_disk][i].num_sec = ul(0); /* AC000 */
520 part_table[cur_disk][i].changed = (FLAG)TRUE; /* AC000 */
521 part_table[cur_disk][i].mbytes_used = f(0); /* AN000 */
522 part_table[cur_disk][i].percent_used = u(0); /* AN000 */
523
524 strcpy(part_table[cur_disk][i].system,c(NUL)); /* AN000 */
525 strcpy(part_table[cur_disk][i].vol_label,c(NUL)); /* AN000 */
526
527 /* Redisplay the partition info */
528 table_display();
529
530 /* clear the prompt off */
531 clear_screen(u(17),u(0),u(23),u(79)); /* AC000 */
532
533 /* Say that you deleted it */
534 display(status_2);
535
536 /* Set the reboot flag */
537 reboot_flag = (FLAG)TRUE; /* AC000 */
538 END
539 END
540 wait_for_ESC();
541 break;
542 END
543
544 case 0: break; /* AC000 */
545
546 case ESC: break;
547
548 default: internal_program_error();
549 break;
550 END
551 END
552 else
553 BEGIN
554 /* Logical drives still exist, can't delete partition */
555 display(error_21);
556 wait_for_ESC();
557 END
558 END
559 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
560 return;
561END
562
563
564/* */
565/******************* START OF SPECIFICATIONS *******************/
566/* */
567/* SUBROUTINE NAME: VOL_DELETE */
568/* */
569/* DESCRIPTIVE NAME: Delete DOS disk Volume */
570/* */
571/* FUNCTION: Prompts user to delete a DOS disk volume */
572/* */
573/* NOTES: Screen can be exited via the ESC command before */
574/* partition is deleted and nothing will change */
575/* */
576/* The following screen is managed */
577/* */
578/* ³0000000000111111111122222222223333333333³ */
579/* ³0123456789012345678901234567890123456789³ */
580/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
581/* 00³Delete DOS Disk Volume ³ */
582/* 01³ ³ */
583/* 02³Vol Start End Size ³ */
584/* 03³ # #### #### #### ³ */
585/* 04³ ³ */
586/* 05³ ³ */
587/* 06³ ³ */
588/* 07³ ³ */
589/* 08³ ³ */
590/* 09³ ³ */
591/* 10³ ³ */
592/* 11³ ³ */
593/* 12³ ³ */
594/* 13³ ³ */
595/* 14³ ³ */
596/* 15³ ³ */
597/* 16³Total partition size is #### cylinders. ³ */
598/* 17³ ³ */
599/* 18³Warning! Data in the DOS disk volume ³ */
600/* 19³will be lost. What volume do you wish ³ */
601/* 20³to delete.........................? [#] ³ */
602/* 21³ ³ */
603/* 22³Are you sure......................? [N] ³ */
604/* 23³Press ESC to return to FDISK Options ³ */
605/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
606/* */
607/* ENTRY POINTS: Vol_Delete */
608/* LINKAGE: vol_delete () */
609/* NEAR CALL */
610/* */
611/* INPUT: None */
612/* */
613/* EXIT-NORMAL: ERROR=FALSE */
614/* */
615/* EXIT-ERROR: ERROR=TRUE */
616/* GOTO internal_program_error if invalid input */
617/* returned to this routine */
618/* */
619/* EFFECTS: No data directly modified by this routine, but */
620/* child routines will modify data. */
621/* */
622/* INTERNAL REFERENCES: */
623/* ROUTINES: */
624/* clear_screen */
625/* display */
626/* volume_display */
627/* get_num_input */
628/* wait_for_ESC */
629/* get_yn_input */
630/* Write_Boot_Record */
631/* Find_Free_Space */
632/* Internal_Program_Error */
633/* */
634/* EXTERNAL REFERENCES: */
635/* ROUTINES: */
636/* */
637/******************** END OF SPECIFICATIONS ********************/
638
639/* */
640void volume_delete()
641
642BEGIN
643
644 char input;
645 char drive_input;
646 char high_drive;
647 char low_drive;
648 char error_low_drive;
649 char error_high_drive;
650 char drives_reassigned;
651 int list_index;
652 int i;
653 int j; /* AN011 */
654 int point;
655 FLAG delete_drive;
656 unsigned char drive_list[23][2];
657 int column;
658 int row;
659 FLAG drives_exist;
660 FLAG vol_matches;
661 char temp;
662 unsigned char drive_temp;
663 char far *s;
664 unsigned char string_input[12]; /* AN000 */
665
666 input = c(NUL);
667 string_input[0] = uc(NUL); /* AN000 */
668
669 /* Clear screen */
670 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
671
672 /* Display header */
673 display(menu_32);
674
675 /* print ESC prompt */
676 display(menu_11);
677
678 /* Display logical drives and get the highest drive letter assigned*/
679 high_drive = volume_display();
680
681 /* Get the first avail drive letter to be deleted */
682 low_drive = (high_drive - get_num_logical_dos_drives()+1);
683 temp = low_drive;
684
685 /* Initialize array of drive letters that exist at this point */
686 for (i=(int)0; i < (int)23; i++) /* AC000 */
687 BEGIN
688 /* See if we've exceeded the drive letter range */
689 if (temp <= high_drive)
690 BEGIN
691 /* Put in drive letter */
692 drive_list[i][0] = ((unsigned char)(temp));
693 /* Initialize the offsets into the array to something harmless */
694 drive_list[i][1] = uc(INVALID); /* AC000 */
695 END
696 else
697 BEGIN
698 /* No drive there, put in NUL */
699 drive_list[i][0] = uc(NUL); /* AC000 */
700 drive_list[i][1] = uc(INVALID); /* AC000 */
701 END
702
703 /* Check for next drive */
704 temp++;
705 END
706
707 /* Set up partition size message */
708 sprintf(insert,"%4.0d",get_partition_size( uc(EXTENDED) ) );
709 display(menu_21);
710
711 /* Assume no drives deleted */
712 drives_reassigned = (FLAG)FALSE; /* AC000 */
713
714 /* Loop until ESC or all deleted */
715 while (input != c(ESC)) /* AC000 */
716 BEGIN
717
718 /* Are there any drives left?*/
719 drives_exist = (FLAG)FALSE; /* AC000 */
720 error_low_drive = ((char)(NUL));
721 error_high_drive = ((char)(NUL));
722
723 for (i=(int)0;i < (int)23; i++) /* AC000 */
724 BEGIN
725 drive_temp = drive_list[i][0];
726 if ((drive_temp != uc(NUL)) && (drive_list[i][1] != uc(DELETED))) /* AC011 */
727 BEGIN
728 drives_exist = (FLAG)TRUE; /* AC000 */
729
730 /* Find last existing drive letter */
731 error_high_drive = ((char)(drive_temp));
732
733 /* See if we've found the first drive yet */
734 if (error_low_drive == ((char)(NUL)))
735 error_low_drive = ((char)(drive_temp));
736 END
737 END
738
739 /* If there are drives, go let user try to delete them */
740 if (drives_exist)
741 BEGIN
742
743 /* Get input until given a correct drive */
744 valid_input = (FLAG)FALSE; /* AC000 */
745 while ( (!valid_input) && (input != c(ESC)) )
746 BEGIN
747
748 /* Prompt for input */
749 display(menu_33);
750
751 /* Get input between first and highest drive letters */
752 clear_screen( u(21), u(0), u(21), u(79) );
753 input = get_alpha_input(low_drive,high_drive,input_row,input_col,error_low_drive,error_high_drive);
754 drive_input = input;
755
756 /* See if it has been deleted already or ESC pressed */
757 drives_exist = FALSE;
758 for (i=(int)0;i < (int)23; i++) /* AC000 */
759 BEGIN
760 if (drive_list[i][0] == ((unsigned char)(drive_input)) &&
761 (drive_list[i][1] != ((unsigned char) DELETED))) /* AC013 */
762 BEGIN
763 drives_exist = TRUE;
764 list_index = i;
765 END
766 if (ext_table[cur_disk][i].drive_letter == c(drive_input) )
767 point = i;
768 END
769 END
770
771 /* Input volume string to confirm delete */
772 vol_matches = FALSE;
773 if (input != c(ESC))
774 BEGIN
775 if (drives_exist)
776 BEGIN
777 /* delete privious volume mismatch message */
778 string_input[0] = uc(NUL); /* AN000 */
779 clear_screen( u(22), u(0), u(23), u(79) );
780 /* Get input volume label */
781 display(menu_41); /* AN000 */
782 get_string_input(input_row,input_col,string_input); /* AN000 */
783 if (string_input[0] == uc(ESC)) input = c(ESC);
784
785 /* See if the volume id matches the selected drive */ /* AN000 */
786 if (strcmp(ext_table[cur_disk][point].vol_label,string_input) == (int)ZERO)
787 vol_matches = TRUE; /* AN000 */
788 else if (input != c(ESC)) display(error_34);
789 END
790 else
791 BEGIN
792 /* Tell user the drive has already been deleted */
793 insert[0] = dos_upper(drive_input); /* AC000 */
794 insert[1] = c(DRIVE_INDICATOR); /* AC000 */
795 clear_screen( u(21), u(0), u(22), u(79) ); /* AN000 */
796 display(error_29);
797 END
798
799 END
800
801 /* If it is a valid drive indicate that the input was ok */
802 if ( (input != c(ESC)) && (drives_exist) && (vol_matches) ) /* AC000 */
803 BEGIN
804 valid_input = TRUE;
805
806 /* At this point we have a valid drive letter to delete */
807
808 /* Get the offset into the array for the drive to be deleted */
809 delete_drive = find_ext_drive(drive_input - low_drive);
810
811 /* Got a drive letter - prompt are you sure */
812 display(menu_34);
813
814 /* Get Y/N input, default is NO */
815 input = get_yn_input(c(No),input_row,input_col); /* AC000 AC011 */
816
817 /* Clear everything out on screen in prompt area */
818 clear_screen(u(23),u(0),u(23),u(79)); /* AC000 */
819
820 /* Go handle the delete */
821 switch(input)
822 BEGIN
823 case 1: /* AC000 */
824 BEGIN
825 /* Go ahead and mark it deleted in list array */
826
827 /* Throw up a flag to indicate we need to delete this one for real later */
828 /* This is because if we change the ext_table array now, we lose the ability */
829 /* to match up drive letters with locations, or at least it become more */
830 /* complicated than I felt like figuring out, so mark it now and do it later */
831 drive_list[list_index][1] = (unsigned char)DELETED; /* AC011 */
832
833 drives_reassigned = TRUE;
834
835 /* Put prompt up on screen */
836 for (i=(int)0; i < (int)23; i++) /* AC000 */
837 BEGIN
838 /* See if drive deleted */
839 if (drive_list[i][1] == uc(DELETED)) /* AC011 */
840 BEGIN
841 /* Wipe out the drive info and print deleted message */
842 /* See what column it is in */
843 if (i < (int)12) /* AC000 */
844 BEGIN
845 column = (int)4; /* AC000 */
846 row = (int)(4 + i - (int)0);
847 clear_screen( (unsigned)row, (unsigned)column,
848 (unsigned)row, (unsigned)39 );
849 END
850 else
851 BEGIN
852 column = (int)45; /* AC000 */
853 row = (int)(4 + i - (int)12);
854 clear_screen( (unsigned)row, (unsigned)column,
855 (unsigned)row, (unsigned)79 );
856 END
857
858 /* Put the start row,col of message in the message string */
859 s=status_3;
860 s++;
861 *s++ = ((char)(row/10))+'0';
862 *s++ = ((char)(row%10))+'0';
863 *s++ = ((char)(column/10))+'0';
864 *s = ((char)(column%10))+'0';
865 display(status_3);
866 END
867 END
868 /* Set the reboot flag */
869 reboot_flag = TRUE;
870 clear_screen( u(21), u(0), u(23), u(79) ); /* AN000 */
871 break;
872 END
873
874 case ESC:
875 case 0:
876 clear_screen( u(21), u(0), u(23), u(79) ); /* AN000 */
877 break; /* AC000 */
878
879 default:
880 internal_program_error();
881 break;
882 END
883 END
884
885 END
886 else /* drives do not exist! */
887 BEGIN
888 /* No more logical drives to delete */
889 clear_screen(u(16),u(0),u(21),u(79)); /* AC000 */
890 display(error_22);
891 input = wait_for_ESC();
892 END
893 END /* while input != esc */
894
895 if (drives_reassigned)
896 BEGIN
897 /* If anything got deleted, lets go do it for real */
898 for (i=(int)0; i < (int)23;i++) /* AC000 */
899 BEGIN
900 if (drive_list[i][1] == uc(DELETED)) /* AC011 */
901 BEGIN /* AN011 */
902 for (j=(int)0; j < (int)23;j++) /* AN011 */
903 BEGIN /* AN011 */
904 if (drive_list[i][0] == ext_table[cur_disk][j].drive_letter) /* AN011 */
905 BEGIN
906 /* Zero sys id and show it changed */
907 ext_table[cur_disk][j].boot_ind = uc(0); /* AC000 */
908 ext_table[cur_disk][j].start_head = uc(0); /* AC000 */
909 ext_table[cur_disk][j].start_sector = uc(0); /* AC000 */
910 ext_table[cur_disk][j].start_cyl = u(0); /* AC000 */
911 ext_table[cur_disk][j].sys_id = uc(0); /* AC000 */
912 ext_table[cur_disk][j].end_head = uc(0); /* AC000 */
913 ext_table[cur_disk][j].end_sector = uc(0); /* AC000 */
914 ext_table[cur_disk][j].end_cyl = u(0); /* AC000 */
915 ext_table[cur_disk][j].rel_sec = ul(0); /* AC000 */
916 ext_table[cur_disk][j].num_sec = ul(0); /* AC000 */
917 ext_table[cur_disk][j].mbytes_used = f(0); /* AN000 */
918 ext_table[cur_disk][j].percent_used = u(0); /* AN000 */
919 ext_table[cur_disk][j].changed = TRUE; /* AN000 */
920 ext_table[cur_disk][j].drive_letter = NUL; /* AN000 */
921 strcpy(ext_table[cur_disk][j].system,c(NUL)); /* AN000 */
922 strcpy(ext_table[cur_disk][j].vol_label,c(NUL)); /* AN000 */
923 END /* AN011 */
924 END /* AN011 */
925 END
926 END
927
928 /* Show new drive letters */
929 volume_display();
930
931 /* Say that drive letters changed */
932 clear_screen(u(16),u(0),u(23),u(79)); /* AC000 */
933 display(status_10);
934 wait_for_ESC();
935 END
936 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
937
938 return;
939
940END
941
diff --git a/v4.0/src/CMD/FDISK/EXTERN.H b/v4.0/src/CMD/FDISK/EXTERN.H
new file mode 100644
index 0000000..6975f67
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/EXTERN.H
@@ -0,0 +1,82 @@
1
2/* */
3/* */
4/****************************************************************************/
5/* Declare Global variables */
6/****************************************************************************/
7/* */
8
9
10
11extern char cur_disk;
12extern FLAG good_disk[2];
13extern unsigned char number_of_drives;
14extern FLAG reboot_flag;
15extern char errorlevel;
16extern char max_partition_size;
17extern char sort[24];
18extern FLAG no_fatal_error; /* AC000 */
19extern char valid_input;
20extern unsigned char video_mode;
21extern unsigned char display_page;
22extern unsigned char video_attribute; /* AN006 */
23
24extern unsigned total_disk[2]; /* AN000 */
25extern XFLOAT total_mbytes[2]; /* AN000 */
26extern unsigned char max_sector[2];
27extern unsigned max_head[2]; /* AC004 */
28extern unsigned required_cyls[2];
29
30extern unsigned input_row;
31extern unsigned input_col;
32extern char insert[800]; /* AC000 */
33extern char *pinsert;
34
35extern unsigned char master_boot_record[2][512];
36extern unsigned char boot_record[512];
37
38extern char next_letter; /* AN000 */
39extern FLAG primary_flag; /* AN000 */
40extern FLAG extended_flag; /* AN000 */
41extern FLAG logical_flag; /* AN000 */
42extern FLAG disk_flag; /* AN000 */
43extern FLAG quiet_flag; /* AN000 */
44extern unsigned primary_buff; /* AN000 */
45extern unsigned extended_buff; /* AN000 */
46extern unsigned logical_buff; /* AN000 */
47extern char cur_disk_buff; /* AN000 */
48extern unsigned long NOVAL; /* AN000 */
49extern char next_letter; /* AN000 */
50extern FLAG PercentFlag; /* AN000 */
51
52extern FLAG mono_flag; /* AN006 */
53
54extern char Yes; /* AN012 */
55extern char No; /* AN012 */
56
57extern unsigned Parse_Ptr; /* AN010 */
58/* */
59/* */
60/****************************************************************************/
61/* Define Global structures */
62/****************************************************************************/
63/* */
64
65extern struct entry part_table[2][4];
66extern struct entry ext_table[2][24];
67extern struct freespace free_space[24];
68extern struct KeyData *input_data;
69extern struct dx_buffer_ioctl dx_buff; /* AN000 */
70extern struct SREGS segregs;
71extern struct subst_list sublist; /* AN000 */
72extern struct diskaccess disk_access; /* AN002 */
73extern struct sublistx sublistp[1]; /* AN010 */
74
75/* */
76/****************************************************************************/
77/* Define UNIONS */
78/****************************************************************************/
79/* */
80
81extern union REGS regs;
82
diff --git a/v4.0/src/CMD/FDISK/FDBOOT.ASM b/v4.0/src/CMD/FDISK/FDBOOT.ASM
new file mode 100644
index 0000000..4d6aaf0
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/FDBOOT.ASM
@@ -0,0 +1,119 @@
1; BOOT - IBM hard disk boot record 6/8/82
2;
3;
4; This is the standard boot record that will be shipped on all hard disks. It contains:
5;
6; 1. Code to load (and give control to) the boot record for 1 of 4 possible
7; operating systems.
8;
9; 2. A partition table at the end of the boot record, followed by the required signature.
10;
11;
12_data segment public
13 assume cs:_data,ds:_data
14
15 org 600h
16
17 cli ;no interrupts for now
18 xor ax,ax
19 mov ss,ax
20 mov sp,7c00h ;new stack at 0:7c00
21 mov si,sp ;where this boot record starts - 0:7c00
22 push ax
23 pop es ;seg regs the same
24 push ax
25 pop ds
26 sti ;interrupts ok now
27 cld
28 mov di,0600h ;where to relocate this boot record to
29 mov cx,100h
30 repnz movsw ;relocate to 0:0600
31; jmp entry2
32 db 0eah
33 dw $+4,0
34entry2:
35 mov si,offset tab ;partition table
36 mov bl,4 ;number of table entries
37next:
38 cmp byte ptr[si],80h ;is this a bootable entry?
39 je boot ;yes
40 cmp byte ptr[si],0 ;no, is boot indicator zero?
41 jne bad ;no, it must be x"00" or x"80" to be valid
42 add si,16 ;yes, go to next entry
43 dec bl
44 jnz next
45 int 18h ;no bootable entries - go to rom basic
46boot:
47 mov dx,[si] ;head and drive to boot from
48 mov cx,[si+2] ;cyl, sector to boot from
49 mov bp,si ;save table entry address to pass to partition boot record
50next1:
51 add si,16 ;next table entry
52 dec bl ;# entries left
53 jz tabok ;all entries look ok
54 cmp byte ptr[si],0 ;all remaining entries should begin with zero
55 je next1 ;this one is ok
56bad:
57 mov si,offset m1 ;oops - found a non-zero entry - the table is bad
58msg:
59 lodsb ;get a message character
60 cmp al,0
61 je hold
62 push si
63 mov bx,7
64 mov ah,14
65 int 10h ;and display it
66 pop si
67 jmp msg ;do the entire message
68;
69hold: jmp hold ;spin here - nothing more to do
70tabok:
71 mov di,5 ;retry count
72rdboot:
73 mov bx,7c00h ;where to read system boot record
74 mov ax,0201h ;read 1 sector
75 push di
76 int 13h ;get the boot record
77 pop di
78 jnc goboot ;successful - now give it control
79 xor ax,ax ;had an error, so
80 int 13h ;recalibrate
81 dec di ;reduce retry count
82 jnz rdboot ;if retry count above zero, go retry
83 mov si,offset m2 ;all retries done - permanent error - point to message,
84 jmp msg ;go display message and loop
85goboot:
86 mov si,offset m3 ;prepare for invalid boot record
87 mov di,07dfeh
88 cmp word ptr [di],0aa55h ;does the boot record have the
89 ; required signature?
90 jne msg ;no, display invalid system boot record message
91 mov si,bp ;yes, pass partition table entry address
92 db 0eah
93 dw 7c00h,0
94
95include fdisk5.cl1
96
97 org 7beh
98tab: ;partition table
99 dw 0,0 ;partition 1 begin
100 dw 0,0 ;partition 1 end
101 dw 0,0 ;partition 1 relative sector (low, high parts)
102 dw 0,0 ;partition 1 # of sectors (low, high parts)
103 dw 0,0 ;partition 2 begin
104 dw 0,0 ;partition 2 end
105 dw 0,0 ;partition 2 relative sector
106 dw 0,0 ;partition 2 # of sectors
107 dw 0,0 ;partition 3 begin
108 dw 0,0 ;partition 3 end
109 dw 0,0 ;partition 3 relative sector
110 dw 0,0 ;partition 3 # of sectors
111 dw 0,0 ;partition 4 begin
112 dw 0,0 ;partition 4 end
113 dw 0,0 ;partition 4 relative sector
114 dw 0,0 ;partition 4 # of sectors
115signa db 55h,0aah ;signature
116
117_data ends
118 end
119 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/FDCHNG.INC b/v4.0/src/CMD/FDISK/FDCHNG.INC
new file mode 100644
index 0000000..198cf79
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/FDCHNG.INC
@@ -0,0 +1,88 @@
1.xlist
2;
3;
4;*****************************************************************************
5;* *
6;* Change list to FDISK modules *
7;* *
8;* Lines are tagged ANxxx for new, ACxxx for changed *
9;* --------------------------------------------------------------------------*
10;* 000 - DOS 4.0 Spec additions and DCR's thru unit/function test *
11;* Date: 12/31/87 Developer: Dennis M *
12;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
13;* 001 - DOS 4.0 DCR D468 Add errorlevel 1 on exit if there is no PRIMARY *
14;* partition and the /Q switch is specified. This was done for *
15;* SELECT. *
16;* Date: 02/06/88 Developer: Dennis M *
17;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
18;* 002 - DOS 4.0 PTM P3383 Add logic to use undocumented int 21 to check *
19;* media to see if it has been formatted or not. CHECK_FORMAT added. *
20;* Date: 02/08/88 Developer: Dennis M *
21;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
22;* 003 - DOS 4.0 PTM P3589 Change CONVERT.C to compare for a period in the *
23;* get_volume_string routine. It does a find first on the logical *
24;* drive for the volume name and must copy it without the period. *
25;* Date: 02/22/88 Developer: Dennis M *
26;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
27;* 004 - DOS 4.0 PTM P3744 Change FDISK logic to display and handle a hard *
28;* file of up to 4,000 MB. *
29;* Date: 03/04/88 Developer: Dennis M *
30;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
31;* 005 - DOS 4.0 PTM P3618 Add errorlevel 2 on exit if there is no changes *
32;* made and the /Q switch is specified. This was done for *
33;* SELECT. *
34;* Date: 02/25/88 Developer: Dennis M *
35;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
36;* 006 - DOS 4.0 PTM P3617 Change FDISK to color screens. This is done for *
37;* SELECT. *
38;* Date: 02/25/88 Developer: Dennis M *
39;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
40;* 007 - DOS 4.0 DCR D490 Change FDISK IOCTL 63 to 66 in FDISK.H. *
41;* Date: 02/26/88 Developer: Dennis M *
42;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
43;* 008 - DOS 4.0 PTM P3698 Logic change for PTM 3618 was bad and had to *
44;* to be corrected. *
45;* Also changed FDISK IOCTL 64 to 67 in FDISK.H. *
46;* Date: 02/26/88 Developer: Dennis M *
47;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
48;* 009 - DOS 4.0 PTM P3938 A variable (temp) in subroutine *
49;* write_info_to_disk was not initialized on entry. *
50;* Date: 03/22/88 Developer: Dennis M *
51;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
52;* 010 - DOS 4.0 PTM P4071 Changed the parsar logic to output the correct *
53;* error message when parse is not correct. *
54;* Date: 03/30/88 Developer: Dennis M *
55;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
56;* 011 - DOS 4.0 PTM P4837 When deleting and allocating FDISK logical drives*
57;* FDISK was deleting the wrong drives. *
58;* Date: 05/12/88 Developer: Dennis M *
59;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
60;* 012 - DOS 4.0 PTM P4835 FDISK had Y and N hard coded for YES and NO. *
61;* Need to pick up 'Y' and 'N' translations from message file. *
62;* Date: 05/12/88 Developer: Dennis M *
63;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
64;* 013 - DOS 4.0 PTM P4883 FDISK will allow the deletion of a logical *
65;* drive that has already been deleted. This error was caused by *
66;* the logic change of P4837. *
67;* Date: 05/17/88 Developer: Dennis M *
68;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
69;* 014 - DOS 4.0 PTM P4953 FDISK displays too many files open error message *
70;* when Cannot FDISK with Network Loaded message should be displayed.*
71;* Date: 05/23/88 Developer: Dennis M *
72;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
73;* 015 - DOS 4.0 PTM P5019 FDISK displays Insufficient memory error message *
74;* when Invalid Parameter should be displayed. *
75;* Logic has also been added to only get the volume ID of a logical *
76;* drive by doing a Int 21 11h instead of IOCTL call 0866h. *
77;* Date: 06/02/88 Developer: Dennis M *
78;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
79;* 016 - DOS 4.0 PTM P5031 FDISK displays the wrong error message with 4 *
80;* partitions allocated on same disk and trying to delete primary *
81;* partition. *
82;* Date: 06/06/88 Developer: Dennis M *
83;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
84;*****************************************************************************
85;* Note: This is file FDCHNG.INC for updating purposes *
86;*****************************************************************************
87.list
88
diff --git a/v4.0/src/CMD/FDISK/FDISK.C b/v4.0/src/CMD/FDISK/FDISK.C
new file mode 100644
index 0000000..b39baad
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/FDISK.C
@@ -0,0 +1,1121 @@
1
2/* */
3
4
5
6/******************* START OF SPECIFICATIONS *******************/
7/* */
8/* SOURCE FILE NAME: FDISK */
9/* */
10/* DESCRIPTIVE NAME: FIXED DISK PARTITIONING UTILITY */
11/* */
12/* FUNCTION: */
13/* Allows creation and deletion of DOS related partitions */
14/* on fixed disk devices 80-81h (int 13h BIOS defined, */
15/* DOS). Also allows display of all partitions, and will */
16/* allow a partition to be marked active (bootable). The */
17/* user will be prompted for action thru a full screen */
18/* interface. The user can also create, delete and display */
19/* logical DOS drives within a EXTENDED DOS Partition. If a*/
20/* regular DOS partition is created, the beginning of the */
21/* partition will be scanned to insure a contiguous area of*/
22/* good sectors on the disk large enough to satisfy the */
23/* DOS system requirements. If a bad spot is found, the */
24/* start of the partition will be moved out until a good */
25/* area is located */
26/* */
27/* NOTES: The program will work by setting up a logical image */
28/* of all relevant disk information at initilization */
29/* time. All operations will be performed on this */
30/* logical image, thus reducing disk accesses to only */
31/* those required to initially set up the logical image,*/
32/* and to write the changed information at the end. The */
33/* user will be informed if there is a problem writing */
34/* the logical image back to the disk. */
35/* */
36/* FDISK will interface with the partition table in the */
37/* master boot record as defined in the PC-DOS technical*/
38/* reference manual. It will also create and manage the */
39/* EXTENDED DOS partition architecture as defined in the*/
40/* PC-DOS 3.30 functional spec (CP/DOS spec dcr pending)*/
41/* */
42/* ENTRY POINTS: MAIN */
43/* LINKAGE: [d:] [path] FDISK */
44/* */
45/* EXTERNAL REFERENCES: */
46/* Fixed Disk Master Boot Record */
47/* EXTENDED Partition Volume Boot Records */
48/* Note: Both of the above are physical data structures on */
49/* the surface of the disk */
50/* */
51/* P.S. - To whoever winds up maintaining this, I will */
52/* apoligize in advance. I had just learned 'C' when */
53/* writing this, so out of ignorance of the finer points*/
54/* of the langauge I did a lot of things by brute force.*/
55/* Hope this doesn't mess you up too much - MT 5/20/86 */
56/******************** END OF SPECIFICATIONS ********************/
57
58#include <dos.h>
59#include <fdisk.h>
60#include <subtype.h>
61#include <extern.h>
62#include <doscall.h>
63#include <ctype.h>
64#include <string.h> /* AN000 */
65#include <fdiskmsg.h> /* AN000 */
66#include <msgret.h> /* AN000 */
67#include <process.h> /* AN000 */
68#include <stdio.h> /* AN000 */
69
70/* */
71/**************************************************************************/
72/* */
73/* UTILITY NAME: FDISK.com */
74/* SOURCE FILE NAME: FDISK.c */
75/* STATUS: FDISK utility, DOS 3.3 */
76/* CHANGE HISTORY: UPDATED 5-29-87 DOS4.0 DRM */
77/* SYNTAX (Command line) */
78/* */
79/* [d:][path]FDISK */
80/* */
81/* or */
82/* */
83/* [d:][path]FDISK d [/PRI:m | /EXT:n | /LOG:o ...] */
84/* */
85/* d: Drive to load FDISK utility from */
86/* */
87/* path path to the directory on specified drive to */
88/* load FDISK from */
89/* */
90/* d Drive (1 or 2) that FDISK should operate on */
91/* */
92/* /PRI:m Size of Primary DOS partition to create in K */
93/* */
94/* /EXT:n Size of Extended DOS partition to create in K */
95/* */
96/* /LOG:o Size of Logical drive to create in K in the */
97/* extended partition */
98/* */
99/* UTILITY FUNCTION: */
100/* Allows you to create, set up, display, and delete the */
101/* DOS partitions on a fixed disk. */
102/* */
103/**************************************************************************/
104
105/* */
106/******************* START OF SPECIFICATIONS *******************/
107/* */
108/* SUBROUTINE NAME: CHANGE_ACTIVE_PARTITION */
109/* */
110/* DESCRIPTIVE NAME: Change bootable partition */
111/* */
112/* FUNCTION: Will allow user to select the partition that will */
113/* recieve control when system is IPL'd. This is */
114/* only for the first hardfile as far as booting is */
115/* concerned, although partitions can be set active */
116/* the second. There are reserved partitions that may*/
117/* not be set active and this routine will enforce */
118/* that. */
119/* */
120/* NOTES: If no valid partition is specified, then the active */
121/* partition setting is left unchanged. Screen can be */
122/* exited via the ESC command before active partition */
123/* is changed and no action will take place */
124/* */
125/* The following screen is managed */
126/* */
127/* ³0000000000111111111122222222223333333333³ */
128/* ³0123456789012345678901234567890123456789³ */
129/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
130/* 00³ ³ */
131/* 01³ ³ */
132/* 02³ ³ */
133/* 03³ ³ */
134/* 04³Change Active Partition ³ */
135/* 05³ ³ */
136/* 06³Current Fixed Disk Drive: # ³ */
137/* 07³ ³ */
138/* 08³Partition Status Type Start End Size³ */
139/* 09³ # # ####### #### #### ####³ */
140/* 10³ ³ */
141/* 11³ ³ */
142/* 12³ ³ */
143/* 13³ ³ */
144/* 14³Total disk space is #### cylinders. ³ */
145/* 15³ ³ */
146/* 16³ ³ */
147/* 17³ ³ */
148/* 18³Enter the number of the partition you ³ */
149/* 19³want to make active...............: [#] ³ */
150/* 20³ ³ */
151/* 21³ ³ */
152/* 22³ ³ */
153/* 23³Press ESC to return to FDISK Options ³ */
154/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
155/* */
156/* ENTRY POINTS: Change_Active_Partition */
157/* LINKAGE: change_active_partition () */
158/* NEAR CALL */
159/* */
160/* INPUT: None */
161/* */
162/* EXIT-NORMAL: ERROR=FALSE */
163/* */
164/* EXIT-ERROR: ERROR=TRUE */
165/* GOTO internal_program_error if invalid num */
166/* input is returned to this level */
167/* */
168/* EFFECTS: Display prompts needed to guide user input, and */
169/* gets input from user. */
170/* */
171/* */
172/* INTERNAL REFERENCES: */
173/* ROUTINES: */
174/* clear_screen */
175/* display */
176/* get_num_input */
177/* table_display */
178/* wait_for_ESC */
179/* internal_program_error */
180/* */
181/* EXTERNAL REFERENCES: */
182/* ROUTINES: */
183/* */
184/******************** END OF SPECIFICATIONS ********************/
185
186/* */
187void change_active_partition()
188
189BEGIN
190
191 char temp;
192 char default_value;
193 char input;
194 unsigned i;
195 unsigned x;
196 char num_partitions;
197 char valid_partitions;
198 char num_of_bootable_partitions;
199 char valid_input;
200 char input_default;
201
202
203
204 input = c(NUL);
205 /* Clear screen */
206 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
207
208 /* Display header */
209 display(menu_23);
210
211 /* Setup and print current disk */
212 insert[0] = cur_disk+1+'0';
213 display(menu_5);
214
215 /* print ESC prompt */
216 display(menu_11);
217
218 /* Only allow active partitions on the first (and bootable) disk */
219 if (cur_disk == c(0)) /* AC000 */
220
221 BEGIN
222 /* Display partition info and see if any partitions exist*/
223 if (table_display())
224
225 BEGIN
226 /* See if active partition is bootable */
227 for (i=u(0); i < u(4); i++) /* AC000 */
228 BEGIN
229 if (part_table[0][i].sys_id != uc(0) &&
230 part_table[0][i].boot_ind == uc(0x80)) /* AC000 */
231 BEGIN
232 if ((part_table[0][i].sys_id == uc(BAD_BLOCK)) ||
233 (part_table[0][i].sys_id==uc(EXTENDED))) /* AC000 */
234 BEGIN
235 /* The active partition is not bootable, so warn user */
236 display(error_24);
237 END
238 END
239 END
240
241 /* Check to see if only one partition */
242 num_partitions = c(0) ; /* AC000 */
243 num_of_bootable_partitions = c(0); /* AC000 */
244 for (i=u(0); i < u(4); i++) /* AC000 */
245
246 BEGIN
247 if (part_table[0][i].sys_id != uc(0)) /* AC000 */
248 BEGIN
249 /* Get a count of partitions */
250 num_partitions++;
251
252 /* Get a count of the number of defined partitions but don't*/
253 /* count those we know aren't bootable */
254 if ((part_table[0][i].sys_id != uc(BAD_BLOCK)) &&
255 (part_table[0][i].sys_id != uc(EXTENDED))) /* AC000 */
256 BEGIN
257 num_of_bootable_partitions++;
258 END
259 END
260 END
261 /* If only one partition found, see if it is active already */
262 if (num_of_bootable_partitions == c(1)) /* AC000 */
263 BEGIN
264
265 /* Find the partition and see if it is already active */
266 for (i=u(0); i < u(4); i++) /* AC000 */
267
268 BEGIN
269 if (part_table[0][i].sys_id !=uc(0) &&
270 part_table[0][i].boot_ind == uc(0x80)) /* AC000 */
271
272 BEGIN
273 /* Make sure it is not unbootable partition again*/
274 if ((part_table[0][i].sys_id != uc(BAD_BLOCK)) &&
275 (part_table[0][i].sys_id!=uc(EXTENDED))) /* AC000 */
276
277 BEGIN
278 /* Once it is found, put out the message */
279 display(error_15);
280
281 /* Wait for ESC, then get out */
282 wait_for_ESC();
283
284 /* clear the screen before going back to main menu*/
285 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
286 return;
287 END
288 END
289 END
290 END
291 /* See if any bootable partitions exist */
292 if (num_of_bootable_partitions == c(0)) /* AC000 */
293 BEGIN
294 /* At this point, we know at least one partition does exist due to*/
295 /* getting past the table_display call, so the only ones around */
296 /* must be unbootable */
297
298 /* Display this fact then get out of here */
299 display(error_25);
300 END
301 else
302 BEGIN
303 /* All is okay to go and set one, do display prompts */
304 number_in_msg((XFLOAT)total_mbytes[cur_disk],u(0)); /* AC000 */
305 display(menu_15);
306
307 /* Put up input prompt*/
308 display(menu_24);
309
310 /* Assume bad input until proven otherwise */
311 valid_input = FALSE;
312 valid_partitions = num_partitions;
313 input_default = c(NUL); /* AC000 */
314
315 while (!valid_input)
316 BEGIN
317 /* Go get partition to make active */
318 input = get_num_input(input_default,num_partitions,input_row,input_col);
319
320 /* Save the input for next time in case CR pressed */
321 input_default = input-'0';
322
323 clear_screen(u(18),u(0),u(23),u(79)); /* AC000 */
324
325 if (input != c(ESC)) /* AC000 */
326 BEGIN
327 /* See if known unbootable partition */
328 /* Set the new one */
329 valid_partitions = c(0); /* AC000 */
330
331 /* Make sure the partitions are in physical order*/
332 sort_part_table(c(4)); /* AC000 */
333
334 /* Go find existing partitiona */
335 for (i=u(0);i < u(4); i++) /* AC000 */
336 BEGIN
337 /* First we have to find it */
338 if (part_table[0][sort[i]].sys_id != uc(0)) /* AC000 */
339 BEGIN
340 /* If this is the 'input'th one, then we got it */
341 if (valid_partitions == (input-'1'))
342 BEGIN
343 /* See if it is an unbootable partition */
344 if ((part_table[0][sort[i]].sys_id != uc(BAD_BLOCK)) &&
345 (part_table[0][sort[i]].sys_id != uc(EXTENDED))) /* AC000 */
346
347 BEGIN
348 /* Its bootable, so we have good input */
349 valid_input = c(TRUE); /* AC000 */
350
351 /* Remove the active indicator from the old partition */
352 for (x=u(0); x < u(4); x++) /* AC000 */
353 BEGIN
354
355 if (part_table[0][x].boot_ind == uc(0x80)) /* AC000 */
356 BEGIN
357 part_table[0][x].changed = TRUE;
358 part_table[0][x].boot_ind = uc(0); /* AC000 */
359 END
360 END
361
362 /* Put in new active indicator */
363 part_table[0][sort[i]].boot_ind = uc(0x80); /* AC000 */
364
365 /* Indicate that it is changed */
366 part_table[0][sort[i]].changed = TRUE;
367
368 /* Update the partition info display */
369 table_display();
370
371 /* Clear off the old prompts */
372 clear_screen(u(16),u(0),u(21),u(79)); /* AC000 */
373
374 /* Say you did it */
375 insert[0] = input;
376 display(status_4);
377 break;
378 END
379 else
380 BEGIN
381 /* It is, so setup message and tell user */
382 insert[0] = input;
383 display(error_17);
384 break;
385 END
386 END
387 else
388 BEGIN
389 /* Indicate we found one but keep going */
390 valid_partitions++;
391 END
392 END
393 END
394 END
395 else
396 BEGIN
397 /* Mark ESC as ok input so we can get out of here */
398 valid_input = c(TRUE); /* AC000 */
399 END
400 END /* While loop */
401 END
402 END /* table display test endif */
403 else
404 BEGIN
405 /* No partitions to make active */
406 display(error_16);
407 END
408 END
409 else
410 BEGIN
411 display(error_26);
412 END
413 /* clear the screen before going back to main menu */
414 if (input != c(ESC)) /* AC000 */
415 BEGIN
416 wait_for_ESC();
417 END
418 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
419 return;
420END
421
422
423/* */
424/******************* START OF SPECIFICATIONS *******************/
425/* */
426/* SUBROUTINE NAME: DISPLAY_PARTITION_INFORMATION */
427/* */
428/* DESCRIPTIVE NAME: Display partition information */
429/* */
430/* FUNCTION: Displays defined partition information and prompt */
431/* user to display disk volumes if they exist */
432/* */
433/* NOTES: */
434/* */
435/* The following screen is managed */
436/* */
437/* ³0000000000111111111122222222223333333333³ */
438/* ³0123456789012345678901234567890123456789³ */
439/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
440/* 00³ ³ */
441/* 01³ ³ */
442/* 02³ ³ */
443/* 03³ ³ */
444/* 04³Display Partition Information ³ */
445/* 05³ ³ */
446/* 06³Current Fixed Disk Drive: # ³ */
447/* 07³ ³ */
448/* 08³Partition Status Type Start End Size³ */
449/* 09³ # # ####### #### #### ####³ */
450/* 10³ ³ */
451/* 11³ ³ */
452/* 12³ ³ */
453/* 13³ ³ */
454/* 14³Total disk space is #### cylinders. ³ */
455/* 15³ ³ */
456/* 16³ ³ */
457/* 17³ ³ */
458/* 18³The EXTENDED DOS partition contains DOS ³ */
459/* 19³disk volumes. Do you want to display ³ */
460/* 20³the volume information............? [Y] ³ */
461/* 21³ ³ */
462/* 22³ ³ */
463/* 23³Press ESC to return to FDISK Options ³ */
464/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
465/* */
466/* ENTRY POINTS: Display_Partition_Information */
467/* LINKAGE: display_partition_information () */
468/* NEAR CALL */
469/* */
470/* INPUT: None */
471/* */
472/* EXIT-NORMAL: ERROR=FALSE */
473/* */
474/* EXIT-ERROR: ERROR=TRUE */
475/* GOTO internal_program_error if invalid input */
476/* returned to this routine */
477/* */
478/* EFFECTS: No data directly modified by this routine, but */
479/* child routines will modify data. */
480/* */
481/* INTERNAL REFERENCES: */
482/* ROUTINES: */
483/* clear_screen */
484/* wait_for_ESC */
485/* display */
486/* table_display */
487/* get_yn_input */
488/* find_partition_type */
489/* display_volume_information */
490/* internal_program_error */
491/* */
492/* EXTERNAL REFERENCES: */
493/* ROUTINES: */
494/* */
495/******************** END OF SPECIFICATIONS ********************/
496
497/* */
498void display_partition_information()
499
500BEGIN
501
502 char input;
503 char temp;
504
505 input = c(NUL); /* AC000 */
506 /* Clear_screen */
507 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
508
509 /* Display Header */
510 display(menu_35);
511
512 /* Setup and print current disk */
513 insert[0] = cur_disk+1+'0';
514 display(menu_5);
515
516 /* print ESC prompt */
517 display(menu_11);
518
519 /* Display information */
520 if (table_display())
521 BEGIN
522
523 /* Setup and print disk space msg */
524 number_in_msg((XFLOAT)total_mbytes[cur_disk],u(0)); /* AC000 */
525 display(menu_15);
526
527 /* See if any logical drive stuff to display */
528 if (find_partition_type(uc(EXTENDED))) /* AC000 */
529 BEGIN
530 /* See if any logical drives exist */
531 if (find_logical_drive())
532 BEGIN
533
534 /* Prompt to see if they want to see EXTENDED info */
535 display(menu_36);
536
537 /* Get Y/N input, default is YES */
538 input = get_yn_input(c(Yes),input_row,input_col); /* AC000 AC011 */
539 switch(input)
540 BEGIN
541
542 case 1: display_volume_information(); /* AC000 */
543 break;
544
545 case 0: break; /* AC000 */
546
547 case ESC: break;
548
549 default: internal_program_error();
550 break;
551 END
552 END
553 else
554 input = wait_for_ESC();
555 END
556 else
557 input = wait_for_ESC();
558 END
559 else
560 input = wait_for_ESC();
561 /* clear the screen before going back to main menu */
562 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
563 return;
564END
565
566
567
568/* */
569/******************* START OF SPECIFICATIONS *******************/
570/* */
571/* SUBROUTINE NAME: DISPLAY_VOLUME_INFORMATION */
572/* */
573/* DESCRIPTIVE NAME: Display DOS disk Volume Information */
574/* */
575/* FUNCTION: Displays disk volume size and existence */
576/* */
577/* NOTES: */
578/* */
579/* The following screen is managed */
580/* */
581/* ³0000000000111111111122222222223333333333³ */
582/* ³0123456789012345678901234567890123456789³ */
583/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
584/* 01³Display DOS Disk Volume Information ³ */
585/* 02³ ³ */
586/* 03³Vol Start End Size Vol Start End Size³ */
587/* 04³ # #### #### #### # #### #### ####³ */
588/* 05³ ³ */
589/* 06³ ³ */
590/* 07³ ³ */
591/* 08³ ³ */
592/* 09³ ³ */
593/* 10³ ³ */
594/* 11³ ³ */
595/* 12³ ³ */
596/* 13³ ³ */
597/* 14³ ³ */
598/* 15³ ³ */
599/* 16³ ³ */
600/* 17³ ³ */
601/* 18³ ³ */
602/* 19³ ³ */
603/* 20³ ³ */
604/* 21³ ³ */
605/* 22³ ³ */
606/* 23³Press ESC to return to FDISK Options ³ */
607/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
608/* */
609/* ENTRY POINTS: Display_Volume_Information */
610/* LINKAGE: display_volume_information () */
611/* NEAR CALL */
612/* */
613/* INPUT: None */
614/* */
615/* EXIT-NORMAL: ERROR=FALSE */
616/* */
617/* EXIT-ERROR: ERROR=TRUE */
618/* */
619/* EFFECTS: No data directly modified by this routine, but */
620/* child routines will modify data. */
621/* */
622/* INTERNAL REFERENCES: */
623/* ROUTINES: */
624/* clear_screen */
625/* wait_for_ESC */
626/* display */
627/* volume_display */
628/* */
629/* EXTERNAL REFERENCES: */
630/* ROUTINES: */
631/* */
632/******************** END OF SPECIFICATIONS ********************/
633
634/* */
635void display_volume_information()
636
637BEGIN
638
639 char input;
640 char temp;
641
642 input = c(NUL); /* AC000 */
643 /* clear the screen */
644 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
645
646 /* Display Header */
647 display(menu_37);
648
649 /* Display information */
650 temp = volume_display();
651
652 /* Set up partition size message */
653 sprintf(insert,"%4.0d",get_partition_size( uc(EXTENDED) ) );
654 display(menu_21);
655
656 /* print ESC prompt */
657 display(menu_11);
658
659 /* Wait to exit */
660 input = wait_for_ESC();
661 return;
662END
663
664/* */
665char check_valid_environment()
666BEGIN
667
668 /* See if the net is there */
669 regs.x.ax = u(INSTALLATION_CHECK); /* AC000 */
670 int86((int)NETWORK,&regs,&regs); /* AC000 */
671
672#ifdef DEBUG /* AN006 */
673 regs.h.al = uc(0); /* AN006 */
674#endif /* AN006 */
675
676 /* Is it ? */
677 if (regs.h.al != uc(0)) /* AC000 */
678 BEGIN
679
680 /* See if server is loaded, otherwise okay */
681 if ((regs.x.bx & SERVER_CHECK) != u(0)) /* AC000 */
682 BEGIN
683 no_fatal_error = FALSE;
684 display_msg((int)4,(int)DosStdEr,(int)nosubcnt,(int)nosubptr,c(noinput),c(Utility_Msg_Class)); /* AN000 AC014*/
685 return(FALSE);
686 END
687 END
688 return(TRUE);
689END
690
691
692
693/* */
694void init_partition_tables()
695BEGIN
696
697unsigned i;
698unsigned char j;
699unsigned k;
700unsigned l;
701unsigned partition_location;
702char temp;
703char more_drives_exist;
704char num_logical_drives;
705unsigned insert;
706unsigned index;
707
708 /* initialize first drive found to "C" */
709 next_letter = c(SEA); /* AC000 */
710
711 /* Look at both disks */
712 for (j = uc(0); j < number_of_drives; j++) /* AC000 */
713 BEGIN
714
715 /* Initialize the cur_disk field to the drive in question so */
716 /* that the calls to the partition information routines will work */
717 cur_disk = ((char)(j));
718
719 /* Read in the master boot record and see if it was okay */
720 if (read_boot_record(u(0),j,uc(0),uc(1))) /* AC000 */
721 BEGIN
722
723 /* See if there was a valid boot record there */
724 if ((boot_record[510] == uc(0x55)) && (boot_record[511] == uc(0xAA))) /* AC000 */
725 BEGIN
726
727 /* What was on the disk is a valid boot record, so save it */
728 for (i=u(0);i < u(BYTES_PER_SECTOR); i++) /* AC000 */
729 BEGIN
730 master_boot_record[j][i] = boot_record[i];
731 END
732 END
733 /* We've now got a copy of the master boot record saved. Now we need */
734 /* to translate what in the boot record to the area that it's going */
735 /* to be worked on (part_table) */
736
737 /* Read in the data from the master boot record partition entries*/
738 for (i=u(0); i < u(4); i++) /* AC000 */
739 BEGIN
740 index = i*16;
741
742 /* Get boot ind */
743 part_table[j][i].boot_ind = master_boot_record[j][0x1BE+index];
744
745 /* Start head */
746 part_table[j][i].start_head = master_boot_record[j][0x1BF+index];
747
748 /* Start sector - unscramble it from INT 13 format*/
749 part_table[j][i].start_sector= (master_boot_record[j][0x1C0+index] & 0x3F);
750
751 /* Start cyl - unscramble it from INT 13 format*/
752 part_table[j][i].start_cyl= ((((unsigned)master_boot_record[j][0x1C0+index]) & 0x00C0) << 2)
753 + ((unsigned)master_boot_record[j][0x1C1+index]);
754
755 /* System id */
756 part_table[j][i].sys_id = master_boot_record[j][0x1C2+index];
757
758 /* End head */
759 part_table[j][i].end_head = master_boot_record[j][0x1C3+index];
760
761 /* End sector - unscramble it from INT 13 format*/
762 part_table[j][i].end_sector= (master_boot_record[j][0x1C4+index] & 0x3F);
763
764 /* End cyl - unscramble it from INT 13 format*/
765 part_table[j][i].end_cyl= ((((unsigned)master_boot_record[j][0x1C4+index]) & 0x00C0) << 2)
766 + ((unsigned)master_boot_record[j][0x1C5+index]);
767
768 /* Relative sectors */
769
770 part_table[j][i].rel_sec =
771 ((unsigned long)master_boot_record[j][0x1C9+index]) << 24;
772
773 part_table[j][i].rel_sec = part_table[j][i].rel_sec +
774 (((unsigned long)master_boot_record[j][0x1C8+index]) << 16);
775
776 part_table[j][i].rel_sec = part_table[j][i].rel_sec +
777 (((unsigned long)master_boot_record[j][0x1C7+index]) << 8);
778
779 part_table[j][i].rel_sec = part_table[j][i].rel_sec +
780 ((unsigned long)master_boot_record[j][0x1C6+index]);
781
782 /* Number of sectors */
783 part_table[j][i].num_sec =
784 ((unsigned long)master_boot_record[j][0x1CD+index]) << 24;
785
786 part_table[j][i].num_sec = part_table[j][i].num_sec +
787 (((unsigned long)master_boot_record[j][0x1CC+index]) << 16);
788
789 part_table[j][i].num_sec = part_table[j][i].num_sec +
790 (((unsigned long)master_boot_record[j][0x1CB+index]) << 8);
791
792 part_table[j][i].num_sec = part_table[j][i].num_sec +
793 ((unsigned long)master_boot_record[j][0x1CA+index]);
794
795 part_table[j][i].mbytes_used =
796 cylinders_to_mbytes(((part_table[j][i].end_cyl-part_table[j][i].start_cyl)+1),
797 cur_disk); /* AN004 */
798
799 part_table[j][i].percent_used =
800 cylinders_to_percent(((part_table[j][i].end_cyl-part_table[j][i].start_cyl)+1),
801 total_disk[cur_disk]); /* AN000 */
802
803 /* Set drive letter */
804 if ( (part_table[j][i].sys_id == DOS12) || /* AN000 */
805 (part_table[j][i].sys_id == DOS16) || /* AN000 */
806 (part_table[j][i].sys_id == DOSNEW) ) /* AN000 */
807 part_table[j][i].drive_letter = next_letter++; /* AN000 */
808
809 /* Set changed flag */
810 part_table[j][i].changed = FALSE;
811 END
812 END
813 else
814 BEGIN
815 return;
816 END
817 END
818
819 /* Look at both disks */
820 for (j = uc(0); j < number_of_drives; j++) /* AC000 */
821 BEGIN
822
823 /* Initialize the cur_disk field to the drive in question so */
824 /* that the calls to the partition information routines will work */
825 cur_disk = ((char)(j));
826
827 /* Read in the master boot record and see if it was okay */
828 if (read_boot_record(u(0),j,uc(0),uc(1))) /* AC000 */
829 BEGIN
830 /* Now, go read in extended partition info */
831 if (find_partition_type(uc(EXTENDED))) /* AC000 */
832 BEGIN
833 /* Initialize the array to zero's - include one dummy entry */
834 for (i=u(0); i < u(24); i++) /* AC000 */
835 BEGIN
836 ext_table[j][i].boot_ind = uc(0); /* AC000 */
837 ext_table[j][i].start_head = uc(0); /* AC000 */
838 ext_table[j][i].start_sector = uc(0); /* AC000 */
839 ext_table[j][i].start_cyl = u(0); /* AC000 */
840 ext_table[j][i].sys_id = uc(0); /* AC000 */
841 ext_table[j][i].end_head = uc(0); /* AC000 */
842 ext_table[j][i].end_sector = uc(0); /* AC000 */
843 ext_table[j][i].end_cyl = u(0); /* AC000 */
844 ext_table[j][i].rel_sec = ul(0); /* AC000 */
845 ext_table[j][i].num_sec = ul(0); /* AC000 */
846 ext_table[j][i].mbytes_used = f(0); /* AN000 */
847 ext_table[j][i].percent_used = u(0); /* AN000 */
848 ext_table[j][i].changed = FALSE;
849 ext_table[j][i].drive_letter = NUL; /* AN000 */
850
851 strcpy(ext_table[cur_disk][i].system,NUL); /* AN000 */
852 strcpy(ext_table[cur_disk][i].vol_label,NUL); /* AN000 */
853
854 END
855
856 /* Find where the first extended boot record is */
857 temp = find_partition_location(uc(EXTENDED)); /* AC000 */
858 partition_location = part_table[j][temp].start_cyl;
859
860 /* Go find extended boot records as long as there are more of them */
861 more_drives_exist = TRUE;
862
863 /* Init the number of logical drives, for a array index */
864 num_logical_drives = c(0); /* AC000 */
865
866 while (more_drives_exist)
867 BEGIN
868 /* Assume we won't find another logical drive */
869 more_drives_exist = FALSE;
870
871 /*Read in the extended boot record */
872 if (read_boot_record(partition_location,
873 j,
874 uc(0),
875 uc(1))) /* AC000 */
876 BEGIN
877 load_logical_drive(num_logical_drives,j);
878
879
880 /* find the next logical drive */
881 for (i = u(0); i < u(4); i++) /* AC000 */
882 BEGIN
883 index = i*16;
884 /* See if a sys id byte of exteneded exists */
885 if (boot_record[0x1C2+index] == uc(EXTENDED)) /* AC000 */
886 BEGIN
887 /* Found another drive, now get its location */
888 partition_location= (((((unsigned)(boot_record[0x1C0 + index])) & 0x00C0) << 2));
889 partition_location = partition_location + ((unsigned)(boot_record[0x1C1+index]));
890
891 /* Indicate we found another one */
892 more_drives_exist = TRUE;
893
894 /* Up the count of found ones */
895 num_logical_drives++;
896 break;
897 END
898 END
899 END
900 END
901 END
902 END
903 END
904 return;
905END
906
907
908/* */
909void load_logical_drive(point,drive)
910
911char point;
912unsigned char drive;
913
914BEGIN
915
916char volume_label[13]; /* AC000 *//*Used be 11*/
917unsigned ext_part_num; /* AN000 */
918unsigned i;
919unsigned j; /* AN000 */
920unsigned k; /* AN000 */
921unsigned length; /* AN000 */
922unsigned index;
923unsigned dx_pointer; /* AN000 */
924unsigned partition_location; /* AN000 */
925
926 /* Check to see if anything is there */
927 if ((boot_record[510] == uc(0x55)) && (boot_record[511] == uc(0xAA))) /* AC000 */
928 BEGIN
929 /* The boot record is there - read in the logical drive if it is there */
930 for (i = u(0); i < u(4); i++) /* AC000 */
931 BEGIN
932
933 index = i*16;
934 /* See if it is a defined extended drive*/
935 if ((boot_record[0x1C2 + index] != uc(0)) && (boot_record[0x1C2 + index] != uc(EXTENDED))) /* AC000 */
936 BEGIN
937 /* Get boot ind */
938 ext_table[drive][point].boot_ind = boot_record[0x1BE + index];
939
940 /* Start head */
941 ext_table[drive][point].start_head = boot_record[0x1BF + index];
942
943 /* Start sector - unscramble it from INT 13 format*/
944 ext_table[drive][point].start_sector= (boot_record[0x1C0 + index] & 0x3F);
945
946 /* Start cyl - unscramble it from INT 13 format*/
947 ext_table[drive][point].start_cyl= ((((unsigned)boot_record[0x1C0+index]) & 0x00C0) << 2)
948 + ((unsigned)boot_record[0x1C1+index]);
949
950
951 /* System id */
952 ext_table[drive][point].sys_id = boot_record[0x1C2+index];
953
954 /* End head */
955 ext_table[drive][point].end_head = boot_record[0x1C3+index];
956
957 /* End sector - unscramble it from INT 13 format*/
958 ext_table[drive][point].end_sector= (boot_record[0x1C4+index] & 0x3F);
959
960
961 /* End cyl - unscramble it from INT 13 format*/
962 ext_table[drive][point].end_cyl= ((((unsigned)boot_record[0x1C4+index]) & 0x00C0) << 2)
963 + ((unsigned)boot_record[0x1C5+index]);
964
965 /* Relative sectors */
966 ext_table[drive][point].rel_sec =
967 ((unsigned long)boot_record[0x1C9+index]) << 24;
968
969 ext_table[drive][point].rel_sec =
970 ext_table[drive][point].rel_sec+(((unsigned long)boot_record[0x1C8+index]) << 16);
971
972 ext_table[drive][point].rel_sec =
973 ext_table[drive][point].rel_sec + (((unsigned long)boot_record[0x1C7+index]) << 8);
974
975 ext_table[drive][point].rel_sec =
976 ext_table[drive][point].rel_sec + ((unsigned long)boot_record[0x1C6+index]);
977
978 /* Number of sectors */
979
980 ext_table[drive][point].num_sec =
981 ((unsigned long)boot_record[0x1CD+index]) << 24;
982
983 ext_table[drive][point].num_sec =
984 ext_table[drive][point].num_sec+(((unsigned long)boot_record[0x1CC+index]) << 16);
985
986 ext_table[drive][point].num_sec =
987 ext_table[drive][point].num_sec + (((unsigned long)boot_record[0x1CB+index]) << 8);
988
989 ext_table[drive][point].num_sec =
990 ext_table[drive][point].num_sec + ((unsigned long)boot_record[0x1CA+index]);
991
992 ext_table[drive][point].mbytes_used =
993 cylinders_to_mbytes(((ext_table[drive][point].end_cyl - ext_table[drive][point].start_cyl)+1),
994 cur_disk); /* AN004 */
995
996 ext_part_num = find_partition_location(uc(EXTENDED));
997
998 ext_table[drive][point].percent_used =
999 cylinders_to_percent(((ext_table[drive][point].end_cyl-ext_table[drive][point].start_cyl)+1),
1000 ((part_table[drive][ext_part_num].end_cyl-part_table[drive][ext_part_num].start_cyl)+1)); /* AN000 */
1001
1002 ext_table[drive][point].drive_letter = next_letter++; /* AN000 */
1003
1004 partition_location = ext_table[drive][point].start_cyl;
1005
1006 if (read_boot_record(ext_table[drive][point].start_cyl,
1007 drive,
1008 ext_table[drive][point].start_head,
1009 ext_table[drive][point].start_sector));
1010 BEGIN /* AN000 */
1011 /* See if the disk has already been formated */
1012 if (check_format(ext_table[drive][point].drive_letter) == TRUE ) /* AN002 */
1013 BEGIN /* AN000 */
1014 /* get volume and system info */
1015
1016 /* AC000 Just for cleaning up purposes */
1017
1018 for (k = u(0); k < u(12); k++) /* AC000 */
1019 BEGIN /* AC000 */
1020 ext_table[drive][point].vol_label[k]=u(0); /* AC000 */
1021 END /* AC000 */
1022
1023 for (k = u(0); k < u(9); k++) /* AC000 */
1024 BEGIN /* AC000 */
1025 ext_table[drive][point].system[k]=u(0); /* AC000 */
1026 END /* AC000 */
1027
1028 get_volume_string(ext_table[drive][point].drive_letter,&volume_label[0]); /* AN000 AC015 */
1029
1030 for (k = u(0); k < strlen(volume_label); k++) /* AC000 AC015 */
1031 BEGIN /* AC000 AC015 */
1032 ext_table[drive][point].vol_label[k]=volume_label[k]; /* AC000 AC015 */
1033 END /* AC000 AC015 */
1034
1035 /* Now try to get it using GET MEDIA ID function */
1036 if (get_fs_and_vol(ext_table[drive][point].drive_letter)) /* AN000 */
1037
1038 BEGIN /* AN000 */
1039 /* AC000 Just use more conceptually simple logic */
1040 for (k=u(0); k < u(8); k++) /* AC000 */
1041
1042 BEGIN /* AC000 */
1043 if (dx_buff.file_system[k] != ' ') /* AC000 */
1044 length = k+1; /* AC000 */
1045 END /* AC000 */
1046
1047 strncpy(ext_table[drive][point].system,&dx_buff.file_system[0],u(length)); /* AN000 */
1048 END /* AN000 */
1049
1050 else /* AN000 */
1051
1052 BEGIN /* AN000 */
1053 if (ext_table[drive][point].num_sec > (unsigned long)FAT16_SIZE) /* AN000 */
1054 strcpy(ext_table[drive][point].system,FAT16); /* AN000 */
1055 else
1056 strcpy(ext_table[drive][point].system,FAT12); /* AN000 */
1057 END /* AN000 */
1058 END /* AN000 */
1059 else /* AN000 */
1060 BEGIN /* AN000 */
1061 /* set up array to say no file system or volume label */
1062 strcpy(ext_table[drive][point].vol_label,NOVOLUME); /* AN000 */
1063 strcpy(ext_table[drive][point].system,NOFORMAT); /* AN000 */
1064 END /* AN000 */
1065
1066 regs.x.dx = u(0);
1067 regs.x.ax = NETWORK_IOCTL;
1068 regs.h.bl = ((ext_table[drive][point].drive_letter - 'A') + 1);
1069 intdos(&regs,&regs);
1070 if (regs.x.dx & 0x1000) strcpy(ext_table[drive][point].vol_label,"* Remote * ");
1071 END
1072 read_boot_record(ext_table[drive][point].start_cyl,
1073 drive,
1074 uc(0),
1075 uc(1)); /* AN000 */
1076 END
1077 END
1078 END
1079
1080 return;
1081
1082END
1083
1084
1085
1086/* */
1087void reboot_system()
1088BEGIN
1089
1090
1091 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
1092 if (quiet_flag == FALSE)
1093 BEGIN
1094 display(menu_38);
1095 getch();
1096 reboot();
1097 END
1098 else
1099 BEGIN
1100 cur_disk = c(0); /* AN001 */
1101 reset_video_information(); /* AN006 */
1102 if ( (find_partition_type(uc(DOS12))) ||
1103 (find_partition_type(uc(DOS16))) ||
1104 (find_partition_type(uc(DOSNEW))) ) /* AN001 */
1105 exit(ERR_LEVEL_0); /* AN001 */
1106 else /* AN001 */
1107 exit(ERR_LEVEL_1); /* AN001 */
1108 END
1109END
1110
1111
1112/* */
1113void internal_program_error()
1114
1115BEGIN
1116 display(internal_error);
1117 DOSEXIT(u(0),u(0)); /* AC000 */
1118 return;
1119END
1120
1121
diff --git a/v4.0/src/CMD/FDISK/FDISK.H b/v4.0/src/CMD/FDISK/FDISK.H
new file mode 100644
index 0000000..5a0834f
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/FDISK.H
@@ -0,0 +1,224 @@
1/* */
2/* */
3/****************************************************************************/
4/* Define statements */
5/****************************************************************************/
6/* */
7
8#define FLAG char /* AN000 */
9#define BEGIN {
10#define END }
11#define ESC 0x1B
12#define ESC_FLAG -2 /* AN000 */
13#define NUL 0x00
14#define NOT_FOUND 0xFF
15#define DELETED -2 /* AC011 */
16#define INVALID 0xFF
17#define PRIMARY 0x00
18#define EXTENDED 0x05
19#define BAD_BLOCK 0xFF
20#define XENIX1 0x02
21#define XENIX2 0x03
22#define PCIX 0x75
23#define DOS12 0x01
24#define DOS16 0x04
25#define DOSNEW 0x06 /* AN000 */
26#define FAT16_SIZE 32680
27#define VOLUME 0x00
28#define FALSE (char) (1==0) /* AC000 */
29#define TRUE (char) !FALSE /* AC000 */
30#define LOGICAL 0x05
31#define CR 0x0D
32#define BACKSPACE 0x08
33#define ACTIVE 0x80
34#define DOS_MAX 65535 /* Allow exactly 32mb worth of partitions */
35#define SYSTEM_FILE_SECTORS 250
36#define BYTES_PER_SECTOR 512 /* AN000 */
37
38#include <version.h>
39
40#define NETWORK 0x2F
41#define INSTALLATION_CHECK 0xB800
42#define SERVER_CHECK 0x40
43
44
45#define FILE_NAME ":\\????????.???" /* AN000 */
46#define NOVOLUME "" /* AN000 */
47#define NOFORMAT "UNKNOWN " /* AN000 */
48#define FAT12 "FAT12 " /* AN000 */
49#define FAT16 "FAT16 " /* AN000 */
50#define SEA 'C' /* AN000 */
51#define ZERO 0 /* AN000 */
52#define NO_GOOD 0x02 /* AN000 */
53#define FIND_FIRST_MATCH 0x4E /* AN000 */
54#define GET_DTA 0x2F /* AN000 */
55#define NETWORK_IOCTL 0x4409 /* AN000 */
56#define GENERIC_IOCTL 0x440D /* AN000 */
57#define GET_MEDIA_ID 0x0866 /* AN007 */
58#define SPECIAL_FUNCTION 0x0867 /* AN002 AC008 */
59#define CAPCHAR 0x6520 /* AN000 */
60#define CAPSTRING 0x6521 /* AN000 */
61#define CAP_YN 0x6523 /* AN000 */
62#define INT21 0x21 /* AN000 */
63#define DISK 0x13 /* AN000 */
64#define NOERROR 0 /* AN000 */
65#define BLANKS " " /* AN000 */
66#define MAX_STRING_INPUT_LENGTH 11 /* AN000 */
67#define ERR_LEVEL_0 0 /* AN001 */
68#define ERR_LEVEL_1 1 /* AN001 */
69#define ERR_LEVEL_2 2 /* AN005 */
70
71#define READ_DISK 2
72#define WRITE_DISK 3
73#define DISK_INFO 8
74
75#define CURRENT_VIDEO_ATTRIBUTE 8 /* AN006 */
76#define CURRENT_VIDEO_STATE 15
77#define SET_ACTIVE_DISPLAY_PAGE 5
78#define SET_MODE 0
79#define SET_PAGE 5
80#define SET_CURSOR 0x02 /* AN006 */
81#define WRITE_ATTRCHAR 0x09 /* AN006 */
82#define VIDEO 0x10
83#define SCROLL_PAGE_UP 0x0600 /* AN006 */
84#define BW40_25 0
85#define Color40_25 1
86#define BW80_25 2
87#define Color80_25 3
88#define Color320_200 4
89#define BW320_200 5
90#define BW640_200 6
91#define MONO80_25 7
92#define MONO80_25A 15 /* AN006 */
93
94#define NORMAL_PRELOAD 0 /* AN000 */
95#define ALL_UTILITY_MESSAGES -1 /* AN000 */
96#define NO_SUBST_TEXT 0 /* AN000 */
97#define NO_RESPONSE 0 /* AN000 */
98#define CLASS -1 /* AN000 */ * AN000 */
99#define NUL_POINTER 0 /* AN000 */
100#define SUBST_LIST 0 /* AN000 */
101#define SUBST_COUNT 0 /* AN000 */
102
103#define VOL_LABEL 0x08 /* AN000 */
104#define PERCENT 0x25 /* AN000 */
105#define DECIMAL 0x2E /* AN000 */
106#define PERIOD 0x2E /* AN000 */
107#define ONE_MEG 1048576 /* AN000 */
108
109 #if IBMCOPYRIGHT
110#define HIWHITE_ON_BLUE 0x1F /* AN006 */
111#define WHITE_ON_BLUE 0x17 /* AN006 */
112#define BLINK_HIWHITE_ON_BLUE 0x9F /* AN006 */
113#define HIWHITE_ON_BLACK 0x0F /* AN006 */
114#define GRAY_ON_BLACK 0x07 /* AN006 */
115 #else
116#define HIWHITE_ON_BLUE 0x0F /* AN006 */
117#define WHITE_ON_BLUE 0x07 /* AN006 */
118#define BLINK_HIWHITE_ON_BLUE 0x8F /* AN006 */
119#define HIWHITE_ON_BLACK 0x0F /* AN006 */
120#define GRAY_ON_BLACK 0x07
121 #endif
122
123
124#define BYTE unsigned char /* AN000 */
125#define WORD unsigned short /* AN000 */
126#define DWORD unsigned long /* AN000 */
127#define sw_type /* AN000 */
128#define sw_item_tag /* AN000 */
129#define sw_synonym /* AN000 */
130#define sw_value /* AN000 */
131
132#define CARRY_FLAG 0x0001 /* mask for carry flag */ /* AN000 */
133#define PARITY_FLAG 0x0004 /* mask for parity flag */ /* AN000 */
134#define ACARRY_FLAG 0x0010 /* mask for aux carry flag */ /* AN000 */
135#define ZERO_FLAG 0x0040 /* mask for zero flag */ /* AN000 */
136#define SIGN_FLAG 0x0080 /* mask for sign flag */ /* AN000 */
137#define TRAP_FLAG 0x0100 /* mask for trap flag */ /* AN000 */
138#define INTERRUPT_FLAG 0x0200 /* mask for interrupt flag */ /* AN000 */
139#define DIRECTION_FLAG 0x0400 /* mask for direction flag */ /* AN000 */
140#define OVERFLOW_FLAG 0x0800 /* mask for overflow flag */ /* AN000 */
141
142#define SEMICOLON 0x3B /* AN000 - VALID COMMAND LINE DELIMITER*/
143
144#define XFLOAT unsigned
145
146#define u(c) ((unsigned)(c)) /* AN000 */
147#define f(c) ((XFLOAT)(c)) /* AN000 */
148#define c(c) ((char)(c)) /* AN000 */
149#define d(c) ((double)(c)) /* AN004 */
150#define uc(c) ((unsigned char)(c)) /* AN000 */
151#define ui(c) ((unsigned int)(c)) /* AN000 */
152#define ul(c) ((unsigned long)(c)) /* AN000 */
153
154
155struct entry
156 BEGIN
157 unsigned char boot_ind;
158 unsigned char start_head;
159 unsigned char start_sector;
160 unsigned start_cyl;
161 unsigned char sys_id;
162 unsigned char end_head;
163 unsigned char end_sector;
164 unsigned end_cyl;
165 unsigned long rel_sec;
166 unsigned long num_sec;
167 char order;
168 FLAG changed;
169 unsigned mbytes_used; /* AN000 */
170 unsigned percent_used; /* AN000 */
171 char vol_label[12]; /* AN000 */
172 char system[9]; /* AN000 */
173 char drive_letter; /* AN000 */
174 END;
175
176struct freespace
177 BEGIN
178 unsigned space;
179 unsigned start;
180 unsigned end;
181 unsigned mbytes_unused; /* AN000 */
182 unsigned percent_unused; /* AN000 */
183 char volume_id[12]; /* AN000 */
184 END;
185
186struct diskaccess /* AN002 */
187 BEGIN /* AN002 */
188 char dac_special_func; /* AN002 */
189 char dac_access_flag; /* AN002 */
190 END; /* AN002 */
191
192struct dx_buffer_ioctl /* AN000 */
193 BEGIN /* AN000 */
194 unsigned int info_level; /* Information level */ /* AN000 */
195 unsigned long serial_num; /* serial number */ /* AN000 */
196 char vol_label[11]; /* volume label */ /* AN000 */
197 char file_system[8]; /* file system */ /* AN000 */
198 END; /* AN000 */
199
200struct subst_list /* AN000 */
201 BEGIN /* AN000 */
202 char sl_size1; /* Size of List */ /* AN000 */
203 char zero1; /* Reserved */ /* AN000 */
204 char far *value1; /* Time, date, or ptr to data item*/ /* AN000 */
205 char one; /* n of %n */ /* AN000 */
206 char flags1; /* Data Type flags */ /* AN000 */
207 char max_width1; /* Maximum FIELD width */ /* AN000 */
208 char min_width1; /* Minimum FIELD width */ /* AN000 */
209 char pad_char1; /* Character for pad FIELD */ /* AN000 */
210 END; /* AN000 */
211
212struct sublistx /* ;an000; */
213 BEGIN /* ;an000; */
214 unsigned char size; /* sublist size */ /* ;an000; */
215 unsigned char reserved; /* reserved for future growth */ /* ;an000; */
216 unsigned far *value; /* pointer to replaceable parm */ /* ;an000; */
217 unsigned char id; /* type of replaceable parm */ /* ;an000; */
218 unsigned char flags; /* how parm is to be displayed */ /* ;an000; */
219 unsigned char max_width; /* max width of replaceable field */ /* ;an000; */
220 unsigned char min_width; /* min width of replaceable field */ /* ;an000; */
221 unsigned char pad_char; /* pad character for replaceable field */ /* ;an000; */
222 END;
223 /* ;an000; */
224 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/FDISK.LNK b/v4.0/src/CMD/FDISK/FDISK.LNK
new file mode 100644
index 0000000..cb495d6
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/FDISK.LNK
@@ -0,0 +1,31 @@
1/DOSSEG /MAP /CPA:1000 /SEG:1024 /E+
2 main.obj +
3 mainmenu.obj +
4 d_menus.obj +
5 c_menus.obj +
6 fdisk.obj +
7 reboot.obj +
8 bootrec.obj +
9 fdboot.obj +
10 display.obj +
11 input.obj +
12 tdisplay.obj +
13 vdisplay.obj +
14 space.obj +
15 partinfo.obj +
16 video.obj +
17 makepart.obj +
18 int13.obj +
19 diskout.obj +
20 messages.obj +
21 fdparse.obj +
22 convert.obj +
23 global.obj +
24 _parse.obj +
25 _msgret.obj +
26 fdiskm.obj
27fdisk.exe,
28fdisk.map,
29..\..\mapper\MAPPER.lib +
30..\..\inc\comsubs.lib;
31 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/FDISK.MSG b/v4.0/src/CMD/FDISK/FDISK.MSG
new file mode 100644
index 0000000..7af7939
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/FDISK.MSG
@@ -0,0 +1,1177 @@
1/* FDISK MESSAGE FILE */
2
3/************************************************************************/
4/* Please log all modifications to this file: */
5/*----------------------------------------------------------------------*/
6/* Date: 04/04/86 */
7/* Changed by: Mark T */
8/* Message changed: menu_1 - menu_38 */
9/* Reason: Creation of file */
10/*----------------------------------------------------------------------*/
11/* Date: 05/04/87 */
12/* Changed by: Dennis M */
13/* Message changed: menu_1 - menu_44 */
14/* Reason: DOS 3.3 */
15/*----------------------------------------------------------------------*/
16/* Date: */
17/* Changed by: */
18/* Message changed: */
19/* Reason: */
20/*----------------------------------------------------------------------*/
21/***********************************************************************/
22
23/************************************************************************/
24/* FDISK MESSAGES */
25/* */
26/* Portions of the screen that are handled in the msg are indicated on */
27/* the listing of the screen with the message name given. If the text */
28/* message is defined in another screen, then the name is followed by */
29/* a "#" character */
30/* */
31/* NOTE TO TRANSLATORS */
32/* The characters inside the <> and the ^^ are control characters and */
33/* should not be translated. The Control characters are defined as */
34/* follows: */
35/* */
36/* <H> - Highlight the following text */
37/* <R> - Regular text */
38/* <U> - Underline the following text */
39/* <B> - Blink the following text */
40/* <O> - Turn off Blink */
41/* <Y> - Print YES character, as set by define */
42/* <N> - Print NO character, as set by define */
43/* <W> - Sound the beep */
44/* <S> - Save cursor position for later use */
45/* <G> - Cursor position left justified and regular proceed to right */
46/* <C> - Clear the screen out from control char to end of line */
47/* <I> - Insert character from Insert[] string. This string must be set */
48/* up prior to displaying the message. The first <I> will insert */
49/* Insert[0], the second Insert[1], etc....This will move the */
50/* cursor one postition. The Insert%% string will be initialized */
51/* */
52/* */
53/* Multiple control characters can be between the <>. */
54/* */
55/* The ^^ indicates Row and column for the text and has the format of */
56/* ^rrcc^ where the numbers are decimal and zero based .first row/col */
57/* is 00. The numbers are in decimal, and must be 2 characters, which */
58/* means rows/cols 0-9 should be listed as 00-09. For example, the 5th */
59/* row, 3rd column on the screen would be listed as ^0402^. */
60/* */
61/* The column number is always the column desired. The row number is */
62/* an offset from the previous row. For example, if the text just */
63/* printed is on row 6, and the next text should be printed 2 rows */
64/* down in column 0, then the control strin would be ^0201^. The first */
65/* row specified in the message is assumed to be based off of row 0, */
66/* it would actually specify the actual row for the start of the msg */
67/* to be printed. */
68/* */
69/* NOTE: ALWAYS SAVE THIS FILE WITH NO TABS CHARACTERS */
70/************************************************************************/
71
72
73/************************************************************************/
74/* */
75/* Define Area for text variables */
76/* */
77/************************************************************************/
78
79#define ACTIVE_PART 'A' /* Character to indicate active status */
80#define DRIVE_INDICATOR ':' /* Character displayed to indicate drive letter */
81
82/* */
83/* */
84/* The following character strings are required to display the */
85/* menu screens for FDISK. The messages have a label type of: menu_xx */
86/* */
87/* */
88
89/*******************************************************************************************************/
90/* Screen for DO_MAIN_MENU */
91/* */
92/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
93/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
94/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
95/* 00³ IBM Personal Computer ³menu_1 */
96/* 01³ Fixed Disk Setup Program Version 3.40 ³menu_1 */
97/* 02³ (C%Copyright IBM Corp. 1983,1988 ³menu_1 */
98/* 03³ ³ */
99/* 04³ FDISK Options ³menu_2 */
100/* 05³ ³ */
101/* 06³ Current fixed disk drive: # ³menu_5 */
102/* 07³ ³ */
103/* 08³ Choose one of the following: ³menu_3 */
104/* 09³ ³ */
105/* 10³ 1. Create DOS Partition or Logical DOS Drive ³menu_2 */
106/* 11³ 2. Set active partition ³menu_2 */
107/* 12³ 3. Delete DOS Partition or Logical DOS Drive ³menu_2 */
108/* 13³ 4. Display partition information ³menu_2 */
109/* 14³ 5. Select next fixed disk drive ³menu_4 */
110/* 15³ ³ */
111/* 16³ ³ */
112/* 17³ Enter choice: [#] ³menu_7 */
113/* 18³ ³ */
114/* 19³ ³ */
115/* 20³ Warning! No partitions are set active - disk 1 is not startable unless ³menu_6 */
116/* 21³ a partition is set active. ³ */
117/* 22³ ³ */
118/* 23³ ³ */
119/* 24³ Press ESC to exit FDISK ³menu_2 */
120/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
121/*******************************************************************************************************/
122
123
124/*-------------------------------------------------------------*/
125 char far *menu_1 =
126
127"^0030^<R>è1001\
128 ^0128^<R>è1002\
129 ^0124^<R>è1003";
130
131
132
133/*-------------------------------------------------------------*/
134 char far *menu_2 =
135
136"^0433^<H>è1004\
137 ^0604^<H>è1005\
138 ^0104^<H>è1006\
139 ^0104^<H>è1007\
140 ^0104^<H>è1008\
141 ^1104^<R>è1009";
142
143/*-------------------------------------------------------------*/
144 char far *menu_3 =
145
146"^0804^<R>è1010";
147
148/*-------------------------------------------------------------*/
149 char far *menu_4 =
150
151"^1404^<H>è1011";
152
153/*-------------------------------------------------------------*/
154 char far *menu_5 =
155
156"^0604^<R>è1012";
157
158/*-------------------------------------------------------------*/
159 char far *menu_6 =
160
161"^2004^<H>è1013\
162 ^0104^<R>è1014";
163
164/*-------------------------------------------------------------*/
165 char far *menu_7 =
166
167"^1704^<H>è1015";
168
169/*******************************************************************************************************/
170/* Screen for CREATE_PARTITION */
171/* */
172/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
173/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
174/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
175/* 00³ ³ */
176/* 01³ ³ */
177/* 02³ ³ */
178/* 03³ ³ */
179/* 04³ Create DOS Partition or Logical DOS Drive ³menu_8 */
180/* 05³ ³ */
181/* 06³ Current fixed disk drive: # ³menu_5 # */
182/* 07³ ³ */
183/* 08³ Choose one of the following: ³menu_3 # */
184/* 09³ ³ */
185/* 10³ 1. Create Primary DOS Partition ³menu_9 */
186/* 11³ 2. Create Extended DOS Partition ³menu_9 */
187/* 12³ 3. Create logical DOS Drive(s) in the Extended DOS Partition ³menu_10 */
188/* 13³ ³ */
189/* 14³ ³ */
190/* 15³ ³ */
191/* 16³ ³ */
192/* 17³ Enter choice: [ ] ³menu_7 # */
193/* 18³ ³ */
194/* 19³ ³ */
195/* 20³ ³ */
196/* 21³ ³ */
197/* 22³ ³ */
198/* 23³ ³ */
199/* 24³ Press ESC to return to FDISK Options ³menu_11 */
200/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
201/*******************************************************************************************************/
202
203/*-------------------------------------------------------------*/
204 char far *menu_8 =
205
206"^0420^<H>è1016";
207
208/*-------------------------------------------------------------*/
209 char far *menu_9 =
210
211"^1004^<H>è1017\
212 ^0104^<H>è1018";
213
214/*-------------------------------------------------------------*/
215 char far *menu_10 =
216
217"^1204^<H>è1019";
218
219/*-------------------------------------------------------------*/
220 char far *menu_11 =
221
222"^2404^<R>è1020";
223
224
225/*******************************************************************************************************/
226/* Screen for DOS_CREATE_PARTITION */
227/* */
228/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
229/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
230/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
231/* 00³ ³ */
232/* 01³ ³ */
233/* 02³ ³ */
234/* 03³ ³ */
235/* 04³ Create Primary DOS Partition ³menu_12 */
236/* 05³ ³ */
237/* 06³ Current fixed disk drive: # ³menu_5 # */
238/* 07³ ³ */
239/* 08³ Do you wish to use the maximum available size for a Primary DOS Partition ³menu_13 */
240/* 09³ and make the partition active (Y/N).....................? [Y] ³menu_13 */
241/* 10³ ³ */
242/* 11³ ³ */
243/* 12³ ³ */
244/* 13³ ³ */
245/* 14³ ³ */
246/* 15³ ³ */
247/* 16³ ³ */
248/* 17³ ³ */
249/* 18³ ³ */
250/* 19³ ³ */
251/* 20³ ³ */
252/* 21³ ³ */
253/* 22³ ³ */
254/* 23³ ³ */
255/* 24³ Press ESC to return to FDISK Options ³menu_11 */
256/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
257/*******************************************************************************************************/
258
259/*-------------------------------------------------------------*/
260 char far *menu_12 =
261
262"^0427^<H>è1021";
263
264/*-------------------------------------------------------------*/
265 char far *menu_13 =
266
267"^0804^<R>è1022\
268 ^0104^<R>è1023";
269
270/*-------------------------------------------------------------*/
271 char far *menu_45 =
272
273"^0804^<R>è1022\
274 ^0104^<R>è1024";
275
276
277/*******************************************************************************************************/
278/* Screen for INPUT_DOS_CREATE */
279/* */
280/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
281/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
282/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
283/* 00³ ³ */
284/* 01³ ³ */
285/* 02³ ³ */
286/* 03³ ³ */
287/* 04³ Create Primary DOS Partition ³menu_12 # */
288/* 05³ ³ */
289/* 06³ Current fixed disk drive: # ³menu_5 # */
290/* 07³ ³ */
291/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 */
292/* 09³ ## # # ####### #### ###% ³ */
293/* 10³ ## # # ####### #### ###% ³ */
294/* 11³ ## # # ####### #### ###% ³ */
295/* 12³ ## # # ####### #### ###% ³ */
296/* 13³ ³ */
297/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 */
298/* 15³ Maximum space available for partition is #### Mbytes (###%) ³menu_16 */
299/* 16³ ³ */
300/* 17³ ³ */
301/* 18³ Enter partition size in Mbytes or percent of disk space (%) to ³menu_39 */
302/* 19³ create a Primary DOS Partition..................................[####] ³ */
303/* 20³ ³ */
304/* 21³ ³ */
305/* 22³ ³ */
306/* 23³ ³ */
307/* 24³ Press ESC to return to FDISK Options ³menu_11 */
308/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
309/****************************************************************/
310
311/*-------------------------------------------------------------*/
312 char far *menu_14 =
313
314"^0804^<R>è1025\
315 ^0104^<R> <II> <I> <I> <IIIIIII> <IIII> <IIII>\
316 ^0104^<R> <II> <I> <I> <IIIIIII> <IIII> <IIII>\
317 ^0104^<R> <II> <I> <I> <IIIIIII> <IIII> <IIII>\
318 ^0104^<R> <II> <I> <I> <IIIIIII> <IIII> <IIII>";
319
320/*-------------------------------------------------------------*/
321 char far *menu_15 =
322
323"^1404^<R>è1026";
324
325/*-------------------------------------------------------------*/
326 char far *menu_16 =
327
328"^1504^<RC>è1027";
329
330/*-------------------------------------------------------------*/
331 char far *menu_39 =
332
333"^1804^<RC>è1028\
334 ^0104^<RC>è1029";
335
336
337/****************************************************************************************************/
338/* Screen for EXT_CREATE_PARTITION */
339/* */
340/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
341/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
342/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
343/* 00³ ³ */
344/* 01³ ³ */
345/* 02³ ³ */
346/* 03³ ³ */
347/* 04³ Create Extended DOS Partition ³menu_17 */
348/* 05³ ³ */
349/* 06³ Current fixed disk drive: # ³menu_5 # */
350/* 07³ ³ */
351/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */
352/* 09³ ## # # ####### #### ###% ³ */
353/* 10³ ## # # ####### #### ###% ³ */
354/* 11³ ## # # ####### #### ###% ³ */
355/* 12³ ## # # ####### #### ###% ³ */
356/* 13³ ³ */
357/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */
358/* 15³ Maximum space available for partition is #### Mbytes (##%) ³menu_16 # */
359/* 16³ ³ */
360/* 17³ ³ */
361/* 18³ Enter partition size in Mbytes or percent of disk space (%) to ³menu_42 # */
362/* 19³ create an Extended DOS Partition................................[####] ³ */
363/* 20³ ³ */
364/* 21³ ³ */
365/* 22³ ³ */
366/* 23³ ³ */
367/* 24³ Press ESC to continue ³menu_46 */
368/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
369/***************************************************************/
370
371/*-------------------------------------------------------------*/
372 char far *menu_17 =
373
374"^0427^<H>è1030";
375
376/*-------------------------------------------------------------*/
377 char far *menu_42 =
378
379"^1804^<RC>è1028\
380 ^0104^<RC>è1031";
381
382
383/*-------------------------------------------------------------*/
384 char far *menu_46 =
385
386"^2404^<R>è1032";
387
388
389
390
391/*****************************************************************************************************/
392/* Screen for VOLUME_CREATE */
393/* */
394/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
395/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
396/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
397/* 00³ ³ */
398/* 01³ Create Logical DOS Drive(s) in the Extended Partition ³menu_18 */
399/* 02³ ³ */
400/* 03³Drv Volume Label Mbytes System Usage Drv Volume Label Mbytes System Usage³menu_19/20 */
401/* 04³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
402/* 05³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
403/* 06³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
404/* 07³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
405/* 08³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
406/* 09³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
407/* 10³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
408/* 11³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
409/* 12³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
410/* 13³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
411/* 14³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
412/* 15³## ########### #### ######## ###% ³ */
413/* 16³ ³ */
414/* 17³ Total Extended DOS partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_17 */
415/* 18³ Maximum space available for logical drive is #### Mbytes (###%) ³menu_22 */
416/* 19³ ³ */
417/* 20³ Enter logical drive size in Mbytes or percent of disk space (%)...[####] ³menu_40 */
418/* 21³ ³ */
419/* 22³ ³ */
420/* 23³ ³ */
421/* 24³ Press ESC to return to FDISK Options ³menu_11 */
422/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
423/***************************************************************/
424
425/*-------------------------------------------------------------*/
426 char far *menu_18 =
427
428"^0112^<HC>è1033";
429
430/*-------------------------------------------------------------*/
431 char far *menu_19 =
432
433"^0300^<H>è1034\
434^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
435^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
436^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
437^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
438^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
439^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>";
440
441/*----------------------------------------------------------*/
442 char far *menu_43 =
443
444"^1000^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
445^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
446^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
447^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
448^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
449^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>";
450
451/*-------------------------------------------------------------*/
452 char far *menu_20 =
453
454"^0341^<H>è1034\
455^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
456^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
457^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
458^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
459^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
460^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>";
461
462/*---------------------------------------------------------*/
463 char far *menu_44 =
464
465"^1041^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
466^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
467^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
468^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
469^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>";
470
471/*-------------------------------------------------------------*/
472 char far *menu_21 =
473
474"^1704^<RC>è1035";
475
476/*-------------------------------------------------------------*/
477 char far *menu_22 =
478
479"^1804^<RC>è1036";
480
481/*-------------------------------------------------------------*/
482 char far *menu_40 =
483
484"^2004^<RC>è1037";
485
486
487/*****************************************************************************************************/
488/* Screen for CHANGE_ACTIVE_PARTITION */
489/* */
490/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
491/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
492/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
493/* 00³ ³ */
494/* 01³ Set Active Partition ³menu_23 */
495/* 02³ ³ */
496/* 03³ ³ */
497/* 04³ ³ */
498/* 05³ ³ */
499/* 06³ Current fixed disk drive: # ³menu_5 # */
500/* 07³ ³ */
501/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */
502/* 09³ ## # # ####### #### ###% ³ */
503/* 10³ ## # # ####### #### ###% ³ */
504/* 11³ ## # # ####### #### ###% ³ */
505/* 12³ ## # # ####### #### ###% ³ */
506/* 13³ ³ */
507/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */
508/* 15³ ³ */
509/* 16³ Enter the number of the partition you want to make active............:[#] ³menu_24 */
510/* 17³ ³ */
511/* 18³ ³ */
512/* 19³ ³ */
513/* 20³ ³ */
514/* 21³ ³ */
515/* 22³ ³ */
516/* 23³ ³ */
517/* 24³ Press ESC to return to FDISK Options ³menu_11 */
518/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
519/*****************************************************************************************************/
520
521/*-------------------------------------------------------------*/
522 char far *menu_23 =
523
524"^0430^<H>è1038";
525
526/*-------------------------------------------------------------*/
527 char far *menu_24 =
528
529"^1604^<R>è1039";
530
531
532/*****************************************************************************************************/
533/* Screen for DELETE_PARTITION */
534/* */
535/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
536/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
537/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
538/* 00³ ³ */
539/* 01³ ³ */
540/* 02³ ³ */
541/* 03³ ³ */
542/* 04³ Delete DOS Partition or Logical DOS Drive ³menu_25 */
543/* 05³ ³ */
544/* 06³ Current fixed disk drive: # ³menu_5 # */
545/* 07³ ³ */
546/* 08³ Choose one of the following: ³menu_3 # */
547/* 09³ ³ */
548/* 10³ 1. Delete Primary DOS Partition ³menu_26 */
549/* 11³ 2. Delete Extended DOS Partition ³menu_26 */
550/* 12³ 3. Delete Logical DOS Drive(s) in the Extended DOS Partition ³menu_27 */
551/* 13³ ³ */
552/* 14³ ³ */
553/* 15³ ³ */
554/* 16³ ³ */
555/* 17³ Enter choice: [ ] ³menu_7 # */
556/* 18³ ³ */
557/* 19³ ³ */
558/* 20³ ³ */
559/* 21³ ³ */
560/* 22³ ³ */
561/* 23³ ³ */
562/* 24³ Press ESC to return to FDISK Options ³menu_11 */
563/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
564/*****************************************************************************************************/
565
566/*-------------------------------------------------------------*/
567 char far *menu_25 =
568
569"^0419^<H>è1040";
570
571/*-------------------------------------------------------------*/
572 char far *menu_26 =
573
574"^1004^<HC>è1041\
575 ^0104^<HC>è1042";
576
577/*-------------------------------------------------------------*/
578 char far *menu_27 =
579
580"^1204^<HC>è1043";
581
582/*****************************************************************************************************/
583/* Screen for DOS_DELETE */
584/* */
585/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
586/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
587/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
588/* 00³ ³ */
589/* 01³ ³ */
590/* 02³ ³ */
591/* 03³ ³ */
592/* 04³ Delete Primary DOS Partition ³menu_28 */
593/* 05³ ³ */
594/* 06³ Current fixed disk drive: # ³menu_5 # */
595/* 07³ ³ */
596/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */
597/* 09³ ## # # ####### #### ###% ³menu_14 # */
598/* 10³ ## # # ####### #### ###% ³ */
599/* 11³ ## # # ####### #### ###% ³ */
600/* 12³ ## # # ####### #### ###% ³ */
601/* 13³ ³ */
602/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */
603/* 15³ ³ */
604/* 16³ Warning! Data in the deleted Primary DOS Partition will be lost. ³menu_29 */
605/* 17³ Do you wish to continue (Y/N).................? [N] ³menu_29 */
606/* 18³ ³ */
607/* 19³ ³ */
608/* 20³ ³ */
609/* 21³ ³ */
610/* 22³ ³ */
611/* 23³ ³ */
612/* 24³ Press ESC to return to FDISK Options ³menu_11 */
613/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
614/*****************************************************************************************************/
615
616/*-------------------------------------------------------------*/
617 char far *menu_28 =
618
619"^0426^<H>è1044";
620
621/*-------------------------------------------------------------*/
622 char far *menu_29 =
623
624"^1604^<HBC>è1045\
625 ^0104^<RC>è1046";
626
627/*****************************************************************************************************/
628/* Screen for EXT_DELETE */
629/* */
630/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
631/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
632/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
633/* 00³ ³ */
634/* 01³ ³ */
635/* 02³ ³ */
636/* 03³ ³ */
637/* 04³ Delete Extended DOS Partition ³menu_30 */
638/* 05³ ³ */
639/* 06³ Current fixed disk drive: # ³menu_5 # */
640/* 07³ ³ */
641/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */
642/* 09³ ## # # ####### #### ###% ³menu_14 # */
643/* 10³ ## # # ####### #### ###% ³ */
644/* 11³ ## # # ####### #### ###% ³ */
645/* 12³ ## # # ####### #### ###% ³ */
646/* 13³ ³ */
647/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */
648/* 15³ ³ */
649/* 16³ Warning! Data in the deleted Extended DOS partition will be lost. ³menu_31 */
650/* 17³ Do you wish to continue (Y/N).................? [N] ³menu_31 */
651/* 18³ ³ */
652/* 19³ ³ */
653/* 20³ ³ */
654/* 21³ ³ */
655/* 22³ ³ */
656/* 23³ ³ */
657/* 24³ Press ESC to return to FDISK Options ³menu_11 */
658/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
659/*****************************************************************************************************/
660
661/*-------------------------------------------------------------*/
662 char far *menu_30 =
663
664"^0426^<H>è1047";
665
666/*-------------------------------------------------------------*/
667 char far *menu_31 =
668
669"^1604^<HBC>è1048\
670 ^0104^<RC>è1049";
671
672/******************************************************************************************************/
673/* Screen for VOL_DELETE */
674/* */
675/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
676/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
677/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
678/* 00³ ³ */
679/* 01³ Delete Logical DOS Drive(s) in the Extended DOS Partition ³menu_32 */
680/* 02³ ³ */
681/* 03³Drv Volume Label MBytes System Usage Drv Volume Label MBytes System Usage³menu_19/20 # */
682/* 04³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
683/* 05³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
684/* 06³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
685/* 07³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
686/* 08³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
687/* 09³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
688/* 10³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
689/* 11³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
690/* 12³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
691/* 13³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
692/* 14³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
693/* 15³## ############# #### ######## ###% ³ */
694/* 16³ ³ */
695/* 17³ Total Extended DOS Partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_21 */
696/* 18³ ³ */
697/* 19³ Warning! Data in a deleted Logical DOS Drive will be lost. ³menu_33 */
698/* 20³ What drive do you want to delete...........................? [ ] ³menu_33 */
699/* 21³ Enter Volume Label.............................? [ ] ³menu_41 */
700/* 22³ Are you sure (Y/N).............................? [N] ³menu_34 */
701/* 23³ ³ */
702/* 24³ Press ESC to return to FDISK Options ³menu_11 */
703/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
704/******************************************************************************************************/
705
706/*-------------------------------------------------------------*/
707 char far *menu_32 =
708
709"^0112^<H>è1050";
710
711/*-------------------------------------------------------------*/
712 char far *menu_33 =
713
714"^1904^<HBC>è1051\
715 ^0104^<RC>è1052";
716
717/*-------------------------------------------------------------*/
718 char far *menu_34 =
719
720"^2204^<R>è1053";
721
722/*-------------------------------------------------------------*/
723 char far *menu_41 =
724
725"^2104^<R>è1054";
726
727/******************************************************************************************************/
728/* Screen for DISPLAY_PARTITION_INFORMATION */
729/* */
730/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
731/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
732/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
733/* 00³ ³ */
734/* 01³ ³ */
735/* 02³ ³ */
736/* 03³ ³ */
737/* 04³ Display Partition Information ³menu_35 */
738/* 05³ ³ */
739/* 06³ Current fixed disk drive: # ³menu_5 # */
740/* 07³ ³ */
741/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */
742/* 09³ ## # # ####### #### ###% ³menu_14 # */
743/* 10³ ## # # ####### #### ###% ³ */
744/* 11³ ## # # ####### #### ###% ³ */
745/* 12³ ## # # ####### #### ###% ³ */
746/* 13³ ³ */
747/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */
748/* 15³ ³ */
749/* 16³ ³ */
750/* 17³ The Extended DOS partition contains Logical DOS Drives. ³menu_36 */
751/* 18³ Do you want to display the logical drive information (Y/N)......? [Y] ³menu_36 */
752/* 19³ ³ */
753/* 20³ ³ */
754/* 21³ ³ */
755/* 22³ ³ */
756/* 23³ ³ */
757/* 24³ Press ESC to return to FDISK Options ³menu_11 */
758/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
759/******************************************************************************************************/
760
761/*-------------------------------------------------------------*/
762 char far *menu_35 =
763
764"^0426^<H>è1055";
765
766/*-------------------------------------------------------------*/
767 char far *menu_36 =
768
769"^1704^<RC>è1056\
770 ^0104^<RC>è1057";
771
772/*****************************************************************************************************/
773/* Screen for DISPLAY_VOLUME_INFORMATION */
774/* */
775/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
776/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
777/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
778/* 00³ ³ */
779/* 01³ Display Logical DOS Drive Information ³menu_37 */
780/* 02³ ³ */
781/* 03³Drv Volume Label Mbytes System Usage Drv Volume Label Mbytes System Usage³menu_19/20 */
782/* 04³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
783/* 05³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
784/* 16³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
785/* 17³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
786/* 18³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
787/* 19³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
788/* 10³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
789/* 11³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
790/* 12³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
791/* 13³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
792/* 14³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
793/* 15³## ############# #### ######## ###% ³ */
794/* 16³ ³ */
795/* 17³ Total Extended DOS partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_17 */
796/* 18³ ³ */
797/* 19³ ³ */
798/* 20³ ³ */
799/* 21³ ³ */
800/* 22³ ³ */
801/* 23³ ³ */
802/* 24³ Press ESC to return to FDISK Options ³menu_11 */
803/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
804/*****************************************************************************************************/
805
806/*-------------------------------------------------------------*/
807 char far *menu_37 =
808
809"^0121^<H>è1058";
810
811/*****************************************************************************************************/
812/* Screen for SYSTEM_REBOOT */
813/* */
814/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
815/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
816/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
817/* 00³ ³ */
818/* 01³ ³ */
819/* 02³ ³ */
820/* 03³ ³ */
821/* 04³ ³ */
822/* 05³ ³ */
823/* 06³ ³ */
824/* 07³ ³ */
825/* 08³ ³ */
826/* 09³ ³ */
827/* 10³ ³ */
828/* 11³ ³ */
829/* 12³ ³ */
830/* 13³ System will now restart ³menu_38 */
831/* 14³ ³ */
832/* 15³ Insert DOS diskette in drive A: ³menu_38 */
833/* 16³ Press any key when ready . . . ³menu_38 */
834/* 17³ ³ */
835/* 18³ ³ */
836/* 19³ ³ */
837/* 20³ ³ */
838/* 21³ ³ */
839/* 22³ ³ */
840/* 23³ ³ */
841/* 24³ ³ */
842/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
843/*****************************************************************************************************/
844
845/*-------------------------------------------------------------*/
846 char far *menu_38 =
847
848"^1304^<H>è1059\
849 ^0204^<R>è1060\
850 ^0104^<R>è1061";
851
852
853/* */
854/* */
855/* The following character strings are required to display the */
856/* status messages indicating successful operation. These messages */
857/* have the form: status_xx */
858/* */
859/* Note: In order to overlay any previous message on the screen, these */
860/* messages are all 2 lines long. The second line may only be */
861/* a blank line. If 2 lines are needed for translation, use the */
862/* second line for text. Exceptions are those msgs on line 0, */
863/* and status_3. */
864/* */
865
866/*-------------------------------------------------------------*/
867 char far *status_1 =
868
869"^2104^<CH>è1062\
870 ^0100^<CW>";
871
872/*-------------------------------------------------------------*/
873 char far *status_2 =
874
875"^2104^<CH>è1063\
876 ^0100^<CW>";
877
878/*-------------------------------------------------------------*/
879 char far *status_3 =
880
881"^0004^<H>è1064";
882/* NOTE - the ^rrcc^ must be the first thing in this string */
883
884/*-------------------------------------------------------------*/
885 char far *status_4 =
886
887"^2104^<CH>è1065\
888 ^0100^<CW>";
889
890/*-------------------------------------------------------------*/
891 char far *status_5 =
892
893"^2104^<CH>è1066\
894 ^0100^<CW>";
895
896/*-------------------------------------------------------------*/
897 char far *status_6 =
898
899"^2104^<CH>è1067\
900 ^0100^<CW>";
901
902/*-------------------------------------------------------------*/
903 char far *status_7 =
904
905"^2204^<CH>è1068";
906
907/*-------------------------------------------------------------*/
908 char far *status_8 =
909
910"^2104^<CH>è1069\
911 ^0100^<C>";
912
913/*-------------------------------------------------------------*/
914 char far *status_9 =
915
916"^1004^<CH>è1070\
917 ^0100^<C>";
918
919/*-------------------------------------------------------------*/
920 char far *status_10 =
921
922"^1804^<CH>è1071";
923
924/*-------------------------------------------------------------*/
925 char far *status_11 =
926
927"^0004^<H>è1072";
928/* NOTE - the ^rrcc^ must be the first thing in this string */
929
930/*-------------------------------------------------------------*/
931 char far *status_12 =
932
933"^2104^<CH>è1073\
934 ^0100^<CW>";
935
936/*-------------------------------------------------------------*/
937
938/* */
939/* */
940/* The following character strings are required to display the */
941/* error messages. These have form: error_xx */
942/* */
943/* Note: In order to overlay any previous message on the screen, these */
944/* messages are all 2 lines long. The second line may only be */
945/* a blank line. If 2 lines are needed for translation, use the */
946/* second line for text. Exceptions are those msgs on line 0. */
947/* and those messages that start on line 23 */
948/* */
949
950
951/*-------------------------------------------------------------*/
952 char far *error_1 =
953
954"^0004^<CH>è1074\
955 ^0100^<CW>";
956
957/*-------------------------------------------------------------*/
958 char far *error_2 =
959
960"^2204^<CH>è1075\
961 ^0100^<CW>";
962
963/*-------------------------------------------------------------*/
964 char far *error_3 =
965
966"^2204^<CH>è1076\
967 ^0100^<CW>";
968
969/*-------------------------------------------------------------*/
970 char far *error_4 =
971
972"^0004^<CHW>è1077";
973
974/*-------------------------------------------------------------*/
975 char far *error_5 =
976
977"^0004^<CHW>è1078";
978
979/*-------------------------------------------------------------*/
980 char far *error_6 =
981
982"^2204^<CH>è1079\
983 ^0100^<CW>";
984
985/*-------------------------------------------------------------*/
986 char far *error_7 =
987
988"^2204^<CH>è1080\
989 ^0100^<CW>";
990
991/*-------------------------------------------------------------*/
992 char far *error_8 =
993
994"^2204^<CH>è1081\
995 ^0100^<CW>";
996
997/*-------------------------------------------------------------*/
998 char far *error_9 =
999
1000"^2204^<CH>è1082\
1001 ^0100^<CW>";
1002
1003/*-------------------------------------------------------------*/
1004 char far *error_10 =
1005
1006"^2204^<CH>è1083\
1007 ^0100^<CW>";
1008
1009/*-------------------------------------------------------------*/
1010 char far *error_12 =
1011
1012"^2204^<CH>è1084\
1013 ^0100^<CW>";
1014
1015/*-------------------------------------------------------------*/
1016 char far *error_13 =
1017
1018"^2204^<CH>è1085\
1019 ^0100^<CW>";
1020
1021/*-------------------------------------------------------------*/
1022 char far *error_14 =
1023
1024"^2204^<CH>è1086\
1025 ^0100^<CW>";
1026
1027/*-------------------------------------------------------------*/
1028 char far *error_15 =
1029
1030"^2204^<CH>è1087\
1031 ^0100^<CW>";
1032
1033/*-------------------------------------------------------------*/
1034 char far *error_16 =
1035
1036"^2204^<CH>è1088\
1037 ^0100^<CW>";
1038
1039/*-------------------------------------------------------------*/
1040 char far *error_17 =
1041
1042"^2204^<CH>è1089";
1043
1044/*-------------------------------------------------------------*/
1045 char far *error_19 =
1046
1047"^2204^<CH>è1090\
1048 ^0104^<CH>è1091";
1049
1050/*-------------------------------------------------------------*/
1051 char far *error_20 =
1052
1053"^2204^<CH>è1092\
1054 ^0104^<CH>è1093";
1055
1056/*-------------------------------------------------------------*/
1057 char far *error_21 =
1058
1059"^2204^<CH>è1094";
1060
1061/*-------------------------------------------------------------*/
1062 char far *error_22 =
1063
1064"^2204^<CH>è1095";
1065
1066/*-------------------------------------------------------------*/
1067 char far *error_23 =
1068
1069"^2204^<C>\
1070 ^0104^<CHI>è1096";
1071
1072/*-------------------------------------------------------------*/
1073 char far *error_24 =
1074
1075"^2204^<CH>è1097";
1076
1077/*-------------------------------------------------------------*/
1078 char far *error_25 =
1079
1080"^2204^<CH>è1098\
1081 ^0100^<CW>";
1082
1083/*-------------------------------------------------------------*/
1084 char far *error_26 =
1085
1086"^2204^<CH>è1099";
1087
1088/*-------------------------------------------------------------*/
1089 char far *error_27 =
1090
1091"^2204^<CH>è1100";
1092
1093/*-------------------------------------------------------------*/
1094 char far *error_28 =
1095
1096"^2204^<CH>è1101\
1097 ^0100^<CW>";
1098
1099/*-------------------------------------------------------------*/
1100 char far *error_29 =
1101
1102"^2204^<CH>è1102\
1103 ^0100^<CW>";
1104
1105/*-------------------------------------------------------------*/
1106 char far *error_30 =
1107
1108"^2204^<CHB>è1103";
1109
1110/*-------------------------------------------------------------*/
1111 char far *error_31 =
1112
1113"^2304^<CH>è1104";
1114
1115/*-------------------------------------------------------------*/
1116 char far *error_32 =
1117
1118"^2204^<CH>è1105\
1119 ^0104^<CH>è1106";
1120
1121/*-------------------------------------------------------------*/
1122 char far *error_33 =
1123
1124"^2200^<C>\
1125 ^0104^<CH>è1107";
1126
1127/*-------------------------------------------------------------*/
1128 char far *error_34 =
1129
1130"^2204^<CH>è1108";
1131
1132/*-------------------------------------------------------------*/
1133 char far *error_35 =
1134
1135"^2204^<CH>è1109\
1136 ^0104^<CH>è1110";
1137
1138/*-------------------------------------------------------------*/
1139 char far *error_36 =
1140
1141"^2204^<CH>è1111\
1142 ^0100^<CW>";
1143
1144/*-------------------------------------------------------------*/
1145
1146
1147/* */
1148/* */
1149/* The following message is only included as an aide to debug message */
1150/* strings during translations. The FDISK message formatter will attempt*/
1151/* to the best of its ability to catch invalid message strings and */
1152/* print the error. This message should NEVER appear for a user, so it */
1153/* is not neccessary to translate this message */
1154/* */
1155/* */
1156
1157
1158/*-------------------------------------------------------------*/
1159
1160 char far *debug_msg =
1161
1162"^2200^<HWB>è1112";
1163
1164/*-------------------------------------------------------------*/
1165 char far *internal_error =
1166
1167"^2204^<HBW>è1113";
1168/* */
1169/* The following are not translatable. They are the partition names */
1170/* */
1171
1172 char *DOS_part = "PRI DOS";
1173 char *XENIX_part = " XENIX ";
1174 char *EXTENDED_part = "EXT DOS";
1175 char *BAD_BLOCK_part= " Table ";
1176 char *PCIX_part = " PC/IX ";
1177 char *NON_DOS_part = "Non-DOS";
diff --git a/v4.0/src/CMD/FDISK/FDISK.SKL b/v4.0/src/CMD/FDISK/FDISK.SKL
new file mode 100644
index 0000000..b50bb13
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/FDISK.SKL
@@ -0,0 +1,18 @@
1:util FDISK ;utility name
2:class A ;system messages
3;
4:use 1 COMMON1 ;"Incorrect DOS version"
5:use 2 COMMON2 ;"Insufficient Memory"
6:use 3 COMMON3 ;"Internal error loading messages"
7:use 8 EXTEND87 ;"Invalid parameter"
8:def 9 "Y",0 ;"Y"
9:def 10 "N",0 ;"N"
10;
11:class B
12:def 4 "Cannot FDISK with network loaded",CR,LF
13:def 5 "No fixed disks present",CR,LF
14:def 6 "Error reading fixed disk",CR,LF
15:def 7 "Error writing fixed disk",CR,LF
16;
17;
18:end
diff --git a/v4.0/src/CMD/FDISK/FDISK5.SKL b/v4.0/src/CMD/FDISK/FDISK5.SKL
new file mode 100644
index 0000000..e7f401d
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/FDISK5.SKL
@@ -0,0 +1,15 @@
1:class 1
2;
3;******** messages for the Fixed Disk Boot Record ******
4;
5;m1: db "Invalid partition table",0 ;23
6:use 1114 fdisk m1:
7;
8;m2: db "Error loading operating system",0 ;30
9:use 1115 fdisk m2:
10;
11;m3: db "Missing operating system",0 ;24
12:use 1116 fdisk m3:
13;
14:end
15 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/FDISKMSG.C b/v4.0/src/CMD/FDISK/FDISKMSG.C
new file mode 100644
index 0000000..72e5567
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/FDISKMSG.C
@@ -0,0 +1,1181 @@
1/* FDISK MESSAGE FILE */
2
3/************************************************************************/
4/* Please log all modifications to this file: */
5/*----------------------------------------------------------------------*/
6/* Date: 04/04/86 */
7/* Changed by: Mark T */
8/* Message changed: menu_1 - menu_38 */
9/* Reason: Creation of file */
10/*----------------------------------------------------------------------*/
11/* Date: 05/04/87 */
12/* Changed by: Dennis M */
13/* Message changed: menu_1 - menu_44 */
14/* Reason: DOS 3.3 */
15/*----------------------------------------------------------------------*/
16/* Date: */
17/* Changed by: */
18/* Message changed: */
19/* Reason: */
20/*----------------------------------------------------------------------*/
21/***********************************************************************/
22
23/************************************************************************/
24/* FDISK MESSAGES */
25/* */
26/* Portions of the screen that are handled in the msg are indicated on */
27/* the listing of the screen with the message name given. If the text */
28/* message is defined in another screen, then the name is followed by */
29/* a "#" character */
30/* */
31/* NOTE TO TRANSLATORS */
32/* The characters inside the <> and the ^^ are control characters and */
33/* should not be translated. The Control characters are defined as */
34/* follows: */
35/* */
36/* <H> - Highlight the following text */
37/* <R> - Regular text */
38/* <U> - Underline the following text */
39/* <B> - Blink the following text */
40/* <O> - Turn off Blink */
41/* <Y> - Print YES character, as set by define */
42/* <N> - Print NO character, as set by define */
43/* <W> - Sound the beep */
44/* <S> - Save cursor position for later use */
45/* <G> - Cursor position left justified and regular proceed to right */
46/* <C> - Clear the screen out from control char to end of line */
47/* <I> - Insert character from Insert[] string. This string must be set */
48/* up prior to displaying the message. The first <I> will insert */
49/* Insert[0], the second Insert[1], etc....This will move the */
50/* cursor one postition. The Insert%% string will be initialized */
51/* */
52/* */
53/* Multiple control characters can be between the <>. */
54/* */
55/* The ^^ indicates Row and column for the text and has the format of */
56/* ^rrcc^ where the numbers are decimal and zero based .first row/col */
57/* is 00. The numbers are in decimal, and must be 2 characters, which */
58/* means rows/cols 0-9 should be listed as 00-09. For example, the 5th */
59/* row, 3rd column on the screen would be listed as ^0402^. */
60/* */
61/* The column number is always the column desired. The row number is */
62/* an offset from the previous row. For example, if the text just */
63/* printed is on row 6, and the next text should be printed 2 rows */
64/* down in column 0, then the control strin would be ^0201^. The first */
65/* row specified in the message is assumed to be based off of row 0, */
66/* it would actually specify the actual row for the start of the msg */
67/* to be printed. */
68/* */
69/* NOTE: ALWAYS SAVE THIS FILE WITH NO TABS CHARACTERS */
70/************************************************************************/
71
72
73/************************************************************************/
74/* */
75/* Define Area for text variables */
76/* */
77/************************************************************************/
78
79#define YES 'Y'
80#define NO 'N'
81#define ACTIVE_PART 'A' /* Character to indicate active status */
82#define DRIVE_INDICATOR ':' /* Character displayed to indicate drive letter */
83
84/* */
85/* */
86/* The following character strings are required to display the */
87/* menu screens for FDISK. The messages have a label type of: menu_xx */
88/* */
89/* */
90
91/*******************************************************************************************************/
92/* Screen for DO_MAIN_MENU */
93/* */
94/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
95/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
96/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
97/* 00³ IBM Personal Computer ³menu_1 */
98/* 01³ Fixed Disk Setup Program Version 3.40 ³menu_1 */
99/* 02³ (C%Copyright IBM Corp. 1983,1988 ³menu_1 */
100/* 03³ ³ */
101/* 04³ FDISK Options ³menu_2 */
102/* 05³ ³ */
103/* 06³ Current fixed disk drive: # ³menu_5 */
104/* 07³ ³ */
105/* 08³ Choose one of the following: ³menu_3 */
106/* 09³ ³ */
107/* 10³ 1. Create DOS Partition or Logical DOS Drive ³menu_2 */
108/* 11³ 2. Set active partition ³menu_2 */
109/* 12³ 3. Delete DOS Partition or Logical DOS Drive ³menu_2 */
110/* 13³ 4. Display partition information ³menu_2 */
111/* 14³ 5. Select next fixed disk drive ³menu_4 */
112/* 15³ ³ */
113/* 16³ ³ */
114/* 17³ Enter choice: [#] ³menu_7 */
115/* 18³ ³ */
116/* 19³ ³ */
117/* 20³ Warning! No partitions are set active - disk 1 is not startable unless ³menu_6 */
118/* 21³ a partition is set active. ³ */
119/* 22³ ³ */
120/* 23³ ³ */
121/* 24³ Press ESC to exit FDISK ³menu_2 */
122/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
123/*******************************************************************************************************/
124
125
126/*-------------------------------------------------------------*/
127 char far *menu_1 =
128
129"^0029^<R>Microsoft DOS \
130 ^0121^<R>Fixed Disk Setup Program Version 4.00\
131 ^0124^<R>(C)Copyright 1988 Microsoft Corp";
132
133
134
135/*-------------------------------------------------------------*/
136 char far *menu_2 =
137
138"^0433^<H>FDISK Options\
139 ^0604^<H>1. <R>Create DOS Partition or Logical DOS Drive\
140 ^0104^<H>2. <R>Set active partition\
141 ^0104^<H>3. <R>Delete DOS Partition or Logical DOS Drive\
142 ^0104^<H>4. <R>Display partition information\
143 ^1104^<R>Press <H>Esc<R> to exit FDISK";
144
145/*-------------------------------------------------------------*/
146 char far *menu_3 =
147
148"^0804^<R>Choose one of the following:";
149
150/*-------------------------------------------------------------*/
151 char far *menu_4 =
152
153"^1404^<H>5. <R>Select next fixed disk drive";
154
155/*-------------------------------------------------------------*/
156 char far *menu_5 =
157
158"^0604^<R>Current fixed disk drive: <H><I>";
159
160/*-------------------------------------------------------------*/
161 char far *menu_6 =
162
163"^2004^<H>Warning! <R>No partitions are set active - disk 1 is not startable unless\
164 ^0104^<R>a partition is set active";
165
166/*-------------------------------------------------------------*/
167 char far *menu_7 =
168
169"^1704^<H>Enter choice: [<S> ]";
170
171/*******************************************************************************************************/
172/* Screen for CREATE_PARTITION */
173/* */
174/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
175/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
176/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
177/* 00³ ³ */
178/* 01³ ³ */
179/* 02³ ³ */
180/* 03³ ³ */
181/* 04³ Create DOS Partition or Logical DOS Drive ³menu_8 */
182/* 05³ ³ */
183/* 06³ Current fixed disk drive: # ³menu_5 # */
184/* 07³ ³ */
185/* 08³ Choose one of the following: ³menu_3 # */
186/* 09³ ³ */
187/* 10³ 1. Create Primary DOS Partition ³menu_9 */
188/* 11³ 2. Create Extended DOS Partition ³menu_9 */
189/* 12³ 3. Create logical DOS Drive(s) in the Extended DOS Partition ³menu_10 */
190/* 13³ ³ */
191/* 14³ ³ */
192/* 15³ ³ */
193/* 16³ ³ */
194/* 17³ Enter choice: [ ] ³menu_7 # */
195/* 18³ ³ */
196/* 19³ ³ */
197/* 20³ ³ */
198/* 21³ ³ */
199/* 22³ ³ */
200/* 23³ ³ */
201/* 24³ Press ESC to return to FDISK Options ³menu_11 */
202/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
203/*******************************************************************************************************/
204
205/*-------------------------------------------------------------*/
206 char far *menu_8 =
207
208"^0420^<H>Create DOS Partition or Logical DOS Drive";
209
210/*-------------------------------------------------------------*/
211 char far *menu_9 =
212
213"^1004^<H>1. <R>Create Primary DOS Partition\
214 ^0104^<H>2. <R>Create Extended DOS Partition";
215
216/*-------------------------------------------------------------*/
217 char far *menu_10 =
218
219"^1204^<H>3. <R>Create Logical DOS Drive(s) in the Extended DOS Partition";
220
221/*-------------------------------------------------------------*/
222 char far *menu_11 =
223
224"^2404^<R>Press <H>Esc<R> to return to FDISK Options";
225
226
227/*******************************************************************************************************/
228/* Screen for DOS_CREATE_PARTITION */
229/* */
230/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
231/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
232/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
233/* 00³ ³ */
234/* 01³ ³ */
235/* 02³ ³ */
236/* 03³ ³ */
237/* 04³ Create Primary DOS Partition ³menu_12 */
238/* 05³ ³ */
239/* 06³ Current fixed disk drive: # ³menu_5 # */
240/* 07³ ³ */
241/* 08³ Do you wish to use the maximum available size for a Primary DOS Partition ³menu_13 */
242/* 09³ and make the partition active (Y/N).....................? [Y] ³menu_13 */
243/* 10³ ³ */
244/* 11³ ³ */
245/* 12³ ³ */
246/* 13³ ³ */
247/* 14³ ³ */
248/* 15³ ³ */
249/* 16³ ³ */
250/* 17³ ³ */
251/* 18³ ³ */
252/* 19³ ³ */
253/* 20³ ³ */
254/* 21³ ³ */
255/* 22³ ³ */
256/* 23³ ³ */
257/* 24³ Press ESC to return to FDISK Options ³menu_11 */
258/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
259/*******************************************************************************************************/
260
261/*-------------------------------------------------------------*/
262 char far *menu_12 =
263
264"^0427^<H>Create Primary DOS Partition";
265
266/*-------------------------------------------------------------*/
267 char far *menu_13 =
268
269"^0804^<R>Do you wish to use the maximum available size for a Primary DOS Partition\
270 ^0104^<R>and make the partition active (<Y>/<N>).....................? <H>[<S> ]";
271
272/*-------------------------------------------------------------*/
273 char far *menu_45 =
274
275"^0804^<R>Do you wish to use the maximum available size for a Primary DOS Partition\
276 ^0104^<R>(<Y>/<N>)...................................................? <H>[<S> ]";
277
278
279/*******************************************************************************************************/
280/* Screen for INPUT_DOS_CREATE */
281/* */
282/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
283/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
284/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
285/* 00³ ³ */
286/* 01³ ³ */
287/* 02³ ³ */
288/* 03³ ³ */
289/* 04³ Create Primary DOS Partition ³menu_12 # */
290/* 05³ ³ */
291/* 06³ Current fixed disk drive: # ³menu_5 # */
292/* 07³ ³ */
293/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 */
294/* 09³ ## # # ####### #### ###% ³ */
295/* 10³ ## # # ####### #### ###% ³ */
296/* 11³ ## # # ####### #### ###% ³ */
297/* 12³ ## # # ####### #### ###% ³ */
298/* 13³ ³ */
299/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 */
300/* 15³ Maximum space available for partition is #### Mbytes (###%) ³menu_16 */
301/* 16³ ³ */
302/* 17³ ³ */
303/* 18³ Enter partition size in Mbytes or percent of disk space (%) to ³menu_39 */
304/* 19³ create a Primary DOS Partition..................................[####] ³ */
305/* 20³ ³ */
306/* 21³ ³ */
307/* 22³ ³ */
308/* 23³ ³ */
309/* 24³ Press ESC to return to FDISK Options ³menu_11 */
310/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
311/****************************************************************/
312
313/*-------------------------------------------------------------*/
314 char far *menu_14 =
315
316"^0804^<R>Partition Status Type Size in Mbytes Percentage of Disk Used\
317 ^0104^<R> <II> <I> <I> <IIIIIII> <IIII> <IIII>\
318 ^0104^<R> <II> <I> <I> <IIIIIII> <IIII> <IIII>\
319 ^0104^<R> <II> <I> <I> <IIIIIII> <IIII> <IIII>\
320 ^0104^<R> <II> <I> <I> <IIIIIII> <IIII> <IIII>";
321
322/*-------------------------------------------------------------*/
323 char far *menu_15 =
324
325"^1404^<R>Total disk space is <HIIIIR> Mbytes (1 Mbyte = 1048576 bytes)";
326
327/*-------------------------------------------------------------*/
328 char far *menu_16 =
329
330"^1504^<RC>Maximum space available for partition is <HIIIIR> Mbytes (<HIIIIR>)";
331
332/*-------------------------------------------------------------*/
333 char far *menu_39 =
334
335"^1804^<RC>Enter partition size in Mbytes or percent of disk space (%) to\
336 ^0104^<RC>create a Primary DOS Partition.................................: <H>[<IIISI>]";
337
338
339/****************************************************************************************************/
340/* Screen for EXT_CREATE_PARTITION */
341/* */
342/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
343/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
344/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
345/* 00³ ³ */
346/* 01³ ³ */
347/* 02³ ³ */
348/* 03³ ³ */
349/* 04³ Create Extended DOS Partition ³menu_17 */
350/* 05³ ³ */
351/* 06³ Current fixed disk drive: # ³menu_5 # */
352/* 07³ ³ */
353/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */
354/* 09³ ## # # ####### #### ###% ³ */
355/* 10³ ## # # ####### #### ###% ³ */
356/* 11³ ## # # ####### #### ###% ³ */
357/* 12³ ## # # ####### #### ###% ³ */
358/* 13³ ³ */
359/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */
360/* 15³ Maximum space available for partition is #### Mbytes (##%) ³menu_16 # */
361/* 16³ ³ */
362/* 17³ ³ */
363/* 18³ Enter partition size in Mbytes or percent of disk space (%) to ³menu_42 # */
364/* 19³ create an Extended DOS Partition................................[####] ³ */
365/* 20³ ³ */
366/* 21³ ³ */
367/* 22³ ³ */
368/* 23³ ³ */
369/* 24³ Press ESC to continue ³menu_46 */
370/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
371/***************************************************************/
372
373/*-------------------------------------------------------------*/
374 char far *menu_17 =
375
376"^0427^<H>Create Extended DOS Partition";
377
378/*-------------------------------------------------------------*/
379 char far *menu_42 =
380
381"^1804^<RC>Enter partition size in Mbytes or percent of disk space (%) to\
382 ^0104^<RC>create an Extended DOS Partition..............................: <H>[<IIISI>]";
383
384
385/*-------------------------------------------------------------*/
386 char far *menu_46 =
387
388"^2404^<R>Press <H>Esc<R> to continue";
389
390
391
392
393/*****************************************************************************************************/
394/* Screen for VOLUME_CREATE */
395/* */
396/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
397/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
398/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
399/* 00³ ³ */
400/* 01³ Create Logical DOS Drive(s) in the Extended Partition ³menu_18 */
401/* 02³ ³ */
402/* 03³Drv Volume Label Mbytes System Usage Drv Volume Label Mbytes System Usage³menu_19/20 */
403/* 04³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
404/* 05³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
405/* 06³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
406/* 07³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
407/* 08³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
408/* 09³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
409/* 10³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
410/* 11³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
411/* 12³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
412/* 13³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
413/* 14³## ########### #### ######## ###% ## ########### #### ######## ###%³ */
414/* 15³## ########### #### ######## ###% ³ */
415/* 16³ ³ */
416/* 17³ Total Extended DOS partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_17 */
417/* 18³ Maximum space available for logical drive is #### Mbytes (###%) ³menu_22 */
418/* 19³ ³ */
419/* 20³ Enter logical drive size in Mbytes or percent of disk space (%)...[####] ³menu_40 */
420/* 21³ ³ */
421/* 22³ ³ */
422/* 23³ ³ */
423/* 24³ Press ESC to return to FDISK Options ³menu_11 */
424/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
425/***************************************************************/
426
427/*-------------------------------------------------------------*/
428 char far *menu_18 =
429
430"^0112^<HC>Create Logical DOS Drive(s) in the Extended DOS Partition";
431
432/*-------------------------------------------------------------*/
433 char far *menu_19 =
434
435"^0300^<H>Drv Volume Label Mbytes System Usage\
436^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
437^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
438^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
439^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
440^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
441^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>";
442
443/*----------------------------------------------------------*/
444 char far *menu_43 =
445
446"^1000^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
447^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
448^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
449^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
450^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
451^0100^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>";
452
453/*-------------------------------------------------------------*/
454 char far *menu_20 =
455
456"^0341^<H>Drv Volume Label Mbytes System Usage\
457^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
458^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
459^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
460^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
461^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
462^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>";
463
464/*---------------------------------------------------------*/
465 char far *menu_44 =
466
467"^1041^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
468^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
469^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
470^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>\
471^0141^<H><II> <RIIIIIIIIIII> <IIII> <IIIIIIII> <IIII>";
472
473/*-------------------------------------------------------------*/
474 char far *menu_21 =
475
476"^1704^<RC>Total Extended DOS Partition size is <HIIIIR> Mbytes (1 MByte = 1048576 bytes)";
477
478/*-------------------------------------------------------------*/
479 char far *menu_22 =
480
481"^1804^<RC>Maximum space available for logical drive is <HIIIIR> Mbytes <H>(<IIII>)";
482
483/*-------------------------------------------------------------*/
484 char far *menu_40 =
485
486"^2004^<RC>Enter logical drive size in Mbytes or percent of disk space (%)...<H>[<IIISI>]";
487
488
489/*****************************************************************************************************/
490/* Screen for CHANGE_ACTIVE_PARTITION */
491/* */
492/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
493/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
494/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
495/* 00³ ³ */
496/* 01³ Set Active Partition ³menu_23 */
497/* 02³ ³ */
498/* 03³ ³ */
499/* 04³ ³ */
500/* 05³ ³ */
501/* 06³ Current fixed disk drive: # ³menu_5 # */
502/* 07³ ³ */
503/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */
504/* 09³ ## # # ####### #### ###% ³ */
505/* 10³ ## # # ####### #### ###% ³ */
506/* 11³ ## # # ####### #### ###% ³ */
507/* 12³ ## # # ####### #### ###% ³ */
508/* 13³ ³ */
509/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */
510/* 15³ ³ */
511/* 16³ Enter the number of the partition you want to make active............:[#] ³menu_24 */
512/* 17³ ³ */
513/* 18³ ³ */
514/* 19³ ³ */
515/* 20³ ³ */
516/* 21³ ³ */
517/* 22³ ³ */
518/* 23³ ³ */
519/* 24³ Press ESC to return to FDISK Options ³menu_11 */
520/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
521/*****************************************************************************************************/
522
523/*-------------------------------------------------------------*/
524 char far *menu_23 =
525
526"^0430^<H>Set Active Partition";
527
528/*-------------------------------------------------------------*/
529 char far *menu_24 =
530
531"^1604^<R>Enter the number of the partition you want to make active...........: <H>[<S> ]";
532
533
534/*****************************************************************************************************/
535/* Screen for DELETE_PARTITION */
536/* */
537/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
538/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
539/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
540/* 00³ ³ */
541/* 01³ ³ */
542/* 02³ ³ */
543/* 03³ ³ */
544/* 04³ Delete DOS Partition or Logical DOS Drive ³menu_25 */
545/* 05³ ³ */
546/* 06³ Current fixed disk drive: # ³menu_5 # */
547/* 07³ ³ */
548/* 08³ Choose one of the following: ³menu_3 # */
549/* 09³ ³ */
550/* 10³ 1. Delete Primary DOS Partition ³menu_26 */
551/* 11³ 2. Delete Extended DOS Partition ³menu_26 */
552/* 12³ 3. Delete Logical DOS Drive(s) in the Extended DOS Partition ³menu_27 */
553/* 13³ ³ */
554/* 14³ ³ */
555/* 15³ ³ */
556/* 16³ ³ */
557/* 17³ Enter choice: [ ] ³menu_7 # */
558/* 18³ ³ */
559/* 19³ ³ */
560/* 20³ ³ */
561/* 21³ ³ */
562/* 22³ ³ */
563/* 23³ ³ */
564/* 24³ Press ESC to return to FDISK Options ³menu_11 */
565/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
566/*****************************************************************************************************/
567
568/*-------------------------------------------------------------*/
569 char far *menu_25 =
570
571"^0419^<H>Delete DOS Partition or Logical DOS Drive";
572
573/*-------------------------------------------------------------*/
574 char far *menu_26 =
575
576"^1004^<HC>1. <R>Delete Primary DOS Partition\
577 ^0104^<HC>2. <R>Delete Extended DOS Partition";
578
579/*-------------------------------------------------------------*/
580 char far *menu_27 =
581
582"^1204^<HC>3. <R>Delete Logical DOS Drive(s) in the Extended DOS Partition";
583
584/*****************************************************************************************************/
585/* Screen for DOS_DELETE */
586/* */
587/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
588/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
589/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
590/* 00³ ³ */
591/* 01³ ³ */
592/* 02³ ³ */
593/* 03³ ³ */
594/* 04³ Delete Primary DOS Partition ³menu_28 */
595/* 05³ ³ */
596/* 06³ Current fixed disk drive: # ³menu_5 # */
597/* 07³ ³ */
598/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */
599/* 09³ ## # # ####### #### ###% ³menu_14 # */
600/* 10³ ## # # ####### #### ###% ³ */
601/* 11³ ## # # ####### #### ###% ³ */
602/* 12³ ## # # ####### #### ###% ³ */
603/* 13³ ³ */
604/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */
605/* 15³ ³ */
606/* 16³ Warning! Data in the deleted Primary DOS Partition will be lost. ³menu_29 */
607/* 17³ Do you wish to continue (Y/N).................? [N] ³menu_29 */
608/* 18³ ³ */
609/* 19³ ³ */
610/* 20³ ³ */
611/* 21³ ³ */
612/* 22³ ³ */
613/* 23³ ³ */
614/* 24³ Press ESC to return to FDISK Options ³menu_11 */
615/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
616/*****************************************************************************************************/
617
618/*-------------------------------------------------------------*/
619 char far *menu_28 =
620
621"^0426^<H>Delete Primary DOS Partition";
622
623/*-------------------------------------------------------------*/
624 char far *menu_29 =
625
626"^1604^<HBC>Warning! <OR>Data in the deleted Primary DOS Partition will be lost.\
627 ^0104^<RC>Do you wish to continue (<Y>/<N>).................? <H>[<S> ]";
628
629/*****************************************************************************************************/
630/* Screen for EXT_DELETE */
631/* */
632/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
633/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
634/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
635/* 00³ ³ */
636/* 01³ ³ */
637/* 02³ ³ */
638/* 03³ ³ */
639/* 04³ Delete Extended DOS Partition ³menu_30 */
640/* 05³ ³ */
641/* 06³ Current fixed disk drive: # ³menu_5 # */
642/* 07³ ³ */
643/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */
644/* 09³ ## # # ####### #### ###% ³menu_14 # */
645/* 10³ ## # # ####### #### ###% ³ */
646/* 11³ ## # # ####### #### ###% ³ */
647/* 12³ ## # # ####### #### ###% ³ */
648/* 13³ ³ */
649/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */
650/* 15³ ³ */
651/* 16³ Warning! Data in the deleted Extended DOS partition will be lost. ³menu_31 */
652/* 17³ Do you wish to continue (Y/N).................? [N] ³menu_31 */
653/* 18³ ³ */
654/* 19³ ³ */
655/* 20³ ³ */
656/* 21³ ³ */
657/* 22³ ³ */
658/* 23³ ³ */
659/* 24³ Press ESC to return to FDISK Options ³menu_11 */
660/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
661/*****************************************************************************************************/
662
663/*-------------------------------------------------------------*/
664 char far *menu_30 =
665
666"^0426^<H>Delete Extended DOS Partition";
667
668/*-------------------------------------------------------------*/
669 char far *menu_31 =
670
671"^1604^<HBC>Warning! <OR>Data in the deleted Extended DOS Partition will be lost.\
672 ^0104^<RC>Do you wish to continue (<Y>/<N>).................? <H>[<S> ]";
673
674/******************************************************************************************************/
675/* Screen for VOL_DELETE */
676/* */
677/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
678/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
679/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
680/* 00³ ³ */
681/* 01³ Delete Logical DOS Drive(s) in the Extended DOS Partition ³menu_32 */
682/* 02³ ³ */
683/* 03³Drv Volume Label MBytes System Usage Drv Volume Label MBytes System Usage³menu_19/20 # */
684/* 04³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
685/* 05³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
686/* 06³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
687/* 07³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
688/* 08³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
689/* 09³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
690/* 10³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
691/* 11³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
692/* 12³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
693/* 13³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
694/* 14³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
695/* 15³## ############# #### ######## ###% ³ */
696/* 16³ ³ */
697/* 17³ Total Extended DOS Partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_21 */
698/* 18³ ³ */
699/* 19³ Warning! Data in a deleted Logical DOS Drive will be lost. ³menu_33 */
700/* 20³ What drive do you want to delete...........................? [ ] ³menu_33 */
701/* 21³ Enter Volume Label.............................? [ ] ³menu_41 */
702/* 22³ Are you sure (Y/N).............................? [N] ³menu_34 */
703/* 23³ ³ */
704/* 24³ Press ESC to return to FDISK Options ³menu_11 */
705/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
706/******************************************************************************************************/
707
708/*-------------------------------------------------------------*/
709 char far *menu_32 =
710
711"^0112^<H>Delete Logical DOS Drive(s) in the Extended DOS Partition";
712
713/*-------------------------------------------------------------*/
714 char far *menu_33 =
715
716"^1904^<HBC>Warning! <OR>Data in a deleted Logical DOS Drive will be lost.\
717 ^0104^<RC>What drive do you want to delete...............................? <H>[<S> ]";
718
719/*-------------------------------------------------------------*/
720 char far *menu_34 =
721
722"^2204^<R>Are you sure (<Y>/<N>)..............................? <H>[<S> ]";
723
724/*-------------------------------------------------------------*/
725 char far *menu_41 =
726
727"^2104^<R>Enter Volume Label..............................? <H>[<S> ]";
728
729/******************************************************************************************************/
730/* Screen for DISPLAY_PARTITION_INFORMATION */
731/* */
732/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
733/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
734/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
735/* 00³ ³ */
736/* 01³ ³ */
737/* 02³ ³ */
738/* 03³ ³ */
739/* 04³ Display Partition Information ³menu_35 */
740/* 05³ ³ */
741/* 06³ Current fixed disk drive: # ³menu_5 # */
742/* 07³ ³ */
743/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */
744/* 09³ ## # # ####### #### ###% ³menu_14 # */
745/* 10³ ## # # ####### #### ###% ³ */
746/* 11³ ## # # ####### #### ###% ³ */
747/* 12³ ## # # ####### #### ###% ³ */
748/* 13³ ³ */
749/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */
750/* 15³ ³ */
751/* 16³ ³ */
752/* 17³ The Extended DOS partition contains Logical DOS Drives. ³menu_36 */
753/* 18³ Do you want to display the logical drive information (Y/N)......? [Y] ³menu_36 */
754/* 19³ ³ */
755/* 20³ ³ */
756/* 21³ ³ */
757/* 22³ ³ */
758/* 23³ ³ */
759/* 24³ Press ESC to return to FDISK Options ³menu_11 */
760/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
761/******************************************************************************************************/
762
763/*-------------------------------------------------------------*/
764 char far *menu_35 =
765
766"^0426^<H>Display Partition Information";
767
768/*-------------------------------------------------------------*/
769 char far *menu_36 =
770
771"^1704^<RC>The Extended DOS Partition contains Logical DOS Drives.\
772 ^0104^<RC>Do you want to display the logical drive information (<Y>/<N>)......?<H>[<S> ]";
773
774/*****************************************************************************************************/
775/* Screen for DISPLAY_VOLUME_INFORMATION */
776/* */
777/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
778/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
779/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
780/* 00³ ³ */
781/* 01³ Display Logical DOS Drive Information ³menu_37 */
782/* 02³ ³ */
783/* 03³Drv Volume Label Mbytes System Usage Drv Volume Label Mbytes System Usage³menu_19/20 */
784/* 04³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
785/* 05³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
786/* 16³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
787/* 17³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
788/* 18³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
789/* 19³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
790/* 10³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
791/* 11³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
792/* 12³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
793/* 13³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
794/* 14³## ############# #### ######## ###% ## ############# #### ######## ###%³ */
795/* 15³## ############# #### ######## ###% ³ */
796/* 16³ ³ */
797/* 17³ Total Extended DOS partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_17 */
798/* 18³ ³ */
799/* 19³ ³ */
800/* 20³ ³ */
801/* 21³ ³ */
802/* 22³ ³ */
803/* 23³ ³ */
804/* 24³ Press ESC to return to FDISK Options ³menu_11 */
805/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
806/*****************************************************************************************************/
807
808/*-------------------------------------------------------------*/
809 char far *menu_37 =
810
811"^0121^<H>Display Logical DOS Drive Information";
812
813/*****************************************************************************************************/
814/* Screen for SYSTEM_REBOOT */
815/* */
816/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */
817/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */
818/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
819/* 00³ ³ */
820/* 01³ ³ */
821/* 02³ ³ */
822/* 03³ ³ */
823/* 04³ ³ */
824/* 05³ ³ */
825/* 06³ ³ */
826/* 07³ ³ */
827/* 08³ ³ */
828/* 09³ ³ */
829/* 10³ ³ */
830/* 11³ ³ */
831/* 12³ ³ */
832/* 13³ System will now restart ³menu_38 */
833/* 14³ ³ */
834/* 15³ Insert DOS diskette in drive A: ³menu_38 */
835/* 16³ Press any key when ready . . . ³menu_38 */
836/* 17³ ³ */
837/* 18³ ³ */
838/* 19³ ³ */
839/* 20³ ³ */
840/* 21³ ³ */
841/* 22³ ³ */
842/* 23³ ³ */
843/* 24³ ³ */
844/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
845/*****************************************************************************************************/
846
847/*-------------------------------------------------------------*/
848 char far *menu_38 =
849
850"^1304^<H>System will now restart\
851 ^0204^<R>Insert DOS Startup diskette in drive A:\
852 ^0104^<R>Press any key when ready . . .<S>";
853
854
855/* */
856/* */
857/* The following character strings are required to display the */
858/* status messages indicating successful operation. These messages */
859/* have the form: status_xx */
860/* */
861/* Note: In order to overlay any previous message on the screen, these */
862/* messages are all 2 lines long. The second line may only be */
863/* a blank line. If 2 lines are needed for translation, use the */
864/* second line for text. Exceptions are those msgs on line 0, */
865/* and status_3. */
866/* */
867
868/*-------------------------------------------------------------*/
869 char far *status_1 =
870
871"^2104^<CH>Primary DOS Partition deleted\
872 ^0100^<CW>";
873
874/*-------------------------------------------------------------*/
875 char far *status_2 =
876
877"^2104^<CH>Extended DOS Partition deleted\
878 ^0100^<CW>";
879
880/*-------------------------------------------------------------*/
881 char far *status_3 =
882
883"^0004^<H>Drive deleted";
884/* NOTE - the ^rrcc^ must be the first thing in this string */
885
886/*-------------------------------------------------------------*/
887 char far *status_4 =
888
889"^2104^<CH>Partition <I> made active\
890 ^0100^<CW>";
891
892/*-------------------------------------------------------------*/
893 char far *status_5 =
894
895"^2104^<CH>Primary DOS Partition created\
896 ^0100^<CW>";
897
898/*-------------------------------------------------------------*/
899 char far *status_6 =
900
901"^2104^<CH>Extended DOS Partition created\
902 ^0100^<CW>";
903
904/*-------------------------------------------------------------*/
905 char far *status_7 =
906
907"^2204^<CH>Logical DOS Drive created, drive letters changed or added<W>";
908
909/*-------------------------------------------------------------*/
910 char far *status_8 =
911
912"^2104^<CH>No partitions defined\
913 ^0100^<C>";
914
915/*-------------------------------------------------------------*/
916 char far *status_9 =
917
918"^1004^<CH>No logical drives defined\
919 ^0100^<C>";
920
921/*-------------------------------------------------------------*/
922 char far *status_10 =
923
924"^1804^<CH>Drive letters have been changed or deleted<W>";
925
926/*-------------------------------------------------------------*/
927 char far *status_11 =
928
929"^0004^<H>Drive redirected";
930/* NOTE - the ^rrcc^ must be the first thing in this string */
931
932/*-------------------------------------------------------------*/
933 char far *status_12 =
934
935"^2104^<CH>Primary DOS Partition created, drive letters changed or added\
936 ^0100^<CW>";
937
938/*-------------------------------------------------------------*/
939
940/* */
941/* */
942/* The following character strings are required to display the */
943/* error messages. These have form: error_xx */
944/* */
945/* Note: In order to overlay any previous message on the screen, these */
946/* messages are all 2 lines long. The second line may only be */
947/* a blank line. If 2 lines are needed for translation, use the */
948/* second line for text. Exceptions are those msgs on line 0. */
949/* and those messages that start on line 23 */
950/* */
951
952
953/*-------------------------------------------------------------*/
954 char far *error_1 =
955
956"^0004^<CH>No fixed disks present.\
957 ^0100^<CW>";
958
959/*-------------------------------------------------------------*/
960 char far *error_2 =
961
962"^2204^<CH>Error reading fixed disk.\
963 ^0100^<CW>";
964
965/*-------------------------------------------------------------*/
966 char far *error_3 =
967
968"^2204^<CH>Error writing fixed disk.\
969 ^0100^<CW>";
970
971/*-------------------------------------------------------------*/
972 char far *error_4 =
973
974"^0004^<CHW>Incorrect DOS version.";
975
976/*-------------------------------------------------------------*/
977 char far *error_5 =
978
979"^0004^<CHW>Cannot FDISK with network loaded.";
980
981/*-------------------------------------------------------------*/
982 char far *error_6 =
983
984"^2204^<CH>No Primary DOS Partition to delete.\
985 ^0100^<CW>";
986
987/*-------------------------------------------------------------*/
988 char far *error_7 =
989
990"^2204^<CH>No Extended DOS Partition to delete.\
991 ^0100^<CW>";
992
993/*-------------------------------------------------------------*/
994 char far *error_8 =
995
996"^2204^<CH>Primary DOS Partition already exists.\
997 ^0100^<CW>";
998
999/*-------------------------------------------------------------*/
1000 char far *error_9 =
1001
1002"^2204^<CH>Extended DOS Partition already exists.\
1003 ^0100^<CW>";
1004
1005/*-------------------------------------------------------------*/
1006 char far *error_10 =
1007
1008"^2204^<CH>No space to create a DOS partition.\
1009 ^0100^<CW>";
1010
1011/*-------------------------------------------------------------*/
1012 char far *error_12 =
1013
1014"^2204^<CH>Requested logical drive size exceeds the maximum available space.<W>\
1015 ^0100^<CW>";
1016
1017/*-------------------------------------------------------------*/
1018 char far *error_13 =
1019
1020"^2204^<CH>Requested partition size exceeds the maximum available space.<W>\
1021 ^0100^<CW>";
1022
1023/*-------------------------------------------------------------*/
1024 char far *error_14 =
1025
1026"^2204^<CH>No partitions to delete.\
1027 ^0100^<CW>";
1028
1029/*-------------------------------------------------------------*/
1030 char far *error_15 =
1031
1032"^2204^<CH>The only startable partition on Drive 1 is already set active.<W>\
1033 ^0100^<CW>";
1034
1035/*-------------------------------------------------------------*/
1036 char far *error_16 =
1037
1038"^2204^<CH>No partitions to make active.\
1039 ^0100^<CW>";
1040
1041/*-------------------------------------------------------------*/
1042 char far *error_17 =
1043
1044"^2204^<CH>Partition selected (<I>) is not startable, active partition not changed.<W>";
1045
1046/*-------------------------------------------------------------*/
1047 char far *error_19 =
1048
1049"^2204^<CH>Cannot create Extended DOS Partition without\
1050 ^0104^<CH>Primary DOS Partition on disk 1.<W>";
1051
1052/*-------------------------------------------------------------*/
1053 char far *error_20 =
1054
1055"^2204^<CH>All available space in the Extended DOS Partition\
1056 ^0104^<CH>is assigned to logical drives.<W>";
1057
1058/*-------------------------------------------------------------*/
1059 char far *error_21 =
1060
1061"^2204^<CH>Cannot delete Extended DOS Partition while logical drives exist.<W>";
1062
1063/*-------------------------------------------------------------*/
1064 char far *error_22 =
1065
1066"^2204^<CH>All logical drives deleted in the Extended DOS Partition.<W>";
1067
1068/*-------------------------------------------------------------*/
1069 char far *error_23 =
1070
1071"^2204^<C>\
1072 ^0104^<CHI> is not a choice. Please enter <III>.<W>";
1073
1074/*-------------------------------------------------------------*/
1075 char far *error_24 =
1076
1077"^2204^<CH>Warning! The partition set active is not startable.<W>";
1078
1079/*-------------------------------------------------------------*/
1080 char far *error_25 =
1081
1082"^2204^<CH> Only non-startable partitions exist.\
1083 ^0100^<CW>";
1084
1085/*-------------------------------------------------------------*/
1086 char far *error_26 =
1087
1088"^2204^<CH>Only partitions on Drive 1 can be made active.<W>";
1089
1090/*-------------------------------------------------------------*/
1091 char far *error_27 =
1092
1093"^2204^<CH>Maximum number of Logical DOS Drives installed.<W>";
1094
1095/*-------------------------------------------------------------*/
1096 char far *error_28 =
1097
1098"^2204^<CH>Cannot create a zero size partition.\
1099 ^0100^<CW>";
1100
1101/*-------------------------------------------------------------*/
1102 char far *error_29 =
1103
1104"^2204^<CH>Drive <II> already deleted.\
1105 ^0100^<CW>";
1106
1107/*-------------------------------------------------------------*/
1108 char far *error_30 =
1109
1110"^2204^<CHB>Unable to access Drive <I>.<OW>";
1111
1112/*-------------------------------------------------------------*/
1113 char far *error_31 =
1114
1115"^2304^<CH>Invalid entry, please enter <III>.<W>";
1116
1117/*-------------------------------------------------------------*/
1118 char far *error_32 =
1119
1120"^2204^<CH>Cannot delete Primary DOS Partition on drive 1 \
1121 ^0104^<CH>when an Extended DOS Partition exists.<W>";
1122
1123/*-------------------------------------------------------------*/
1124 char far *error_33 =
1125
1126"^2200^<C>\
1127 ^0104^<CH>Invalid entry, please press Enter.<W>";
1128
1129/*-------------------------------------------------------------*/
1130 char far *error_34 =
1131
1132"^2204^<CH>Volume label does not match.<W>";
1133
1134/*-------------------------------------------------------------*/
1135 char far *error_35 =
1136
1137"^2204^<CH>Cannot create Logical DOS Drive without\
1138 ^0104^<CH>an Extended DOS Partition on the current drive.<W>";
1139
1140/*-------------------------------------------------------------*/
1141 char far *error_36 =
1142
1143"^2204^<CH>No Logical DOS Drive(s) to delete.\
1144 ^0100^<CW>";
1145
1146/*-------------------------------------------------------------*/
1147
1148
1149/* */
1150/* */
1151/* The following message is only included as an aide to debug message */
1152/* strings during translations. The FDISK message formatter will attempt*/
1153/* to the best of its ability to catch invalid message strings and */
1154/* print the error. This message should NEVER appear for a user, so it */
1155/* is not neccessary to translate this message */
1156/* */
1157/* */
1158
1159
1160/*-------------------------------------------------------------*/
1161 char far *debug_msg =
1162
1163"^2200^<HWB>Message string error <I>. See header of FDISKC.MSG for error definition";
1164
1165/*-------------------------------------------------------------*/
1166 char far *internal_error =
1167
1168"^2204^<HBW>Internal error";
1169
1170/* */
1171/* The following are not translatable. They are the partition names */
1172/* */
1173
1174 char *DOS_part = "PRI DOS";
1175 char *XENIX_part = " XENIX ";
1176 char *EXTENDED_part = "EXT DOS";
1177 char *BAD_BLOCK_part= " Table ";
1178 char *PCIX_part = " PC/IX ";
1179 char *NON_DOS_part = "Non-DOS";
1180
1181
diff --git a/v4.0/src/CMD/FDISK/FDISKMSG.H b/v4.0/src/CMD/FDISK/FDISKMSG.H
new file mode 100644
index 0000000..2c684a9
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/FDISKMSG.H
@@ -0,0 +1,131 @@
1/* FDISK MESSAGE FILE */
2
3/************************************************************************/
4/* Please log all modifications to this file: */
5/*----------------------------------------------------------------------*/
6/* Date: 04/04/86 */
7/* Changed by: Mark T */
8/* Message changed: menu_1 - menu_38 */
9/* Reason: Creation of file */
10/*----------------------------------------------------------------------*/
11/* Date: 05/04/87 */
12/* Changed by: Dennis M */
13/* Message changed: menu_1 - menu_44 */
14/* Reason: DOS 3.3 */
15/*----------------------------------------------------------------------*/
16/* Date: */
17/* Changed by: */
18/* Message changed: */
19/* Reason: */
20/*----------------------------------------------------------------------*/
21/************************************************************************/
22
23#define ACTIVE_PART 'A' /* Character to indicate active status */
24#define DRIVE_INDICATOR ':' /* Character displayed to indicate drive letter */
25
26/*-------------------------------------------------------------*/
27 extern char far *menu_1; /* AN000 */
28 extern char far *menu_2; /* AN000 */
29 extern char far *menu_3 ; /* AN000 */
30 extern char far *menu_4 ; /* AN000 */
31 extern char far *menu_5 ; /* AN000 */
32 extern char far *menu_6 ; /* AN000 */
33 extern char far *menu_7 ; /* AN000 */
34 extern char far *menu_8 ; /* AN000 */
35 extern char far *menu_9 ; /* AN000 */
36 extern char far *menu_10 ; /* AN000 */
37 extern char far *menu_11 ; /* AN000 */
38 extern char far *menu_12 ; /* AN000 */
39 extern char far *menu_13 ; /* AN000 */
40 extern char far *menu_14 ; /* AN000 */
41 extern char far *menu_15 ; /* AN000 */
42 extern char far *menu_16 ; /* AN000 */
43 extern char far *menu_39 ; /* AN000 */
44 extern char far *menu_17 ; /* AN000 */
45 extern char far *menu_42 ; /* AN000 */
46 extern char far *menu_18 ; /* AN000 */
47 extern char far *menu_19 ; /* AN000 */
48 extern char far *menu_43 ; /* AN000 */
49 extern char far *menu_20 ; /* AN000 */
50 extern char far *menu_44 ; /* AN000 */
51 extern char far *menu_21 ; /* AN000 */
52 extern char far *menu_22 ; /* AN000 */
53 extern char far *menu_40 ; /* AN000 */
54 extern char far *menu_23 ; /* AN000 */
55 extern char far *menu_24 ; /* AN000 */
56 extern char far *menu_25 ; /* AN000 */
57 extern char far *menu_26 ; /* AN000 */
58 extern char far *menu_27 ; /* AN000 */
59 extern char far *menu_28 ; /* AN000 */
60 extern char far *menu_29 ; /* AN000 */
61 extern char far *menu_30 ; /* AN000 */
62 extern char far *menu_31 ; /* AN000 */
63 extern char far *menu_32 ; /* AN000 */
64 extern char far *menu_33 ; /* AN000 */
65 extern char far *menu_34 ; /* AN000 */
66 extern char far *menu_41 ; /* AN000 */
67 extern char far *menu_35 ; /* AN000 */
68 extern char far *menu_36 ; /* AN000 */
69 extern char far *menu_37 ; /* AN000 */
70 extern char far *menu_38 ; /* AN000 */
71 extern char far *menu_45 ; /* AN000 */
72 extern char far *menu_46 ; /* AN000 */
73/*-------------------------------------------------------------*/
74 extern char far *status_1 ; /* AN000 */
75 extern char far *status_2 ; /* AN000 */
76 extern char far *status_3 ; /* AN000 */
77 extern char far *status_4 ; /* AN000 */
78 extern char far *status_5 ; /* AN000 */
79 extern char far *status_6 ; /* AN000 */
80 extern char far *status_7 ; /* AN000 */
81 extern char far *status_8 ; /* AN000 */
82 extern char far *status_9 ; /* AN000 */
83 extern char far *status_10 ; /* AN000 */
84 extern char far *status_11 ; /* AN000 */
85 extern char far *status_12 ; /* AN000 */
86/*-------------------------------------------------------------*/
87 extern char far *error_1 ; /* AN000 */
88 extern char far *error_2 ; /* AN000 */
89 extern char far *error_3 ; /* AN000 */
90 extern char far *error_4 ; /* AN000 */
91 extern char far *error_5 ; /* AN000 */
92 extern char far *error_6 ; /* AN000 */
93 extern char far *error_7 ; /* AN000 */
94 extern char far *error_8 ; /* AN000 */
95 extern char far *error_9 ; /* AN000 */
96 extern char far *error_10 ; /* AN000 */
97 extern char far *error_12 ; /* AN000 */
98 extern char far *error_13 ; /* AN000 */
99 extern char far *error_14 ; /* AN000 */
100 extern char far *error_15 ; /* AN000 */
101 extern char far *error_16 ; /* AN000 */
102 extern char far *error_17 ; /* AN000 */
103 extern char far *error_19 ; /* AN000 */
104 extern char far *error_20 ; /* AN000 */
105 extern char far *error_21 ; /* AN000 */
106 extern char far *error_22 ; /* AN000 */
107 extern char far *error_23 ; /* AN000 */
108 extern char far *error_24 ; /* AN000 */
109 extern char far *error_25 ; /* AN000 */
110 extern char far *error_26 ; /* AN000 */
111 extern char far *error_27 ; /* AN000 */
112 extern char far *error_28 ; /* AN000 */
113 extern char far *error_29 ; /* AN000 */
114 extern char far *error_30 ; /* AN000 */
115 extern char far *error_31 ; /* AN000 */
116 extern char far *error_32 ; /* AN000 */
117 extern char far *error_33 ; /* AN000 */
118 extern char far *error_34 ; /* AN000 */
119 extern char far *error_35 ; /* AN000 */
120 extern char far *error_36 ; /* AN000 */
121/*-------------------------------------------------------------*/
122 extern char far *debug_msg ; /* AN000 */
123 extern char far *internal_error ; /* AN000 */
124/*-------------------------------------------------------------*/
125 extern char *DOS_part ; /* AN000 */
126 extern char *XENIX_part ; /* AN000 */
127 extern char *EXTENDED_part ; /* AN000 */
128 extern char *BAD_BLOCK_part ; /* AN000 */
129 extern char *PCIX_part ; /* AN000 */
130 extern char *NON_DOS_part ; /* AN000 */
131
diff --git a/v4.0/src/CMD/FDISK/FDPARSE.C b/v4.0/src/CMD/FDISK/FDPARSE.C
new file mode 100644
index 0000000..7cf3143
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/FDPARSE.C
@@ -0,0 +1,312 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "extern.h" /* AN000 */
5#include "parse.h" /* AN000 */
6#include "string.h" /* AN000 */
7#include "subtype.h" /* AN000 */
8#include "msgret.h" /* AN000 */
9
10
11/* */
12/******************************************************************************/
13/*Routine name: PARSE_COMMAND_LINE */
14/******************************************************************************/
15/* */
16/*Description: Sets up flags, preloads messages, and parses the command */
17/* line for switchs. */
18/* */
19/*Called Procedures: */
20/* */
21/*Change History: Created 5/30/87 DRM */
22/* */
23/*Input: None */
24/* */
25/*Output: None */
26/* */
27/******************************************************************************/
28
29
30char parse_command_line(argc,argv) /* AN000 */
31
32char *argv[]; /* array of pointer arguments AN000 */
33int argc;
34
35BEGIN /* AN000 */
36
37
38 char cmd_line[128]; /* AN000 */
39 char finished; /* AN000 */
40 int i; /* AN000 */
41 char parse_good; /* AN000 */
42 char far *cmdline;
43
44 parse_init(); /* AN000 */
45
46 /* Initialize parse_flag to true and don't change unless error */
47 parse_good = TRUE; /* AN000 */
48
49 regs.h.ah = (unsigned char) 0x62;
50 intdosx(&regs, &regs, &segregs);
51
52 FP_OFF(cmdline) = 0x81;
53 FP_SEG(cmdline) = regs.x.bx;
54
55 i = 0;
56 while ( *cmdline != (char) '\x0d' ) cmd_line[i++] = *cmdline++;
57 cmd_line[i++] = (char) '\x0d';
58 cmd_line[i++] = (char) '\0';
59
60 regs.x.si = (unsigned)cmd_line; /* AN000 make DS:SI point to source */
61 regs.x.cx = u(0); /* AN000 operand ordinal (whatever that means) */
62 regs.x.dx = u(0); /* AN000 operand ordinal (whatever that means) */
63 regs.x.di = (unsigned)&p_p; /* AN000 address of parm list */
64 Parse_Ptr = (unsigned)cmd_line; /* AN010 */
65 regs.x.si = (unsigned)cmd_line; /* AN010 */
66
67 finished = FALSE;
68 while ( !finished ) /* AN000 */
69 BEGIN /* AN000 */
70
71 Parse_Ptr = regs.x.si; /* AN010 point to next parm */
72 parse(&regs,&regs); /* AN000 Call DOS PARSE service routines*/
73
74 if (regs.x.ax == u(NOERROR)) /* AN000 If there was an error*/
75 BEGIN
76 if (regs.x.dx == (unsigned)&p_buff) /* AN000 */
77 check_disk_validity(); /* AN000 It's a drive letter */
78
79 if (regs.x.dx == (unsigned)&sp_buff) /* AN000 */
80 process_switch(); /* AN000 It's a switch*/
81 END
82 else
83 BEGIN
84 if (regs.x.ax == u(0xffff))
85 finished = TRUE; /* AN000 Then we are done*/
86 else
87 BEGIN
88 Parse_msg(regs.x.ax,STDERR,Parse_err_class); /* AN010 */
89 parse_good = FALSE;
90 finished = TRUE; /* AN000 Then we are done*/
91 END
92 END
93 END /* End WHILE */ /* AN000 */
94
95 return(parse_good); /* AN000 Return to caller*/
96
97END /* end parser */ /* AN000 */
98
99
100/* */
101/******************************************************************************/
102/*Routine name: INIT_PARSE */
103/******************************************************************************/
104/* */
105/*Description: Sets up ALL VALUES AND STRUCTS FOR PARSER. */
106/* */
107/*Called Procedures: */
108/* */
109/*Change History: Created 6/15/87 DRM */
110/* */
111/*Input: None */
112/* */
113/*Output: None */
114/* */
115/******************************************************************************/
116
117
118void parse_init() /* AN000 */
119
120BEGIN /* AN000 */
121
122
123 primary_flag = FALSE; /* AN000 */
124 extended_flag = FALSE; /* AN000 */
125 logical_flag = FALSE; /* AN000 */
126 disk_flag = FALSE; /* AN000 */
127 quiet_flag = FALSE; /* AN000 */
128
129 p_p.p_parmsx_ptr = (unsigned)&p_px; /* AN000 Address of extended parm list */
130 p_p.p_num_extra = uc(1); /* AN000 */
131 p_p.p_len_extra_delim = uc(1); /* AN000 */
132 p_p.p_extra_delim = c(SEMICOLON); /* AN000 */
133
134 p_px.p_minp = uc(0); /* AN000 1 required positional */
135 p_px.p_maxp = uc(1); /* AN000 1 maximum positionals */
136 p_px.p_con1_ptr = (unsigned)&p_con; /* AN000 pointer to next control blk */
137 p_px.p_maxs = uc(2); /* AN000 number of switches */
138 p_px.p_swi1_ptr = (unsigned)&p_swi1; /* AN000 pointer to next control blk */
139 p_px.p_swi2_ptr = (unsigned)&p_swi2; /* AN000 pointer to next control blk */
140 p_px.p_maxk = uc(NOVAL); /* AN000 no keywords */
141
142 p_con.p_match_flag = u(0x8001); /* AN000 DRIVE NUMBER 1 OR 2 optional */
143 p_con.p_function_flag = u(0x0000); /* AN000 DO NOTHING FOR FUNCTION FLAG */
144 p_con.p_buff1_ptr = (unsigned)&p_buff; /* AN000 */
145 p_con.p_val1_ptr = (unsigned)&p_val; /* AN000 */
146 p_con.p_nid = uc(0); /* AN000 */
147
148 p_swi1.sp_match_flag = u(0x8000); /* AN000 Optional (switch) */
149 p_swi1.sp_function_flag = u(0x0000); /* AN000 DO NOTHING FOR FUNCTION FLAG */
150 p_swi1.sp_buff1_ptr = (unsigned)&sp_buff; /* AN000 */
151 p_swi1.sp_val1_ptr = (unsigned)&sp_val; /* AN000 */
152 p_swi1.sp_nid = uc(3); /* AN000 3 switches allowed */
153 strcpy((char *) p_swi1.sp_switch1,PRI); /* AN000 /a switch */
154 strcpy((char *) p_swi1.sp_switch2,EXT); /* AN000 /a switch */
155 strcpy((char *) p_swi1.sp_switch3,LOG); /* AN000 /a switch */
156
157 p_swi2.sp_match_flag = u(0x0001); /* AN000 Optional (switch) */
158 p_swi2.sp_function_flag = u(0x0000); /* AN000 DO NOTHING FOR FUNCTION FLAG */
159 p_swi2.sp_buff1_ptr = (unsigned)&sp_buff; /* AN000 */
160 p_swi2.sp_val1_ptr = (unsigned)NOVAL; /* AN000 */
161 p_swi2.sp_nid = uc(1); /* AN000 3 switches allowed */
162 strcpy((char *) p_swi2.sp_switch4,QUIET); /* AN000 /a switch */
163
164 p_val.p_values = uc(1); /* AN000 - Number of values items returned */
165 p_val.p_range = uc(1); /* AN000 - Number of ranges */
166 p_val.p_range_one = uc(1); /* AN000 - range number one */
167 p_val.p_low_range = ul(1); /* AN000 - low value for range */
168 p_val.p_high_range = ul(2); /* AN000 - high value for range */
169
170 sp_val.p_values = uc(1); /* AN000 - Number of values items returned */
171 sp_val.p_range = uc(1); /* AN000 - Number of ranges */
172 sp_val.p_range_one = uc(1); /* AN000 - range number one */
173 sp_val.p_low_range = ul(1); /* AN000 - low value for range */
174 sp_val.p_high_range = ul(4000); /* AN000 - high value for range */
175
176 return; /* AN000 */
177
178END
179 /* AN000 */
180/* */
181/******************************************************************************/
182/*Routine name: CHECK_DISK_VALIDITY */
183/******************************************************************************/
184/* */
185/*Description: Checks the return buffer from parse for the positional */
186/* value to be equal to 0 or 1. */
187/* */
188/*Called Procedures: */
189/* */
190/*Change History: Created 6/18/87 DRM */
191/* */
192/*Input: None */
193/* */
194/*Output: None */
195/* */
196/******************************************************************************/
197
198
199void check_disk_validity() /* AN000 */
200
201BEGIN /* AN000 */
202
203 disk_flag = (FLAG)TRUE; /* AN000 */
204 cur_disk_buff = ((char)p_buff.p_value - 1); /* AN000 */
205 return; /* AN000 */
206END /* AN000 */
207
208/* */
209/******************************************************************************/
210/*Routine name: PROCESS_SWITCH */
211/******************************************************************************/
212/* */
213/*Description: This function looks at the return buffer of the parse and */
214/* determins the switch, places value in buffer, and sets */
215/* flag for specific switch. */
216/* */
217/*Called Procedures: */
218/* */
219/*Change History: Created 6/18/87 DRM */
220/* */
221/*Input: None */
222/* */
223/*Output: None */
224/* */
225/******************************************************************************/
226
227
228void process_switch() /* AN000 */
229
230BEGIN /* AN000 */
231
232
233 BEGIN /* AN000 */
234 if (sp_buff.p_synonym == (unsigned)p_swi1.sp_switch1) /* AN000 */
235 BEGIN /* AN000 */
236 primary_flag = (FLAG)TRUE; /* AN000 */
237 primary_buff = (unsigned)sp_buff.p_value; /* AN000 */
238 END /* AN000 */
239
240 if (sp_buff.p_synonym == (unsigned)p_swi1.sp_switch2) /* AN000 */
241 BEGIN /* AN000 */
242 extended_flag = (FLAG)TRUE; /* AN000 */
243 extended_buff = (unsigned)sp_buff.p_value; /* AN000 */
244 END /* AN000 */
245
246 if (sp_buff.p_synonym == (unsigned)p_swi1.sp_switch3) /* AN000 */
247 BEGIN /* AN000 */
248 logical_flag = (FLAG)TRUE; /* AN000 */
249 logical_buff = (unsigned)sp_buff.p_value; /* AN000 */
250 END /* AN000 */
251
252 if (sp_buff.p_synonym == (unsigned)p_swi2.sp_switch4) /* AN000 */
253 BEGIN /* AN000 */
254 quiet_flag = (FLAG)TRUE; /* AN000 */
255 END /* AN000 */
256 END /* AN000 */
257 return; /* AN000 Return to caller*/
258END /* end parser */ /* AN000 */
259
260/************************************************************************/ /* ;an000; */
261/* Parse_Message - This routine will print only those */
262/* messages that require 1 replaceable */
263/* parm. */
264/* */
265/* Inputs : Msg_Num - number of applicable message */
266/* Handle - display type */
267/* Message_Type - type of message to display */
268/* Replace_Parm - pointer to parm to replace */
269/* */
270/* Outputs : message */
271/* */
272/* Date : 03/28/88 */
273/* Version : DOS 4.00 */
274/************************************************************************/
275
276void Parse_msg(Msg_Num,Handle,Message_Type) /* AN010 */
277 /* AN010 */
278int Msg_Num; /* AN010 */
279int Handle; /* AN010 */
280unsigned char Message_Type; /* AN010 */
281
282BEGIN /* AN010 */
283char far *Cmd_Ptr; /* AN010 */
284
285
286 BEGIN /* AN010 */
287 segread(&segregs); /* AN010 */
288 FP_SEG(Cmd_Ptr) = segregs.ds; /* AN010 */
289 FP_OFF(Cmd_Ptr) = regs.x.si; /* AN010 */
290 *Cmd_Ptr = '\0'; /* AN010 */
291
292 FP_SEG(sublistp[0].value) = segregs.ds; /* AN010 */
293 FP_OFF(sublistp[0].value) = Parse_Ptr; /* AN010 */
294 sublistp[0].size = Sublist_Length; /* AN010 */
295 sublistp[0].reserved = Reserved; /* AN010 */
296 sublistp[0].id = 0; /* AN010 */
297 sublistp[0].flags = Char_Field_ASCIIZ+Left_Align; /* AN010 */
298 sublistp[0].max_width = 80; /* AN010 */
299 sublistp[0].min_width = 01; /* AN010 */
300 sublistp[0].pad_char = Blank; /* AN010 */
301
302 regs.x.ax = Msg_Num; /* AN010 */
303 regs.x.bx = Handle; /* AN010 */
304 regs.x.cx = SubCnt1; /* AN010 */
305 regs.h.dl = No_Input; /* AN010 */
306 regs.h.dh = Message_Type; /* AN010 */
307 regs.x.si = (unsigned int)&sublistp[0]; /* AN010 */
308 sysdispmsg(&regs,&regs); /* AN010 */
309 END /* AN010 */
310 return; /* AN010 */
311END /* AN010 */
312
diff --git a/v4.0/src/CMD/FDISK/GLOBAL.C b/v4.0/src/CMD/FDISK/GLOBAL.C
new file mode 100644
index 0000000..85b6e85
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/GLOBAL.C
@@ -0,0 +1,84 @@
1
2#include "fdisk.h"
3#include "dos.h"
4
5/* */
6/* */
7/****************************************************************************/
8/* Declare Global variables */
9/****************************************************************************/
10/* */
11
12
13
14char cur_disk;
15char good_disk[2];
16unsigned char number_of_drives;
17char reboot_flag;
18char errorlevel;
19char max_partition_size;
20char sort[24];
21char no_fatal_error;
22char valid_input;
23unsigned char video_mode;
24unsigned char display_page;
25unsigned char video_attribute; /* AN006 */
26
27
28unsigned total_disk[2];
29unsigned total_mbytes[2]; /* AN000 */
30unsigned char max_sector[2];
31unsigned max_head[2]; /* AC004 */
32unsigned required_cyls[2];
33
34unsigned input_row;
35unsigned input_col;
36char insert[800]; /* AC000 */
37char *pinsert = insert;
38
39extern unsigned char master_boot_record[2][512];
40unsigned char boot_record[512];
41
42char next_letter; /* AN000 */
43char primary_flag; /* AC000 */
44char extended_flag; /* AC000 */
45char logical_flag; /* AC000 */
46char disk_flag; /* AC000 */
47char quiet_flag; /* AC000 */
48unsigned primary_buff; /* AC000 */
49unsigned extended_buff; /* AC000 */
50unsigned logical_buff; /* AC000 */
51char cur_disk_buff; /* AC000 */
52unsigned long NOVAL = (unsigned long) 0; /* AC000 */
53FLAG PercentFlag; /* AC000 */
54
55FLAG mono_flag; /* AC006 */
56
57char Yes; /* AC012 */
58char No; /* AC012 */
59
60unsigned Parse_Ptr; /* AN010 */
61/* */
62/* */
63/****************************************************************************/
64/* Define Global structures */
65/****************************************************************************/
66/* */
67
68struct entry part_table[2][4];
69struct entry ext_table[2][24];
70struct freespace free_space[24];
71struct KeyData *input_data;
72struct dx_buffer_ioctl dx_buff; /* AN000 */
73struct diskaccess disk_access; /* AN002 */
74struct SREGS segregs;
75struct sublistx sublistp[1]; /* AN010 */
76
77/* */
78/****************************************************************************/
79/* Define UNIONS */
80/****************************************************************************/
81/* */
82
83union REGS regs;
84
diff --git a/v4.0/src/CMD/FDISK/INPUT.C b/v4.0/src/CMD/FDISK/INPUT.C
new file mode 100644
index 0000000..a818ef8
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/INPUT.C
@@ -0,0 +1,673 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "subtype.h" /* AN000 */
5#include "extern.h" /* AN000 */
6#include "ctype.h" /* AN000 */
7#include "string.h" /* AN000 */
8#include "stdio.h"
9#include "fdiskmsg.h" /* AN000 */
10#include "doscall.h" /* AN000 */
11
12/* */
13char get_num_input(input_default,max_num,row,col)
14
15char max_num;
16unsigned row;
17unsigned col;
18char input_default;
19
20BEGIN
21
22 char input;
23 char default_used;
24 char input_value;
25
26 /* print default entry if there is one */
27 if (input_default != c(NUL)) /* AC000 */
28
29 BEGIN
30 default_used = TRUE;
31 /* position the cursor */
32 VIOSETCURPOS(row,col,u(0)); /* AC000 */
33
34 /* Display the default character */
35 putch(((int)(input_default+'0')));
36 END
37
38 /* Assume bad input */
39 valid_input = FALSE;
40
41 /* Loop until we get good stuff */
42 while (valid_input == FALSE)
43 BEGIN
44
45 /* position the cursor */
46 VIOSETCURPOS(row,col,u(0)); /* AC000 */
47
48 /* Flush the keyboard buffer and get the next pressed key */
49 input = get_char_input();
50
51 /* Do world trade get country information */
52 input = dos_upper(input); /* AN000 */
53
54 /* Go handle different inputs */
55 switch(input)
56 BEGIN
57 case ESC:
58 BEGIN
59 valid_input = TRUE;
60 break;
61 END
62
63 case CR:
64 BEGIN
65 /* Set the input to the default if there is one there */
66 if (default_used)
67 BEGIN
68 if (input_default != c(NUL))
69 BEGIN
70 input_value = input_default+'0';
71 END
72 else
73 BEGIN
74 /* Make the enter look like a blank for error message */
75 input_value = c(' '); /* AC000 */
76 END
77 END
78 /* See if it is digit and less or equal to max */
79 if ( (isdigit(input_value)) &&
80 (input_value <= (max_num+'0')) &&
81 (input_value != c('0')) )
82 BEGIN
83 valid_input = TRUE;
84 input = input_value;
85 END
86 else
87 BEGIN
88 if (isdigit(input_value))
89 BEGIN
90 /* Setup error message */
91 insert[0] = input_value;
92 insert[1] = c('1'); /* AC000 */
93 insert[2] = c('-'); /* AC000 */
94 insert[3] = max_num+'0';
95 display(error_23);
96 END
97 else
98 BEGIN
99 insert[0] = c('1'); /* AC000 */
100 insert[1] = c('-'); /* AC000 */
101 insert[2] = max_num+'0';
102 display(error_31);
103 END
104 END
105 break;
106 END
107
108 default:
109 BEGIN
110 putch(((int)(input)));
111 default_used = FALSE;
112 input_value = input;
113 break;
114 END
115 END
116 END
117 return(input);
118END
119
120
121
122/* */
123
124char get_yn_input(input_default,row,col)
125
126unsigned row;
127unsigned col;
128char input_default;
129
130BEGIN
131
132 char input;
133 char default_used;
134 char input_value;
135
136 /* print default entry if there is one */
137 if (input_default != c(NUL)) /* AC000 */
138
139 BEGIN
140 default_used = TRUE;
141 /* position the cursor */
142 VIOSETCURPOS(row,col,u(0)); /* AC000 */
143
144 /* Display the default character */
145 putch(((int)(input_default)));
146 END
147
148 /* Assume bad input */
149 valid_input = FALSE;
150
151 /* Loop until we get good stuff */
152 while (valid_input == FALSE)
153 BEGIN
154
155 /* position the cursor */
156 VIOSETCURPOS(row,col,u(0)); /* AC000 */
157
158 /* Flush the keyboard buffer and get the next pressed key */
159 input = get_char_input();
160 input = dos_upper(input);
161
162 /* Go handle different inputs */
163 switch(input)
164 BEGIN
165 case ESC:
166 BEGIN
167 valid_input = TRUE;
168 break;
169 END
170
171 case CR:
172 BEGIN
173 /* Set the input to the default if there is one there */
174 if (default_used)
175 BEGIN
176 if (input_default != c(NUL)) /* AC000 */
177 BEGIN
178 input_value = input_default;
179 END
180 else
181 BEGIN
182 internal_program_error();
183 END
184 END
185 /* See if YES or NO */
186
187 /* Do world trade get country information */
188 input = check_yn_input(input_value); /* AN000 */
189
190 if ((input == c(1)) || (input == c(0))) /* AC000 */
191 BEGIN
192 valid_input = TRUE;
193 END
194 else
195 BEGIN
196 /* Setup error message */
197 insert[0] = c(Yes); /* AC000 AC011 */
198 insert[1] = c('-'); /* AC000 */
199 insert[2] = c(No); /* AC000 AC011 */
200 display(error_31);
201 END
202 break;
203 END
204
205 default:
206 BEGIN
207 putch(((int)(input)));
208 default_used = FALSE;
209 input_value = input;
210 break;
211 END
212 END
213 END
214 return(input);
215END
216
217
218/* */
219char wait_for_ESC()
220
221BEGIN
222 char input;
223
224 while (input != c(ESC)) /* AC000 */
225 BEGIN
226 /* position the cursor at the end of the ESC prompt */
227 VIOSETCURPOS(u(24),u(39),u(0)); /* AC000 */
228
229 /* Get input */
230 input = get_char_input();
231
232 END
233 return(c(ESC)); /* AC000 */
234END
235
236
237
238
239XFLOAT get_large_num_input(input_default,max_num,max_percent,input_message,prompt_location,error_message)
240
241unsigned input_default; /* AC000 */
242unsigned max_num;
243unsigned max_percent;
244char far *input_message;
245char far *error_message;
246unsigned prompt_location;
247
248BEGIN
249
250char input;
251XFLOAT large_input; /* AC000 */
252char default_used;
253unsigned long very_big_input;
254
255 /* Assume bad input */
256 valid_input = FALSE;
257
258 /* Assume no input, and use default */
259 default_used = TRUE;
260
261 /* Initialize the input value */
262 large_input = u(0); /* AC000 */
263
264 /* Loop until we get good stuff */
265 while (valid_input == FALSE)
266
267 BEGIN
268 /* position the cursor */
269 VIOSETCURPOS(input_row,input_col,u(0)); /* AC000 */
270
271 /* Flush the keyboard buffer and get the next pressed key */
272
273 input = get_char_input();
274
275 /* Go handle different inputs */
276 switch(input)
277 BEGIN
278 case ESC:
279 valid_input = TRUE;
280 large_input = ((unsigned)(ESC_FLAG));
281 break;
282
283 case CR:
284 BEGIN
285 if (PercentFlag)
286 BEGIN
287 /* Set the input to the default if there is one there and nothing else entered */
288 if ((input_default != u(NUL)) && (default_used)) /* AC000 */
289 large_input = input_default;
290 /* See if input is less or equal to max_value */
291 if (large_input <= max_percent)
292 BEGIN
293 if (large_input != u(0))
294 valid_input = TRUE;
295 else
296 display(error_28);
297 END
298 else
299 display(error_message);
300 END
301 else
302 BEGIN
303 /* Set the input to the default if there is one there and nothing else entered */
304 if ((input_default != u(NUL)) && (default_used)) /* AC000 */
305 large_input = input_default;
306 /* See if input is less or equal to max_value */
307 if (large_input <= max_num)
308 BEGIN
309 if (large_input != u(0))
310 valid_input = TRUE;
311 else
312 display(error_28);
313 END
314 else
315 display(error_message);
316 END
317 break;
318 END
319
320 case BACKSPACE:
321 if (PercentFlag)
322 PercentFlag = (FLAG)FALSE; /* AN000 */
323 else
324 large_input = large_input / 10;
325
326 /* Indicate that we are not using the default */
327 default_used = FALSE;
328 sprintf(&insert[prompt_location],"%4.0d",large_input); /* AN000 */
329 display(input_message);
330 break;
331
332 case PERCENT: /* AN000 */
333
334 if (PercentFlag == (FLAG)FALSE)
335 BEGIN /* AN000 */
336 PercentFlag = (FLAG)TRUE; /* AN000 */
337 /* Round down if > 999.9 */
338 if (large_input > u(999)) /* AN000 */
339 large_input = (large_input%1000); /* AN000 */
340 sprintf(&insert[prompt_location],"%3.0d%%",large_input); /* AN000 */
341 /* Indicate that we are not using the default */
342 default_used = FALSE; /* AN000 */
343 display(input_message); /* AN000 */
344 END /* AN000 */
345 else
346 display(error_33); /* AN000 */
347
348 break; /* AN000 */
349
350
351 default:
352 BEGIN
353
354 /* Make sure it is numerical input */
355
356 if ( (isdigit(input)) && ((!PercentFlag) || (default_used)) ) /* AN000 */
357 BEGIN
358 /* Add this digit in */
359 very_big_input= (((unsigned long)(large_input)) * 10) + ((unsigned long)input - '0'); /* AC000 */
360
361 /* Round down if > 9999.9 */
362 large_input = ((unsigned)(very_big_input%10000));
363
364 /* Put it in the message */
365 number_in_msg((XFLOAT)large_input,prompt_location); /* AN000 */
366 display(input_message);
367
368 /* Indicate that we are not using the default */
369 default_used = FALSE;
370 PercentFlag = (FLAG)FALSE; /* AN000 */
371 END
372 else
373 BEGIN
374 if (!PercentFlag) /* AN000 */
375 BEGIN /* AN000 */
376 /* Setup error message */
377 insert[0] = c('0'); /* AC000 */
378 insert[1] = c('-'); /* AC000 */
379 insert[2] = c('9'); /* AC000 */
380 display(error_31);
381 END /* AN000 */
382 else /* AN000 */
383 BEGIN /* AN000 */
384 display(error_33); /* AN000 */
385 END /* AN000 */
386 END
387 END
388 END
389 END
390
391 return(large_input);
392END
393
394
395/* */
396char get_alpha_input(low_letter,high_letter,row,col,error_low_letter,error_high_letter)
397
398unsigned row;
399unsigned col;
400char low_letter;
401char high_letter;
402char error_low_letter;
403char error_high_letter;
404
405BEGIN
406
407 char input;
408 char default_used;
409 char input_value;
410
411
412 /* Assume bad input */
413 valid_input = FALSE;
414
415 /* Init input_value to something non-alpha */
416 input_value = c(0); /* AC000 */
417
418 /* Loop until we get good stuff */
419 while (valid_input == FALSE)
420 BEGIN
421
422 /* position the cursor */
423 VIOSETCURPOS(row,col,u(0)); /* AC000 */
424
425 /* Flush the keyboard buffer and get the next pressed key */
426 input = get_char_input();
427 input = dos_upper(input);
428
429 /* Go handle different inputs */
430 switch(input)
431 BEGIN
432 case ESC:
433 BEGIN
434 valid_input = TRUE;
435 break;
436 END
437
438 case CR:
439 BEGIN
440 /* See if it is digit and between given letters*/
441 /* Do world trade get country information */
442 input = dos_upper(input_value); /* AN000 */
443 if ((isalpha(input)) &&
444 (input >= low_letter) &&
445 (input <= high_letter) &&
446 (isalpha(input_value)))
447 BEGIN
448 valid_input = TRUE;
449 END
450 else
451 BEGIN
452 if (isalpha(input_value))
453 BEGIN
454 /* Setup error message */
455 insert[0] = input;
456 insert[1] = error_low_letter;
457 insert[2] = c('-'); /* AC000 */
458 insert[3] = error_high_letter;
459 display(error_23);
460 END
461 else
462 BEGIN
463 insert[0] = error_low_letter;
464 insert[1] = c('-'); /* AC000 */
465 insert[2] = error_high_letter;
466 display(error_31);
467 END
468 END
469 break;
470 END
471
472 default:
473 BEGIN
474 putch(((int)(input)));
475 default_used = FALSE;
476 input_value = input;
477 break;
478 END
479 END
480 END
481 return(input);
482END
483
484
485/* */
486char get_char_input()
487
488BEGIN
489 regs.h.ah = uc(0x0C); /* AC000 */
490 regs.h.al = uc(0x08); /* AC000 */
491 intdos(&regs,&regs);
492 if (regs.h.al == uc(0)) /* AC000 */
493 BEGIN
494 DOSBEEP(u(900),u(400)); /* AC000 */
495 END
496 return(((char)(regs.h.al)));
497
498END
499
500
501
502/* */ /* AN000 */
503 /* AN000 */
504void get_string_input(StartRow,StartCol,string_ptr) /* AN000 */
505 /* AN000 */
506unsigned StartRow; /* AN000 */
507unsigned StartCol; /* AN000 */
508char far *string_ptr; /* AN000 */
509 /* AN000 */
510BEGIN /* AN000 */
511
512#define MAX_STRING_INPUT_LENGTH 11
513 /* AN000 */
514unsigned char input; /* AN000 */
515char input_value; /* AN000 */
516char far *WorkingPtr; /* AN000 */
517char far *DeletePtr; /* AN000 */
518char Done; /* AN000 */
519unsigned Row; /* AN000 */
520unsigned Col; /* AN000 */
521int i; /* AN000 */
522 /* AN000 */
523 /* AN000 */
524 WorkingPtr = string_ptr; /* AN000 */
525
526 Row = StartRow; /* AN000 */
527 Col = StartCol; /* AN000 */
528 VIOSETCURPOS(Row,Col,u(0)); /* AN000 */
529
530 while(*WorkingPtr != c(NUL)) /* AN000 */
531 BEGIN /* AN000 */
532 putch((int)(*WorkingPtr++)); /* AN000 */
533 Col++; /* AN000 */
534 VIOSETCURPOS(Row,Col,u(0)); /* AN000 */
535 END /* AN000 */
536
537 regs.h.ah = uc(12); /* AN000 */
538 regs.h.al = uc(8); /* AN000 */
539 intdos(&regs,&regs); /* AN000 */
540 input = regs.h.al; /* AN000 */
541
542 /* Loop until we get good stuff */ /* AN000 */
543 Done = FALSE; /* AN000 */
544 while (!Done) /* AN000 */
545 BEGIN /* AN000 */
546
547 /* Go handle different inputs */
548
549 if (input < 32) /* AN000 */
550 BEGIN /* AN000 */
551 switch(input) /* AN000 */
552 BEGIN /* AN000 */
553 case ESC: /* AN000 */
554 Done=TRUE; /* AN000 */
555 *string_ptr++ = c(ESC); /* AN000 */
556 *string_ptr++ = c('\0'); /* AN000 */
557 break; /* AN000 */
558
559 case CR: /* AN000 */
560 Done=TRUE; /* AN000 */
561 break; /* AN000 */
562
563 case 8: /* backspace */ /* AN000 */
564 if (Col > StartCol) /* AN000 */
565 BEGIN /* AN000 */
566 WorkingPtr--; /* AN000 */
567 Col--; /* AN000 */
568 VIOSETCURPOS(Row,Col,u(0)); /* AN000 */
569 putch(' '); /* AN000 */
570 VIOSETCURPOS(Row,Col,u(0)); /* AN000 */
571 DeletePtr = WorkingPtr; /* AN000 */
572 while ( *(DeletePtr+1) != c('\0') ) /* AN000 */
573 BEGIN /* AN000 */
574 *DeletePtr = *(DeletePtr+1); /* AN000 */
575 putch(*DeletePtr); /* AN000 */
576 DeletePtr++; /* AN000 */
577 END /* AN000 */
578 *DeletePtr = c('\0'); /* AN000 */
579 putch(' '); /* AN000 */
580 VIOSETCURPOS(Row,Col,u(0)); /* AN000 */
581 END /* AN000 */
582 else DOSBEEP(u(900),u(400)); /* AN000 */
583 break; /* AN000 */
584
585 case 0: /* AN000 */
586 regs.h.ah = uc(0x08); /* AN000 */
587 intdos(&regs,&regs); /* AN000 */
588 input = regs.h.al; /* AN000 */
589 switch(input) /* AN000 */
590 BEGIN /* AN000 */
591 case 71: /* HOME */ /* AN000 */
592 WorkingPtr = string_ptr; /* AN000 */
593 Row = StartRow; /* AN000 */
594 Col = StartCol; /* AN000 */
595 VIOSETCURPOS(Row,Col,u(0)); /* AN000 */
596 break; /* AN000 */
597
598 case 79: /* END */ /* AN000 */
599 while (*WorkingPtr != c('\0') ) /* AN000 */
600 BEGIN /* AN000 */
601 WorkingPtr++; /* AN000 */
602 Col++; /* AN000 */
603 VIOSETCURPOS(Row,Col,u(0)); /* AN000 */
604 END /* AN000 */
605 break; /* AN000 */
606
607
608 case 75: /* Cursor Left */ /* AN000 */
609 if (Col > StartCol) /* AN000 */
610 BEGIN /* AN000 */
611 WorkingPtr--; /* AN000 */
612 Col--; /* AN000 */
613 VIOSETCURPOS(Row,Col,u(0)); /* AN000 */
614 END /* AN000 */
615 else DOSBEEP(u(900),u(400)); /* AN000 */
616 break; /* AN000 */
617
618
619 case 77: /* Cursor Right */ /* AN000 */
620 if ( *WorkingPtr != c('\0') ) /* AN000 */
621 BEGIN /* AN000 */
622 WorkingPtr++; /* AN000 */
623 Col++; /* AN000 */
624 VIOSETCURPOS(Row,Col,u(0)); /* AN000 */
625 END /* AN000 */
626 else DOSBEEP(u(900),u(400)); /* AN000 */
627 break; /* AN000 */
628
629
630 default: /* AN000 */
631 DOSBEEP(u(900),u(400)); /* AN000 */
632 break; /* AN000 */
633
634 END /* AN000 */
635 break; /* AN000 */
636
637 default: /* AN000 */
638 DOSBEEP(u(900),u(400)); /* AN000 */
639 break; /* AN000 */
640 END /* AN000 */
641
642 END /* AN000 */
643 else /* input is >= 32 */ /* AN000 */
644 BEGIN /* AN000 */
645 input = dos_upper(input); /* AN000 */
646 if ( (strchr(".\"/\\[]:|<>+=;,",input) == NULL) &&
647 (Col < StartCol + MAX_STRING_INPUT_LENGTH) ) /* AN000 */
648 BEGIN /* AN000 */
649 putch(((int)(input))); /* AN000 */
650 *WorkingPtr = input; /* AN000 */
651 *(WorkingPtr+1) = c('\0'); /* AN000 */
652 if (Col < (StartCol + MAX_STRING_INPUT_LENGTH - 1) ) /* AN000 */
653 BEGIN /* AN000 */
654 Col++; /* AN000 */
655 WorkingPtr++; /* AN000 */
656 END /* AN000 */
657 VIOSETCURPOS(Row,Col,u(0)); /* AN000 */
658 END /* AN000 */
659 else DOSBEEP(u(900),u(400)); /* AN000 */
660 END /* AN000 */
661
662 if (!Done) /* AN000 */
663 BEGIN /* AN000 */
664 /* Get a character */ /* AN000 */
665 regs.h.ah = uc(0x08); /* AN000 */
666 intdos(&regs,&regs); /* AN000 */
667 input = regs.h.al; /* AN000 */
668 END /* AN000 */
669 END /* AN000 */
670
671 return; /* AN000 */
672END /* AN000 */
673
diff --git a/v4.0/src/CMD/FDISK/INT13.C b/v4.0/src/CMD/FDISK/INT13.C
new file mode 100644
index 0000000..ded7ff0
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/INT13.C
@@ -0,0 +1,443 @@
1#include "dos.h" /* AN000 */
2#include "fdisk.h" /* AN000 */
3#include "extern.h" /* AN000 */
4#include "subtype.h" /* AN000 */
5#include "fdiskmsg.h" /* AN000 */
6
7#include "string.h"
8#include "stdio.h"
9#include "stdlib.h"
10
11/* int printf(char *, ...); */
12
13/* */
14char get_disk_info()
15
16BEGIN
17
18unsigned char i;
19
20 /* Initialize values */
21 number_of_drives = uc(0); /* AC000 */
22 for (i=uc(0); i < uc(2); i++) /* AC000 */
23 BEGIN
24 total_disk[i] = u(0); /* AC000 */
25 total_mbytes[i] = f(0); /* AC000 */
26 max_sector[i] = uc(0); /* AC000 */
27 max_head[0] = u(0); /* AC004 */
28 END
29
30 /* See how many drives there are */
31 if (get_drive_parameters(uc(0x80))) /* AC000 */
32
33 BEGIN
34 /* Get the drive parameters for all drives */
35 for (i = uc(0); i < number_of_drives;i++) /* AC000 */
36
37 BEGIN
38 if (get_drive_parameters(uc(0x80)+i)) /* AC000 */
39
40 BEGIN
41 /* Save drive parameters */
42 max_sector[i] = ((unsigned char)(regs.h.cl & 0x3F));
43 max_head[i] = ((unsigned)(regs.h.dh +1)); /* AC004 */
44#if IBMCOPYRIGHT
45 total_disk[i] = ((((unsigned)(regs.h.cl & 0xC0 )) & 0x00C0) << 2)+ ((unsigned)regs.h.ch) +1;
46#else
47 total_disk[i] = ((((unsigned)(regs.h.cl & 0xc0)) << 2) | regs.h.ch) + 1;
48#endif
49 total_mbytes[i] = cylinders_to_mbytes(total_disk[i],i); /* AN004 */
50 END
51 else
52 BEGIN
53 good_disk[i] = FALSE;
54 return(FALSE);
55 END
56 END
57 return(TRUE);
58 END
59 else
60 /* No drives present */
61 BEGIN
62 no_fatal_error = FALSE;
63 return(FALSE);
64 END
65END
66
67
68
69/* */
70char write_boot_record(cylinder,which_disk)
71
72unsigned cylinder;
73unsigned char which_disk;
74
75BEGIN
76
77char i;
78char j;
79char far *buffer_pointer = boot_record;
80
81 /* Setup read, always on a cylinder boundary */
82 regs.h.ah = uc(WRITE_DISK); /* AC000 */
83 regs.h.al = uc(1); /* AC000 */
84 regs.h.dh = uc(0); /* AC000 */
85 regs.h.cl = uc(0x01); /* AC000 */
86
87 /* Specify the disk */
88 regs.h.dl = which_disk + 0x80;
89
90 /* Need to scramble CX so that sectors and cyl's are in INT 13 format */
91
92 if (cylinder > u(255)) /* AC000 */
93 BEGIN
94 regs.h.cl = regs.h.cl | ((unsigned char)((cylinder /256) << 6));
95 END
96 regs.h.ch = (unsigned char)(cylinder & 0xFF);
97
98 /* Point at the place to read the boot record */
99 regs.x.bx = FP_OFF(buffer_pointer);
100 segregs.es = FP_SEG(buffer_pointer);
101
102 /* write the boot record */
103 DiskIo(&regs,&regs,&segregs); /* AC000 */
104
105 /* Check for error reading it */
106 if ((regs.x.cflag & 1) != u(1)) /* AC000 */
107 BEGIN
108 return(TRUE);
109 END
110 else
111 BEGIN
112 /* Tell user there was an error */
113 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
114 display(error_2);
115 no_fatal_error = FALSE;
116 return(FALSE);
117 END
118END
119
120/* */
121unsigned verify_tracks(pointer,type)
122
123char pointer;
124char type;
125
126BEGIN
127unsigned i;
128unsigned location;
129unsigned sectors_per_fat;
130unsigned cur_cyl;
131unsigned verify_cyl;
132unsigned num_tracks;
133unsigned long total_sectors;
134char golden_tracks;
135char retry;
136unsigned char cur_head; /* AC004 */
137
138char far *buffer_pointer = boot_record;
139char head;
140
141
142
143 for (i=u(0); i< u(BYTES_PER_SECTOR);i++) /* AC000 */
144 BEGIN
145 /* Put something other then 0's so that unformatted FAT looks full */
146
147 boot_record[i] = uc(0xF6); /* AC000 */
148 END
149
150 /* Get the start cylinder for the sweep */
151 cur_cyl = free_space[pointer].start;
152
153 /* Also keep track of what it is */
154 verify_cyl = cur_cyl;
155
156 /* Initialize the start head -assume 0*/
157 cur_head = uc(0); /* AC004 */
158 if ((type == c(PRIMARY)) && (cur_cyl == u(0))) /* AC000 */
159 BEGIN
160
161 /* It's head 1 - NOTE: This is convience for PC-DOS because it is */
162 /* always this way - This may have to be beefed up for IFS */
163 cur_head = uc(1); /* AC004 */
164 END
165
166 /* Now go figure out the number of golden sectors needed. Use the */
167 /* allocation equation in the fixed disk section of DOS Tech Ref. */
168 /* */
169 /* TS = Free cyl's * sector/track * track/cyl */
170 /* RS = 1 */
171 /* D = 512 */
172 /* BPD = 32 */
173 /* BPS = BYTES_PER_SECTOR */
174 /* CF = 2 */
175 /* SPF = Solve */
176 /* SPC = 4 or 8 */
177 /* BPC = 1.5 or 2 */
178 /* */
179 /* Golden Sectors = RS + 2(SPF) + BPD(D) + (DOSFILES) */
180 /* ÄÄÄÄÄÄ if bootable */
181 /* BPS */
182
183 total_sectors = ((unsigned long)free_space[pointer].space) * max_head[cur_disk] * max_sector[cur_disk];
184
185 /* Chop off one track if it starts on head 1 */
186 if (cur_head == uc(1)) /* AC004 */
187 BEGIN
188 total_sectors = total_sectors - max_sector[cur_disk];
189 END
190
191 /* See if 12 or 16 bit fat */
192 if (total_sectors > (unsigned long)FAT16_SIZE)
193 BEGIN
194 /* 16 bit */
195 sectors_per_fat = ((unsigned)((total_sectors -33)/(2 + ((BYTES_PER_SECTOR *4)/2))));
196 END
197 else
198 BEGIN
199 /* 12 bit */
200 sectors_per_fat = ((unsigned)((total_sectors -33)/(2 + ((BYTES_PER_SECTOR *8)/1.5))));
201 END
202
203 /* Round up one just to handle any rounding errors */
204 sectors_per_fat++;
205
206 /* Now see how many tracks */
207 num_tracks = (sectors_per_fat*2) + 33;
208
209 /* If primary and drive 0, add in enough for system files */
210 if ((type == c(PRIMARY)) && (cur_disk == c(0))) /* AC000 */
211 BEGIN
212 num_tracks = num_tracks + SYSTEM_FILE_SECTORS;
213 END
214
215 #if IBMCOPYRIGHT
216 /* Now convert to tracks */
217 num_tracks = num_tracks/max_sector[cur_disk];
218
219 /* Handle upward rounding */
220 if (num_tracks%max_sector[cur_disk] != u(0)) /* AC000 */
221 BEGIN
222 num_tracks++;
223 END
224 #else
225 /* Handle upward rounding */ /* The problem with the IBM code is */
226 if (num_tracks%max_sector[cur_disk] != u(0)) /* that if num_tracks is < max_sector[cur_disk] */
227 BEGIN /* the num_tracks becomes 0 due to the integer */
228 num_tracks = num_tracks + max_sector[cur_disk]; /* division and num_tracks will not be inc'd . */
229 END /* This section of code overcomes that. */
230
231 /* Now convert to tracks */
232 num_tracks = num_tracks/max_sector[cur_disk];
233 #endif
234
235
236 golden_tracks = FALSE;
237 while (!golden_tracks)
238 BEGIN
239 for (i = u(0);i < num_tracks; i++) /* AC000 */
240 BEGIN
241 retry = c(0); /* AC000 */
242 do
243 BEGIN
244 retry++;
245 /* Specify the operation */
246 regs.h.ah = uc(WRITE_DISK); /* AC000 */
247
248 /* Specify number of sectors */
249 regs.h.al = ((unsigned char)max_sector[cur_disk]);
250
251 /* Specify the start sectors */
252 regs.h.cl = uc(1); /* AC000 */
253
254 /* Need to scramble CX so that sectors and cyl's are in INT 13 format */
255 if (cur_cyl > u(255)) /* AC000 */
256 BEGIN
257 regs.h.cl = regs.h.cl | ((unsigned char)((cur_cyl/256) << 6));
258 END
259 regs.h.ch = ((unsigned char)cur_cyl) & 0xFF;
260
261 /* Specify the disk */
262 regs.h.dl = ((unsigned char)cur_disk) + 0x80;
263
264 /* Specify the head */
265 regs.h.dh = cur_head; /* AC004 */
266
267 /* Point at the place to write */
268 regs.x.bx = FP_OFF(buffer_pointer);
269 segregs.es = FP_SEG(buffer_pointer);
270
271 /* write the track */
272 DiskIo(&regs,&regs,&segregs); /* AC000 */
273
274 END
275 while (((regs.x.cflag & 1) == u(1)) && (retry != c(5))); /* AC000 */
276
277 /* See if we had a good read */
278 if ((regs.x.cflag & 1) != u(1)) /* AC000 */
279 BEGIN
280 golden_tracks = TRUE;
281 /* Get the next head */
282 cur_head++;
283 if (cur_head == (uc(max_head[cur_disk] -1))) /* AC004 */
284 BEGIN
285 /* Up to the next cylinder */
286 cur_head = uc(0); /* AC004 */
287 cur_cyl++;
288
289 /* Check to see if we've reached the end of the free_space*/
290 if (cur_cyl > free_space[pointer].end)
291 BEGIN
292 /* It is, so return with the cyl offset equal to the freespace */
293 return(free_space[pointer].space);
294 END
295 END
296 END
297 else
298 BEGIN
299 /* Get out of the for loop, with a false flag */
300 golden_tracks = FALSE;
301
302 /* Bump up to the next cylinder boundary */
303 cur_cyl++;
304 cur_head = uc(0); /* AC004 */
305
306 /* Save the new verify start point */
307 verify_cyl = cur_cyl;
308
309 break;
310 END
311 END /* for num_tracks */
312 END /* while !golden_tracks */
313
314 /* All done, return the offset from original cyl to the new one */
315 return(verify_cyl - free_space[pointer].start);
316END
317
318
319/* */
320char get_drive_parameters(drive)
321
322unsigned char drive;
323
324BEGIN
325 /* See how many drives there are */
326 regs.h.ah = uc(DISK_INFO); /* AC000 */
327 regs.h.dl = drive;
328 DiskIo(&regs,&regs,&segregs); /* AC000 */
329
330 /* See if any drives exist */
331 if ((regs.h.dl == uc(0)) || ((regs.x.cflag & 1) == u(1))) /* AC000 */
332 BEGIN
333 display(error_1);
334 return(FALSE);
335 END
336 else
337 BEGIN
338 /* Save the number of drives */
339 number_of_drives = regs.h.dl;
340 return(TRUE);
341 END
342END
343
344/* */
345char read_boot_record(cylinder,which_disk,which_head,which_sector) /* AC000 */
346
347unsigned cylinder;
348unsigned char which_disk;
349unsigned char which_head; /* AN000 */
350unsigned char which_sector; /* AN000 */
351
352BEGIN
353
354char far *buffer_pointer = boot_record;
355
356 /* Setup read, always on a cylinder boundary */
357 regs.h.ah = uc(READ_DISK); /* AC000 */
358 regs.h.al = uc(1); /* AC000 */
359 regs.h.dh = which_head; /* AC000 */
360 regs.h.cl = which_sector; /* AC000 */
361
362 /* Specify the disk */
363 regs.h.dl = which_disk + 0x80;
364
365 /* Need to scramble CX so that sectors and cyl's are in INT 13 format */
366
367 if (cylinder > u(255)) /* AC000 */
368 BEGIN
369 regs.h.cl = regs.h.cl | ((char)((cylinder /256) << 6));
370 END
371 regs.h.ch = (unsigned char)(cylinder & 0xFF);
372
373 /* Point at the place to write the boot record */
374 regs.x.bx = FP_OFF(buffer_pointer);
375 segregs.es = FP_SEG(buffer_pointer);
376
377 /* read in the boot record */
378 DiskIo(&regs,&regs,&segregs); /* AC000 */
379 /* Check for error reading it */
380 if ((regs.x.cflag & 1) != u(1)) /* AC000 */
381 BEGIN
382 return(TRUE);
383 END
384 else
385 BEGIN
386 /* Tell user there was an error */
387 good_disk[which_disk] = FALSE;
388 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
389 return(FALSE);
390 END
391END
392
393/* */
394void DiskIo(InRegs,OutRegs,SegRegs)
395union REGS *InRegs;
396union REGS *OutRegs;
397struct SREGS *SegRegs;
398
399BEGIN
400
401 char *WritePtr;
402
403#ifdef DEBUG
404
405 switch(InRegs->h.ah)
406 {
407 case 0:
408 case 1:
409 case 2:
410 case 4:
411 case 8:
412 case 15:
413 case 16:
414 int86x((int)DISK,InRegs,OutRegs,SegRegs); /* AC000 */
415 break;
416
417 default:
418 WritePtr = getenv("WRITE");
419 if (strcmpi(WritePtr,"ON") != 0)
420 BEGIN
421 printf("\nDisallowing Disk I/O Request\n");
422 printf("AX:%04X BX:%04X CX:%04X DX:%04X ES:%04X\n",
423 InRegs->x.ax,InRegs->x.bx,InRegs->x.cx,InRegs->x.dx,SegRegs->es);
424
425 OutRegs->h.ah = (unsigned char) 0;
426 OutRegs->x.cflag = (unsigned) 0;
427 END
428 else int86x((int)DISK,InRegs,OutRegs,SegRegs);
429
430 break;
431
432 }
433
434#else
435
436 int86x((int)DISK,InRegs,OutRegs,SegRegs); /* AC000 */
437
438#endif
439
440 return;
441
442END
443
diff --git a/v4.0/src/CMD/FDISK/MAIN.C b/v4.0/src/CMD/FDISK/MAIN.C
new file mode 100644
index 0000000..289d5cc
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/MAIN.C
@@ -0,0 +1,332 @@
1
2/* */
3
4/******************* START OF SPECIFICATIONS *******************/
5/* */
6/* SOURCE FILE NAME: FDISK */
7/* */
8/* DESCRIPTIVE NAME: FIXED DISK PARTITIONING UTILITY */
9/* */
10/* FUNCTION: */
11/* Allows creation and deletion of DOS related partitions */
12/* on fixed disk devices 80-81h (int 13h BIOS defined, */
13/* DOS). Also allows display of all partitions, and will */
14/* allow a partition to be marked active (bootable). The */
15/* user will be prompted for action thru a full screen */
16/* interface. The user can also create, delete and display */
17/* logical DOS drives within a EXTENDED DOS Partition. If a*/
18/* regular DOS partition is created, the beginning of the */
19/* partition will be scanned to insure a contiguous area of*/
20/* good sectors on the disk large enough to satisfy the */
21/* DOS system requirements. If a bad spot is found, the */
22/* start of the partition will be moved out until a good */
23/* area is located */
24/* */
25/* NOTES: The program will work by setting up a logical image */
26/* of all relevant disk information at initilization */
27/* time. All operations will be performed on this */
28/* logical image, thus reducing disk accesses to only */
29/* those required to initially set up the logical image,*/
30/* and to write the changed information at the end. The */
31/* user will be informed if there is a problem writing */
32/* the logical image back to the disk. */
33/* */
34/* FDISK will interface with the partition table in the */
35/* master boot record as defined in the PC-DOS technical*/
36/* reference manual. It will also create and manage the */
37/* EXTENDED DOS partition architecture as defined in the*/
38/* PC-DOS 3.30 functional spec (CP/DOS spec dcr pending)*/
39/* */
40/* ENTRY POINTS: MAIN */
41/* LINKAGE: [d:] [path] FDISK */
42/* */
43/* EXTERNAL REFERENCES: */
44/* Fixed Disk Master Boot Record */
45/* EXTENDED Partition Volume Boot Records */
46/* Note: Both of the above are physical data structures on */
47/* the surface of the disk */
48/* */
49/* P.S. - To whoever winds up maintaining this, I will */
50/* apoligize in advance. I had just learned 'C' when */
51/* writing this, so out of ignorance of the finer points*/
52/* of the langauge I did a lot of things by brute force.*/
53/* Hope this doesn't mess you up too much - MT 5/20/86 */
54/******************** END OF SPECIFICATIONS ********************/
55
56#include <dos.h> /* AN000 */
57#include <fdisk.h> /* AN000 */
58#include <subtype.h> /* AN000 */
59#include <doscall.h> /* AN000 */
60#include <ctype.h> /* AN000 */
61#include <extern.h> /* AN000 */
62#include <signal.h> /* AN000 */
63#include <string.h> /* AN000 */
64#include <fdiskmsg.h> /* AN000 */
65#include <msgret.h> /* AN000 */
66#include <process.h> /* AN001 */
67#include <stdio.h> /* AN000 */
68
69/* */
70/******************* START OF SPECIFICATIONS *******************/
71/* */
72/* SUBROUTINE NAME: MAIN */
73/* */
74/* DESCRIPTIVE NAME: Main control routine */
75/* */
76/* FUNCTION: Main will handle call routines to handle the */
77/* setup of the video for the full screen interface, */
78/* get physical data on the drive characteristics, */
79/* initilize all data fields with the current status */
80/* of the disk partitioning information. Before the */
81/* program is terminated, the video is reset to the */
82/* mode it was in previous to the routine entry. It */
83/* will also handle the case of an improper setup */
84/* */
85/* NOTES: FDISK requires at least 1 hardfile to operate */
86/* */
87/* ENTRY POINTS: main(); */
88/* LINKAGE: */
89/* */
90/* INPUT: None */
91/* */
92/* EXIT-NORMAL: Return Code = 0 */
93/* */
94/* EXIT-ERROR: Return Code = 1 */
95/* */
96/* EFFECTS: Sets up status variables, sets up video for full */
97/* screen interface, and then restores the video mode */
98/* before exiting program */
99/* */
100/* INTERNAL REFERENCES: */
101/* ROUTINES: */
102/* init_video_information */
103/* get_disk_information */
104/* check_valid_environment */
105/* do_main_menu */
106/* init_partition_tables */
107/* reset_video_information */
108/* */
109/* EXTERNAL REFERENCES: */
110/* ROUTINES: */
111/* DosExit */
112/* */
113/******************** END OF SPECIFICATIONS ********************/
114
115
116/* */
117/**************************************************************************/
118/* */
119/* UTILITY NAME: FDISK.com */
120/* SOURCE FILE NAME: FDISK.c */
121/* STATUS: FDISK utility, DOS 3.3 */
122/* CHANGE HISTORY: UPDATED 5-29-87 DOS4.0 DRM */
123/* SYNTAX (Command line) */
124/* */
125/* [d:][path]FDISK */
126/* */
127/* or */
128/* */
129/* [d:][path]FDISK d [/PRI:m | /EXT:n | /LOG:o | /Q ...] */
130/* */
131/* d: Drive to load FDISK utility from */
132/* */
133/* path path to the directory on specified drive to */
134/* load FDISK from */
135/* */
136/* d Drive (1 or 2) that FDISK should operate on */
137/* */
138/* /PRI:m Size of Primary DOS partition to create in K */
139/* */
140/* /EXT:n Size of Extended DOS partition to create in K */
141/* */
142/* /LOG:o Size of Logical drive to create in K in the */
143/* extended partition */
144/* */
145/* /Q This suppresses the reboot screen and returns */
146/* FDISK to DOS even if partitons have changed. */
147/* */
148/* UTILITY FUNCTION: */
149/* Allows you to create, set up, display, and delete the */
150/* DOS partitions on a fixed disk. */
151/* */
152/**************************************************************************/
153/* */
154void main(argc,argv) /* AC000 */
155
156int argc; /* AN000 */
157char *argv[]; /* AN000 */
158
159BEGIN
160
161 char temp; /* AN000 */
162 unsigned input;
163
164 /* DISABLE CNTL-BREAK HERE */
165 /* Gets defines from signal.h */
166 signal( (int) SIGINT, SIG_IGN ); /* AN000 */
167
168 no_fatal_error = TRUE; /* AN000 */
169
170 /* Preload messages and return */
171 if ( preload_messages() &&
172 get_yes_no_values() ) /* AN000 AC012 */
173 BEGIN /* AN000 */
174
175 /* Parse the command line for syntax and switches */
176 if(parse_command_line(argc,argv)) /* AN000 */
177
178 BEGIN /* AN000 */
179 /* check to see if switches were set */
180 if ((primary_flag == FALSE) &&
181 (extended_flag == FALSE) &&
182 (logical_flag == FALSE) &&
183 (disk_flag == FALSE)) /* AN000 */
184
185 BEGIN /* AN000 */
186 reboot_flag = FALSE;
187 /* See if running evironment is ok (Got hardfile, no network */
188 if (check_valid_environment())
189 BEGIN /* AN000 */
190 /* Get and save screen mode information */
191 init_video_information();
192 clear_screen(u(0),u(0),u(24),u(79)); /* AC006 */
193
194 /* Get disk size information */
195 good_disk[0] = TRUE;
196 good_disk[1] = TRUE;
197
198 if (get_disk_info())
199 BEGIN
200 /* build memory model of partitions */
201 init_partition_tables();
202
203 /* Go do main screen */
204 do_main_menu();
205 write_info_to_disk();
206 END
207
208 if (reboot_flag)
209 BEGIN /* AN000 */
210 reboot_system();
211 DOSEXIT((unsigned) 0,(unsigned) 0); /* AC000 */
212 END /* AN000 */
213
214 /* Nearly done, go reset screen mode */
215 if (no_fatal_error)
216 BEGIN
217 reset_video_information();
218 END /* AN000 */
219 /* this is end of check valid environment */
220 END /* AN000 */
221 /* This is end for no switches set */
222 END /* AN000 */
223
224 else /* AN000 */
225
226 BEGIN /* AN000 */
227 if ( ((primary_flag == FALSE) &&
228 (extended_flag == FALSE) &&
229 (logical_flag == FALSE)) ||
230 (disk_flag == FALSE) ) /* AN000 */
231 display_msg((int)8,(int)DosStdEr,(int)nosubcnt,(int)nosubptr,c(noinput),c(Utility_Msg_Class)); /*;AN000; AC014 AC015 */
232
233 else
234 BEGIN
235 reboot_flag = FALSE; /* AN000 */
236 /* Get disk size information */ /* AN000 */
237 good_disk[0] = TRUE; /* AN000 */
238 good_disk[1] = TRUE; /* AN000 */
239 if (get_disk_info()) /* AN000 */
240 BEGIN
241 if (number_of_drives < (cur_disk_buff+1))
242 display_msg((int)8,(int)DosStdEr,(int)nosubcnt,(int)nosubptr,c(noinput),c(Utility_Msg_Class)); /*;AN000; AC014 AC015*/
243 else
244 BEGIN /* AN000 */
245 /* build memory model of partitions */
246 init_partition_tables(); /* AN000 */
247
248 /* set cur_disk to current disk */
249 cur_disk = cur_disk_buff; /* AN000 */
250
251 /* If /PRI: was specified, create primary partition */
252 /* check to see if a primary partition already exists */
253 if ( (primary_flag == TRUE) && /* AN000 */
254 ( (!find_partition_type(uc(DOS12))) &&
255 (!find_partition_type(uc(DOS16))) &&
256 (!find_partition_type(uc(DOSNEW))) ) ) /* AC000 */
257 BEGIN
258 temp = find_part_free_space((char) PRIMARY); /* AN000 */
259 if (primary_buff >= free_space[temp].mbytes_unused) /* AN000 */
260 input = free_space[temp].space; /* AN000 */
261 else /* AN000 */
262 input = (unsigned)mbytes_to_cylinders(primary_buff,
263 cur_disk_buff); /* AN004 */
264 make_partition(input,temp,uc(ACTIVE),(char)PRIMARY); /* AN000 */
265 END
266
267 /* If /EXT: was specified, create extended partition */
268 /* Check and see if there is a primary partition before you create an extended */
269 if ( (extended_flag == TRUE) && /* AN000 */
270 ( (cur_disk == c(1)) ||
271 (find_partition_type(uc(DOS12))) ||
272 (find_partition_type(uc(DOS16))) ||
273 (find_partition_type(uc(DOSNEW))) ) ) /* AC000 */
274 BEGIN
275 /* Make sure there isn't an extended already there */
276 if (!find_partition_type(uc(EXTENDED))) /* AC000 */
277 BEGIN
278 temp = find_part_free_space((char) EXTENDED); /* AN000 */
279 if (extended_buff >= free_space[temp].mbytes_unused) /* AN000 */
280 input = free_space[temp].space; /* AN000 */
281 else /* AN000 */
282 input = (unsigned)mbytes_to_cylinders(extended_buff,
283 cur_disk_buff); /* AN004 */
284 make_partition(input,temp,(unsigned char) NUL,(char) EXTENDED); /* AN000 */
285 END
286 END
287
288 /* If /LOG: was specified, create logical partition */
289 if ( (logical_flag == TRUE) &&
290 (find_partition_type(uc(EXTENDED))) ) /* AN000 */
291 BEGIN /* AN000 */
292 temp = find_ext_free_space(); /* AN000 */
293 if (logical_buff >= free_space[temp].mbytes_unused) /* AN000 */
294 input = free_space[temp].space; /* AN000 */
295 else /* AN000 */
296 input = (unsigned)mbytes_to_cylinders(logical_buff,
297 cur_disk_buff); /* AN004 */
298 make_volume(input,temp); /* AN000 */
299 END
300
301 /* This is end of switch execution */
302 write_info_to_disk(); /* AN000 */
303 END /* AN000 */
304 /* This is the end of compare cur_disk_buff for valid drive */
305 END
306 /* This is the end of just disk_flag set */
307 END
308 /* This is end of if switch is present */
309 END
310 /* This is end of Parse command line */
311 END /* AN000 */
312 /* This end of Preload_messages function */
313 END /* AN000 */
314 cur_disk = c(0); /* AN001 */
315 if ( (quiet_flag == TRUE) &&
316 (!find_partition_type(uc(DOS12))) &&
317 (!find_partition_type(uc(DOS16))) &&
318 (!find_partition_type(uc(DOSNEW))) ) /* AN001 */
319 exit(ERR_LEVEL_1); /* AN001 */
320 else
321 BEGIN /* AN005 */
322 if ((quiet_flag == TRUE) && /* AN005 */
323 (primary_flag == FALSE) && /* AN008 */
324 (extended_flag == FALSE) && /* AN008 */
325 (logical_flag == FALSE)) /* AN008 */
326 exit(ERR_LEVEL_2); /* AN005 */
327 else /* AN005 */
328 exit(ERR_LEVEL_0); /* AN001 */
329 END /* AN005 */
330END
331
332
diff --git a/v4.0/src/CMD/FDISK/MAINMENU.C b/v4.0/src/CMD/FDISK/MAINMENU.C
new file mode 100644
index 0000000..c0a99c8
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/MAINMENU.C
@@ -0,0 +1,231 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "subtype.h" /* AN000 */
5#include "extern.h" /* AN000 */
6#include "fdiskmsg.h" /* AN000 */
7
8/* */
9/******************* START OF SPECIFICATIONS *******************/
10/* */
11/* SUBROUTINE NAME: DO_MAIN_MENU */
12/* */
13/* DESCRIPTIVE NAME: Main menu display and input routine */
14/* */
15/* FUNCTION: */
16/* Displays the main FDISK menu, accepts and validates */
17/* input from menu and passes control to requested function */
18/* */
19/* NOTES: The following screen is managed by this routine: */
20/* */
21/* ³0000000000111111111122222222223333333333³ */
22/* ³0123456789012345678901234567890123456789³ */
23/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
24/* 00³IBM Personal Computer ³ */
25/* 01³Fixed Disk Setup Program Version 3.30 ³ */
26/* 02³(C)Copyright IBM Corp. 1983,1987 ³ */
27/* 03³ ³ */
28/* 04³FDISK Options ³ */
29/* 05³ ³ */
30/* 06³Current Fixed Disk Drive: # ³ */
31/* 07³ ³ */
32/* 08³Choose one of the following: ³ */
33/* 09³ ³ */
34/* 10³ 1. Create DOS partition ³ */
35/* 11³ 2. Change Active Partition ³ */
36/* 12³ 3. Delete DOS Partition ³ */
37/* 13³ 4. Display Partition Data ³ */
38/* 14³ 5. Select Next Fixed Disk Drive ³ */
39/* 15³ ³ */
40/* 16³ ³ */
41/* 17³ ³ */
42/* 18³Enter choice: [#] ³ */
43/* 19³ ³ */
44/* 20³ ³ */
45/* 21³WARNING! No partitions marked active ³ */
46/* 22³ ³ */
47/* 23³Press ESC to return to DOS ³ */
48/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
49/* */
50/* ENTRY POINTS: do_main_menu */
51/* LINKAGE: do_main_menu(); */
52/* NEAR CALL */
53/* */
54/* INPUT: None */
55/* */
56/* EXIT-NORMAL: ERROR=FALSE */
57/* */
58/* EXIT-ERROR: ERROR=TRUE */
59/* GOTO internal_program_error if case statement */
60/* failure when branching to requested function */
61/* */
62/* EFFECTS: No data directly modified by this routine, but */
63/* child routines will modify data. */
64/* */
65/* INTERNAL REFERENCES: */
66/* ROUTINES: */
67/* clear_screen */
68/* display */
69/* get_num_input */
70/* create_partition */
71/* change_active_partition */
72/* delete_partition */
73/* display_partition_information */
74/* find_active_partition */
75/* change_drive */
76/* internal_program_error */
77/* */
78/* EXTERNAL REFERENCES: */
79/* ROUTINES: */
80/* */
81/******************** END OF SPECIFICATIONS ********************/
82
83/* */
84void do_main_menu()
85
86BEGIN
87
88char input;
89char max_input;
90unsigned temp;
91unsigned i;
92
93
94 input = c(NUL); /* AC000 */
95 PercentFlag = (FLAG)FALSE; /* AN000 */
96 /* Intialize cur_disk indicator. It is 0 based for array usage */
97 /* See if first disk readable */
98 cur_disk = c(0); /* AC000 */
99 if (!good_disk[0])
100 BEGIN
101 cur_disk++;
102 END
103
104 /* See if we have a valid combo of disk */
105 if ((good_disk[0]) || ((good_disk[1]) && (number_of_drives == uc(2)))) /* AC000 */
106 BEGIN
107 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
108 /* Display the copyright */
109 display(menu_1);
110
111 /* See if we couldn't access drive 1 */
112 if (!good_disk[0])
113 BEGIN
114 insert[0] = c('1'); /* AC000 */
115 display(error_30);
116 END
117
118 /* Display the menu every time this routine is returned to until ESC */
119 input = c(NUL); /* AC000 */
120 while (input !=c(ESC)) /* AC000 */
121 BEGIN
122 /* Put up most of the menu */
123 display(menu_2);
124 display(menu_3);
125 display(menu_7);
126
127 /* Put correct disk in current disk message */
128 insert[0]=cur_disk+1+'0';
129 display(menu_5);
130
131 /* Display warning prompt if no active partitions */
132 /* check to see if there is an avail partition */
133 temp = u(0); /* AC000 */
134 for (i = u(0); i < u(4);i++) /* AC000 */
135 BEGIN
136
137 /* See if any non - zero system id bytes */
138 temp = temp | part_table[cur_disk][i].sys_id ;
139 END
140 /* Any entry that isn't zero means */
141 if (temp != u(0)) /* AC000 */
142 BEGIN
143 /* If there isn't an active partition and this is disk 1, then yell) */
144 if ((!find_active_partition()) && (cur_disk == c(0))) /* AC000 */
145 display(menu_6);
146 END
147
148 /* Get the menu input */
149
150 /* See if more than one fixed disk */
151 if (number_of_drives == uc(2)) /* AC000 */
152 BEGIN
153 display(menu_4);
154 max_input = c(5); /* AC000 */
155 END
156 else /* only 4 options */
157 max_input = c(4); /* AC000 */
158 /* Setup default and go get input */
159 input = get_num_input(c(1),max_input,input_row,input_col); /* AC000 */
160 switch(input)
161 BEGIN
162 case '1': create_partition();
163 break;
164
165 case '2': change_active_partition();
166 break;
167
168 case '3': delete_partition();
169 break;
170
171 case '4': display_partition_information();
172 break;
173
174 case '5': BEGIN
175 if (number_of_drives == uc(1)) /* AC000 */
176 internal_program_error();
177 else
178 BEGIN
179 /* Swap the number */
180 if (cur_disk == c(0)) /* AC000 */
181 BEGIN
182 if (good_disk[1])
183 BEGIN
184 cur_disk++;
185 END
186 else
187 BEGIN
188 /* Disk has error reading */
189 insert[0] = c('2'); /* AC000 */
190 display(error_30);
191 END
192 END
193 else
194 BEGIN
195
196 if (cur_disk == c(1)) /* AC000 */
197 BEGIN
198 if (good_disk[0])
199 BEGIN
200 cur_disk--;
201 END
202 else
203 BEGIN
204 /* Disk has error reading */
205 insert[0] = c('1'); /* AC000 */
206 display(error_30);
207 END
208 END
209 else
210 internal_program_error;
211 END
212 END
213 break;
214 END
215
216 case ESC: break; /* ESC case */
217
218 default: internal_program_error();
219 END
220 END
221 END
222 else
223 BEGIN
224 /* Can't read either drive, so quit */
225 no_fatal_error = c(FALSE); /* AC000 */
226 display(error_2);
227 END
228 return;
229END
230
231 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/MAKEFILE b/v4.0/src/CMD/FDISK/MAKEFILE
new file mode 100644
index 0000000..2d4117e
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/MAKEFILE
@@ -0,0 +1,114 @@
1#************************** makefile for cmd\... ***************************
2
3msg =..\..\messages
4dos =..\..\dos
5inc =..\..\inc
6hinc =..\..\h
7
8#
9####################### dependencies begin here. #########################
10#
11
12map =..\..\mapper
13here =..\cmd\fdisk
14
15all: fdisk.exe
16
17
18# Handle the FDISK 'C' source compilations first
19
20fdiskm.c : $(msg)\$(COUNTRY).msg fdisk.msg
21 menubld fdisk.msg $(msg)\$(COUNTRY).MSG
22
23fdisk5.cl1 : fdisk5.skl $(msg)\$(COUNTRY).msg
24
25fdisk.ctl : fdisk.skl $(msg)\$(COUNTRY).msg
26
27main.obj : main.c \
28 fdisk.h subtype.h extern.h fdiskmsg.h msgret.h doscall.h
29
30fdisk.obj : fdisk.c \
31 fdisk.h subtype.h extern.h fdiskmsg.h doscall.h msgret.h
32
33mainmenu.obj : mainmenu.c fdisk.h subtype.h extern.h fdiskmsg.h
34
35display.obj : display.c \
36 fdisk.h subtype.h extern.h fdiskmsg.h doscall.h
37
38d_menus.obj : d_menus.c fdisk.h subtype.h extern.h fdiskmsg.h
39
40c_menus.obj : c_menus.c fdisk.h subtype.h extern.h fdiskmsg.h
41
42input.obj : input.c fdisk.h subtype.h extern.h fdiskmsg.h doscall.h
43
44tdisplay.obj : tdisplay.c fdisk.h subtype.h extern.h fdiskmsg.h
45
46vdisplay.obj : vdisplay.c fdisk.h subtype.h extern.h fdiskmsg.h
47
48space.obj : space.c fdisk.h subtype.h extern.h
49
50partinfo.obj : partinfo.c fdisk.h subtype.h extern.h
51
52makepart.obj : makepart.c fdisk.h subtype.h extern.h
53
54video.obj : video.c fdisk.h extern.h subtype.h fdiskmsg.h doscall.h
55
56int13.obj : int13.c fdisk.h subtype.h extern.h fdiskmsg.h
57
58diskout.obj : diskout.c fdisk.h subtype.h extern.h
59
60fdparse.obj : fdparse.c fdisk.h subtype.h extern.h parse.h msgret.h
61
62convert.obj : convert.c fdisk.h subtype.h extern.h
63
64global.obj : global.c fdisk.h makefile
65
66fdiskm.obj : fdiskm.c
67
68messages.obj : messages.c msgret.h extern.h subtype.h fdisk.h
69
70
71# Handle the FDISK MASM source
72
73
74fdboot.obj : fdboot.asm fdisk5.cl1
75
76fdboot.inc: fdboot.obj
77 link fdboot;
78 exe2bin fdboot
79 del fdboot.exe
80 dbof fdboot.bin fdboot.inc 600 200
81
82_parse.obj : _parse.asm $(inc)\psdata.inc $(inc)\parse.asm \
83 makefile
84
85_msgret.obj : _msgret.asm $(inc)\psdata.inc \
86 fdisk.ctl fdisk.cla fdisk.clb fdisk.cl1 fdisk.cl2 \
87 makefile
88
89bootrec.obj : bootrec.asm fdboot.inc \
90 makefile
91
92reboot.obj : reboot.asm \
93 makefile
94
95$(map)\mapper.lib:
96 cd $(map)
97 nmake
98 cd $(here)
99
100# Do the link of FDISK
101
102fdisk.exe : fdisk.obj reboot.obj bootrec.obj fdboot.obj \
103 display.obj input.obj tdisplay.obj vdisplay.obj \
104 space.obj partinfo.obj video.obj makepart.obj \
105 int13.obj diskout.obj messages.obj fdparse.obj \
106 convert.obj global.obj fdiskm.obj main.obj \
107 c_menus.obj d_menus.obj mainmenu.obj _msgret.obj \
108 $(map)\mapper.lib makefile fdisk.lnk fdisk.ctl _parse.obj \
109 $(inc)\comsubs.lib
110 cd $(inc)
111 nmake
112 cd $(here)
113 link @fdisk.lnk
114
diff --git a/v4.0/src/CMD/FDISK/MAKEPART.C b/v4.0/src/CMD/FDISK/MAKEPART.C
new file mode 100644
index 0000000..b33e091
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/MAKEPART.C
@@ -0,0 +1,282 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "extern.h" /* AN000 */
5#include "subtype.h" /* AN000 */
6#include "string.h" /* AN000 */
7
8/* */
9
10void make_partition(size,free_pointer,bootable,type)
11
12unsigned size;
13char free_pointer;
14unsigned char bootable;
15char type;
16
17BEGIN
18
19char table_pointer;
20unsigned i;
21unsigned char temp;
22unsigned long total_sectors;
23
24 /* Find a free spot to put it in */
25 table_pointer = find_free_partition();
26
27 if (table_pointer != ((char)(NOT_FOUND)))
28 BEGIN
29 /* found a free partition, now lets go fill it up */
30
31 /* Do we need to make it active? */
32 if (bootable == ((unsigned char)(ACTIVE)))
33 BEGIN
34
35 /* Go clear out a previously active one */
36 for (i=u(0); i <u(4); i++) /* AC000 */
37 BEGIN
38 if (part_table[cur_disk][i].boot_ind == uc(0x80)) /* AC000 */
39 BEGIN
40 part_table[cur_disk][i].changed = TRUE;
41 part_table[cur_disk][i].boot_ind = uc(0); /* AC000 */
42 END
43 END
44
45 /* Now mark the new one active */
46 part_table[cur_disk][table_pointer].boot_ind = uc(0x80); /* AC000 */
47 END
48 else
49 BEGIN
50 /* Mark it as not active, leaving the others alone */
51 part_table[cur_disk][table_pointer].boot_ind = uc(0); /* AC000 */
52 END
53
54 /* Go get the start cylinder */
55 part_table[cur_disk][table_pointer].start_cyl = free_space[free_pointer].start;
56
57 /* Setup end cylinder */
58 part_table[cur_disk][table_pointer].end_cyl = part_table[cur_disk][table_pointer].start_cyl + size - 1;
59
60 /* Start sector is always 1 */
61 part_table[cur_disk][table_pointer].start_sector = uc(1); /* AC000 */
62
63 /* End sector is always the last sector */
64 part_table[cur_disk][table_pointer].end_sector = max_sector[cur_disk];
65
66 /* End head is always the last head */
67 part_table[cur_disk][table_pointer].end_head = uc(max_head[cur_disk] -1); /* AC004 */
68
69 /* Start head is always 0 unless this is track 0 - then it is 1 */
70 temp = uc(0); /* AC000 */
71 if (part_table[cur_disk][table_pointer].start_cyl == u(0)) /* AC000 */
72 BEGIN
73 temp = uc(1); /* AC000 */
74 END
75 part_table[cur_disk][table_pointer].start_head = temp;
76
77 /* Figure out the total number of sectors */
78 /* Total sectors in partition = */
79 /* [(end_cyl - start_cyl)*(max_sector)*(max_head)] */
80 /* - [start_head * max_sector] */
81 /* Note: This is assuming a track or cylinder aligned partition */
82
83 /* First - get the total size in Cylinders assuming head 0 start*/
84 total_sectors = ((unsigned long)(part_table[cur_disk][table_pointer].end_cyl -
85 part_table[cur_disk][table_pointer].start_cyl+1));
86
87 /* Now multiply it by the number of sectors and heads per track */
88 total_sectors = total_sectors * max_sector[cur_disk] * max_head[cur_disk];
89
90 /* This will give us the total of sectors if it is cyl aligned */
91 /* Now, if it isn't aligned on head 0, we need to subtract off */
92 /* the skipped tracks in the first cylinder */
93
94 /* Because the head is zero based, we can get the total number of */
95 /* skipped sectors by multipling the head number by sectors per track */
96 total_sectors = total_sectors - ((unsigned long)part_table[cur_disk][table_pointer].start_head) *
97 max_sector[cur_disk];
98 part_table[cur_disk][table_pointer].num_sec = total_sectors;
99
100 /* Get the relative sector */
101 /* Figure out the total number of sectors */
102 /* Total sectors before partition = */
103 /* (start_cyl)*(max_sector)*(max_head)] */
104 /* + [start_head * max_sector] */
105 /* Note: This is assuming a track or cylinder aligned partition */
106
107 /* Start cyl will work because it is zero based */
108 total_sectors = ((unsigned long)part_table[cur_disk][table_pointer].start_cyl);
109
110 /* Get sectors up to head 0 of the partition */
111 total_sectors = total_sectors * max_sector[cur_disk] * max_head[cur_disk];
112
113 /* Because the head is zero based, we can get the total number of */
114 /* skipped sectors by multipling the head number by sectors per track */
115 total_sectors = total_sectors + ((unsigned long)part_table[cur_disk][table_pointer].start_head) *
116 max_sector[cur_disk];
117
118 /* Save it! */
119 part_table[cur_disk][table_pointer].rel_sec = total_sectors;
120
121 /* Setup the system id byte */
122 if (type == ((char)(EXTENDED)))
123 BEGIN
124 temp = uc(EXTENDED); /* AC000 */
125 END
126 else
127 BEGIN
128 if (type == ((char)(PRIMARY)))
129 BEGIN
130 /* Always set to 06h - let format worry about setting to correct value */
131 temp = uc(DOSNEW); /* AC000 */ /* AN000 */
132 END
133 else
134 BEGIN
135 internal_program_error();
136 END
137 END
138
139 /* We got the sys id, now put it in */
140 part_table[cur_disk][table_pointer].sys_id = temp;
141
142 /* Set the changed flag */
143 part_table[cur_disk][table_pointer].changed = TRUE;
144
145 /* Set the mbytes used */
146 part_table[cur_disk][table_pointer].mbytes_used =
147 cylinders_to_mbytes(size,cur_disk); /* AN004 */
148
149 /* Set the percent used */
150 part_table[cur_disk][table_pointer].percent_used =
151 cylinders_to_percent(((part_table[cur_disk][table_pointer].end_cyl-part_table[cur_disk][table_pointer].start_cyl)+1),
152 total_disk[cur_disk]); /* AN000 */
153 END
154 else
155
156 BEGIN
157 /* This should not have happened */
158 internal_program_error();
159 return;
160 END
161
162 return;
163END
164
165
166/* */
167char make_volume(size,free_pointer)
168
169unsigned size;
170char free_pointer;
171
172BEGIN
173
174char table_pointer;
175unsigned i;
176unsigned ext_part_num; /* AN000 */
177unsigned char temp;
178unsigned long total_sectors;
179
180 /* Find a free spot to put it in */
181 table_pointer = find_free_ext();
182
183 if (table_pointer != ((char)(NOT_FOUND)))
184 BEGIN
185 /* found a free partition, now lets go fill it up */
186
187
188 /* This can never be marked active */
189 ext_table[cur_disk][table_pointer].boot_ind = uc(0); /* AC000 */
190
191
192 /* Go get the start cylinder */
193 ext_table[cur_disk][table_pointer].start_cyl = free_space[free_pointer].start;
194
195 /* Setup end cylinder */
196 ext_table[cur_disk][table_pointer].end_cyl = ext_table[cur_disk][table_pointer].start_cyl + size - 1;
197
198 /* Start sector is always 1 */
199 ext_table[cur_disk][table_pointer].start_sector = uc(1); /* AC000 */
200
201 /* End sector is always the last sector */
202 ext_table[cur_disk][table_pointer].end_sector = max_sector[cur_disk];
203
204 /* End head is always the last head */
205 ext_table[cur_disk][table_pointer].end_head = uc(max_head[cur_disk]-1); /* AC004 */
206
207 /* Start head is always 1 - NOTE: This is a shortcut for PC-DOS */
208 /* If this is being modified for IFS drivers this may not be the */
209 /* the case - use caution */
210 ext_table[cur_disk][table_pointer].start_head = uc(1); /* AC000 */
211
212 /* Figure out the total number of sectors */
213 /* Total sectors in partition = */
214 /* [(end_cyl - start_cyl)*(max_sector)*(max_head)] */
215 /* - [start_head * max_sector] */
216 /* Note: This is assuming a track or cylinder aligned partition */
217
218 /* First - get the total size in Cylinders assuming head 0 start*/
219 total_sectors = ((unsigned long)(ext_table[cur_disk][table_pointer].end_cyl -
220 ext_table[cur_disk][table_pointer].start_cyl+1));
221
222 /* Now multiply it by the number of sectors and heads per track */
223 total_sectors = total_sectors * max_sector[cur_disk] * max_head[cur_disk];
224
225 /* This will give us the total of sectors if it is cyl aligned */
226 /* Now, if it isn't aligned on head 0, we need to subtract off */
227 /* the skipped tracks in the first cylinder */
228
229 /* Because the head is zero based, we can get the total number of */
230 /* skipped sectors by multipling the head number by sectors per track */
231 total_sectors = total_sectors - ((unsigned long)(ext_table[cur_disk][table_pointer].start_head *
232 max_sector[cur_disk]));
233
234 ext_table[cur_disk][table_pointer].num_sec = total_sectors;
235
236 /* Get the relative sector */
237 /* Figure out the total number of sectors */
238 /* Total sectors before partition = max_sector */
239 /* NOTE: Again, this is a PC-DOS 3.30 shortcut - by definition */
240 /* a logical drive always starts on head 1, so there is always */
241 /* one tracks worth of sectors before it. Hence, max_sector */
242
243 /* Save it! */
244 ext_table[cur_disk][table_pointer].rel_sec = ((unsigned long)(max_sector[cur_disk]));
245
246 /* Setup the system id byte */
247 /* Set to 06h - format will fix later on */
248 temp = uc(DOSNEW); /* AC000 */ /* AN000 */
249
250 /* We got the sys id, now put it in */
251 ext_table[cur_disk][table_pointer].sys_id = temp;
252
253 /* Set the changed flag */
254 ext_table[cur_disk][table_pointer].changed = TRUE;
255
256 /* Set the mbytes used */
257 ext_table[cur_disk][table_pointer].mbytes_used =
258 cylinders_to_mbytes(size,cur_disk); /* AN004 */
259
260 /* find the number of the extended partiton to figure out percent */
261 ext_part_num = find_partition_location(uc(EXTENDED)); /* AN000 */
262
263 /* Set the percent used */
264 ext_table[cur_disk][table_pointer].percent_used =
265 cylinders_to_percent(((ext_table[cur_disk][table_pointer].end_cyl-ext_table[cur_disk][table_pointer].start_cyl)+1),
266 ((part_table[cur_disk][ext_part_num].end_cyl-part_table[cur_disk][ext_part_num].start_cyl)+1)); /* AN000 */
267
268 /* set the system to unknown and volume label to blanks */
269 strcpy(ext_table[cur_disk][table_pointer].system,NOFORMAT); /* AN000 */
270 strcpy(ext_table[cur_disk][table_pointer].vol_label,NOVOLUME); /* AN000 */
271
272 END
273 else
274
275 BEGIN
276 /* This should not have happened */
277 internal_program_error();
278 END
279
280 return(table_pointer);
281END
282
diff --git a/v4.0/src/CMD/FDISK/MESSAGES.C b/v4.0/src/CMD/FDISK/MESSAGES.C
new file mode 100644
index 0000000..a375145
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/MESSAGES.C
@@ -0,0 +1,162 @@
1
2#include "dos.h" /* AN000 */
3#include "msgret.h" /* AN000 */
4#include "fdisk.h" /* AN000 */
5#include "extern.h" /* AN000 */
6#include "subtype.h" /* AN000 */
7#include "stdio.h" /* AN000 */
8
9/* */
10/******************************************************************************/
11/*Routine name: PRELOAD_MESSAGES */
12/******************************************************************************/
13/* */
14/*Description: Preloads messages for Display_Msg and returns error code */
15/* if incorrect DOS version, insuffient memory, or unable to */
16/* to find messages. */
17/* */
18/*Called Procedures: sysloadmsg */
19/* display_msg */
20/* */
21/*Change History: Created 5/30/87 DRM */
22/* */
23/*Input: None */
24/* */
25/*Output: None */
26/* */
27/******************************************************************************/
28
29
30char preload_messages() /* AN000 */
31
32BEGIN /* AN000 */
33
34char message_flag; /* AN000 */
35
36 /* load all messages for FDISK */
37 message_flag = c(TRUE); /* AN000 */
38 sysloadmsg(&regs,&regs); /* AN000 load the messages */
39
40 if ((regs.x.cflag & CARRY_FLAG) == CARRY_FLAG) /* AN000 If msg load problem */
41 BEGIN
42 sysdispmsg(&regs,&regs); /* AN000 write the error message */
43 message_flag = FALSE; /* AN000 */
44 END
45 return(message_flag); /* AN000 */
46
47END /* AN000 */
48
49/* */
50/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
51/* */
52/* Subroutine Name: display_msg */
53/* */
54/* Subroutine Function: */
55/* Display the requested message to the standard output device */
56/* */
57/* Input: */
58/* (1) Number of the message to be displayed (see FDISK.SKL) */
59/* (2) Number of substitution parameters (%1,%2) */
60/* (3) Offset of sublist control block */
61/* (4) Message Class, 0=no input, 1=input via INT 21 AH=1 */
62/* */
63/* Output: */
64/* The message is written to the standard output device. If input */
65/* was requested, the character code of the key pressed is returned */
66/* in regs.x.ax. */
67/* */
68/* Normal exit: Message written to handle */
69/* */
70/* Error exit: None */
71/* */
72/* Internal References: */
73/* None */
74/* */
75/* External References: */
76/* Sysdispmsg (module _msgret.sal) */
77/* */
78/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
79
80void display_msg(msgnum,msghan,msgparms,msgsub,msginput,msgclass) /*;AN000 AC014; */
81int msgnum; /*;AN000; message number */
82int msghan; /*;AN000; output device */
83int msgparms; /*;AN000; number of substitution parms*/
84int *msgsub; /*;AN000; offset of sublist */
85char msginput; /*;AN000; 0=no input, else input func */
86char msgclass; /*;AN014; 0=no input, else input func */
87
88BEGIN
89 regs.x.ax = u(msgnum); /*;AN000; set registers */
90 regs.x.bx = u(msghan); /*;AN000; */
91 regs.x.cx = u(msgparms); /*;AN000; */
92 regs.h.dh = uc(msgclass); /*;AN014; */
93 regs.h.dl = uc(msginput); /*;AN000; */
94 regs.x.si = u(msgsub); /*;AN000; */
95 sysdispmsg(&regs,&regs); /*;AN000; write the messages */
96
97 return; /*;AN000; */
98END
99
100/* */
101/******************************************************************************/
102/*Routine name: GET_YES_NO_VALUES */
103/******************************************************************************/
104/* */
105/*Description: Uses SYSGETMSG to get the translated values for Y and N */
106/* for display purposes. */
107/* */
108/*Called Procedures: sysgetmsg */
109/* sysdispmsg */
110/* */
111/*Change History: Created 5/11/88 DRM */
112/* */
113/*Input: None */
114/* */
115/*Output: None */
116/* */
117/******************************************************************************/
118
119
120char get_yes_no_values() /* AN012 */
121
122BEGIN /* AN012 */
123
124char message_flag; /* AN012 */
125char far *msg_buff; /* AN012 */
126
127 message_flag = c(TRUE); /* AN012 */
128
129 /* do sysgetmsg for 'Y' */
130 regs.x.ax = YesMsg; /* AN012 */
131 regs.h.dh = uc(utility_msg_class); /* AN012 */
132 sysgetmsg(&regs,&segregs,&regs); /* AN012 */
133
134 FP_OFF(msg_buff) = regs.x.si; /* AN012 */
135 FP_SEG(msg_buff) = segregs.ds; /* AN012 */
136
137 Yes = *msg_buff; /* AN012 */
138
139 if ((regs.x.cflag & CARRY_FLAG) != CARRY_FLAG) /* AN012 If msg load problem */
140 BEGIN /* AN012 */
141 /* do sysgetmsg for 'N' */
142 regs.x.ax = NoMsg; /* AN012 */
143 regs.h.dh = uc(utility_msg_class); /* AN012 */
144 sysgetmsg(&regs,&segregs,&regs); /* AN012 */
145
146 FP_OFF(msg_buff) = regs.x.si; /* AN012 */
147 FP_SEG(msg_buff) = segregs.ds; /* AN012 */
148
149 No = *msg_buff; /* AN012 */
150
151 END /* AN012 */
152
153 if ((regs.x.cflag & CARRY_FLAG) == CARRY_FLAG) /* AN012 If msg load problem */
154 BEGIN /* AN012 */
155 sysdispmsg(&regs,&regs); /* AN012 write the error message */
156 message_flag = FALSE; /* AN012 */
157 END /* AN012 */
158
159 return(message_flag); /* AN012 */
160
161END /* AN012 */
162
diff --git a/v4.0/src/CMD/FDISK/MSGRET.H b/v4.0/src/CMD/FDISK/MSGRET.H
new file mode 100644
index 0000000..dd95b37
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/MSGRET.H
@@ -0,0 +1,55 @@
1/*  */
2/*----------------------------------------------------------------------+
3| |
4| This file contains the structures and defines that are needed to use |
5| the message retriever C program. |
6| |
7| |
8| Date: 6-27-87 |
9| |
10+----------------------------------------------------------------------*/
11
12#define NORMAL_PRELOAD 0 /* AN000 */
13#define ALL_UTILITY_MESSAGES -1 /* AN000 */
14#define Utility_Msg_Class -1 /* AN014 */
15#define Ext_Err_Class 1 /* AN014 */
16
17#define DosStdEr 2 /*;AN000; standard error */
18
19#define nosubptr 0 /*;AN000; no sublist pointer */
20#define nosubcnt 0 /*;AN000; 0 substitution count */
21#define oneparm 1 /*;AN000; 1 substitution count */
22#define twoparm 2 /*;AN000; 2 substitution count */
23#define noinput 0 /*;AN000; no user input */
24
25
26#define utility_msg_class 0xff /*;AN000; Utility message type */
27
28
29/* Sublist Flag Values */
30
31/* Alignment Indicator */
32#define sf_left 0x00 /*;AN000; left align */
33#define sf_right 0x80 /*;AN000; right align */
34
35/* Field Type */
36#define sf_char 0x00 /*;AN000; character */
37#define sf_unsbin2d 0x01 /*;AN000; unsigned binary to decimal */
38#define sf_sbin 0x02 /*;AN000; signed binary to decimal */
39#define sf_unsbin2h 0x03 /*;AN000; unsigned binary to hex */
40#define sf_date 0x04 /*;AN000; date */
41#define sf_time12 0x05 /*;AN000; time 12-hour */
42#define sf_time24 0x06 /*;AN000; time 24-hour */
43
44
45/* Data Variable Size */
46
47#define sf_ch 0x00 /*;AN000; single character */
48#define sf_asciiz 0x10 /*;AN000; asciiz string */
49#define sf_word 0x20 /*;AN000; word */
50#define sf_dword 0x30 /*;AN000; double word */
51#define sf_word 0x20 /*;AN000; word */
52
53#define YesMsg 0x09 /* AN012 */
54#define NoMsg 0x0A /* AN012 */
55
diff --git a/v4.0/src/CMD/FDISK/PARSE.H b/v4.0/src/CMD/FDISK/PARSE.H
new file mode 100644
index 0000000..8d878e6
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/PARSE.H
@@ -0,0 +1,188 @@
1
2/* */
3/*----------------------------------------------------------------------+
4| |
5| This file contains the structures and defines that are needed to use |
6| the parser from a C program. |
7| |
8| |
9| Date: 6-15-87 |
10| |
11+----------------------------------------------------------------------*/
12
13
14#define p_len_parms 4 /* AN000 - length of p_parms */
15#define p_i_use_default 0 /* AN000 - no extra stuff specified */
16#define p_i_have_delim 1 /* AN000 - extra delimiter specified */
17#define p_i_have_eol 2 /* AN000 - extra EOL specified */
18#define PRI "/PRI" /* AN000 */
19#define EXT "/EXT" /* AN000 */
20#define LOG "/LOG" /* AN000 */
21#define QUIET "/Q" /* AN000 */
22
23struct p_parms /* AN000 */
24 BEGIN /* AN000 */
25 unsigned p_parmsx_ptr; /* AN000 - address of p_parmsx */
26 unsigned char p_num_extra; /* AN000 - number of extra stuff */
27 unsigned char p_len_extra_delim; /* AN000 - length of extra delimiter */
28 char p_extra_delim; /* AN000 - extra delimiters */
29 END; /* AN000 */
30
31struct p_parmsx /* AN000 */
32 BEGIN /* AN000 */
33 unsigned char p_minp; /* AN000 - Minimum positional number */
34 unsigned char p_maxp; /* AN000 - Maximum positional number */
35 unsigned p_con1_ptr; /* AN000 - Address of the 1st CONTROL block */
36 unsigned char p_maxs; /* AN000 - Maximum number of switches */
37 unsigned p_swi1_ptr; /* AN000 - Address of the 1st CONTROL block */
38 unsigned p_swi2_ptr; /* AN000 - Address of the 2nd CONTROL block */
39 unsigned char p_maxk; /* AN000 - Any keyworks?? */
40 END; /* AN000 */
41
42
43struct p_control_blk /* AN000 */
44 BEGIN /* AN000 */
45 unsigned p_match_flag; /* AN000 - Controls type matched */
46 unsigned p_function_flag; /* AN000 - Function should be taken */
47 unsigned p_buff1_ptr; /* AN000 - Result buffer address */
48 unsigned p_val1_ptr; /* AN000 - Value list address */
49 unsigned char p_nid; /* AN000 - # of keyword/SW synonyms */
50 END; /* AN000 */
51
52struct p_switch_blk /* AN000 */
53 BEGIN /* AN000 */
54 unsigned sp_match_flag; /* AN000 - Controls type matched */
55 unsigned sp_function_flag; /* AN000 - Function should be taken */
56 unsigned sp_buff1_ptr; /* AN000 - Result buffer address */
57 unsigned sp_val1_ptr; /* AN000 - Value list address */
58 unsigned char sp_nid; /* AN000 - # of keyword/SW synonyms */
59 unsigned char sp_switch1[5]; /* AN000 - keyword or sw */
60 unsigned char sp_switch2[5]; /* AN000 - keyword or sw */
61 unsigned char sp_switch3[5]; /* AN000 - keyword or sw */
62 END; /* AN000 */
63
64struct p_switch1_blk /* AN000 */
65 BEGIN /* AN000 */
66 unsigned sp_match_flag; /* AN000 - Controls type matched */
67 unsigned sp_function_flag; /* AN000 - Function should be taken */
68 unsigned sp_buff1_ptr; /* AN000 - Result buffer address */
69 unsigned sp_val1_ptr; /* AN000 - Value list address */
70 unsigned char sp_nid; /* AN000 - # of keyword/SW synonyms */
71 unsigned char sp_switch4[3]; /* AN000 - keyword or sw */
72 END; /* AN000 */
73
74struct p_result_buff /* AN000 */
75 BEGIN /* AN000 */
76 unsigned char p_type; /* AN000 - type returned */
77 unsigned char p_item_tag; /* AN000 - Matched item tag */
78 unsigned p_synonym; /* AN000 - Synonym list */
79 unsigned long p_value; /* AN000 - result value */
80 END; /* AN000 */
81
82struct p_value_list /* AN000 */
83 BEGIN /* AN000 */
84 unsigned char p_values; /* AN000 - number of values */
85 unsigned char p_range; /* AN000 - number of ranges */
86 unsigned char p_range_one; /* AN000 - range one */
87 unsigned long p_low_range; /* AN000 - low value of range */
88 unsigned long p_high_range; /* AN000 - high value of range */
89 END; /* AN000 */
90
91/* Match_Flags */
92
93#define p_num_val 0x8000 /* AN000 - Numeric Value */
94#define p_snum_val 0x4000 /* AN000 - Signed numeric value */
95#define p_simple_s 0x2000 /* AN000 - Simple string */
96#define p_date_s 0x1000 /* AN000 - Date string */
97#define p_time_s 0x0800 /* AN000 - Time string */
98#define p_cmpx_s 0x0400 /* AN000 - Complex string */
99#define p_file_spc 0x0200 /* AN000 - File Spec */
100#define p_drv_only 0x0100 /* AN000 - Drive Only */
101#define p_qu_string 0x0080 /* AN000 - Quoted string */
102#define p_ig_colon 0x0010 /* AN000 - Ignore colon at end in match */
103#define p_repeat 0x0002 /* AN000 - Repeat allowed */
104#define p_optional 0x0001 /* AN000 - Optional */
105
106/*----------------------------------------------------------------------+
107| |
108| Function flags |
109| |
110+----------------------------------------------------------------------*/
111
112#define p_cap_file 0x0001 /* AN000 - CAP result by file table */
113#define p_cap_char 0x0002 /* AN000 - CAP result by character table */
114#define p_rm_colon 0x0010 /* AN000 - Remove ":" at the end */
115#define STDERR 0x0002 /* AN010 */
116#define Parse_err_class 0x0002 /* AN010 */
117#define Sublist_Length 0x000b /* AN010 */
118#define Reserved 0x0000 /* AN010 */
119#define Char_Field_ASCIIZ 0x0010 /* AN010 */
120#define Left_Align 0x0000 /* AN010 */
121#define Blank 0x0020 /* AN010 */
122#define SubCnt1 0x0001 /* AN010 */
123#define No_Input 0x0000 /* AN010 */
124
125
126
127#define p_nval_none 0 /* AN000 - no value list ID */
128#define p_nval_range 1 /* AN000 - range list ID */
129#define p_nval_value 2 /* AN000 - value list ID */
130#define p_nval_string 3 /* AN000 - string list ID */
131#define p_len_range 9 /* AN000 - Length of a range choice(two DD plus one DB) */
132#define p_len_value 5 /* AN000 - Length of a value choice(one DD plus one DB) */
133#define p_len_string 3 /* AN000 - Length of a string choice(one DW plus one DB) */
134
135
136/*----------------------------------------------------------------------+
137| |
138| type |
139| |
140+----------------------------------------------------------------------*/
141
142#define p_eol 0 /* AN000 - End of line */
143#define p_number 1 /* AN000 - Number */
144#define p_list_idx 2 /* AN000 - List Index */
145#define p_string 3 /* AN000 - String */
146#define p_complex 4 /* AN000 - Complex */
147#define p_file_spec 5 /* AN000 - File Spec */
148#define p_drive 6 /* AN000 - Drive */
149#define p_date_f 7 /* AN000 - Date */
150#define p_time_f 8 /* AN000 - Time */
151#define p_quoted_string 9 /* AN000 - Quoted String */
152
153#define p_no_tag 0x0FF /* AN000 - No ITEM_TAG found */
154
155/*----------------------------------------------------------------------+
156| |
157| following return code will be returned in the AX register. |
158| |
159+----------------------------------------------------------------------*/
160
161#define p_no_error 0 /* AN000 - No error */
162#define p_too_many 1 /* AN000 - Too many operands */
163#define p_op_missing 2 /* AN000 - Required operand missing */
164#define p_not_in_sw 3 /* AN000 - Not in switch list provided */
165#define p_not_in_key 4 /* AN000 - Not in keyword list provided */
166#define p_out_of_range 6 /* AN000 - Out of range specified */
167#define p_not_in_val 7 /* AN000 - Not in value list provided */
168#define p_not_in_str 8 /* AN000 - Not in string list provided */
169#define p_syntax 9 /* AN000 - Syntax error */
170#define p_rc_eol 0x0ffff /* AN000 - End of command line */
171
172
173/*----------------------------------------------------------------------+
174| |
175| following are the structure intializations |
176| |
177+----------------------------------------------------------------------*/
178
179struct p_parms p_p; /* AN000 */
180struct p_parmsx p_px; /* AN000 */
181struct p_control_blk p_con; /* AN000 */
182struct p_switch_blk p_swi1; /* AN000 */
183struct p_switch1_blk p_swi2; /* AN000 */
184struct p_result_buff p_buff; /* AN000 */
185struct p_value_list p_val; /* AN000 */
186struct p_result_buff sp_buff; /* AN000 */
187struct p_value_list sp_val; /* AN000 */
188
diff --git a/v4.0/src/CMD/FDISK/PARTINFO.C b/v4.0/src/CMD/FDISK/PARTINFO.C
new file mode 100644
index 0000000..040ee5a
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/PARTINFO.C
@@ -0,0 +1,262 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "subtype.h" /* AN000 */
5#include "extern.h" /* AN000 */
6
7/* */
8char find_free_partition()
9
10BEGIN
11 char i;
12
13 /* Look at all four partition entries for empty partition */
14 for (i = c(0); i < c(4);i++) /* AC000 */
15 BEGIN
16
17 /* if we find an empty one, return which one */
18 if (part_table[cur_disk][i].num_sec == ul(0)) /* AC000 */
19 BEGIN
20 return(i);
21 break;
22 END
23 END
24 /* Did not find one, return NOT_FOUND */
25 return(c(NOT_FOUND)); /* AC000 */
26END
27
28/* */
29char find_partition_type(type)
30
31unsigned char type;
32
33BEGIN
34 char i;
35
36/* Look at all four partition entries for system id byte that matches */
37 for (i = c(0); i < c(4);i++) /* AC000 */
38 BEGIN
39
40 /* if we find a match, do a TRUE return */
41 if (part_table[cur_disk][i].sys_id == type)
42 BEGIN
43 return(TRUE);
44 break;
45 END
46 END
47 /* Did not find one, return FALSE */
48 return(FALSE);
49END
50
51
52
53/* */
54XFLOAT get_partition_size(type) /* AC000 */
55
56unsigned char type; /* AC000 */
57
58BEGIN
59 char i;
60
61 /* Look at all four partition entries for system id byte that matches */
62 for (i = c(0); i < c(4);i++) /* AC000 */
63 BEGIN
64
65 /* if we find a match, get the size */
66 if (part_table[cur_disk][i].sys_id == type)
67 BEGIN
68 /* Get the size of the partition from the array */
69 return(part_table[cur_disk][i].mbytes_used); /* AC000 */
70 END
71 END
72 /* Did not find one, something bad wrong happened */
73 internal_program_error();
74END
75
76/* */
77char find_active_partition()
78
79BEGIN
80
81unsigned char i;
82
83 /* See if there is an active partition */
84 for (i = uc(0); i < uc(4);i++) /* AC000 */
85 BEGIN
86
87 /* if we find an active one, TRUE return */
88 if (part_table[cur_disk][i].boot_ind == uc(ACTIVE)) /* AC000 */
89 BEGIN
90 return(TRUE);
91 break;
92 END
93 END
94 /* Did not find one, return FALSE */
95 return(FALSE);
96END
97
98
99/* */
100char find_partition_location(type)
101
102unsigned char type;
103
104BEGIN
105 char i;
106
107/* Look at all four partition entries for system id byte that matches */
108 for (i = c(0); i < c(4);i++) /* AC000 */
109 BEGIN
110
111 /* if we find a match, do a TRUE return */
112 if (part_table[cur_disk][i].sys_id == type)
113 BEGIN
114 return(i);
115 break;
116 END
117 END
118 /* Did not find one, return */
119 return(c(NOT_FOUND)); /* AC000 */
120END
121
122/* */
123char find_free_ext()
124
125BEGIN
126
127 char i;
128
129 /* Look at all 23 extended entries for empty partition */
130 for (i = c(0); i < c(23);i++) /* AC000 */
131 BEGIN
132
133 /* if we find an empty one, return which one */
134 if (ext_table[cur_disk][i].sys_id == uc(0)) /* AC000 */
135 BEGIN
136 return(i);
137 break;
138 END
139 END
140 return(c(NOT_FOUND)); /* AC000 */
141END
142
143/* */
144char find_logical_drive()
145
146BEGIN
147
148unsigned char i;
149
150 /* See if there is a logical drive defined in Extended Partition */
151 for (i = uc(0); i < uc(23);i++) /* AC000 */
152 BEGIN
153
154 /* See if we find a sys id that is not 0 */
155 if (ext_table[cur_disk][i].sys_id != uc(0)) /* AC000 */
156 BEGIN
157 return(TRUE);
158 break;
159 END
160 END
161 return(FALSE);
162END
163
164/* */
165char get_num_logical_dos_drives()
166BEGIN
167
168char i;
169char number;
170
171 number = c(0); /* AC000 */
172 /* See if there is a logical drive defined in Extended Partition */
173 for (i = c(0); i < c(23);i++) /* AC000 */
174 BEGIN
175
176 /* See if we find a sys id that is DOS */
177 if ((ext_table[cur_disk][i].sys_id == uc(DOS12)) || (ext_table[cur_disk][i].sys_id == uc(DOS16)) ||
178 (ext_table[cur_disk][i].sys_id == uc(DOSNEW))) /* AC000 */
179 BEGIN
180 number++;
181 END
182 END
183 return(number);
184END
185
186/* */
187char find_ext_drive(offset)
188
189char offset;
190
191BEGIN
192
193char number_found;
194char i;
195
196 number_found = c(0); /* AC000 */
197
198 /* Go look for the nth extended drive */
199 for (i=c(0); i < c(23); i++) /* AC000 */
200 BEGIN
201
202 /* See if there is a drive we know about */
203 if ((ext_table[cur_disk][i].sys_id == uc(DOS12)) || (ext_table[cur_disk][i].sys_id == uc(DOS16)) ||
204 (ext_table[cur_disk][i].sys_id == uc(DOSNEW))) /* AC000 */
205 BEGIN
206 /* Is this the one we were looking for ? */
207 if (number_found == offset)
208 BEGIN
209 /* Yes it is, return where we found it */
210 return(i);
211 break;
212 END
213 /* Show we found one and go look for the next */
214 number_found++;
215 END
216 END
217 /* We should never get here */
218 internal_program_error();
219 return(c(INVALID)); /* AC000 */
220END
221
222
223/* */
224char find_previous_drive(offset)
225
226char offset;
227
228BEGIN
229
230char number_found;
231char last_found;
232char i;
233
234 number_found = c(0); /* AC000 */
235 last_found = c(0); /* AC000 */
236
237 /* Go look for the nth extended drive */
238 for (i=c(0); i < c(23); i++) /* AC000 */
239 BEGIN
240
241 /* See if there is a drive */
242 if (ext_table[cur_disk][i].sys_id != uc(0)) /* AC000 */
243 BEGIN
244 /* Is this the one we were looking for ? */
245 if (number_found == offset)
246 BEGIN
247 /* Yes it is, return where we found the previous one */
248 return(last_found);
249 END
250 /* This is the latest one we found, but not the limit, so save it */
251 last_found = i;
252
253 /* Show we found one and go look for the next */
254 number_found++;
255 END
256 END
257 /* We should never get here */
258 internal_program_error();
259 return(c(INVALID)); /* AC000 */
260END
261
262 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/PRINT.H b/v4.0/src/CMD/FDISK/PRINT.H
new file mode 100644
index 0000000..42824aa
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/PRINT.H
@@ -0,0 +1,15 @@
1
2 clear_screen(0,0,24,39);
3 printf("boot_ind=%d\n", part_table[temp][cur_disk].boot_ind);
4 printf("start head=%d\n", part_table[temp][cur_disk].start_head);
5 printf("start sec=%d\n", part_table[temp][cur_disk].start_sector);
6 printf("start cyl=%d\n", part_table[temp][cur_disk].start_cyl);
7 printf("sys id=%d\n", part_table[temp][cur_disk].sys_id);
8 printf("end head=%d\n", part_table[temp][cur_disk].end_head);
9 printf("end sec=%d\n", part_table[temp][cur_disk].end_sector);
10 printf("end cyl=%d\n", part_table[temp][cur_disk].end_cyl);
11 printf("rel sec=%d\n", part_table[temp][cur_disk].rel_sec);
12 printf("num sec=%d\n", part_table[temp][cur_disk].num_sec);
13
14 wait_for_esc();
15 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/PROFILE.C b/v4.0/src/CMD/FDISK/PROFILE.C
new file mode 100644
index 0000000..5bee0a5
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/PROFILE.C
@@ -0,0 +1,802 @@
1
2#include <doscall.h>
3#include <profile.h>
4#include <fdiskc.msg>
5#include <subtype.h>
6#include <ctype.h>
7
8
9void main()
10
11BEGIN
12
13unsigned i;
14
15 /* Main Menu */
16 clear_screen(0,0,24,79);
17 display(menu_1);
18 display(menu_2);
19 display(menu_3);
20 display(menu_4);
21 insert[0] = 'C';
22 display(menu_5);
23 display(menu_6);
24 display(menu_7);
25
26 wait_for_ESC();
27
28
29 /* Type of DOS partition for create */
30 clear_screen(0,0,24,39);
31 display(menu_3);
32 insert[0] = 'C';
33 display(menu_5);
34 display(menu_7);
35 display(menu_8);
36 display(menu_9);
37 display(menu_10);
38 display(menu_11);
39 wait_for_ESC();
40
41 /* Shortcut screen C:*/
42 clear_screen(0,0,24,39);
43 display(menu_12);
44 insert[0] = 'C';
45 display(menu_5);
46 display(menu_11);
47 display(menu_12);
48 display(menu_13);
49 wait_for_ESC();
50
51 /* Shortcut screen D:*/
52 clear_screen(0,0,24,39);
53 display(menu_12);
54 insert[0] = 'C';
55 display(menu_5);
56 display(menu_11);
57 display(menu_12);
58 display(menu_41);
59 wait_for_ESC();
60
61
62/* Create primary DOS partition screen */
63 display(menu_12);
64 insert[0] = 'C';
65 display(menu_5);
66 for (i=0;i < 92;i++)
67 BEGIN
68 insert[i] = 'x';
69 END
70 display(menu_14);
71 insert[0] = 'x';
72 insert[1] = 'x';
73 insert[2] = 'x';
74 insert[3] = 'x';
75 display(menu_15);
76 insert[0] = 'x';
77 insert[1] = 'x';
78 insert[2] = 'x';
79 insert[3] = 'x';
80 display(menu_16);
81 insert[0] = 'x';
82 insert[1] = 'x';
83 insert[2] = 'x';
84 insert[3] = 'x';
85 display(menu_39);
86 display(menu_11);
87 wait_for_ESC();
88
89/* Create Extended Partition */
90 clear_screen(0,0,24,39);
91 display(menu_17);
92 insert[0] = 'C';
93 display(menu_5);
94 for (i=0;i < 92;i++)
95 BEGIN
96 insert[i] = 'x';
97 END
98 display(menu_14);
99 insert[0] = 'x';
100 insert[1] = 'x';
101 insert[2] = 'x';
102 insert[3] = 'x';
103 display(menu_15);
104 insert[0] = 'x';
105 insert[1] = 'x';
106 insert[2] = 'x';
107 insert[3] = 'x';
108 display(menu_16);
109 display(menu_39);
110 display(menu_11);
111 wait_for_ESC();
112
113
114/* Create logical drive screen */
115 clear_screen(0,0,24,39);
116 display(menu_18);
117 for (i=0;i < 168;i++)
118 BEGIN
119 insert[i]= 'x';
120 END
121 display(menu_19);
122 for (i=0;i < 168;i++)
123 BEGIN
124 insert[i]= 'x';
125 END
126 display(menu_20);
127 insert[0] = 'x';
128 insert[1] = 'x';
129 insert[2] = 'x';
130 insert[3] = 'x';
131 display(menu_21);
132 insert[0] = 'x';
133 insert[1] = 'x';
134 insert[2] = 'x';
135 insert[3] = 'x';
136 display(menu_22);
137 insert[0] = 'x';
138 insert[1] = 'x';
139 insert[2] = 'x';
140 insert[3] = 'x';
141 display(menu_40);
142 display(menu_11);
143 wait_for_ESC();
144
145
146/* Change active partition screen */
147 clear_screen(0,0,24,39);
148 display(menu_23);
149 insert[0] = 'C';
150 display(menu_5);
151 for (i=0;i < 92;i++)
152 BEGIN
153 insert[i] = 'x';
154 END
155 display(menu_14);
156 insert[0] = 'x';
157 insert[1] = 'x';
158 insert[2] = 'x';
159 insert[3] = 'x';
160 display(menu_15);
161 display(menu_24);
162 display(menu_11);
163 wait_for_ESC();
164
165
166/* Delete Partition Screen */
167 clear_screen(0,0,24,39);
168 display(menu_25);
169 insert[0] = 'C';
170 display(menu_5);
171 display(menu_3);
172 display(menu_26);
173 display(menu_27);
174 display(menu_7);
175 display(menu_11);
176 wait_for_ESC();
177
178/* Delete Primary Screen */
179 clear_screen(0,0,24,39);
180 display(menu_28);
181 insert[0] = 'C';
182 display(menu_5);
183 for (i=0;i < 92;i++)
184 BEGIN
185 insert[i] = 'x';
186 END
187 display(menu_14);
188 insert[0] = 'x';
189 insert[1] = 'x';
190 insert[2] = 'x';
191 insert[3] = 'x';
192 display(menu_15);
193 display(menu_29);
194 display(menu_11);
195 wait_for_ESC();
196
197
198/* Delete Extended Screen */
199 clear_screen(0,0,24,39);
200 display(menu_30);
201 insert[0] = 'C';
202 display(menu_5);
203 for (i=0;i<92;i++)
204 BEGIN
205 insert[i] = 'x';
206 END
207 display(menu_14);
208 insert[0] = 'x';
209 insert[1] = 'x';
210 insert[2] = 'x';
211 insert[3] = 'x';
212 display(menu_15);
213 display(menu_31);
214 display(menu_11);
215 wait_for_ESC();
216
217
218/* Delete Logical Drives */
219 clear_screen(0,0,24,39);
220 display(menu_32);
221 display(menu_18);
222 for (i=0;i<168;i++)
223 BEGIN
224 insert[i]='x';
225 END
226 display(menu_19);
227 insert[0] = 'x';
228 insert[1] = 'x';
229 insert[2] = 'x';
230 insert[3] = 'x';
231 display(menu_21);
232 display(menu_33);
233 display(menu_11);
234 wait_for_ESC();
235
236/* Display Partition Information */
237 clear_screen(0,0,24,39);
238 display(menu_35);
239 insert[0] = 'C';
240 display(menu_5);
241 for (i=0;i<92;i++)
242 BEGIN
243 insert[i] = 'x';
244 END
245 display(menu_14);
246 insert[0] = 'x';
247 insert[1] = 'x';
248 insert[2] = 'x';
249 insert[3] = 'x';
250 display(menu_15);
251 display(menu_36);
252 display(menu_11);
253 wait_for_ESC();
254
255/* Display Logical Drive Info */
256 clear_screen(0,0,24,39);
257 display(menu_37);
258 for (i=0;i<168;i++)
259 BEGIN
260 insert[i]='x';
261 END
262 display(menu_19);
263 for (i=0;i<168;i++)
264 BEGIN
265 insert[i]='x';
266 END
267 display(menu_20);
268 display(menu_11);
269 wait_for_ESC();
270
271/* Reboot Screen */
272 clear_screen(0,0,24,39);
273 display(menu_38);
274 wait_for_ESC();
275
276 clear_screen(0,0,24,39);
277 display(status_1);
278 wait_for_ESC();
279
280 clear_screen(0,0,24,39);
281 display(status_2);
282 wait_for_ESC();
283
284 clear_screen(0,0,24,39);
285 display(status_3);
286 wait_for_ESC();
287
288 clear_screen(0,0,24,39);
289 insert[0] = 'x';
290 display(status_4);
291 wait_for_ESC();
292
293 clear_screen(0,0,24,39);
294 display(status_5);
295 wait_for_ESC();
296
297 clear_screen(0,0,24,39);
298 display(status_6);
299 wait_for_ESC();
300
301 clear_screen(0,0,24,39);
302 display(status_7);
303 wait_for_ESC();
304
305 clear_screen(0,0,24,39);
306 display(status_8);
307 wait_for_ESC();
308
309 clear_screen(0,0,24,39);
310 display(status_9);
311 wait_for_ESC();
312
313 clear_screen(0,0,24,39);
314 display(status_10);
315 wait_for_ESC();
316
317 clear_screen(0,0,24,39);
318 display(error_1);
319 wait_for_ESC();
320
321 clear_screen(0,0,24,39);
322 display(error_2);
323 wait_for_ESC();
324
325 clear_screen(0,0,24,39);
326 display(error_3);
327 wait_for_ESC();
328
329 clear_screen(0,0,24,39);
330 display(error_4);
331 wait_for_ESC();
332
333 clear_screen(0,0,24,39);
334 display(error_5);
335 wait_for_ESC();
336
337 clear_screen(0,0,24,39);
338 display(error_6);
339 wait_for_ESC();
340
341 clear_screen(0,0,24,39);
342 display(error_7);
343 wait_for_ESC();
344
345 clear_screen(0,0,24,39);
346 display(error_8);
347 wait_for_ESC();
348
349 clear_screen(0,0,24,39);
350 display(error_9);
351 wait_for_ESC();
352
353 clear_screen(0,0,24,39);
354 display(error_10);
355 wait_for_ESC();
356
357 clear_screen(0,0,24,39);
358 display(error_12);
359 wait_for_ESC();
360
361 clear_screen(0,0,24,39);
362 display(error_13);
363 wait_for_ESC();
364
365 clear_screen(0,0,24,39);
366 display(error_14);
367 wait_for_ESC();
368
369 clear_screen(0,0,24,39);
370 display(error_15);
371 wait_for_ESC();
372
373 clear_screen(0,0,24,39);
374 display(error_16);
375 wait_for_ESC();
376
377 clear_screen(0,0,24,39);
378 display(error_17);
379 wait_for_ESC();
380
381 clear_screen(0,0,24,39);
382 display(error_19);
383 wait_for_ESC();
384
385 clear_screen(0,0,24,39);
386 display(error_20);
387 wait_for_ESC();
388
389 clear_screen(0,0,24,39);
390 display(error_21);
391 wait_for_ESC();
392
393 clear_screen(0,0,24,39);
394 display(error_22);
395 wait_for_ESC();
396
397 clear_screen(0,0,24,39);
398 insert[0]='x';
399 insert[1]='y';
400 insert[2]='-';
401 insert[3]='z';
402 display(error_23);
403 wait_for_ESC();
404
405 clear_screen(0,0,24,39);
406 display(error_24);
407 wait_for_ESC();
408
409 clear_screen(0,0,24,39);
410 display(error_25);
411 wait_for_ESC();
412
413 clear_screen(0,0,24,39);
414 display(error_26);
415 wait_for_ESC();
416
417 clear_screen(0,0,24,39);
418 display(error_27);
419 wait_for_ESC();
420
421 clear_screen(0,0,24,39);
422 display(error_28);
423 wait_for_ESC();
424
425 clear_screen(0,0,24,39);
426 insert[0]='X';
427 insert[1]=':';
428 display(error_29);
429 wait_for_ESC();
430
431 clear_screen(0,0,24,39);
432 insert[0]='X';
433 display(error_30);
434 wait_for_ESC();
435
436 clear_screen(0,0,24,39);
437 insert[0]='x';
438 insert[1]='-';
439 insert[2]='y';
440 display(error_31);
441 wait_for_ESC();
442
443 clear_screen(0,0,24,39);
444 display(error_32);
445 wait_for_ESC();
446
447 clear_screen(0,0,24,39);
448 DOSEXIT(0,0);
449
450END
451
452
453/******************* START OF SPECIFICATIONS *******************/
454/* */
455/* SUBROUTINE NAME: DISPLAY */
456/* */
457/* DESCRIPTIVE NAME: Display full screen interface messages */
458/* */
459/* FUNCTION: Displays messages and handles control characters */
460/* */
461/* NOTES: */
462/* FDISK MESSAGES */
463/* Portions of the screen that are handled in the msg are */
464/* indicated on the listing of the screen with the message */
465/* name given. If the text message is defined in another */
466/* screen, then the name is followed by a "#" character */
467/* */
468/* NOTE TO TRANSLATORS The characters inside the <> and the [] */
469/* are control characters and should not be translated. The */
470/* Control characters are defined as follows: */
471/* */
472/* <H> - Highlight the following text */
473/* <R> - Regular text */
474/* <B> - Blink the following text */
475/* <O> - Turn blinking off */
476/* <Y> - Print YES character, as set by define */
477/* <N> - Print NO character, as set by define */
478/* <W> - Sound the beep */
479/* <S> - Save cursor position for later use */
480/* <I> - Insert character from insert[] string. This string */
481/* must be set up prior to displaying the message. The */
482/* first <I> will insert Insert[0], the second */
483/* insert[1], etc....This will move the cursor one */
484/* postition. The insert[] string will be initialized */
485/* */
486/* Multiple control characters can be between the <>. */
487/* */
488/* The %####%indicates Row and column for the text and has the */
489/* format of [rrcc] where the numbers are decimal and zero */
490/* based (first row/col is 00. The numbers are in decimal, */
491/* and must be 2 characters, which means rows/cols 0-9 should */
492/* be listed as 00-09. For example, the 5th row, 3rd column */
493/* on the screen would be listed as %0402%. */
494/* */
495/* The column number is always the column desired. The row */
496/* number is an offset from the previous row. For example, if */
497/* the text just printed is on row 6, and the next text should */
498/* be printed 2 rows down in column 0, then the control strin */
499/* would be %0201%. The first row specified in the message is */
500/* assumed to be based off of row 0, it would actually specify */
501/* the actual row for the start of the msg to be printed. */
502/* */
503/* ENTRY POINTS: display(*message_name); */
504/* LINKAGE: Near call */
505/* */
506/* INPUT: char *message_name */
507/* */
508/* EXIT-NORMAL: */
509/* */
510/* EXIT-ERROR: */
511/* */
512/* EFFECTS: */
513/* input_row changed if <S> control character in message */
514/* input_col changed if <S> control character in message */
515/* */
516/* INTERNAL REFERENCES: */
517/* ROUTINES: */
518/* */
519/* EXTERNAL REFERENCES: */
520/* ROUTINES: */
521/* */
522/* viowrtcharstratt(); */
523/******************** END OF SPECIFICATIONS ********************/
524void display(s)
525
526char far *s;
527
528BEGIN
529 unsigned row;
530 unsigned col;
531 char attribute;
532 char far *attribute_ptr = &attribute;
533 unsigned insert_count;
534
535
536 /* Initialize row and col, and index into array */
537 row = 0;
538 col = 0;
539 insert_count = 0;
540 /* check for a request to display a null string */
541 if (*s == '\0')
542 BEGIN
543 /* Message string error */
544 insert[0] = '1';
545 display(debug_msg);
546 END
547 else
548 BEGIN
549 /* There is data there, lets go handle it */
550
551 attribute = 0x00;
552 /* Go until end of string */
553 while (*s != '\0')
554 BEGIN
555
556 /* Check for any imbedded control strings */
557 switch (*s)
558 BEGIN
559 /* Check for control characters */
560 case '<':
561 BEGIN
562 s++;
563 while ( (*s != '>') && (*s != '\0') )
564 BEGIN
565 switch (*s++)
566 BEGIN
567 case 'H': attribute = (attribute & 0x80) | 0x0F;
568 break;
569
570
571 case 'R': attribute = (attribute & 0x80) | 0x07;
572 break;
573
574 case 'B': attribute |= 0x80;
575 break;
576
577 case 'O': attribute &= 0x7F;
578 break;
579
580 case 'W': DOSBEEP(900,400);
581 break;
582
583 case 'I':
584 BEGIN
585 /* display next element in the array */
586 if (attribute == 0x00)
587 attribute = 0x07;
588 VIOWRTCHARSTRATT(pinsert+insert_count++,1,row,col++,attribute_ptr,0);
589 break;
590 END
591
592
593 case 'Y':
594 BEGIN
595 /* display YES character in next location */
596 *--s = YES;
597 if (attribute == 0x00)
598 attribute = 0x07;
599 VIOWRTCHARSTRATT(s++,1,row,col++,attribute_ptr,0);
600 break;
601 END
602
603 case 'N':
604 BEGIN
605 /* display NO character in next location */
606 *--s = NO;
607 if (attribute == 0x00)
608 attribute = 0x07;
609 VIOWRTCHARSTRATT(s++,1,row,col++,attribute_ptr,0);
610 break;
611 END
612
613
614 case 'S':
615 BEGIN
616 input_row = row;
617 input_col = col;
618 break;
619 END
620
621 case 'C':
622 BEGIN
623 /* Clear from current position to end of line */
624 clear_screen(row,col,row,39);
625 break;
626 END
627
628 case '\0':
629 BEGIN
630 /* Message string error - string ended in the middle of control string*/
631 insert[0] = '7';
632 display(debug_msg);
633 break;
634 END
635
636 default:
637 BEGIN
638 /* Message string error - no valid control char found */
639 insert[0] = '6';
640 display(debug_msg);
641 break;
642 END
643 END /* Switch */
644 END /* While */
645 /* Get the pointer past the '>' */
646 s++;
647 break;
648 END /* control characters */
649
650 /* Check for row,col */
651 case '%':
652 BEGIN
653 s++;
654 /* determine the row to put the message on */
655 if ( !isdigit(*s) )
656 BEGIN
657 /* Message string error */
658 insert[0] = '2';
659 display(debug_msg);
660 END
661 else
662 BEGIN
663 row = row+((unsigned)(((*s++ - '0')*10)));
664 if ( !isdigit(*s) )
665 BEGIN
666 /* Message string error */
667 insert[0] = '2';
668 display(debug_msg);
669 END
670 else
671 BEGIN
672 row = row+((unsigned)(*s++ - '0'));
673 /* determine the col to put the message on */
674 if ( !isdigit(*s) )
675 BEGIN
676 /* Message string error */
677 insert[0] = '3';
678 display(debug_msg);
679 END
680 else
681 BEGIN
682 col = ((unsigned)(*s++ - '0'));
683 if ( !isdigit(*s) )
684 BEGIN
685 /* Message string error */
686 insert[0] = '3';
687 display(debug_msg);
688 END
689 else
690 BEGIN
691 col = ((unsigned)((col* 10) + (*s++ - '0')));
692 if (*s++ != '%')
693 BEGIN
694 /* Message string error */
695 insert[0] = '4';
696 display(debug_msg);
697 END /* 2nd sq bracket */
698 END /* 2nd digit col */
699 END /* 1st digit col */
700 END /* 2nd digit row */
701 END /* 1st digit row */
702 break;
703 END
704 /* Handle anything else */
705
706
707 default:
708 BEGIN
709 /* See if attribute set to anything */
710 if (attribute == 0x00)
711 attribute = 0x07;
712 VIOWRTCHARSTRATT(s++,1,row,col++,attribute_ptr,0);
713 break;
714 END
715 END
716 END /* End of string check */
717 END /* No characters in string check */
718 return;
719
720END
721
722void number_in_msg(number,start)
723
724unsigned number;
725unsigned start;
726
727BEGIN
728
729unsigned i;
730
731 /* init the four spots to zero's */
732 for (i = 0; i < 4;i++)
733 BEGIN
734 insert[start+i] = ' ';
735 END
736 /* Divide the space down and get it into decimal */
737 if (number > 999)
738 BEGIN
739 insert[start] = ((char)(number/1000))+'0';
740 insert[start+1] = '0';
741 insert[start+2] = '0';
742 insert[start+3] = '0';
743 number = number%1000;
744 END
745 if (number > 99)
746 BEGIN
747 insert[start+1] = ((char)(number/100))+'0';
748 insert[start+2] = '0';
749 insert[start+3] = '0';
750 number = number%100;
751 END
752 if (number > 9)
753 BEGIN
754 insert[start+2] = ((char)(number/10))+'0';
755 insert[start+3] = '0';
756 number = number%10;
757 END
758 insert[start+3] = ((char)(number +'0'));
759 return;
760END
761
762
763
764void clear_screen(TopRow,LeftCol,BotRow,RightCol)
765
766unsigned TopRow;
767unsigned LeftCol;
768unsigned BotRow;
769unsigned RightCol;
770
771BEGIN
772
773char attribute;
774char *attribute_ptr = &attribute;
775
776 attribute = 0x07;
777 VIOSCROLLUP(TopRow,LeftCol,BotRow,RightCol,0,attribute_ptr,0);
778 return;
779END
780
781
782
783char wait_for_ESC()
784
785BEGIN
786 char input;
787
788 while (input != ESC)
789 BEGIN
790 /* position the cursor at the end of the ESC prompt */
791 VIOSETCURPOS(24,39,0);
792
793 /* Get input */
794 KBDFLUSHBUFFER(0);
795 /*KBDCHARIN(input_data,0,0);*/
796 /*input = input_data->char_code;*/
797 input = ((char)(getch()));
798 END
799 return(ESC);
800END
801
802 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/PROFILE.H b/v4.0/src/CMD/FDISK/PROFILE.H
new file mode 100644
index 0000000..a15b72b
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/PROFILE.H
@@ -0,0 +1,44 @@
1
2/* */
3/****************************************************************************/
4/* Define statements */
5/****************************************************************************/
6/* */
7
8#define BEGIN {
9#define END }
10#define ESC 0x1B
11#define NUL 0x00
12#define NOT_FOUND 0xFF
13#define DELETED 0xFF
14#define INVALID 0xFF
15#define FALSE (1==0)
16#define TRUE !FALSE
17#define CR 0x0D
18
19/* */
20/****************************************************************************/
21/* Declare Global variables */
22/****************************************************************************/
23/* */
24
25
26
27
28unsigned input_row;
29unsigned input_col;
30char insert[200];
31char *pinsert = insert;
32
33
34/* */
35/****************************************************************************/
36/* Subroutine Definitions */
37/****************************************************************************/
38/* */
39
40void clear_screen(unsigned,unsigned,unsigned,unsigned);
41void display(char far *);
42char wait_for_ESC(void);
43
44 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/REBOOT.ASM b/v4.0/src/CMD/FDISK/REBOOT.ASM
new file mode 100644
index 0000000..272e607
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/REBOOT.ASM
@@ -0,0 +1,43 @@
1
2 title Reboot Support for FDISK
3
4IF1
5 %OUT ASSEMBLING: Reboot
6 %OUT
7ENDIF
8
9ROMDATA segment at 040h
10 org 072h
11BootType dw ?
12ROMDATA ends
13
14ROMBIOS segment at 0ffffh
15 org 0
16POR label far
17ROMBIOS ends
18
19_text segment byte public 'code'
20 assume cs:_TEXT
21 assume ds:nothing
22 assume es:nothing
23 assume ss:nothing
24
25 public _reboot
26_reboot proc near
27
28 mov ax,ROMDATA
29 mov ds,ax
30 assume ds:ROMDATA
31
32 mov BootType,1234h
33
34 cli
35 cld
36 jmp POR
37
38_reboot endp
39
40_text ends
41
42 end
43 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/SPACE.C b/v4.0/src/CMD/FDISK/SPACE.C
new file mode 100644
index 0000000..21d10b5
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/SPACE.C
@@ -0,0 +1,439 @@
1
2#include "dos.h"
3#include "fdisk.h"
4#include "extern.h"
5#include "subtype.h"
6
7/* */
8char find_part_free_space(type)
9
10char type;
11
12BEGIN
13
14
15char i;
16char partition_count;
17char last_found_partition;
18unsigned temp;
19char freespace_count;
20char any_partition;
21unsigned temp_size;
22
23 /* Sort the partition table */
24 sort_part_table(c(4)); /* AC000 */
25
26
27 /* Intialize free space to zero */
28 for (i = c(0); i < c(5); i++) /* AC000 */
29 BEGIN
30 free_space[i].space = u(0); /* AC000 */
31 free_space[i].start = u(0); /* AC000 */
32 free_space[i].end = u(0); /* AC000 */
33 free_space[i].mbytes_unused = f(0); /* AC000 */ /* AN000 */
34 free_space[i].percent_unused = u(0); /* AC000 */ /* AN000 */
35 END
36
37 /* Find space between start of disk and first partition */
38 partition_count = c(0); /* AC000 */
39
40 any_partition = FALSE;
41 for (i = c(0); i < c(4); i++) /* AC000 */
42 BEGIN
43 if (part_table[cur_disk][sort[i]].sys_id != uc(0)) /* AC000 */
44 BEGIN
45 /* Found a partition, get the space */
46
47 free_space[0].start = u(0); /* AC000 */
48
49 /* This is a special case - the extended partition can not start */
50 /* on cylinder 0 due too its archetecture. Protect against that here */
51 if (type == c(EXTENDED)) /* AC000 */
52 BEGIN
53 free_space[0].start = u(1); /* AC000 */
54 END
55
56 /* free space ends before start of next valid partition */
57 if (part_table[cur_disk][sort[i]].start_cyl > u(0)) /* AC000 */
58 BEGIN
59 free_space[0].end = part_table[cur_disk][sort[i]].start_cyl-1;
60 END
61
62 free_space[0].space = part_table[cur_disk][sort[i]].start_cyl;
63 free_space[0].mbytes_unused =
64 cylinders_to_mbytes(free_space[0].space,cur_disk); /* AN004 */
65 free_space[0].percent_unused = (unsigned)cylinders_to_percent(free_space[0].space,total_disk[cur_disk]); /* AN000 */
66
67 partition_count = i;
68 last_found_partition = sort[i];
69 any_partition = TRUE;
70 break;
71 END
72 END
73 /* See if any partitions were there */
74 if (any_partition)
75 BEGIN
76 /* Look for space between the rest of the partitions */
77 freespace_count = c(1); /* AC000 */
78 for (i = partition_count+1; i < c(4); i++) /* AC000 */
79 BEGIN
80 if (part_table[cur_disk][sort[i]].sys_id != uc(0)) /* AC000 */
81 BEGIN
82
83 /* Check to see if more than one partition on a cylinder (i.e. XENIX bad block) */
84 /* If so, leave the space at zero */
85
86 if (part_table[cur_disk][sort[i]].start_cyl != part_table[cur_disk][last_found_partition].end_cyl)
87
88 BEGIN
89 /* No, things are normal */
90 /* Get space between the end of the last one and the start of the next one */
91 free_space[freespace_count].space = part_table[cur_disk][sort[i]].start_cyl
92 - (part_table[cur_disk][last_found_partition].end_cyl+1);
93
94 temp_size = (part_table[cur_disk][sort[i]].start_cyl -
95 part_table[cur_disk][last_found_partition].end_cyl);
96
97 if (temp_size != u(0) ) /* AC000 */
98 BEGIN
99 free_space[freespace_count].space = temp_size - u(1); /* AC000 */
100 END
101 END
102
103 free_space[freespace_count].start = part_table[cur_disk][last_found_partition].end_cyl+1;
104 free_space[freespace_count].end = part_table[cur_disk][sort[i]].start_cyl -1;
105 free_space[freespace_count].mbytes_unused =
106 cylinders_to_mbytes(free_space[freespace_count].space,cur_disk); /* AN004 */
107 free_space[freespace_count].percent_unused = (unsigned)
108 cylinders_to_percent(free_space[freespace_count].space,total_disk[cur_disk]); /* AN000 */
109
110
111
112 /* update the last found partition */
113 last_found_partition = sort[i];
114 freespace_count++;
115 END
116 END
117 /* Find the space between the last partition and the end of the disk */
118 free_space[freespace_count].space = (total_disk[cur_disk]
119 - part_table[cur_disk][last_found_partition].end_cyl)-1;
120 free_space[freespace_count].start = part_table[cur_disk][last_found_partition].end_cyl+1;
121 free_space[freespace_count].end = total_disk[cur_disk]-1;
122 free_space[freespace_count].mbytes_unused =
123 cylinders_to_mbytes(free_space[freespace_count].space,cur_disk); /* AN004 */
124 free_space[freespace_count].percent_unused =
125 cylinders_to_percent(free_space[freespace_count].space,total_disk[cur_disk]); /* AN000 */
126 END
127 else
128 BEGIN
129 /* No partitions found, show entire space as free */
130 free_space[0].start = u(0); /* AC000 */
131
132 /* This is a special case - the extended partition can not start */
133 /* on cylinder 0 due too its architecture. Protect against that here */
134 if (type == c(EXTENDED)) /* AC000 */
135 BEGIN
136 free_space[0].start = u(1); /* AC000 */
137 END
138 free_space[0].end = total_disk[cur_disk]-1;
139 free_space[0].space = (free_space[0].end - free_space[0].start)+1;
140 free_space[0].mbytes_unused =
141 cylinders_to_mbytes(free_space[0].space,cur_disk); /* AN004 */
142 free_space[0].percent_unused =
143 cylinders_to_percent(free_space[0].space,total_disk[cur_disk]); /* AN000 */
144 END
145
146
147
148 /* Find largest free space, and verify the golden tracks while we are at it */
149 do
150 BEGIN
151 temp = u(0); /* AC000 */
152
153 /* Zip thru the table */
154 for (i = c(0); i < c(5); i++) /* AC000 */
155 BEGIN
156 /* Is this one bigger ? */
157 if (free_space[i].space > temp)
158 BEGIN
159 temp = free_space[i].space;
160 last_found_partition = i;
161
162 END
163 END
164
165 /* If there is any free space, go verify it */
166 temp = u(0);
167 if (free_space[last_found_partition].space != u(0)) /* AC000 */
168 BEGIN
169
170 /* Go verify the tracks */
171 temp = verify_tracks(last_found_partition,c(PRIMARY)); /* AC000 */
172 END
173 /* Move up to next golden track */
174 free_space[last_found_partition].start = free_space[last_found_partition].start+temp;
175 free_space[last_found_partition].space = free_space[last_found_partition].space-temp;
176 free_space[last_found_partition].mbytes_unused =
177 cylinders_to_mbytes(free_space[last_found_partition].space,cur_disk); /* AN004 */
178 free_space[last_found_partition].percent_unused = (unsigned)
179 cylinders_to_percent(free_space[last_found_partition].space,total_disk[cur_disk]); /* AN000 */
180 END
181
182 /* Repeat the loop if the start was moved due to bad tracks */
183 /* Unless we're past the end of the free space */
184 while ((temp != u(0)) && (free_space[last_found_partition].space != u(0))); /* AC000 */
185
186 /* Return with the pointer to the largest free space */
187 return(last_found_partition);
188END
189
190
191
192/* */
193void sort_part_table(size)
194
195char size;
196
197BEGIN
198
199char changed;
200char temp;
201char i;
202
203 /* Init the sorting parameters */
204
205 for (i=c(0); i < size; i++) /* AC000 */
206 BEGIN
207 sort[i] = i;
208 END
209
210 /* Do a bubble sort */
211 changed = TRUE;
212
213 /* Sort until we don't do a swap */
214 while (changed)
215
216 BEGIN
217 changed = FALSE;
218 for (i=c(1); i < size; i++) /* AC000 */
219 BEGIN
220
221 /* Does the partition entry start before the previous one, or */
222 /* is it empty (0 ENTRY). If empty, it automatically gets shoved */
223 /* to the front, if the previous entry isn't also empty */
224
225 if ((part_table[cur_disk][sort[i]].end_cyl < part_table[cur_disk][sort[i-1]].end_cyl)
226 || ((part_table[cur_disk][sort[i]].num_sec == ul(0))
227 && (part_table[cur_disk][sort[i-1]].num_sec != ul(0)))) /* AC000 */
228
229 BEGIN
230 /* Swap the order indicators */
231 temp = sort[i-1];
232 sort[i-1] = sort[i];
233 sort[i] = temp;
234
235 /* printf("\nI-1 =%d\n",part_table[cur_disk][sort[i-1]].start_cyl);*/
236 /* printf("I =%d\n",part_table[cur_disk][sort[i]].start_cyl);*/
237 /* printf("Sort[i-1] = %d\n",sort[i-1]);*/
238 /* printf("Sort[i] = %d\n",sort[i]); */
239 /* wait_for_ESC(); */
240
241
242 /* indicate we did a swap */
243 changed = TRUE;
244 END
245 END
246 END
247 return;
248END
249
250
251
252
253/* */
254char find_ext_free_space()
255
256
257BEGIN
258
259
260char i;
261char partition_count;
262char last_found_partition;
263unsigned temp;
264char freespace_count;
265char any_partition;
266char ext_location;
267
268 /* Sort the partition table */
269 sort_ext_table(c(23)); /* AC000 */
270
271
272 /* Initialize free space to zero */
273 for (i = c(0); i < c(24); i++) /* AC000 */
274 BEGIN
275 free_space[i].space = u(0); /* AC000 */
276 free_space[i].start = u(0);
277 free_space[i].end = u(0); /* AC000 */
278 free_space[i].mbytes_unused = f(0); /* AN000 */
279 free_space[i].percent_unused = u(0); /* AN000 */
280 END
281
282 /* Find space between start of Extended partition and first volume */
283 ext_location = find_partition_location(uc(EXTENDED)); /* AC000 */
284
285 partition_count = c(0); /* AC000 */
286
287 any_partition = FALSE;
288 for (i = c(0); i < c(23); i++) /* AC000 */
289 BEGIN
290 if (ext_table[cur_disk][sort[i]].sys_id != uc(0)) /* AC000 */
291 BEGIN
292 /* Found a partition, get the space */
293 free_space[0].space = ext_table[cur_disk][sort[i]].start_cyl - part_table[cur_disk][ext_location].start_cyl;
294 free_space[0].start = part_table[cur_disk][ext_location].start_cyl;
295 free_space[0].end = ext_table[cur_disk][sort[i]].start_cyl-1;
296 free_space[0].mbytes_unused =
297 cylinders_to_mbytes(free_space[0].space,cur_disk); /* AN004 */
298 free_space[0].percent_unused = (unsigned)cylinders_to_percent(free_space[0].space,total_disk[cur_disk]); /* AN000 */
299
300 partition_count = i;
301 last_found_partition = sort[i];
302 any_partition = TRUE;
303 break;
304 END
305 END
306 /* See if any partitions were there */
307 if (any_partition)
308 BEGIN
309 /* Look for space between the rest of the partitions */
310 freespace_count = c(1); /* AC000 */
311 for (i = partition_count+1; i < c(23); i++) /* AC000 */
312 BEGIN
313 if (ext_table[cur_disk][sort[i]].sys_id != uc(0)) /* AC000 */
314 BEGIN
315
316 /* Get space between the end of the last one and the start of the next one */
317 temp = ext_table[cur_disk][sort[i]].start_cyl - (ext_table[cur_disk][last_found_partition].end_cyl+1);
318 free_space[freespace_count].space = temp;
319 free_space[freespace_count].start = ext_table[cur_disk][last_found_partition].end_cyl+1;
320 free_space[freespace_count].end = ext_table[cur_disk][sort[i]].start_cyl -1;
321 free_space[freespace_count].mbytes_unused =
322 cylinders_to_mbytes(free_space[freespace_count].space,cur_disk); /* AN004 */
323 free_space[freespace_count].percent_unused = (unsigned)
324 cylinders_to_percent(free_space[freespace_count].space,total_disk[cur_disk]); /* AN000 */
325
326
327 /* update the last found partition */
328 last_found_partition = sort[i];
329 freespace_count++;
330 END
331 END
332 /* Find the space between the last partition and the end of the extended partition */
333 temp = part_table[cur_disk][ext_location].end_cyl - ext_table[cur_disk][last_found_partition].end_cyl;
334 free_space[freespace_count].space = temp;
335 free_space[freespace_count].start = ext_table[cur_disk][last_found_partition].end_cyl+1;
336 free_space[freespace_count].end = part_table[cur_disk][ext_location].end_cyl;
337 free_space[freespace_count].mbytes_unused =
338 cylinders_to_mbytes(free_space[freespace_count].space,cur_disk); /* AN004 */
339 free_space[freespace_count].percent_unused = (unsigned)
340 cylinders_to_percent(free_space[freespace_count].space,total_disk[cur_disk]); /* AN000 */
341
342 END
343 else
344 BEGIN
345 /* No partitions found, show entire space as free */
346 free_space[0].space = (part_table[cur_disk][ext_location].end_cyl - part_table[cur_disk][ext_location].start_cyl) + 1;
347 free_space[0].start = part_table[cur_disk][ext_location].start_cyl;
348 free_space[0].end = part_table[cur_disk][ext_location].end_cyl;
349 free_space[0].mbytes_unused =
350 cylinders_to_mbytes(free_space[0].space,cur_disk); /* AN004 */
351 free_space[0].percent_unused = (unsigned)cylinders_to_percent(free_space[0].space,total_disk[cur_disk]); /* AN000 */
352 END
353
354 /* Find largest free space */
355 temp = u(0); /* AC000 */
356
357
358 /* Find largest free space, and verify the golden tracks while we are at it */
359 do
360 BEGIN
361 temp = u(0); /* AC000 */
362
363 /* Zip thru the table */
364 for (i = c(0); i < c(24); i++) /* AC000 */
365 BEGIN
366 /* Is this one bigger ? */
367 if (free_space[i].space > temp)
368 BEGIN
369 temp = free_space[i].space;
370 last_found_partition = i;
371 END
372 END
373 /* If there is any free space, go verify it */
374 temp = u(0);
375 if (free_space[last_found_partition].space != u(0)) /* AC000 */
376 BEGIN
377
378 /* Go verify the tracks */
379 temp = verify_tracks(last_found_partition,c(EXTENDED)); /* AC000 */
380 END
381 /* Move up to next golden track */
382 free_space[last_found_partition].start = free_space[last_found_partition].start+temp;
383 free_space[last_found_partition].space = free_space[last_found_partition].space-temp;
384 free_space[last_found_partition].mbytes_unused =
385 cylinders_to_mbytes(free_space[last_found_partition].space,cur_disk); /* AN004 */
386 free_space[last_found_partition].percent_unused =
387 cylinders_to_percent(free_space[last_found_partition].space,total_disk[cur_disk]); /* AN000 */
388 END
389 /* Repeat the loop if the start was moved due to bad tracks */
390 /* Unless we're past the end of the free space */
391 while ((temp !=u(0)) && (free_space[last_found_partition].space!= u(0))); /* AC000 */
392
393 /* Return with the pointer to the largest free space */
394 return(last_found_partition);
395END
396
397
398/* */
399void sort_ext_table(size)
400
401char size;
402
403BEGIN
404
405char changed;
406char temp;
407char i;
408
409 /* Init the sorting parameters */
410
411 for (i=c(0); i < size; i++) /* AC000 */
412 BEGIN
413 sort[i] = i;
414 END
415
416 /* Do a bubble sort */
417 changed = TRUE;
418
419 /* Sort until we don't do a swap */
420 while (changed)
421
422 BEGIN
423 changed = FALSE;
424 for (i=c(1); i < size; i++) /* AC000 */
425 BEGIN
426
427 if (ext_table[cur_disk][sort[i]].start_cyl < ext_table[cur_disk][sort[i-1]].start_cyl)
428 BEGIN
429
430 temp = sort[i-1];
431 sort[i-1] = sort[i];
432 sort[i] = temp;
433 /* indicate we did a swap */
434 changed = TRUE;
435 END
436 END
437 END
438 return;
439END
diff --git a/v4.0/src/CMD/FDISK/SUBTYPE.H b/v4.0/src/CMD/FDISK/SUBTYPE.H
new file mode 100644
index 0000000..60de3f6
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/SUBTYPE.H
@@ -0,0 +1,158 @@
1/*************************************************************/
2/* DISPLAY.C ROUTINES */
3/*************************************************************/
4void display(char far *);
5void number_in_msg(XFLOAT,unsigned);
6void percent_in_msg(unsigned,unsigned); /* AN000 */
7void string_in_msg(char far *,unsigned); /* AN000 */
8void volume_in_msg(char far *,unsigned); /* AN000 */
9
10/*************************************************************/
11/* VIDEO.C ROUTINES */
12/*************************************************************/
13void clear_screen(unsigned,unsigned,unsigned,unsigned);
14void init_video_information(void);
15void reset_video_information(void);
16void get_video_attribute(void); /* AN006 */
17
18
19/*************************************************************/
20/* DISKOUT.C ROUTINES */
21/*************************************************************/
22void write_info_to_disk(void);
23char write_master_boot_to_disk(unsigned char);
24char write_ext_boot_to_disk(char,unsigned char);
25
26
27/*************************************************************/
28/* PARTINFO.C ROUTINES */
29/*************************************************************/
30char find_free_partition(void);
31char find_partition_type(unsigned char);
32XFLOAT get_partition_size(unsigned char);
33char find_active_partition(void);
34char find_partition_location(unsigned char);
35char find_free_ext(void);
36char find_logical_drive(void);
37char get_num_logical_dos_drives(void);
38char find_ext_drive(char);
39char find_previous_drive(char);
40
41/*************************************************************/
42/* MAKEPART.C ROUTINES */
43/*************************************************************/
44void make_partition(unsigned,char,unsigned char,char);
45char make_volume(unsigned,char);
46
47/*************************************************************/
48/* INPUT.C ROUTINES */
49/*************************************************************/
50char get_num_input(char,char,unsigned,unsigned);
51char get_yn_input(char,unsigned,unsigned);
52char wait_for_ESC(void);
53unsigned get_large_num_input(unsigned,unsigned,unsigned,char far *,unsigned,char far *);
54char get_alpha_input(char,char,unsigned,unsigned,char,char);
55char get_char_input(void);
56void get_string_input(unsigned,unsigned,char far *);
57
58
59/*************************************************************/
60/* SPACE.C ROUTINES */
61/*************************************************************/
62char find_part_free_space(char);
63void sort_part_table(char);
64char find_ext_free_space(void);
65void sort_ext_table(char);
66
67
68/*************************************************************/
69/* INT13.C ROUTINES */
70/*************************************************************/
71char get_disk_info(void);
72char read_boot_record(unsigned,unsigned char,unsigned char,unsigned char); /* AC000 */
73char write_boot_record(unsigned,unsigned char);
74unsigned verify_tracks(char,char);
75char get_drive_parameters(unsigned char);
76void DiskIo(union REGS *,union REGS *, struct SREGS *);
77
78/*************************************************************/
79/* VDISPLAY.C ROUTINES */
80/*************************************************************/
81char volume_display(void);
82
83/*************************************************************/
84/* TDISPLAY.C ROUTINES */
85/*************************************************************/
86char table_display(void);
87char table_drive_letter(void);
88
89/*************************************************************/
90/* FDISK.C ROUTINES */
91/*************************************************************/
92void main(int,char * []);
93void load_logical_drive(char,unsigned char);
94void init_partition_tables(void);
95char check_valid_environment(void);
96void reboot_system(void);
97void display_volume_information(void);
98void display_partition_information(void);
99void volume_delete(void);
100void ext_delete(void);
101void delete_partition(void);
102void dos_delete(void);
103void change_active_partition(void);
104void volume_create(void);
105void ext_create_partition(void);
106void input_dos_create(void);
107void dos_create_partition(void);
108void create_partition(void);
109void do_main_menu(void);
110void internal_program_error(void);
111void reboot(void);
112
113/*************************************************************/
114/* CONVERT ROUTINES */
115/*************************************************************/
116void get_volume_string(char,char *); /* AN000 */
117unsigned mbytes_to_cylinders(XFLOAT,char); /* AN004 */
118XFLOAT percent_to_cylinders(unsigned,XFLOAT); /* AN000 */
119XFLOAT cylinders_to_mbytes(unsigned,char); /* AN004 */
120unsigned cylinders_to_percent(unsigned,unsigned); /* AN000 */
121char dos_upper(char); /* AN000 */
122char check_yn_input(char); /* AN000 */
123FLAG get_fs_and_vol(char); /* AN000 */
124FLAG check_format(char); /* AN002 */
125
126/*************************************************************/
127/* PARSE ROUTINES */
128/*************************************************************/
129char parse_command_line(int,char * []); /* AN000 */
130void parse_init(void); /* AN000 */
131void check_disk_validity(void); /* AN000 */
132void process_switch(void); /* AN000 */
133void parse(union REGS *, union REGS *); /* AN000 */
134void Parse_msg(int,int,unsigned char); /* AN010 */
135
136
137/*************************************************************/
138/* MESSAGES ROUTINES */
139/*************************************************************/
140char preload_messages(void); /* AN000 */
141void display_msg(int,int,int,int *,char,char); /* AN000 AC014 */
142void sysloadmsg(union REGS *, union REGS *); /* AN000 */
143void sysdispmsg(union REGS *, union REGS *); /* AN000 */
144void sysgetmsg(union REGS *, struct SREGS *, union REGS *); /* AN012 */
145char get_yes_no_values(void); /* AN012 */
146
147
148/*************************************************************/
149/* C ROUTINES */
150/*************************************************************/
151
152int getch(void);
153void putch(int);
154
155int int86x(int, union REGS *, union REGS *, struct SREGS *);
156int int86(int, union REGS *, union REGS *);
157int intdos(union REGS *, union REGS *);
158
diff --git a/v4.0/src/CMD/FDISK/TDISPLAY.C b/v4.0/src/CMD/FDISK/TDISPLAY.C
new file mode 100644
index 0000000..7cc5e97
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/TDISPLAY.C
@@ -0,0 +1,134 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "extern.h" /* AN000 */
5#include "subtype.h" /* AN000 */
6#include "fdiskmsg.h" /* AN000 */
7#include "stdio.h"
8#include "string.h"
9#include "memory.h"
10
11/* */
12char table_display()
13
14BEGIN
15
16
17unsigned i;
18unsigned x;
19unsigned io;
20char *ThisPartitionType;
21char ThisPartitionLetter[3];
22FLAG partition_found;
23char partition_num;
24
25 /* initialize all the inserts to blanks */
26 memset(insert,c(' '),4*21);
27 io = u(0);
28
29 /* Sort the partitions */
30 sort_part_table(c(4)); /* AC000 */
31
32 /* loop thru the partitions, only print stuff if it is there */
33 partition_found = FALSE;
34 partition_num = c(0); /* AC000 */
35
36 for (i=u(0); i < u(4); i++) /* AC000 */
37 BEGIN
38
39 if (part_table[cur_disk][sort[i]].sys_id != uc(0)) /* AC000 */
40 BEGIN
41
42 partition_found = TRUE;
43
44 strcpy(ThisPartitionLetter," ");
45 switch(part_table[cur_disk][sort[i]].sys_id)
46 BEGIN
47 case DOSNEW: /* AN000 */
48 case DOS16:
49 case DOS12:
50 ThisPartitionType = DOS_part;
51 part_table[cur_disk][sort[i]].drive_letter = table_drive_letter(); /* AN000 */
52 sprintf(ThisPartitionLetter,"%c%c",
53 part_table[cur_disk][sort[i]].drive_letter,
54 ( part_table[cur_disk][sort[i]].drive_letter == c(' ') ) ? ' ' : ':');
55 break;
56 case EXTENDED:
57 ThisPartitionType = EXTENDED_part;
58 break;
59 case BAD_BLOCK:
60 ThisPartitionType = BAD_BLOCK_part;
61 break;
62 case XENIX1:
63 ThisPartitionType = XENIX_part;
64 break;
65 case XENIX2:
66 ThisPartitionType = XENIX_part;
67 break;
68 case PCIX:
69 ThisPartitionType = PCIX_part;
70 break;
71 default:
72 ThisPartitionType = NON_DOS_part;
73 break;
74 END
75
76 io += sprintf(&insert[io],"%-2.2s%c%c%-7.7s%4.0d%3.0d%%",
77 ThisPartitionLetter,
78 partition_num+'1',
79 (part_table[cur_disk][sort[i]].boot_ind == uc(0x80)) ? 'A' : ' ',
80 ThisPartitionType,
81 part_table[cur_disk][sort[i]].mbytes_used,
82 part_table[cur_disk][sort[i]].percent_used);
83
84 partition_num++;
85
86 END
87
88 END
89
90 /* Do a clearscreen to erase previous data */
91 clear_screen(u(8),u(0),u(12),u(79)); /* AC000 */
92
93 if (partition_found) display(menu_14);
94 else display(status_8);
95
96 /* Return true if partitions exist, false otherwise */
97 if (partition_found) return(TRUE);
98
99 return(FALSE);
100
101END
102
103/* */
104char table_drive_letter()
105
106BEGIN
107char drive_letter;
108
109 /* Put in drive letter in display */
110 if (cur_disk == c(0)) /* AC000 */
111 BEGIN
112 /* There is a primary partition on 80h, so drive C: */
113 drive_letter = c('C'); /* AC000 */
114 END
115 else
116 BEGIN
117 /* We are on drive 81h, so assume D: */
118 drive_letter = c('D'); /* AC000 */
119
120 /* See if primary exists on 80h drive */
121 /* First, set cur_drive to 0 */
122 cur_disk = c(0); /* AC000 */
123
124 /* Check for primary on drive 80h */
125 if (!(find_partition_type(uc(DOS12)) || find_partition_type(uc(DOS16)) || find_partition_type(uc(DOSNEW)))) /* AC000 */
126 BEGIN
127 drive_letter = c('C'); /* AC000 */
128 END
129 /* restore cur_disk to normal */
130 cur_disk = c(1); /* AC000 */
131 END
132 return(drive_letter);
133END
134 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/TEST.H b/v4.0/src/CMD/FDISK/TEST.H
new file mode 100644
index 0000000..ef12d9e
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/TEST.H
@@ -0,0 +1,26 @@
1test()
2
3BEGIN
4
5int i;
6int x;
7
8 for (i=0;i<24;i++)
9 BEGIN
10 for (x=0;x <2; x++)
11 BEGIN
12 ext_part_entry[i][x].boot_ind = 0;
13 ext_part_entry[i][x].start_head = 0;
14 ext_part_entry[i][x].start_sector = 0;
15 ext_part_entry[i][x].start_cyl = 0;
16 ext_part_entry[i][x].sys_id = 0;
17 ext_part_entry[i][x].end_head = 0;
18 ext_part_entry[i][x].end_sector = 0;
19 ext_part_entry[i][x].end_cyl = 0;
20 ext_part_entry[i][x].rel_sec = 0;
21 ext_part_entry[i][x].num_sec = 0;
22 END
23 END
24 return;
25END
26 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/VDISPLAY.C b/v4.0/src/CMD/FDISK/VDISPLAY.C
new file mode 100644
index 0000000..41b6285
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/VDISPLAY.C
@@ -0,0 +1,180 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "extern.h" /* AN000 */
5#include "subtype.h" /* AN000 */
6#include "fdiskmsg.h" /* AN000 */
7#include "string.h"
8#include "stdio.h"
9#include "memory.h"
10
11/* */
12char volume_display()
13
14BEGIN
15
16unsigned i;
17unsigned x;
18char drive_found;
19char drive_letter;
20char drive_num;
21char temp;
22char first_display;
23char second_display;
24char third_display;
25char fourth_display;
26unsigned insert_offset;
27
28 first_display = FALSE;
29 second_display = FALSE;
30 third_display = FALSE;
31 fourth_display = FALSE;
32
33 /* See what the starting drive letter is */
34 drive_letter = c(SEA); /* AC000 */
35
36 /* See if primary on drive 1 */
37 temp = cur_disk;
38 cur_disk = c(0); /* AC000 */
39 if ( (find_partition_type(uc(DOS12))) ||
40 (find_partition_type(uc(DOS16))) ||
41 (find_partition_type(uc(DOSNEW)))) /* AC000 */
42 BEGIN
43 /* There is a Primary partition on drive 1, so increment for first logical drive */
44 drive_letter++;
45 END
46 cur_disk = temp;
47
48 /* See if there is a second drive */
49 if (number_of_drives == uc(2)) /* AC000 */
50 BEGIN
51
52 /* Go see if DOS partition on drive 2 */
53 temp = cur_disk;
54 cur_disk = c(1); /* AC000 */
55 if ( (find_partition_type(uc(DOS12))) ||
56 (find_partition_type(uc(DOS16))) ||
57 (find_partition_type(uc(DOSNEW)))) /*AC000*/
58 BEGIN
59
60 /* There is a Primary partition on drive 2, so increment for first logical drive */
61 drive_letter++;
62 END
63 /* Are we on drive 2? If so, we got to find all the drives on drive 1 */
64 if (temp == c(1)) /* AC000 */
65 BEGIN
66 /* Next, we need to see what is on drive 1 */
67 for (i=u(0); i < u(23); i++) /* AC000 */
68 BEGIN
69 /* See if there is a logical drive we understand in PC-DOS land */
70 if ( (ext_table[0][i].sys_id == uc(DOS12)) ||
71 (ext_table[0][i].sys_id == uc(DOS16)) ||
72 (ext_table[0][i].sys_id == uc(DOSNEW)) ) /* AC000 */
73 BEGIN
74 /* Found one, so kick up the first available drive letter */
75 drive_letter++;
76 END
77 END
78 END
79
80 /* Reset the cur_drive to where it was */
81 cur_disk = temp;
82 END
83
84
85
86
87 /* loop thru the partitions, only print stuff if it is there */
88
89 /* Get the drives in order by location on disk */
90 sort_ext_table(c(23)); /* AC000 */
91
92 /* initialize all the inserts to blanks */
93 memset(insert,c(' '),(24*29));
94
95 drive_num = c(0); /* AC000 */
96 drive_found = FALSE;
97 first_display = TRUE;
98 insert_offset = 0;
99
100 for (i=u(0); i < u(23); i++) /* AC000 */
101 BEGIN
102
103 /* See if entry exists */
104 if ( (ext_table[cur_disk][sort[i]].sys_id == uc(DOS12)) ||
105 (ext_table[cur_disk][sort[i]].sys_id == uc(DOS16)) ||
106 (ext_table[cur_disk][sort[i]].sys_id == uc(DOSNEW)) ) /* AC000 */
107 BEGIN
108
109 /* We found one, now get the info */
110 drive_found = TRUE;
111
112 /* Get the drive letter - make sure it is Z: or less*/
113 /* Put it in the message, and set it up for next time */
114 if (drive_letter > c('Z'))
115 ext_table[cur_disk][sort[i]].drive_letter = c(' ');
116 else ext_table[cur_disk][sort[i]].drive_letter = drive_letter;
117
118 insert_offset += sprintf(&insert[insert_offset],"%c%c%-11.11s%4.0d%-8.8s%3.0d%%",
119 ext_table[cur_disk][sort[i]].drive_letter,
120 ( ext_table[cur_disk][sort[i]].drive_letter == c(' ') ) ? ' ' : ':',
121 ext_table[cur_disk][sort[i]].vol_label,
122 ext_table[cur_disk][sort[i]].mbytes_used,
123 ext_table[cur_disk][sort[i]].system,
124 ext_table[cur_disk][sort[i]].percent_used );
125
126
127 drive_letter++;
128 drive_num++;
129
130 END
131 END
132
133 /* Display the column of drives */
134 if (drive_found)
135 BEGIN
136
137 clear_screen(u(2),u(0),u(15),u(79)); /* AC000 */
138
139 if ( drive_num > 0 )
140 BEGIN
141 pinsert = &insert[0];
142 display(menu_19);
143 END
144
145 if ( drive_num > 6 )
146 BEGIN
147 pinsert = &insert[6*29];
148 display(menu_43);
149 END
150
151 if ( drive_num > 12 )
152 BEGIN
153 pinsert = &insert[12*29];
154 display(menu_20);
155 END
156
157 if ( drive_num > 18 )
158 BEGIN
159 pinsert = &insert[18*29];
160 display(menu_44);
161 END
162 pinsert = &insert[0];
163 END
164 else
165 BEGIN
166 /* Didn't find any */
167 if (first_display)
168 BEGIN
169 /* Wipe out display and put up message */
170 clear_screen(u(2),u(0),u(15),u(79)); /* AC000 */
171 display(status_9);
172 END
173 END
174 /* Return the highest drive letter found */
175 drive_letter--;
176 return(drive_letter);
177
178END
179
180 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/VIDEO.C b/v4.0/src/CMD/FDISK/VIDEO.C
new file mode 100644
index 0000000..750a94a
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/VIDEO.C
@@ -0,0 +1,146 @@
1
2#include "dos.h" /* AN000 */
3#include "fdisk.h" /* AN000 */
4#include "extern.h" /* AN000 */
5#include "doscall.h" /* AN000 */
6#include "fdiskmsg.h" /* AN000 */
7#include "subtype.h"
8
9/* */
10
11void clear_screen(TopRow,LeftCol,BotRow,RightCol)
12
13unsigned TopRow;
14unsigned LeftCol;
15unsigned BotRow;
16unsigned RightCol;
17
18BEGIN
19
20char attribute;
21char *attribute_ptr = &attribute;
22
23 if (mono_flag == TRUE) /* AN006 */
24 attribute = GRAY_ON_BLACK; /* AN006 */
25 else /* AN006 */
26 attribute = WHITE_ON_BLUE; /* AC000 */
27 VIOSCROLLUP(TopRow,LeftCol,BotRow,RightCol,u(0),attribute_ptr,u(0)); /* AC000 */
28 return;
29END
30
31
32
33
34
35/* */
36/* */
37/****************************************************************************/
38/* Initializes the screen and stores the lower right hand corner */
39/* of the screen in the global variable LowerRightHandCorner. This */
40/* is which is used for screen clears. If the screen is in grahpics mode, */
41/* it is changed to BW 40x25. This procedure is only called once at program*/
42/* start. Also saves the current screen */
43/****************************************************************************/
44/* */
45
46
47void init_video_information()
48
49BEGIN
50 mono_flag = FALSE; /* AN006 */
51
52 /* Get the current video state */
53 regs.h.ah = uc(CURRENT_VIDEO_STATE); /* AC000 */
54 int86((int)VIDEO,&regs,&regs); /* AC000 */
55
56 /* Save the mode and display page */
57 video_mode = regs.h.al;
58 display_page = regs.h.bh;
59
60 get_video_attribute(); /* AN006 */
61
62 BEGIN
63 /* assume color mode */
64 regs.h.al = uc(Color80_25); /* AC000 */
65
66 /* See if we are in MONOCHROME mode */
67 if ((video_mode == uc(MONO80_25)) || (video_mode == uc(MONO80_25A))) /* AC000 AC006 */
68 BEGIN
69
70 /* Nope,set to BW80x25*/
71 regs.h.al = uc(BW80_25); /* AC000 */
72 mono_flag = TRUE; /* AN006 */
73 END
74
75 /* go set the new mode */
76 regs.h.ah = uc(SET_MODE); /* AC000 */
77 int86((int)VIDEO,&regs,&regs); /* AC000 */
78 END
79
80 /* Set the display page */
81 regs.h.ah = uc(SET_ACTIVE_DISPLAY_PAGE); /* AC000 */
82 regs.h.al = uc(0); /* AC000 */
83 int86((int)VIDEO,&regs,&regs); /* AC000 */
84
85 return;
86END
87
88/* */
89/* */
90/* Resets the video mode to the original value */
91/* */
92
93void reset_video_information()
94
95BEGIN
96
97char *attribute_ptr = &video_attribute; /* AN006 */
98
99 /* Clear display with colors that were present when FDISK was invoked */
100 VIOSCROLLUP(u(0),u(0),u(24),u(79),u(0),attribute_ptr,u(0)); /* AN006 */
101
102 /* Reset the video mode */
103 regs.h.ah = SET_MODE;
104 regs.h.al = video_mode;
105 int86((int)VIDEO,&regs,&regs); /* AC000 */
106
107 /* Set the page */
108 regs.h.ah = SET_PAGE;
109 regs.h.al = display_page;
110 int86((int)VIDEO,&regs,&regs); /* AC000 */
111 return;
112
113END
114
115/******************************************************************************/
116/*Routine name: GET_VIDEO_ATTRIBUTE */
117/******************************************************************************/
118/* */
119/*Description: This routine will invoke interrupt 10 function 08h to */
120/* get the current attributes at the cursor postition in order */
121/* to restore the correct colors when returning out of FDISK. */
122/* */
123/*Called Procedures: none */
124/* */
125/* */
126/*Change History: Created 3/11/88 DRM */
127/* */
128/*Input: None */
129/* */
130/*Output: None */
131/* */
132/******************************************************************************/
133
134void get_video_attribute() /* AN006 */
135
136BEGIN /* AN006 */
137
138 /* Get current attributes */
139 regs.h.ah = CURRENT_VIDEO_ATTRIBUTE; /* AN006 */
140 regs.h.bh = display_page; /* AN006 */
141 int86((int)VIDEO,&regs,&regs); /* AN006 */
142 video_attribute = regs.h.ah; /* AN006 */
143 return; /* AN006 */
144
145END /* AN006 */
146
diff --git a/v4.0/src/CMD/FDISK/_MSGRET.ASM b/v4.0/src/CMD/FDISK/_MSGRET.ASM
new file mode 100644
index 0000000..c19108f
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/_MSGRET.ASM
@@ -0,0 +1,263 @@
1page 60,132
2name _msgret
3title C to Message Retriever
4;-------------------------------------------------------------------
5;
6; MODULE: _msgret
7;
8; PURPOSE: Supplies an interface between C programs and
9; the DOS 3.3 message retriever
10;
11; CALLING FORMAT:
12; msgret(&inregs,&outregs);
13;
14; DATE: 5-21-87
15;
16;-------------------------------------------------------------------
17
18 INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AC010;
19
20 MSG_UTILNAME <FDISK> ;IDENTIFY THE COMPONENT ;AC010;
21
22;-------------------------------------------------------------------
23;-------------------------------------------------------------------
24
25
26_TEXT SEGMENT BYTE PUBLIC 'CODE' ;AC010;
27_TEXT ENDS ;AC010;
28_DATA SEGMENT WORD PUBLIC 'DATA' ;AC010;
29_DATA ENDS ;AC010;
30CONST SEGMENT WORD PUBLIC 'CONST' ;AC010;
31CONST ENDS ;AC010;
32_BSS SEGMENT WORD PUBLIC 'BSS' ;AC010;
33_BSS ENDS ;AC010;
34
35DGROUP GROUP CONST, _BSS, _DATA ;AC010;
36 ASSUME CS: DGROUP, DS: DGROUP, SS: DGROUP, ES: NOTHING ;AC010;
37
38 public data_sysloadmsg ;AC010;
39 public data_sysdispmsg ;AC010;
40 public data_sysgetmsg ;AC010;
41
42_DATA SEGMENT ;AC010;
43
44 MSG_SERVICES <MSGDATA> ;AC010;
45 MSG_SERVICES <LOADmsg,FARmsg> ;AC010;
46 MSG_SERVICES <DISPLAYmsg,GETmsg,CHARmsg,NUMmsg> ;AC010;
47 MSG_SERVICES <FDISK.CLA,FDISK.CLB,FDISK.CL1,FDISK.CL2,FDISK.CTL> ;AC010; ;AC010;
48
49
50data_sysloadmsg proc far
51
52 push bp ; save user's base pointer ;AC010;
53 mov bp,sp ; set bp to current sp ;AC010;
54 push di ; save some registers ;AC010;
55 push si ;AC010;
56
57; copy C inregs into proper registers
58
59 mov di,[bp+4+4] ; fix di (arg 0) ;AC010;
60
61;-------------------------------------------------------------------
62
63 mov ax,[di+0ah] ; load di ;AC010;
64 push ax ; the di value from inregs is now on stack ;AC010;
65
66 mov ax,[di+00] ; get inregs.x.ax ;AC010;
67 mov bx,[di+02] ; get inregs.x.bx ;AC010;
68 mov cx,[di+04] ; get inregs.x.cx ;AC010;
69 mov dx,[di+06] ; get inregs.x.dx ;AC010;
70 mov si,[di+08] ; get inregs.x.si ;AC010;
71 pop di ; get inregs.x.di from stack ;AC010;
72
73 push bp ; save base pointer ;AC010;
74
75;-------------------------------------------------------------------
76
77 call sysloadmsg ; call the message retriever ;AC010;
78
79;-------------------------------------------------------------------
80
81 pop bp ; restore base pointer ;AC010;
82 push di ; the di value from call is now on stack ;AC010;
83 mov di,[bp+6+4] ; fix di (arg 1) ;AC010;
84
85 mov [di+00],ax ; load outregs.x.ax ;AC010;
86 mov [di+02],bx ; load outregs.x.bx ;AC010;
87 mov [di+04],cx ; load outregs.x.cx ;AC010;
88 mov [di+06],dx ; load outregs.x.dx ;AC010;
89 mov [di+08],si ; load outregs.x.si ;AC010;
90
91 lahf ; get flags into ax ;AC010;
92 mov al,ah ; move into low byte ;AC010;
93 mov [di+0ch],ax ; load outregs.x.cflag ;AC010;
94
95 pop ax ; get di from stack ;AC010;
96 mov [di+0ah],ax ; load outregs.x.di ;AC010;
97
98;-------------------------------------------------------------------
99
100 pop si ; restore registers ;AC010;
101 pop di ;AC010;
102 mov sp,bp ; restore sp ;AC010;
103 pop bp ; restore user's bp ;AC010;
104 ret
105
106data_sysloadmsg endp ;AC010;
107
108
109data_sysdispmsg proc far ;AC010;
110
111 push bp ; save user's base pointer ;AC010;
112 mov bp,sp ; set bp to current sp ;AC010;
113 push di ; save some registers ;AC010;
114 push si ;AC010;
115
116; copy C inregs into proper registers
117
118 mov di,[bp+4+4] ; fix di (arg 0) ;AC010;
119
120;-------------------------------------------------------------------
121
122 mov ax,[di+0ah] ; load di ;AC010;
123 push ax ; the di value from inregs is now on stack ;AC010;
124
125 mov ax,[di+00] ; get inregs.x.ax ;AC010;
126 mov bx,[di+02] ; get inregs.x.bx ;AC010;
127 mov cx,[di+04] ; get inregs.x.cx ;AC010;
128 mov dx,[di+06] ; get inregs.x.dx ;AC010;
129 mov si,[di+08] ; get inregs.x.si ;AC010;
130 pop di ; get inregs.x.di from stack ;AC010;
131
132 push bp ; save base pointer ;AC010;
133
134;-------------------------------------------------------------------
135
136 call sysdispmsg ;AC010;
137
138;-------------------------------------------------------------------
139
140 pop bp ; restore base pointer ;AC010;
141 push di ; the di value from call is now on stack ;AC010;
142 mov di,[bp+6+4] ; fix di (arg 1) ;AC010;
143
144 mov [di+00],ax ; load outregs.x.ax ;AC010;
145 mov [di+02],bx ; load outregs.x.bx ;AC010;
146 mov [di+04],cx ; load outregs.x.cx ;AC010;
147 mov [di+06],dx ; load outregs.x.dx ;AC010;
148 mov [di+08],si ; load outregs.x.si ;AC010;
149
150 lahf ; get flags into ax ;AC010;
151 mov al,ah ; move into low byte ;AC010;
152 mov [di+0ch],ax ; load outregs.x.cflag ;AC010;
153
154 pop ax ; get di from stack ;AC010;
155 mov [di+0ah],ax ; load outregs.x.di ;AC010;
156
157;-------------------------------------------------------------------
158
159 pop si ; restore registers ;AC010;
160 pop di ;AC010;
161 mov sp,bp ; restore sp ;AC010;
162 pop bp ; restore user's bp ;AC010;
163 ret ;AC010;
164
165data_sysdispmsg endp ;AC010;
166
167
168data_sysgetmsg proc far ;AC010;
169
170 push bp ; save user's base pointer ;AC010;
171 mov bp,sp ; set bp to current sp ;AC010;
172 push di ; save some registers ;AC010;
173 push si ;AC010;
174
175; copy C inregs into proper registers
176
177 mov di,[bp+4+4] ; fix di (arg 0) ;AC010;
178
179;-------------------------------------------------------------------
180
181 mov ax,[di+0ah] ; load di ;AC010;
182 push ax ; the di value from inregs is now on stack ;AC010;
183
184 mov ax,[di+00] ; get inregs.x.ax ;AC010;
185 mov bx,[di+02] ; get inregs.x.bx ;AC010;
186 mov cx,[di+04] ; get inregs.x.cx ;AC010;
187 mov dx,[di+06] ; get inregs.x.dx ;AC010;
188 mov si,[di+08] ; get inregs.x.si ;AC010;
189 pop di ; get inregs.x.di from stack ;AC010;
190
191 push bp ; save base pointer ;AC010;
192
193;-------------------------------------------------------------------
194
195 call sysgetmsg ; call the message retriever ;AC010;
196
197;-------------------------------------------------------------------
198
199 pop bp ; restore base pointer ;AC010;
200 push di ; the di value from call is now on stack ;AC010;
201 mov di,[bp+6+4] ; fix di (arg 1) ;AC010;
202
203 push ax ; save ax ;AC010;
204 mov [di+00],es ; load segregs.es ;AC010;
205 mov [di+06],ds ; load outregs.ds ;AC010;
206 pop ax ; restore ax ;AC010;
207
208 pop di ; restore di ;AC010;
209 push di ; save it ;AC010;
210 mov di,[bp+8+4] ; fix di (arg 2) ;AC010;
211 mov [di+00],ax ; load outregs.x.ax ;AC010;
212 mov [di+02],bx ; load outregs.x.bx ;AC010;
213 mov [di+04],cx ; load outregs.x.cx ;AC010;
214 mov [di+06],dx ; load outregs.x.dx ;AC010;
215 mov [di+08],si ; load outregs.x.si ;AC010;
216
217 lahf ; get flags into ax ;AC010;
218 mov al,ah ; move into low byte ;AC010;
219 mov [di+0ch],ax ; load outregs.x.cflag ;AC010;
220
221 pop ax ; get di from stack ;AC010;
222 mov [di+0ah],ax ; load outregs.x.di ;AC010;
223
224;-------------------------------------------------------------------
225
226 pop si ; restore registers ;AC010;
227 pop di ;AC010;
228 mov sp,bp ; restore sp ;AC010;
229 pop bp ; restore user's bp ;AC010;
230 ret ;AC010;
231
232data_sysgetmsg endp ;AC010;
233
234
235_DATA ends ; end code segment ;AC010;
236
237_TEXT SEGMENT ;AC010;
238
239 assume cs:_TEXT ;AC010;
240
241 public _sysdispmsg ;AC010;
242 public _sysloadmsg ;AC010;
243 public _sysgetmsg ;AC010;
244
245_sysdispmsg proc near ;AC010;
246 call data_sysdispmsg ;AC010;
247 ret ;AC010;
248_sysdispmsg endp ;AC010;
249
250_sysloadmsg proc near ;AC010;
251 call data_sysloadmsg ;AC010;
252 ret ;AC010;
253_sysloadmsg endp ;AC010;
254
255_sysgetmsg proc near ;AC010;
256 call data_sysgetmsg ;AC010;
257 ret ;AC010;
258_sysgetmsg endp ;AC010;
259
260_TEXT ENDS ;AC010;
261 end ;AC010;
262
263 \ No newline at end of file
diff --git a/v4.0/src/CMD/FDISK/_PARSE.ASM b/v4.0/src/CMD/FDISK/_PARSE.ASM
new file mode 100644
index 0000000..9e308af
--- /dev/null
+++ b/v4.0/src/CMD/FDISK/_PARSE.ASM
@@ -0,0 +1,165 @@
1page 60,132
2name _parse
3title C to PARSER interface
4;-------------------------------------------------------------------
5;
6; MODULE: _parse
7;
8; PURPOSE: Supplies an interface between C programs and
9; the DOS 3.3 parser
10;
11; CALLING FORMAT:
12; parse(&inregs,&outregs);
13;
14; DATE: 5-21-87
15;
16;-------------------------------------------------------------------
17
18; extrn sysparse:far
19
20 public _parse
21
22;-------------------------------------------------------------------
23FarSW equ 0 ; make sysparse be a NEAR proc
24TimeSW equ 0 ; Check time format
25FileSW equ 0 ; Check file specification
26CAPSW equ 0 ; Perform CAPS if specified
27CmpxSW equ 0 ; Check complex list
28NumSW equ 1 ; Check numeric value
29KeySW equ 0 ; Support keywords
30SwSW equ 1 ; Support switches
31Val1SW equ 1 ; Support value definition 1
32Val2SW equ 1 ; Support value definition 2
33Val3SW equ 0 ; Support value definition 3
34DrvSW equ 0 ; Support drive only format
35QusSW equ 0 ; Support quoted string format
36;-------------------------------------------------------------------
37
38
39
40
41_TEXT SEGMENT BYTE PUBLIC 'CODE'
42_TEXT ENDS
43_DATA SEGMENT WORD PUBLIC 'DATA'
44_DATA ENDS
45CONST SEGMENT WORD PUBLIC 'CONST'
46CONST ENDS
47_BSS SEGMENT WORD PUBLIC 'BSS'
48_BSS ENDS
49
50
51DGROUP GROUP CONST, _BSS, _DATA
52
53
54_DATA segment word public 'DATA'
55
56 assume cs:DGROUP
57 assume ss:dgroup
58
59 public SysParse
60
61;-------------------------------------------------------------------
62.xlist
63include parse.asm ; include the parser
64.list
65;-------------------------------------------------------------------
66
67 public CallParser
68CallParser proc far
69
70 push ds
71 PUSH ES
72
73 push cs
74 pop ds
75 assume ds:DGROUP
76
77 push cs
78 pop es
79 assume es:DGROUP
80
81 nop
82
83 call SysParse
84
85 POP ES
86 pop ds
87
88 ret
89
90CallParser endp
91
92
93
94_DATA ends
95
96_TEXT segment byte public 'CODE'
97
98 ASSUME CS:_TEXT
99 ASSUME DS:DGROUP
100 ASSUME ES:NOTHING
101 ASSUME SS:DGROUP
102
103_parse proc near
104
105 push bp ; save user's base pointer
106 mov bp,sp ; set bp to current sp
107 push di ; save some registers
108 push si
109
110; copy C inregs into proper registers
111
112 mov di,[bp+4] ; fix di (arg 0)
113
114;-------------------------------------------------------------------
115
116 mov ax,[di+0ah] ; load di
117 push ax ; the di value from inregs is now on stack
118
119 mov ax,[di+00] ; get inregs.x.ax
120 mov bx,[di+02] ; get inregs.x.bx
121 mov cx,[di+04] ; get inregs.x.cx
122 mov dx,[di+06] ; get inregs.x.dx
123 mov si,[di+08] ; get inregs.x.si
124 pop di ; get inregs.x.di from stack
125
126 push bp ; save base pointer
127
128;-------------------------------------------------------------------
129;-------------------------------------------------------------------
130
131 call CallParser ; call the parser
132
133;-------------------------------------------------------------------
134;-------------------------------------------------------------------
135
136 pop bp ; restore base pointer
137 push di ; the di value from call is now on stack
138 mov di,[bp+6] ; fix di (arg 1)
139
140 mov [di+00],ax ; load outregs.x.ax
141 mov [di+02],bx ; load outregs.x.bx
142 mov [di+04],cx ; load outregs.x.cx
143 mov [di+06],dx ; load outregs.x.dx
144 mov [di+08],si ; load outregs.x.si
145
146 xor ax,ax ; clear ax
147 lahf ; get flags into ax
148 mov [di+0ch],ax ; load outregs.x.cflag
149
150 pop ax ; get di from stack
151 mov [di+0ah],ax ; load outregs.x.di
152
153;-------------------------------------------------------------------
154
155 pop si ; restore registers
156 pop di
157 mov sp,bp ; restore sp
158 pop bp ; restore user's bp
159 ret
160
161_parse endp
162
163_TEXT ends ; end code segment
164 end
165