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 */
10 /******************* START OF SPECIFICATIONS *******************/
12 /* SUBROUTINE NAME: CREATE_PARTITION */
14 /* DESCRIPTIVE NAME: Create DOS related partition(s) */
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 */
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 */
29 /* The following screen in managed */
31 /* ³0000000000111111111122222222223333333333³ */
32 /* ³0123456789012345678901234567890123456789³ */
33 /* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
38 /* 04³Create DOS Partition ³ */
40 /* 06³Current Fixed Disk Drive: # ³ */
42 /* 08³Choose one of the following: ³ */
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 ³ */
52 /* 18³Enter choice: [ ] ³ */
57 /* 23³Press ESC to return to FDISK Options ³ */
58 /* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
60 /* ENTRY POINTS: create_partition */
61 /* LINKAGE: create_partition(); */
65 /* EXIT-NORMAL: ERROR=FALSE */
67 /* EXIT-ERROR: ERROR=TRUE */
68 /* GOTO internal_program_error if case statement */
69 /* failure when branching to requested function */
71 /* EFFECTS: No data directly modified by this routine, but */
72 /* child routines will modify data. */
74 /* INTERNAL REFERENCES: */
76 /* find_free_partition */
77 /* dos_create_partition */
78 /* ext_create_partition */
80 /* internal_program_error */
81 /* find_partition_type */
87 /* EXTERNAL REFERENCES: */
90 /******************** END OF SPECIFICATIONS ********************/
93 void create_partition()
104 input = c(NUL); /* AC000 */
105 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
106 /* put up heading and ESC */
110 /* Setup current drive msg */
111 insert[0]=cur_disk+1+'0';
114 /* See if there are free partitions */
115 if (find_free_partition() != ((char)(NOT_FOUND))) /* AC000 */
118 display(menu_3); /* AN000 */
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 */
131 max_input = c(3); /* AC000 */
133 input = get_num_input(default_value,max_input,input_row,input_col);
135 /* Go branch to the requested function */
138 case '1': dos_create_partition();
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();
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 */
156 if (find_partition_type(uc(EXTENDED))) /* AC000 */
160 display(error_35); /* AN000 */
161 clear_screen(u(17),u(0),u(17),u(79)); /* AN000 */
162 wait_for_ESC(); /* AN000 */
169 default: internal_program_error();
175 /* Display prompt telling there is no avail partition */
177 input = wait_for_ESC();
179 /* clear the screen before going back to main menu */
180 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
186 /******************* START OF SPECIFICATIONS *******************/
188 /* SUBROUTINE NAME: DOS_CREATE_PARTITION */
190 /* DESCRIPTIVE NAME: Create default DOS partition on disk */
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. */
199 /* NOTES: Screen can be exited via the ESC command before */
200 /* partition is created and nothing will change */
202 /* The following screen is managed: */
204 /* ³0000000000111111111122222222223333333333³ */
205 /* ³0123456789012345678901234567890123456789³ */
206 /* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
211 /* 04³Create DOS Partition ³ */
213 /* 06³Current Fixed Disk Drive: # ³ */
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] ³ */
230 /* 23³Press ESC to return to FDISK Options ³ */
231 /* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
233 /* ENTRY POINTS: dos_create_partition */
234 /* LINKAGE: dos_create_partition(); */
239 /* EXIT-NORMAL: ERROR=FALSE */
241 /* EXIT-ERROR: ERROR=TRUE */
242 /* GOTO internal_program_error if case statement */
243 /* failure when branching to requested function */
245 /* EFFECTS: No data directly modified by this routine, but */
246 /* child routines will modify data. */
248 /* INTERNAL REFERENCES: */
254 /* input_dos_create */
256 /* check_bad_tracks */
259 /* EXTERNAL REFERENCES: */
262 /******************** END OF SPECIFICATIONS ********************/
265 void dos_create_partition()
272 char second_disk_flag; /* AN000 */
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 */
284 /* Set up current disk message */
285 insert[0] = cur_disk+1+'0';
288 /* Display ESC prompt */
291 /* See if already exists */
292 if ((!find_partition_type(uc(DOS12))) && (!find_partition_type(uc(DOS16))) && (!find_partition_type(uc(DOSNEW)))) /* AC000 */
295 /* Display prompt, depending on what disk */
296 if (cur_disk == c(0)) /* AC000 */
297 /* Put up make active partition message */
301 /* Second disk, so don;t put up prompt mentioning active partition */
302 second_disk_flag = (FLAG)TRUE; /* AN000 */
303 display(menu_45); /* AC000 */
306 input = get_yn_input(c(Yes),input_row,input_col); /* AC000 AC011 */
308 /* Go handle input */
312 if ( second_disk_flag == (FLAG)FALSE)
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 */
320 write_info_to_disk();
321 reboot_system(); /* AC000 */
323 clear_screen(u(16),u(0),u(23),u(79)); /* AN000 */
324 display(status_12); /* 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 */
340 case 0: input_dos_create(); /* AC000 */
343 case ESC: break; /* take no action */
345 default : internal_program_error();
350 /* Display partition table-it will return if no partitions there */
353 /* Primary partition already exists message */
362 /******************* START OF SPECIFICATIONS *******************/
364 /* SUBROUTINE NAME: INPUT_DOS_CREATE */
366 /* DESCRIPTIVE NAME: Create DOS partition on disk */
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 */
376 /* NOTES: Screen can be exited via the ESC command before */
377 /* partition is created and nothing will change */
379 /* The following screen is managed */
381 /* ³0000000000111111111122222222223333333333³ */
382 /* ³0123456789012345678901234567890123456789³ */
383 /* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
388 /* 04³Create DOS partition ³ */
390 /* 06³Current Fixed Disk Drive: # ³ */
392 /* 08³Partition Status Type Start End Size³ */
398 /* 14³Total disk space is #### cylinders. ³ */
399 /* 15³Maximum space available for partition ³ */
400 /* 16³is #### cylinders. ³ */
402 /* 18³Enter partition size............: [####]³ */
407 /* 23³Press ESC to return to FDISK Options ³ */
408 /* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
410 /* ENTRY POINTS: input_dos_create */
411 /* LINKAGE: input_dos_create(); */
416 /* EXIT-NORMAL: ERROR=FALSE */
418 /* EXIT-ERROR: ERROR=TRUE */
419 /* GOTO internal_program_error if case statement */
420 /* failure when branching to requested function */
422 /* EFFECTS: No data directly modified by this routine, but */
423 /* child routines will modify data. */
425 /* INTERNAL REFERENCES: */
433 /* check_bad_tracks */
435 /* EXTERNAL REFERENCES: */
438 /******************** END OF SPECIFICATIONS ********************/
441 void input_dos_create()
446 unsigned default_entry;
450 input = u(NUL); /* AC000 */
451 /* clear off screen */
452 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
457 /* Setup and print current disk */
458 insert[0] = cur_disk+1+'0';
461 /* Print ESC prompt */
464 /* Display partition table-it will return if no partitions there */
467 sprintf(insert,"%4.0d",total_mbytes[cur_disk]);
470 /* Get the free space */
471 temp = find_part_free_space(c(PRIMARY)); /* AC000 */
474 if (free_space[temp].mbytes_unused != u(0)) /* AC000 */
477 /* Display disk space */
478 sprintf(insert,"%4.0d",total_mbytes[cur_disk]);
481 /* Setup and print max partition size */
483 sprintf(insert,"%4.0d%3.0d%%",
484 free_space[temp].mbytes_unused,
485 free_space[temp].percent_unused);
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 */
496 sprintf(insert,"%4.0d",default_entry);
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 */
501 /* Update default in case of error, so it gets displayed and used */
502 /* if user presses CR only */
504 default_entry = input;
505 clear_screen(u(19),u(0),u(23),u(79)); /* AC000 */
508 if (input != ((unsigned)(ESC_FLAG))) /* AC000 */
511 /* Change input to cylinders */
512 /* check to see if input was in percent or mbytes */
514 if (PercentFlag) /* AN000 */
516 if (input == free_space[temp].percent_unused)
517 input = free_space[temp].space; /* AN000 */
519 input = percent_to_cylinders(input,total_disk[cur_disk]);
523 if (input == free_space[temp].mbytes_unused)
524 input = free_space[temp].space; /* AN000 */
526 input = (unsigned)mbytes_to_cylinders(input,
527 cur_disk); /* AN004 */
530 /* Initialize PecentFlag back to FALSE */
531 PercentFlag = (FLAG)FALSE; /* AN000 */
533 /* Go create the partition */
534 make_partition(input,temp,uc(NUL),c(PRIMARY)); /* AC000 */
536 /* clear off the old prompt */
537 clear_screen(u(13),u(0),u(19),u(79)); /* AC000 */
539 /* Reissue the partition info */
542 /* display the "okay, we did it" msg */
543 if (number_of_drives == uc(1)) /* AN000 */
547 clear_screen(u(16),u(0),u(23),u(79)); /* AN000 */
548 display(status_12); /* AN000 */
562 /******************* START OF SPECIFICATIONS *******************/
564 /* SUBROUTINE NAME: EXT_CREATE_PARTITION */
566 /* DESCRIPTIVE NAME: Create EXTENDED DOS partition */
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 */
576 /* NOTES: Screen can be exited via the ESC command before */
577 /* partition is created and nothing will change */
579 /* The following screen is managed */
581 /* ³0000000000111111111122222222223333333333³ */
582 /* ³0123456789012345678901234567890123456789³ */
583 /* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
588 /* 04³Create EXTENDED DOS partition ³ */
590 /* 06³Current Fixed Disk Drive: # ³ */
592 /* 08³Partition Status Type Start End Size³ */
598 /* 14³Total disk space is #### cylinders. ³ */
599 /* 15³Maximum space available for partition ³ */
600 /* 16³is #### cylinders. ³ */
602 /* 18³Enter partition size............: [####]³ */
607 /* 23³Press ESC to return to FDISK Options ³ */
608 /* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
610 /* ENTRY POINTS: EXTENDED_create_partition */
611 /* LINKAGE: EXTENDED_create_partition(); */
616 /* EXIT-NORMAL: ERROR=FALSE */
618 /* EXIT-ERROR: ERROR=TRUE */
619 /* GOTO internal_program_error if case statement */
620 /* failure when branching to requested function */
622 /* EFFECTS: No data directly modified by this routine, but */
623 /* child routines will modify data. */
625 /* INTERNAL REFERENCES: */
631 /* find_partition_type */
635 /* EXTERNAL REFERENCES: */
638 /******************** END OF SPECIFICATIONS ********************/
641 void ext_create_partition()
647 unsigned default_entry;
651 input = u(NUL); /* AC000 */
652 /* clear off screen */
653 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
658 /* Setup and print current disk */
659 insert[0] = cur_disk+1+'0';
662 /* print ESC prompt */
665 /* Display partition table-it will return if no partitions there */
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 */
672 if (!find_partition_type(uc(EXTENDED))) /* AC000 */
673 /* We can go create one now */
676 /* Get the free space */
677 temp = find_part_free_space(c(EXTENDED)); /* AC000 */
680 if (free_space[temp].percent_unused != u(0)) /* AC000 */
683 /* Display disk space */
684 sprintf(insert,"%4.0d",total_mbytes[cur_disk]);
687 /* Setup and print max partition size */
689 sprintf(insert,"%4.0d%3.0d%%",
690 free_space[temp].mbytes_unused,
691 free_space[temp].percent_unused);
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 */
698 default_entry = (unsigned)free_space[temp].percent_unused; /* AC000 */
699 PercentFlag = (FLAG)TRUE; /* AN000 */
703 default_entry = (unsigned)free_space[temp].mbytes_unused; /* AC000 */
704 PercentFlag = (FLAG)FALSE; /* AN000 */
707 valid_input = (FLAG)FALSE; /* AC000 */
712 if (!PercentFlag) /* AN000 */
713 sprintf(insert,"%4.0d",default_entry);
715 sprintf(insert,"%3.0d%%",default_entry); /* AN000 */
716 display(menu_42); /* AC000 */
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 */
720 /* Update default in case of error, so it gets displayed and used */
721 /* if user presses CR only */
723 default_entry = input;
724 clear_screen(u(19),u(0),u(23),u(79)); /* AC000 */
727 if (input != ((unsigned)(ESC_FLAG))) /* AC000 */
730 /* Change input to cylinders */
731 if (PercentFlag) /* AN000 */
733 if (input == free_space[temp].percent_unused)
734 input = free_space[temp].space; /* AN000 */
736 input = percent_to_cylinders(input,total_disk[cur_disk]);
740 if (input == free_space[temp].mbytes_unused)
741 input = free_space[temp].space; /* AN000 */
743 input = (unsigned)mbytes_to_cylinders(input,
744 cur_disk); /* AN004 */
748 /* Initialize PecentFlag back to FALSE */
749 PercentFlag = (FLAG)FALSE; /* AN000 */
751 /* Go create the partition */
752 make_partition(input,temp,uc(NUL),c(EXTENDED)); /* AC000 */
754 /* clear off the old prompt */
755 clear_screen(u(13),u(0),u(19),u(79)); /* AC000 */
757 /* Display the updated partition information */
760 /* Hit esc to continue line */
761 clear_screen(u(24),u(0),u(24),u(79)); /* AN000 */
762 display(menu_46); /* AN000 */
764 /* Tell user we created it */
768 reboot_flag = (FLAG)TRUE; /* AC000 */
770 /* Go allow him to create disk volumes */
783 /* Already have ext partition, tell user and bow out */
790 /* don't have a primary partition yet, can't create an ext */
800 /******************* START OF SPECIFICATIONS *******************/
802 /* SUBROUTINE NAME: VOLUME_CREATE */
804 /* DESCRIPTIVE NAME: Create DOS disk volumes */
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 */
817 /* NOTES: Screen can be exited via the ESC command before */
818 /* partition is created and nothing will change */
820 /* The following screen is managed */
822 /* ³0000000000111111111122222222223333333333³ */
823 /* ³0123456789012345678901234567890123456789³ */
824 /* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */
825 /* 00³Create DOS Disk Volume ³ */
827 /* 02³Vol Start End Size ³ */
828 /* 03³ # #### #### #### ³ */
841 /* 16³Total partition size is #### cylinders. ³ */
842 /* 17³Maximum space available for disk ³ */
843 /* 18³volume is #### cylinders. ³ */
845 /* 20³Enter disk volume size..........: [####]³ */
848 /* 23³Press ESC to return to FDISK Options ³ */
849 /* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */
851 /* ENTRY POINTS: Volume_Create */
852 /* LINKAGE: Volume_Create () */
857 /* EXIT-NORMAL: ERROR=FALSE */
859 /* EXIT-ERROR: ERROR=TRUE */
860 /* GOTO internal_program_error if case statement */
861 /* failure when branching to requested function */
863 /* EFFECTS: No data directly modified by this routine, but */
864 /* child routines will modify data. */
866 /* INTERNAL REFERENCES: */
875 /* EXTERNAL REFERENCES: */
878 /******************** END OF SPECIFICATIONS ********************/
886 unsigned default_entry;
891 char previous_location;
896 unsigned ext_part_percent_unused; /* AN000 */
897 unsigned ext_part_num; /* AN000 */
899 input = u(NUL); /* AC000 */
901 /* clear off screen */
902 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */
907 /* print ESC prompt */
910 /* Display volume info */
911 drive_letter = volume_display();
913 /* Loop until done */
914 input = u(NUL); /* AC000 */
915 while (input != ((unsigned)(ESC_FLAG))) /* AC000 */
918 /* See if we have hit the max number of drives */
919 defined_drives = c(0); /* AC000 */
920 temp_cur_disk = cur_disk;
922 /* Search both drives for defined drives */
923 for (i = uc(0); i < number_of_drives; i++) /* AC000 */
926 cur_disk = ((char)(i));
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*/
932 /* See if extended partition on disk */
933 if (find_partition_type(uc(EXTENDED))) /* AC000 */
935 /* Get number of logical drives */
936 defined_drives = defined_drives + get_num_logical_dos_drives();
939 /* Restore cur_disk to original */
940 cur_disk = temp_cur_disk;
942 /* See if 26 or less drives total */
943 if (defined_drives < c(24)) /* AC000 */
945 location = find_ext_free_space();
947 /* find the number of the extended partiton to figure out percent */
948 ext_part_num = find_partition_location(uc(EXTENDED)); /* AN000 */
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 */
956 if (ext_part_percent_unused != u(0)) /* AC000 */
959 /* Display disk space */
960 sprintf(insert,"%4.0d",get_partition_size(uc(EXTENDED)) );
963 /* Setup and print max partition size */
965 sprintf(insert,"%4.0d%3.0d%%",
966 free_space[location].mbytes_unused,
967 ext_part_percent_unused);
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 */
974 default_entry = (unsigned)ext_part_percent_unused; /* AN000 */
975 PercentFlag = (FLAG)TRUE; /* AN000 */
979 default_entry = (unsigned)free_space[location].mbytes_unused; /* AC000 */
980 PercentFlag = (FLAG)FALSE; /* AN000 */
983 valid_input = (FLAG)FALSE; /* AC000 */
988 if (!PercentFlag) /* AN000 */
989 sprintf(insert,"%4.0d",default_entry);
991 sprintf(insert,"%3.0d%%",default_entry); /* AN000 */
995 input = get_large_num_input(default_entry,free_space[location].mbytes_unused,ext_part_percent_unused,menu_40,u(0),error_12); /* AC000*/
997 /* Update default in case of error, so it gets displayed and used */
998 /* if user presses CR only */
1000 default_entry = input;
1001 clear_screen(u(19),u(0),u(23),u(79)); /* AC000 */
1004 if (input != ((unsigned)(ESC_FLAG))) /* AC000 */
1007 /* Change input to cylinders */
1008 if (PercentFlag) /* AN000 */
1010 if (input == ext_part_percent_unused)
1011 input = free_space[location].space; /* 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));
1017 if (input == free_space[location].mbytes_unused)
1018 input = free_space[location].space; /* AN000 */
1020 input = (unsigned)mbytes_to_cylinders(input,
1021 cur_disk); /* AN004 */
1024 /* Initialize PecentFlag back to FALSE */
1025 PercentFlag = (FLAG)FALSE; /* AN000 */
1027 /* go create the entry and find out where it put it */
1028 ext_location = make_volume(input,location);
1030 /* clear off the old prompt */
1031 clear_screen(u(15),u(0),u(19),u(79)); /* AC000 */
1033 reboot_flag = (FLAG)TRUE; /* AC000 */
1035 /* Display the updated partition information */
1036 drive_letter = volume_display();
1038 /* Tell user we created it */
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 */
1049 wait_for_ESC(); /* KWC, 11-01-87 */
1050 input = u(ESC_FLAG); /* KWC, 11-01-87 */
1055 /* Reached the maximum */
1056 /* Get rid of the size prompts */
1057 clear_screen(u(17),u(0),u(21),u(79)); /* AC000 */
1059 /* Force an exit with ESC */
1060 wait_for_ESC(); /* KWC, 11-01-87 */
1061 input = u(ESC_FLAG); /* KWC, 11-01-87 */
1064 clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */