From 2d04cacc5322951f187bb17e017c12920ac8ebe2 Mon Sep 17 00:00:00 2001 From: Mark Zbikowski Date: Thu, 25 Apr 2024 21:24:10 +0100 Subject: MZ is back! --- v4.0/src/CMD/FDISK/BOOTREC.ASM | 36 + v4.0/src/CMD/FDISK/CONVERT.C | 478 +++++++ v4.0/src/CMD/FDISK/C_MENUS.C | 1067 +++++++++++++++ v4.0/src/CMD/FDISK/DISKOUT.C | 354 +++++ v4.0/src/CMD/FDISK/DISPLAY.C | 406 ++++++ v4.0/src/CMD/FDISK/DOS.H | 81 ++ v4.0/src/CMD/FDISK/DOSCALL.H | 2811 ++++++++++++++++++++++++++++++++++++++++ v4.0/src/CMD/FDISK/D_MENUS.C | 941 ++++++++++++++ v4.0/src/CMD/FDISK/EXTERN.H | 82 ++ v4.0/src/CMD/FDISK/FDBOOT.ASM | 119 ++ v4.0/src/CMD/FDISK/FDCHNG.INC | 88 ++ v4.0/src/CMD/FDISK/FDISK.C | 1121 ++++++++++++++++ v4.0/src/CMD/FDISK/FDISK.H | 224 ++++ v4.0/src/CMD/FDISK/FDISK.LNK | 31 + v4.0/src/CMD/FDISK/FDISK.MSG | 1177 +++++++++++++++++ v4.0/src/CMD/FDISK/FDISK.SKL | 18 + v4.0/src/CMD/FDISK/FDISK5.SKL | 15 + v4.0/src/CMD/FDISK/FDISKMSG.C | 1181 +++++++++++++++++ v4.0/src/CMD/FDISK/FDISKMSG.H | 131 ++ v4.0/src/CMD/FDISK/FDPARSE.C | 312 +++++ v4.0/src/CMD/FDISK/GLOBAL.C | 84 ++ v4.0/src/CMD/FDISK/INPUT.C | 673 ++++++++++ v4.0/src/CMD/FDISK/INT13.C | 443 +++++++ v4.0/src/CMD/FDISK/MAIN.C | 332 +++++ v4.0/src/CMD/FDISK/MAINMENU.C | 231 ++++ v4.0/src/CMD/FDISK/MAKEFILE | 114 ++ v4.0/src/CMD/FDISK/MAKEPART.C | 282 ++++ v4.0/src/CMD/FDISK/MESSAGES.C | 162 +++ v4.0/src/CMD/FDISK/MSGRET.H | 55 + v4.0/src/CMD/FDISK/PARSE.H | 188 +++ v4.0/src/CMD/FDISK/PARTINFO.C | 262 ++++ v4.0/src/CMD/FDISK/PRINT.H | 15 + v4.0/src/CMD/FDISK/PROFILE.C | 802 ++++++++++++ v4.0/src/CMD/FDISK/PROFILE.H | 44 + v4.0/src/CMD/FDISK/REBOOT.ASM | 43 + v4.0/src/CMD/FDISK/SPACE.C | 439 +++++++ v4.0/src/CMD/FDISK/SUBTYPE.H | 158 +++ v4.0/src/CMD/FDISK/TDISPLAY.C | 134 ++ v4.0/src/CMD/FDISK/TEST.H | 26 + v4.0/src/CMD/FDISK/VDISPLAY.C | 180 +++ v4.0/src/CMD/FDISK/VIDEO.C | 146 +++ v4.0/src/CMD/FDISK/_MSGRET.ASM | 263 ++++ v4.0/src/CMD/FDISK/_PARSE.ASM | 165 +++ 43 files changed, 15914 insertions(+) create mode 100644 v4.0/src/CMD/FDISK/BOOTREC.ASM create mode 100644 v4.0/src/CMD/FDISK/CONVERT.C create mode 100644 v4.0/src/CMD/FDISK/C_MENUS.C create mode 100644 v4.0/src/CMD/FDISK/DISKOUT.C create mode 100644 v4.0/src/CMD/FDISK/DISPLAY.C create mode 100644 v4.0/src/CMD/FDISK/DOS.H create mode 100644 v4.0/src/CMD/FDISK/DOSCALL.H create mode 100644 v4.0/src/CMD/FDISK/D_MENUS.C create mode 100644 v4.0/src/CMD/FDISK/EXTERN.H create mode 100644 v4.0/src/CMD/FDISK/FDBOOT.ASM create mode 100644 v4.0/src/CMD/FDISK/FDCHNG.INC create mode 100644 v4.0/src/CMD/FDISK/FDISK.C create mode 100644 v4.0/src/CMD/FDISK/FDISK.H create mode 100644 v4.0/src/CMD/FDISK/FDISK.LNK create mode 100644 v4.0/src/CMD/FDISK/FDISK.MSG create mode 100644 v4.0/src/CMD/FDISK/FDISK.SKL create mode 100644 v4.0/src/CMD/FDISK/FDISK5.SKL create mode 100644 v4.0/src/CMD/FDISK/FDISKMSG.C create mode 100644 v4.0/src/CMD/FDISK/FDISKMSG.H create mode 100644 v4.0/src/CMD/FDISK/FDPARSE.C create mode 100644 v4.0/src/CMD/FDISK/GLOBAL.C create mode 100644 v4.0/src/CMD/FDISK/INPUT.C create mode 100644 v4.0/src/CMD/FDISK/INT13.C create mode 100644 v4.0/src/CMD/FDISK/MAIN.C create mode 100644 v4.0/src/CMD/FDISK/MAINMENU.C create mode 100644 v4.0/src/CMD/FDISK/MAKEFILE create mode 100644 v4.0/src/CMD/FDISK/MAKEPART.C create mode 100644 v4.0/src/CMD/FDISK/MESSAGES.C create mode 100644 v4.0/src/CMD/FDISK/MSGRET.H create mode 100644 v4.0/src/CMD/FDISK/PARSE.H create mode 100644 v4.0/src/CMD/FDISK/PARTINFO.C create mode 100644 v4.0/src/CMD/FDISK/PRINT.H create mode 100644 v4.0/src/CMD/FDISK/PROFILE.C create mode 100644 v4.0/src/CMD/FDISK/PROFILE.H create mode 100644 v4.0/src/CMD/FDISK/REBOOT.ASM create mode 100644 v4.0/src/CMD/FDISK/SPACE.C create mode 100644 v4.0/src/CMD/FDISK/SUBTYPE.H create mode 100644 v4.0/src/CMD/FDISK/TDISPLAY.C create mode 100644 v4.0/src/CMD/FDISK/TEST.H create mode 100644 v4.0/src/CMD/FDISK/VDISPLAY.C create mode 100644 v4.0/src/CMD/FDISK/VIDEO.C create mode 100644 v4.0/src/CMD/FDISK/_MSGRET.ASM create mode 100644 v4.0/src/CMD/FDISK/_PARSE.ASM (limited to 'v4.0/src/CMD/FDISK') 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 @@ +; Static Name Aliases +; + TITLE bootrec.asm - master boot record images for fdisk + +_TEXT SEGMENT BYTE PUBLIC 'CODE' +_TEXT ENDS +_DATA SEGMENT WORD PUBLIC 'DATA' +_DATA ENDS +CONST SEGMENT WORD PUBLIC 'CONST' +CONST ENDS +_BSS SEGMENT WORD PUBLIC 'BSS' +_BSS ENDS + +DGROUP GROUP CONST, _BSS, _DATA + ASSUME CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP + +_DATA SEGMENT WORD PUBLIC 'DATA' + +; +; extern struct struct-name BootRecordData; +; +; +; + + +PUBLIC _master_boot_record + public _master_boot_record +_master_boot_record label byte + +include fdboot.inc +include fdboot.inc + +_DATA ENDS + +END + \ 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 @@ + +#include "fdisk.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "dos.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "string.h" +#include "ctype.h" + + +/******************************************************************************/ +/*Routine name: MBYTES_TO_CYLINDERS */ +/******************************************************************************/ +/* */ +/*Description: This routine will take input of MBtes and */ +/* convert it to cylinders rounding up to the next largest */ +/* cylinder boundry. Rounding up is done to make sure the */ +/* requester is getting at least what he asked for to the */ +/* next cylinder boundry. */ +/* */ +/*Called Procedures: none */ +/* */ +/* */ +/*Change History: Created 5/30/87 DRM */ +/* */ +/*Input: Input */ +/* */ +/*Output: Cylinders_out */ +/* */ +/******************************************************************************/ + + +unsigned mbytes_to_cylinders(mbytes_in,which_disk) /* AN004 */ + +XFLOAT mbytes_in; /* AN000 */ +char which_disk; /* AN004 */ + + + +BEGIN /* AN000 */ + +unsigned cylinders_out; /* AN000 */ +unsigned long cylinders_out1; /* AN000 */ +unsigned long number_of_sectors; /* AN000 */ +unsigned long number_of_tracks; /* AN000 */ +unsigned long divide_by; /* AN000 */ + + /* If trying to create a 3.30 compatible 32 MB partition */ + /* Set the 32mb limit - round down */ + if (mbytes_in == (XFLOAT)32) + BEGIN + cylinders_out1 = ul(DOS_MAX - max_sector[which_disk]); /* AN004 */ + divide_by = ul((max_head[which_disk]) * ul(max_sector[which_disk])); /* AN004 */ + cylinders_out = u(cylinders_out1 / divide_by); /* AN000 */ + END + else + BEGIN + number_of_sectors = ul(((mbytes_in * ONE_MEG)/BYTES_PER_SECTOR)); /* AN000 */ + if (((int)(mbytes_in * ONE_MEG) % BYTES_PER_SECTOR) != (int)0) /* AN000 */ + number_of_sectors++; /* AN000 */ + number_of_tracks = ul((number_of_sectors / max_sector[which_disk])); /* AN004 */ + if (((int)number_of_sectors % max_sector[which_disk]) != (int)0) /* AN004 */ + number_of_tracks++; /* AN000 */ + cylinders_out = u((number_of_tracks / max_head[which_disk])); /* AN004 */ + if (((int)number_of_tracks % max_head[which_disk]) != (int)0) /* AN004 */ + cylinders_out++; /* AN000 */ + END + + return(cylinders_out); /* AN000 */ +END /* AN000 */ + + + +/* */ +/*******************************************************************************/ +/*Routine name: CYLINDERS_TO_MBYTES */ +/*******************************************************************************/ +/* */ +/*Description: This routine will take input of cylinders and convert */ +/* it to MBytes. */ +/* */ +/* */ +/*Called Procedures: */ +/* */ +/* */ +/*Change History: Created 5/16/87 DRM */ +/* */ +/*Input: Cylinders_in */ +/* */ +/*Output: MBytes_out */ +/* */ +/* */ +/* */ +/*******************************************************************************/ + +XFLOAT cylinders_to_mbytes(cylinders_in,which_disk) /* AN004 */ + +unsigned cylinders_in; /* AN000 */ +char which_disk; /* AN004 */ + +BEGIN /* AN000 */ + +unsigned mbytes_out; /* AN000 */ +unsigned long number_of_bytes; /* AN000 */ +unsigned long number_of_sectors; /* AN000 */ +unsigned long number_of_tracks; /* AN000 */ +unsigned long bytes_in_one_sector; /* AN004 */ + + bytes_in_one_sector = BYTES_PER_SECTOR; /* AN004 */ + number_of_tracks = (ul(cylinders_in) * ul(max_head[which_disk])); /* AN004 */ + number_of_sectors = (number_of_tracks * ul(max_sector[which_disk])); /* AN004 */ + number_of_bytes = (ul(number_of_sectors) * ul(bytes_in_one_sector)); /* AN004 */ + mbytes_out = f(number_of_bytes / ONE_MEG); /* AN000 */ + if ((number_of_bytes % ONE_MEG) >= (ONE_MEG / 2)) mbytes_out++; /* AN000 */ + return(mbytes_out); /* AN000 */ + +END /* AN000 */ + + + + +/* */ +/*******************************************************************************/ +/*Routine name: CYLINDERS_TO_PERCENT */ +/*******************************************************************************/ +/* */ +/*Description: This routine will take input of cylinders and convert */ +/* it to Percent. */ +/* */ +/* */ +/*Called Procedures: */ +/* */ +/* */ +/*Change History: Created 5/16/87 DRM */ +/* */ +/*Input: Cylinders_in */ +/* */ +/*Output: percent_out */ +/* */ +/* */ +/* */ +/*******************************************************************************/ + +unsigned cylinders_to_percent(cylinders_in,total_cylinders) /* AN000 */ + +unsigned cylinders_in; /* AN000 */ +unsigned total_cylinders; /* AN000 */ + +BEGIN /* AN000 */ + +unsigned percentage_out; /* AN000 */ +double large_number; /* AN000 */ + + /* This is the same as (cyl_in / tot_cyl) * 100 to get the percentage */ + /* because * 100 is really 100/1 which is (cyl_in*100)/(tot_cyl*1). */ + + if (total_cylinders == 0) + percentage_out = 0; + else + BEGIN + large_number = (double)((long)cylinders_in * 100l); /* AN000 */ + percentage_out = u(large_number / total_cylinders); /* AN000 */ + END + /* this should round up to the next percent if more than .5 percent */ + if (((cylinders_in * 100) % total_cylinders) >= (total_cylinders / 2)) + percentage_out++; /* AN000 */ + if (percentage_out > u(100)) percentage_out = u(100); /* AN000 */ + return(percentage_out); /* AN000 */ +END /* AN000 */ + + + +/* */ +/******************************************************************************/ +/*Routine name: PERCENT_TO_CYLINDERS */ +/******************************************************************************/ +/* */ +/*Description: This routine will take input of percentage and */ +/* convert it to cylinders rounding up to the next largest */ +/* cylinder boundry. Rounding up is done to make sure the */ +/* requester is getting at least what he asked for to the */ +/* next cylinder boundry. */ +/* */ +/*Called Procedures: none */ +/* */ +/* */ +/*Change History: Created 5/30/87 DRM */ +/* */ +/*Input: Input */ +/* */ +/*Output: Cylinders_out */ +/* */ +/******************************************************************************/ + + +XFLOAT percent_to_cylinders(percent_in,total_cylinders) /* AN000 */ + +unsigned percent_in; /* AN000 */ +XFLOAT total_cylinders; /* AN000 */ + + +BEGIN /* AN000 */ + + XFLOAT cylinders_out; /* AN000 */ +#if IBMCOPYRIGHT + cylinders_out = ((percent_in * total_cylinders) / 100); /* AN000 */ +#else + cylinders_out = (unsigned)((ul(percent_in) * ul(total_cylinders)) / 100); +#endif + if (((percent_in * total_cylinders) % 100) != u(0)) /* AN000 */ + cylinders_out++; /* AN000 */ + return(cylinders_out); /* AN000 */ +END /* AN000 */ + + + + + + +/* */ +/*******************************************************************************/ +/*Routine name: DOS_UPPER */ +/*******************************************************************************/ +/* */ +/*Description: This routine will uppcase a character using get country */ +/* information (65H) with the capitalize single character */ +/* call (20H). */ +/* */ +/*Called Procedures: */ +/* */ +/* */ +/* */ +/*Change History: Updated 5/31/87 DRM */ +/* */ +/*Input: drive_value */ +/* */ +/*Output: input_value */ +/* */ +/*******************************************************************************/ + +char dos_upper(drive_value) /* AN000 */ + +char drive_value; /* AN000 */ + +BEGIN /* AN000 */ + + char output; /* AN000 */ + + regs.x.ax = (unsigned)CAPCHAR; /* Get extended country information - AN000 */ + regs.h.dl = (unsigned char)drive_value; /* Move input_value to register DL - AN000 */ + int86((int)INT21,®s,®s); /* AN000 */ + output = (char)regs.h.dl; /* AN000 */ + +#ifdef DEBUG + output = toupper(drive_value); +#endif + + return(output); /* AN000 */ +END /* AN000 */ + + + + + +/* */ +/*******************************************************************************/ +/*Routine name: CHECK_YN_INPUT */ +/*******************************************************************************/ +/* */ +/*Description: Get single character input, which must be a country */ +/* dependent (Y/N). Will be verified using new uppercase table */ +/* function calls. Will accept default value. */ +/* */ +/*Called Procedures: */ +/* */ +/* */ +/* */ +/*Change History: Updated 5/31/87 DRM */ +/* */ +/*Input: input_value */ +/* */ +/*Output: input */ +/* valid_input */ +/* */ +/*******************************************************************************/ + +char check_yn_input(input_value) /* AN000 */ + + char input_value; /* AN000 */ + +BEGIN + char input; /* AN000 */ + + /* Get extended country information */ + regs.x.ax = (unsigned)CAP_YN; /* AN000 */ + /* Move input_value to register DL */ + regs.h.dl = (unsigned char)input_value; /* AN000 */ + int86((int)INT21,®s,®s); /* AN000 */ + + /* check carry flag for error */ + if ((regs.x.cflag & CARRY_FLAG) == CARRY_FLAG) /* AN000 */ + /* input will be 0 for NO and 1 for YES in AX */ + input = c(NO_GOOD); /* input will equal not 0 or 1 */ /* AN000 */ + else /* AN000 */ + input = c(regs.x.ax); /* AN000 */ + +#ifdef DEBUG + + input = NO_GOOD; + if ( (input_value == (char) 'Y') || (input_value == (char) 'y') ) input = c(1); + if ( (input_value == (char) 'N') || (input_value == (char) 'n') ) input = c(0); + +#endif + + return(input); /* AN000 */ +END /* AN000 */ + + + + +/* */ +/*******************************************************************************/ +/*Routine name: GET_FS_AND_VOL */ +/*******************************************************************************/ +/* */ +/*Description: This routine will invoke INT21 44h (Block Generic IOCTL */ +/* Subfunction) call to get volume label and file system type. */ +/* */ +/*Called Procedures: */ +/* */ +/*Change History: Created 6/01/87 DRM */ +/* */ +/*Input: input_drive */ +/* */ +/*Output: pointer to dx register */ +/* */ +/*******************************************************************************/ + +FLAG get_fs_and_vol(input_drive) /* AN000 */ + + char input_drive; /* AN000 */ + +BEGIN /* AN000 */ + + char output; + + /* Set up registers for Generic IOCTL INT21 (44h) get media ID */ + regs.x.ax = u(GENERIC_IOCTL); /* AN000 */ + regs.h.bh = uc(ZERO); /* AN000 */ + regs.h.bl = (((unsigned char)input_drive - 'A') + 1); /* AN000 */ + regs.x.cx = u(GET_MEDIA_ID); /* AN000 */ + regs.x.dx = (unsigned)&dx_buff; /* AN000 */ + segread(&segregs); + intdosx(®s,®s,&segregs); /* AN000 */ + + /* see if carry flag was zero or one */ + if ((regs.x.cflag & CARRY_FLAG) == CARRY_FLAG) /* AN000 */ + output = FALSE; /* AN000 */ + else /* AN000 */ + output = TRUE; /* AN000 */ + + return(output); /* AN000 */ + /* AN000 */ +END + + + +/* */ +/*******************************************************************************/ +/*Routine name: GET_VOLUME_STRING */ +/*******************************************************************************/ +/* */ +/*Description: This routine will invoke INT21 4Eh (Find First Matching File) */ +/* and return the disk volume label. */ +/* */ +/*Called Procedures: */ +/* */ +/*Change History: Created 6/01/87 DRM */ +/* */ +/*Input: input_drive */ +/* */ +/*Output: volume_out */ +/* */ +/*******************************************************************************/ +void get_volume_string(input_drive,vol_label_addr) /* AN000 */ + char input_drive; /* AN000 */ + char *vol_label_addr; /* AN000 */ +BEGIN /* AN000 */ + + char first_string[13]; /* AC000 */ + char find_first_buffer[50]; /* AN000 */ + unsigned i,j; /* AC000 */ + + /* clear out any garbage in volume label field */ + for (i = u(0); i < u(12); i++) /* AN015 */ + BEGIN /* AN015 */ + vol_label_addr[i] = u(0); /* AN015 */ + END /* AN015 */ + + /* Point the DTA to our buffer so we can get the FindFirst output */ + regs.h.ah = uc(0x1A); /* AN000 */ + regs.x.dx = (unsigned)&find_first_buffer[0]; /* AN000 */ + segread(&segregs); + intdosx(®s,®s,&segregs); /* AN000 */ + + /* Find the first volume id */ + first_string[0] = input_drive; /* Find the vol label - AN000 */ + first_string[1] = (char) '\0'; + strcat(first_string,FILE_NAME); /* AN000 */ + regs.h.ah = uc(FIND_FIRST_MATCH); /* AN000 */ + regs.x.cx = u(VOL_LABEL); /* AN000 */ + regs.x.dx = (unsigned)&first_string[0]; /* AN000 */ + intdos(®s,®s); /* AN000 */ + +/* AC000 The following is modified to take care of "." in the middle of the */ +/*name */ + + if ((regs.x.cflag & CARRY_FLAG) != CARRY_FLAG) /* AN000 AC015 */ + BEGIN /* AN000 */ + for (i=j=u(0); i < strlen (&find_first_buffer[30]) ; i++) /* AN000 */ + BEGIN /* AN000 */ + if (find_first_buffer[30+i] != PERIOD) /* AN003 */ + vol_label_addr[i-j] = find_first_buffer[30+i]; /* AN000 */ + else /* AN000 */ + j = u(1); /* AN000 */ + END /* AN000 */ + END /* AN000 */ + return; /* AN000 */ +END /* AN000 */ + + +/* */ +/*******************************************************************************/ +/*Routine name: CHECK_FORMAT */ +/*******************************************************************************/ +/* */ +/*Description: This routine will invoke INT21 44h (Block Generic IOCTL */ +/* Subfunction) call to see if the drive has been previously */ +/* formatted by using a undocumented call. */ +/* */ +/*Called Procedures: */ +/* */ +/*Change History: Created 2/07/88 DRM */ +/* */ +/*Input: input_drive */ +/* */ +/*Output: pointer to dx register */ +/* */ +/*******************************************************************************/ + +FLAG check_format(input_drive) /* AN002 */ + + char input_drive; /* AN002 */ + +BEGIN /* AN002 */ + + char formatted; /* AN002 */ + + /* Set up registers for Generic IOCTL INT21 (44h) check media */ + regs.x.ax = u(GENERIC_IOCTL); /* AN002 */ + regs.h.bh = uc(ZERO); /* AN002 */ + regs.h.bl = (((unsigned char)input_drive - 'A') + 1); /* AN002 */ + regs.x.cx = u(SPECIAL_FUNCTION); /* AN002 */ + regs.x.dx = (unsigned)&disk_access; /* AN002 */ + segread(&segregs); /* AN002 */ + intdosx(®s,®s,&segregs); /* AN002 */ + + /* see if buffer returned good or not */ + if (disk_access.dac_access_flag == ZERO) /* AN002 */ + formatted = FALSE; /* AN002 */ + else /* AN002 */ + formatted = TRUE; /* AN002 */ + + return(formatted); /* AN002 */ + +END /* AN002 */ + + + 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 @@ + +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "fdiskmsg.h" /* AN000 */ +#include "stdio.h" + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: CREATE_PARTITION */ +/* */ +/* DESCRIPTIVE NAME: Create DOS related partition(s) */ +/* */ +/* FUNCTION: */ +/* This routine verifies if there are free partitions, */ +/* posts an status message if there is not, otherwise */ +/* prints a screen asking what type of partition to */ +/* be created, and passes control to the requested */ +/* function. */ +/* */ +/* NOTES: This is a screen control module only, no data is */ +/* modified. Routine also will only allow 1 DOS and */ +/* 1 Ext DOS partitions per disk, if one already exists,*/ +/* then status message is displayed when the create */ +/* option for that type partition is selected */ +/* */ +/* The following screen in managed */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³Create DOS Partition ³ */ +/* 05³ ³ */ +/* 06³Current Fixed Disk Drive: # ³ */ +/* 07³ ³ */ +/* 08³Choose one of the following: ³ */ +/* 09³ ³ */ +/* 10³ 1. Create Primary DOS partition ³ */ +/* 11³ 2. Create EXTENDED DOS partition ³ */ +/* 12³ 3. Create logical DOS drive(s) in ³ */ +/* 13³ the EXTENDED DOS partition ³ */ +/* 14³ ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³Enter choice: [ ] ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: create_partition */ +/* LINKAGE: create_partition(); */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if case statement */ +/* failure when branching to requested function */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* find_free_partition */ +/* dos_create_partition */ +/* ext_create_partition */ +/* volume_create */ +/* internal_program_error */ +/* find_partition_type */ +/* get_num_input */ +/* display */ +/* wait_for_ESC */ +/* clear_screen */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void create_partition() + +BEGIN + +char input; +char default_value; +char max_input; + + + + + input = c(NUL); /* AC000 */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + /* put up heading and ESC */ + display(menu_8); + display(menu_11); + + /* Setup current drive msg */ + insert[0]=cur_disk+1+'0'; + display(menu_5); + + /* See if there are free partitions */ + if (find_free_partition() != ((char)(NOT_FOUND))) /* AC000 */ + BEGIN + /* display menu */ + display(menu_3); /* AN000 */ + display(menu_9); + + /* ############# ADD CODE HERE FOR THIS FUNCTION ############## */ + /* Do something about highlighting the available options and */ + /* setting up defaults */ + default_value = c(1); /* AC000 */ + /* ############################################################ */ + /* setup default for prompt */ + insert[0] = c('1'); /* AC000 */ + display(menu_7); + display(menu_10); + + max_input = c(3); /* AC000 */ + + input = get_num_input(default_value,max_input,input_row,input_col); + + /* Go branch to the requested function */ + switch(input) + BEGIN + case '1': dos_create_partition(); + break; + + case '2': + if ((cur_disk == c(1)) || (find_partition_type(uc(DOS12))) || (find_partition_type(uc(DOS16))) || + (find_partition_type(uc(DOSNEW)))) /* AN000 */ /* AC000 */ + ext_create_partition(); + else + BEGIN /* AN000 */ + /* don't have a primary partition yet, can't create an ext */ + display(error_19); /* AN000 */ + clear_screen(u(17),u(0),u(17),u(79)); /* AN000 */ + wait_for_ESC(); /* AN000 */ + END /* AN000 */ + break; + + case '3': + BEGIN + if (find_partition_type(uc(EXTENDED))) /* AC000 */ + volume_create(); + else /* AN000 */ + BEGIN /* AN000 */ + display(error_35); /* AN000 */ + clear_screen(u(17),u(0),u(17),u(79)); /* AN000 */ + wait_for_ESC(); /* AN000 */ + END /* AN000 */ + break; + END + + case ESC: break; + + default: internal_program_error(); + END + END + else + BEGIN + + /* Display prompt telling there is no avail partition */ + display(error_10); + input = wait_for_ESC(); + END + /* clear the screen before going back to main menu */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + return; +END + + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: DOS_CREATE_PARTITION */ +/* */ +/* DESCRIPTIVE NAME: Create default DOS partition on disk */ +/* */ +/* FUNCTION: User is prompted to see if he wishes to use to */ +/* set up a DOS partition in the maximum available */ +/* size (limited to 32mb). If option is selected */ +/* than partition is created and marked active. The */ +/* partition is scanned to insure there are enough */ +/* contiguous good sectors for DOS. */ +/* */ +/* NOTES: Screen can be exited via the ESC command before */ +/* partition is created and nothing will change */ +/* */ +/* The following screen is managed: */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³Create DOS Partition ³ */ +/* 05³ ³ */ +/* 06³Current Fixed Disk Drive: # ³ */ +/* 07³ ³ */ +/* 08³Do you wish to use the maximum size ³ */ +/* 09³for a DOS partition and make the DOS ³ */ +/* 10³partition active (Y/N).........? [Y] ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³ ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: dos_create_partition */ +/* LINKAGE: dos_create_partition(); */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if case statement */ +/* failure when branching to requested function */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* clear_screen */ +/* display */ +/* get_yn_input */ +/* wait_for_ESC */ +/* input_dos_create */ +/* make_partition */ +/* check_bad_tracks */ +/* */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void dos_create_partition() + + +BEGIN + + char input; + char temp; + char second_disk_flag; /* AN000 */ + + + + second_disk_flag = (FLAG)FALSE; /* AN000 */ + input = c(NUL); /* AC000 */ + /* clear off screen */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + /* Put up header */ + display(menu_12); + + /* Set up current disk message */ + insert[0] = cur_disk+1+'0'; + display(menu_5); + + /* Display ESC prompt */ + display(menu_11); + + /* See if already exists */ + if ((!find_partition_type(uc(DOS12))) && (!find_partition_type(uc(DOS16))) && (!find_partition_type(uc(DOSNEW)))) /* AC000 */ + + BEGIN + /* Display prompt, depending on what disk */ + if (cur_disk == c(0)) /* AC000 */ + /* Put up make active partition message */ + display(menu_13); + else + BEGIN + /* Second disk, so don;t put up prompt mentioning active partition */ + second_disk_flag = (FLAG)TRUE; /* AN000 */ + display(menu_45); /* AC000 */ + END + /* Get Y/N input */ + input = get_yn_input(c(Yes),input_row,input_col); /* AC000 AC011 */ + + /* Go handle input */ + switch(input) + BEGIN + case 1: /* AC000 */ + if ( second_disk_flag == (FLAG)FALSE) + BEGIN + /* Go get the biggest area left */ + temp = find_part_free_space(c(PRIMARY)); /* AC000 */ + make_partition(free_space[temp].space,temp,uc(ACTIVE),c(PRIMARY)); /* AC000 */ + reboot_flag = (FLAG)TRUE; /* AC000 */ + if (number_of_drives == uc(1)) /* AN000 */ + BEGIN /* AN000 */ + write_info_to_disk(); + reboot_system(); /* AC000 */ + END /* AN000 */ + clear_screen(u(16),u(0),u(23),u(79)); /* AN000 */ + display(status_12); /* AN000 */ + wait_for_ESC(); + break; + END + else + BEGIN /* AN000 */ + /* Go get the biggest area left */ /* AN000 */ + temp = find_part_free_space(c(PRIMARY)); /* AN000 */ + make_partition(free_space[temp].space,temp,uc(NUL),c(PRIMARY)); /* AN000 */ + reboot_flag = (FLAG)TRUE; /* AN000 */ + clear_screen(u(16),u(0),u(23),u(79)); /* AN000 */ + display(status_12); /* AN000 */ + wait_for_ESC(); + break; + END + + case 0: input_dos_create(); /* AC000 */ + break; + + case ESC: break; /* take no action */ + + default : internal_program_error(); + END + END + else + BEGIN + /* Display partition table-it will return if no partitions there */ + table_display(); + + /* Primary partition already exists message */ + display(error_8); + wait_for_ESC(); + END + return; +END + + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: INPUT_DOS_CREATE */ +/* */ +/* DESCRIPTIVE NAME: Create DOS partition on disk */ +/* */ +/* FUNCTION: Gets user specified size for partition (maximum */ +/* is 32mb or largest contiguous freespace, which- */ +/* ever is smaller). Default is largest avail free */ +/* space. Partition is created to default size,unless*/ +/* user enters different size, but is not marked */ +/* active. User specified size must be smaller or */ +/* equal to the default size */ +/* */ +/* NOTES: Screen can be exited via the ESC command before */ +/* partition is created and nothing will change */ +/* */ +/* The following screen is managed */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³Create DOS partition ³ */ +/* 05³ ³ */ +/* 06³Current Fixed Disk Drive: # ³ */ +/* 07³ ³ */ +/* 08³Partition Status Type Start End Size³ */ +/* 09³ ³ */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³Total disk space is #### cylinders. ³ */ +/* 15³Maximum space available for partition ³ */ +/* 16³is #### cylinders. ³ */ +/* 17³ ³ */ +/* 18³Enter partition size............: [####]³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: input_dos_create */ +/* LINKAGE: input_dos_create(); */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if case statement */ +/* failure when branching to requested function */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* clear_screen */ +/* table_display */ +/* get_num_input */ +/* display */ +/* wait_for_ESC */ +/* make_partition */ +/* check_bad_tracks */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void input_dos_create() + +BEGIN + + unsigned input; + unsigned default_entry; + char temp; + char location; + + input = u(NUL); /* AC000 */ + /* clear off screen */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + /* Put up heading */ + display(menu_12); + + /* Setup and print current disk */ + insert[0] = cur_disk+1+'0'; + display(menu_5); + + /* Print ESC prompt */ + display(menu_11); + + /* Display partition table-it will return if no partitions there */ + table_display(); + + sprintf(insert,"%4.0d",total_mbytes[cur_disk]); + display(menu_15); + + /* Get the free space */ + temp = find_part_free_space(c(PRIMARY)); /* AC000 */ + + /* Is there any ?*/ + if (free_space[temp].mbytes_unused != u(0)) /* AC000 */ + + BEGIN + /* Display disk space */ + sprintf(insert,"%4.0d",total_mbytes[cur_disk]); + display(menu_15); + + /* Setup and print max partition size */ + + sprintf(insert,"%4.0d%3.0d%%", + free_space[temp].mbytes_unused, + free_space[temp].percent_unused); + display(menu_16); + + /* Force repeats on the input until something valid (Non-Zero return) */ + default_entry = (unsigned)free_space[temp].mbytes_unused; /* AC000 */ + valid_input = (FLAG)FALSE; /* AC000 */ + + while (!valid_input) + + BEGIN + /* Display prompt */ + sprintf(insert,"%4.0d",default_entry); + display(menu_39); + + input = get_large_num_input(default_entry,free_space[temp].mbytes_unused,free_space[temp].percent_unused,menu_39,u(0),error_13); /* AC000 */ + + /* Update default in case of error, so it gets displayed and used */ + /* if user presses CR only */ + + default_entry = input; + clear_screen(u(19),u(0),u(23),u(79)); /* AC000 */ + END + + if (input != ((unsigned)(ESC_FLAG))) /* AC000 */ + + BEGIN + /* Change input to cylinders */ + /* check to see if input was in percent or mbytes */ + + if (PercentFlag) /* AN000 */ + BEGIN /* AN000 */ + if (input == free_space[temp].percent_unused) + input = free_space[temp].space; /* AN000 */ + else /* AN000 */ + input = percent_to_cylinders(input,total_disk[cur_disk]); + END /* AN000 */ + else /* AN000 */ + BEGIN /* AN000 */ + if (input == free_space[temp].mbytes_unused) + input = free_space[temp].space; /* AN000 */ + else /* AN000 */ + input = (unsigned)mbytes_to_cylinders(input, + cur_disk); /* AN004 */ + END /* AN000 */ + + /* Initialize PecentFlag back to FALSE */ + PercentFlag = (FLAG)FALSE; /* AN000 */ + + /* Go create the partition */ + make_partition(input,temp,uc(NUL),c(PRIMARY)); /* AC000 */ + + /* clear off the old prompt */ + clear_screen(u(13),u(0),u(19),u(79)); /* AC000 */ + + /* Reissue the partition info */ + table_display(); + + /* display the "okay, we did it" msg */ + if (number_of_drives == uc(1)) /* AN000 */ + display(status_5); + else + BEGIN /* AN000 */ + clear_screen(u(16),u(0),u(23),u(79)); /* AN000 */ + display(status_12); /* AN000 */ + END /* AN000 */ + + wait_for_ESC(); + + reboot_flag = TRUE; + + END + END + return; +END + + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: EXT_CREATE_PARTITION */ +/* */ +/* DESCRIPTIVE NAME: Create EXTENDED DOS partition */ +/* */ +/* FUNCTION: Gets user specified size for EXTENDED partition */ +/* (Maximum is largest contiguous freespace). The */ +/* default is the largest available freespace. */ +/* space. Partition is created to default size, */ +/* unless user enters different size, but is not */ +/* marked as active. User specified size must be */ +/* smaller or equal to default size */ +/* */ +/* NOTES: Screen can be exited via the ESC command before */ +/* partition is created and nothing will change */ +/* */ +/* The following screen is managed */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³Create EXTENDED DOS partition ³ */ +/* 05³ ³ */ +/* 06³Current Fixed Disk Drive: # ³ */ +/* 07³ ³ */ +/* 08³Partition Status Type Start End Size³ */ +/* 09³ ³ */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³Total disk space is #### cylinders. ³ */ +/* 15³Maximum space available for partition ³ */ +/* 16³is #### cylinders. ³ */ +/* 17³ ³ */ +/* 18³Enter partition size............: [####]³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: EXTENDED_create_partition */ +/* LINKAGE: EXTENDED_create_partition(); */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if case statement */ +/* failure when branching to requested function */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* clear_screen */ +/* table_display */ +/* get_num_input */ +/* display */ +/* find_partition_type */ +/* wait_for_ESC */ +/* make_partition */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void ext_create_partition() + + +BEGIN + + unsigned input; + unsigned default_entry; + char temp; + + + input = u(NUL); /* AC000 */ + /* clear off screen */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + /* Put up heading */ + display(menu_17); + + /* Setup and print current disk */ + insert[0] = cur_disk+1+'0'; + display(menu_5); + + /* print ESC prompt */ + display(menu_11); + + /* Display partition table-it will return if no partitions there */ + table_display(); + + /* Go see if primary already exists and ext doesn't */ + if ((cur_disk == c(1)) || (find_partition_type(uc(DOS12))) || (find_partition_type(uc(DOS16))) || + (find_partition_type(uc(DOSNEW)))) /* AC000 */ + BEGIN + if (!find_partition_type(uc(EXTENDED))) /* AC000 */ + /* We can go create one now */ + BEGIN + + /* Get the free space */ + temp = find_part_free_space(c(EXTENDED)); /* AC000 */ + + /* Is there any ?*/ + if (free_space[temp].percent_unused != u(0)) /* AC000 */ + BEGIN + + /* Display disk space */ + sprintf(insert,"%4.0d",total_mbytes[cur_disk]); + display(menu_15); + + /* Setup and print max partition size */ + + sprintf(insert,"%4.0d%3.0d%%", + free_space[temp].mbytes_unused, + free_space[temp].percent_unused); + display(menu_16); + + /* Force repeats on the input until something valid (Non-Zero return) */ + /* Display MBytes unless MBytes == 0, then display percent */ + if (free_space[temp].mbytes_unused == u(0)) /* AN000 */ + BEGIN /* AN000 */ + default_entry = (unsigned)free_space[temp].percent_unused; /* AC000 */ + PercentFlag = (FLAG)TRUE; /* AN000 */ + END /* AN000 */ + else /* AN000 */ + BEGIN + default_entry = (unsigned)free_space[temp].mbytes_unused; /* AC000 */ + PercentFlag = (FLAG)FALSE; /* AN000 */ + END + + valid_input = (FLAG)FALSE; /* AC000 */ + + while (!valid_input) + BEGIN + /* Display prompt */ + if (!PercentFlag) /* AN000 */ + sprintf(insert,"%4.0d",default_entry); + else /* AN000 */ + sprintf(insert,"%3.0d%%",default_entry); /* AN000 */ + display(menu_42); /* AC000 */ + + input = get_large_num_input(default_entry,free_space[temp].mbytes_unused,free_space[temp].percent_unused,menu_42,u(0),error_13); /* AC000 */ + + /* Update default in case of error, so it gets displayed and used */ + /* if user presses CR only */ + + default_entry = input; + clear_screen(u(19),u(0),u(23),u(79)); /* AC000 */ + END + + if (input != ((unsigned)(ESC_FLAG))) /* AC000 */ + BEGIN + + /* Change input to cylinders */ + if (PercentFlag) /* AN000 */ + BEGIN /* AN000 */ + if (input == free_space[temp].percent_unused) + input = free_space[temp].space; /* AN000 */ + else /* AN000 */ + input = percent_to_cylinders(input,total_disk[cur_disk]); + END /* AN000 */ + else /* AN000 */ + BEGIN /* AN000 */ + if (input == free_space[temp].mbytes_unused) + input = free_space[temp].space; /* AN000 */ + else /* AN000 */ + input = (unsigned)mbytes_to_cylinders(input, + cur_disk); /* AN004 */ + END /* AN000 */ + + + /* Initialize PecentFlag back to FALSE */ + PercentFlag = (FLAG)FALSE; /* AN000 */ + + /* Go create the partition */ + make_partition(input,temp,uc(NUL),c(EXTENDED)); /* AC000 */ + + /* clear off the old prompt */ + clear_screen(u(13),u(0),u(19),u(79)); /* AC000 */ + + /* Display the updated partition information */ + table_display(); + + /* Hit esc to continue line */ + clear_screen(u(24),u(0),u(24),u(79)); /* AN000 */ + display(menu_46); /* AN000 */ + + /* Tell user we created it */ + display(status_6); + wait_for_ESC(); + + reboot_flag = (FLAG)TRUE; /* AC000 */ + + /* Go allow him to create disk volumes */ + volume_create(); + END + END + else + BEGIN + /* No room */ + display(error_10); + wait_for_ESC(); + END + END + else + BEGIN + /* Already have ext partition, tell user and bow out */ + display(error_9); + wait_for_ESC(); + END + END + else + BEGIN + /* don't have a primary partition yet, can't create an ext */ + display(error_19); + wait_for_ESC(); + END + + return; +END + + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: VOLUME_CREATE */ +/* */ +/* DESCRIPTIVE NAME: Create DOS disk volumes */ +/* */ +/* FUNCTION: Create the boot record/partition table structure */ +/* needed to support the DOS disk volume arch in */ +/* the EXTENDED partition. Volume is created to the */ +/* the default size (largest contiguous freespace or */ +/* 32mb, whichever smaller) or to the user specified */ +/* size (must be smaller or equal to default size). */ +/* The volume boot record is created, and the appro- */ +/* priate pointers in other volume partition tables */ +/* are generated. */ +/* */ +/* */ +/* NOTES: Screen can be exited via the ESC command before */ +/* partition is created and nothing will change */ +/* */ +/* The following screen is managed */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³Create DOS Disk Volume ³ */ +/* 01³ ³ */ +/* 02³Vol Start End Size ³ */ +/* 03³ # #### #### #### ³ */ +/* 04³ ³ */ +/* 05³ ³ */ +/* 06³ ³ */ +/* 07³ ³ */ +/* 08³ ³ */ +/* 09³ ³ */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³ ³ */ +/* 15³ ³ */ +/* 16³Total partition size is #### cylinders. ³ */ +/* 17³Maximum space available for disk ³ */ +/* 18³volume is #### cylinders. ³ */ +/* 19³ ³ */ +/* 20³Enter disk volume size..........: [####]³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: Volume_Create */ +/* LINKAGE: Volume_Create () */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if case statement */ +/* failure when branching to requested function */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* clear_screen */ +/* display */ +/* volume_display */ +/* get_num_input */ +/* wait_for_ESC */ +/* make_partition */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void volume_create() + +BEGIN + + unsigned input; + unsigned default_entry; + char temp; + char drive_letter; + char default_value; + char location; + char previous_location; + char ext_location; + unsigned char i; + char defined_drives; + char temp_cur_disk; + unsigned ext_part_percent_unused; /* AN000 */ + unsigned ext_part_num; /* AN000 */ + + input = u(NUL); /* AC000 */ + + /* clear off screen */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + /* Display header */ + display (menu_18); + + /* print ESC prompt */ + display(menu_11); + + /* Display volume info */ + drive_letter = volume_display(); + + /* Loop until done */ + input = u(NUL); /* AC000 */ + while (input != ((unsigned)(ESC_FLAG))) /* AC000 */ + + BEGIN + /* See if we have hit the max number of drives */ + defined_drives = c(0); /* AC000 */ + temp_cur_disk = cur_disk; + + /* Search both drives for defined drives */ + for (i = uc(0); i < number_of_drives; i++) /* AC000 */ + + BEGIN + cur_disk = ((char)(i)); + + /* See if there is a primary drive letter */ + if ((find_partition_type(uc(DOS12))) || (find_partition_type(uc(DOS16))) || (find_partition_type(uc(DOSNEW)))) /*AC000*/ + defined_drives++; + + /* See if extended partition on disk */ + if (find_partition_type(uc(EXTENDED))) /* AC000 */ + BEGIN + /* Get number of logical drives */ + defined_drives = defined_drives + get_num_logical_dos_drives(); + END + END + /* Restore cur_disk to original */ + cur_disk = temp_cur_disk; + + /* See if 26 or less drives total */ + if (defined_drives < c(24)) /* AC000 */ + BEGIN + location = find_ext_free_space(); + + /* find the number of the extended partiton to figure out percent */ + ext_part_num = find_partition_location(uc(EXTENDED)); /* AN000 */ + + /* Set the percent used */ + ext_part_percent_unused = + cylinders_to_percent(free_space[location].space, + ((part_table[cur_disk][ext_part_num].end_cyl-part_table[cur_disk][ext_part_num].start_cyl)+1)); /* AN000 */ + + /* Is there any ?*/ + if (ext_part_percent_unused != u(0)) /* AC000 */ + BEGIN + + /* Display disk space */ + sprintf(insert,"%4.0d",get_partition_size(uc(EXTENDED)) ); + display(menu_21); + + /* Setup and print max partition size */ + + sprintf(insert,"%4.0d%3.0d%%", + free_space[location].mbytes_unused, + ext_part_percent_unused); + display(menu_22); + + /* Force repeats on the input until something valid (Non-Zero return) */ + /* If MBytes unused is equel to zero, display percent unused */ + if (free_space[location].mbytes_unused == u(0)) /* AN000 */ + BEGIN /* AN000 */ + default_entry = (unsigned)ext_part_percent_unused; /* AN000 */ + PercentFlag = (FLAG)TRUE; /* AN000 */ + END /* AN000 */ + else /* AN000 */ + BEGIN /* AN000 */ + default_entry = (unsigned)free_space[location].mbytes_unused; /* AC000 */ + PercentFlag = (FLAG)FALSE; /* AN000 */ + END /* AN000 */ + + valid_input = (FLAG)FALSE; /* AC000 */ + + while (!valid_input) + BEGIN + /* Display prompt */ + if (!PercentFlag) /* AN000 */ + sprintf(insert,"%4.0d",default_entry); + else /* AN000 */ + sprintf(insert,"%3.0d%%",default_entry); /* AN000 */ + + display(menu_40); + + input = get_large_num_input(default_entry,free_space[location].mbytes_unused,ext_part_percent_unused,menu_40,u(0),error_12); /* AC000*/ + + /* Update default in case of error, so it gets displayed and used */ + /* if user presses CR only */ + + default_entry = input; + clear_screen(u(19),u(0),u(23),u(79)); /* AC000 */ + END + + if (input != ((unsigned)(ESC_FLAG))) /* AC000 */ + BEGIN + + /* Change input to cylinders */ + if (PercentFlag) /* AN000 */ + BEGIN /* AN000 */ + if (input == ext_part_percent_unused) + input = free_space[location].space; /* AN000 */ + else /* AN000 */ + input = percent_to_cylinders(input,((part_table[cur_disk][ext_part_num].end_cyl-part_table[cur_disk][ext_part_num].start_cyl)+1)); + END /* AN000 */ + else /* AN000 */ + BEGIN /* AN000 */ + if (input == free_space[location].mbytes_unused) + input = free_space[location].space; /* AN000 */ + else /* AN000 */ + input = (unsigned)mbytes_to_cylinders(input, + cur_disk); /* AN004 */ + END /* AN000 */ + + /* Initialize PecentFlag back to FALSE */ + PercentFlag = (FLAG)FALSE; /* AN000 */ + + /* go create the entry and find out where it put it */ + ext_location = make_volume(input,location); + + /* clear off the old prompt */ + clear_screen(u(15),u(0),u(19),u(79)); /* AC000 */ + + reboot_flag = (FLAG)TRUE; /* AC000 */ + + /* Display the updated partition information */ + drive_letter = volume_display(); + + /* Tell user we created it */ + display(status_7); + END + END + else + BEGIN + /* No space left or already max'd on the devices */ + /* Get rid of the size prompts */ + clear_screen(u(17),u(0),u(21),u(79)); /* AC000 */ + display(error_20); + volume_display(); + wait_for_ESC(); /* KWC, 11-01-87 */ + input = u(ESC_FLAG); /* KWC, 11-01-87 */ + END + END + else + BEGIN + /* Reached the maximum */ + /* Get rid of the size prompts */ + clear_screen(u(17),u(0),u(21),u(79)); /* AC000 */ + display(error_27); + /* Force an exit with ESC */ + wait_for_ESC(); /* KWC, 11-01-87 */ + input = u(ESC_FLAG); /* KWC, 11-01-87 */ + END + END + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + return; +END + 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 @@ + +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "extern.h" /* AN000 */ + + +/* */ +void write_info_to_disk() + +BEGIN + +char i; +unsigned char j; +unsigned extended_location; +char extended_index; +char temp; +char first_found; +char changed_flag; +char temp_disk; + + + temp = c(NUL); /* AN009 */ + temp_disk = cur_disk; + /* See if need to update the master boot record */ + for (j = uc(0); j < number_of_drives; j++) /* AC000 */ + BEGIN + + /* Save disk number */ + cur_disk = ((char)(j)); + + /* See if there were any errors on that drive */ + if (good_disk[j]) + BEGIN + for (i=c(0); i < c(4); i++) /* AC000 */ + BEGIN + if (part_table[j][i].changed) + BEGIN + write_master_boot_to_disk(j); + break; + END + END + /* See if the extended partition exists - if not, don't fool with the logical*/ + /* drives - there is nothing to point to thier structures. Otherwise you get into */ + /* a chicken and the egg situation, where you are trying to write out 'deletes' of */ + /* the logical drive based on the start of the extended partition, but there isn't one */ + /* because it has already been deleted already. Bad things happen - PTM P941 */ + + if (find_partition_type(uc(EXTENDED))); /* AC000 */ + BEGIN + /* See if any extended partitions need to be updated */ + changed_flag = FALSE; + + for (i=c(0);i > 24)); /* AC000 */ + boot_record[0x1C8+(index)] = uc(((long_temp & 0x00FF0000l) >> 16)); /* AC000 */ + boot_record[0x1C7+(index)] = uc(((long_temp & 0x0000FF00l) >> 8)); /* AC000 */ + boot_record[0x1C6+(index)] = uc((long_temp & 0x000000FFl)); /* AC000 */ + + + /* Number of sectors */ + long_temp = part_table[disk][i].num_sec; + boot_record[0x1CD+(index)] = uc(long_temp >> 24); /* AC000 */ + boot_record[0x1CC+(index)] = uc((long_temp & 0x00FF0000l) >> 16); /* AC000 */ + boot_record[0x1CB+(index)] = uc((long_temp & 0x0000FF00l) >> 8); /* AC000 */ + boot_record[0x1CA+(index)] = uc(long_temp & 0x000000FFl); /* AC000 */ + END + END + boot_record[510] = uc(0x55); /* AC000 */ + boot_record[511] = uc(0xAA); /* AC000 */ + + return(write_boot_record(u(0),disk)); /* AC000 */ +END + +/* */ +char write_ext_boot_to_disk(entry,disk) + +char entry; +unsigned char disk; +BEGIN + +char i; +unsigned j; +unsigned long long_temp; +unsigned index; +char location; +char next_drive; +char pointer; +char write; + + /* Clean out the boot_record */ + for (j=u(0);j < u(BYTES_PER_SECTOR); j++) /* AC000 */ + BEGIN + boot_record[j] = uc(0); /* AC000 */ + END + + /* First - setup the logical devices */ + /* See if it has been deleted - if so, leave entries as zero */ + /* Otherwise - go unscramble everything out of the arrays */ + + if (ext_table[disk][sort[entry]].sys_id != uc(0)) /* AC000 */ + BEGIN + /* Get boot ind */ + boot_record[0x1BE] = ext_table[disk][sort[entry]].boot_ind; + + /* Start head */ + boot_record[0x1BF] = ext_table[disk][sort[entry]].start_head; + + /* Start sector - scramble it to INT 13 format*/ + boot_record[0x1C0] = (ext_table[disk][sort[entry]].start_sector & 0x3F) | + ((ext_table[disk][sort[entry]].start_cyl/256) << 6); + + /* Start cyl - scramble it to INT 13 format*/ + boot_record[0x1C1] = ((unsigned char)(ext_table[disk][sort[entry]].start_cyl%256)); + + /* System id */ + boot_record[0x1C2]= ext_table[disk][sort[entry]].sys_id; + + /* End head */ + boot_record[0x1C3] = ext_table[disk][sort[entry]].end_head; + + /* End sector - scramble it to INT 13 format*/ + boot_record[0x1C4] = (ext_table[disk][sort[entry]].end_sector & 0x3F) | + ((ext_table[disk][sort[entry]].end_cyl/256) << 6); + + /* End cyl - scramble it to INT 13 format*/ + boot_record[0x1C5] = ((unsigned char)(ext_table[disk][sort[entry]].end_cyl%256)); + + /* Relative sectors */ + long_temp = ext_table[disk][sort[entry]].rel_sec; + boot_record[0x1C9] = uc((long_temp >> 24)); /* AC000 */ + boot_record[0x1C8] = uc(((long_temp & 0x00FF0000l) >> 16)); /* AC000 */ + boot_record[0x1C7] = uc(((long_temp & 0x0000FF00l) >> 8)); /* AC000 */ + boot_record[0x1C6] = uc((long_temp & 0x000000FFl)); /* AC000 */ + + /* Number of sectors */ + long_temp = ext_table[disk][sort[entry]].num_sec; + boot_record[0x1CD] = uc((long_temp >> 24)); /* AC000 */ + boot_record[0x1CC] = uc(((long_temp & 0x00FF0000l) >> 16)); /* AC000 */ + boot_record[0x1CB] = uc(((long_temp & 0x0000FF00l) >> 8)); /* AC000 */ + boot_record[0x1CA] = uc((long_temp & 0x000000FFl)); /* AC000 */ + END + + /* set up pointer to next logical drive unless this is # 23 */ + if (entry != c(22)) /* AC000 */ + BEGIN + /* Find the drive to be pointed to */ + pointer = entry+1; + + /* Handle the special case of a deleted or empty first entry in partition*/ + if (entry == c(23)) /* AC000 */ + BEGIN + pointer = c(0); /* AC000 */ + END + for (i = pointer; i > 24)); /* AC000 */ + boot_record[0x1D8] = uc(((long_temp & 0x00FF0000l) >> 16)); /* AC000 */ + boot_record[0x1D7] = uc(((long_temp & 0x0000FF00l) >> 8)); /* AC000 */ + boot_record[0x1D6] = uc((long_temp & 0x000000FFl)); /* AC000 */ + + /* Number of sectors in the next volume*/ + long_temp = ((unsigned long)(ext_table[disk][next_drive].end_cyl - ext_table[disk][next_drive].start_cyl+1)) + * max_head[disk] * max_sector[disk]; + boot_record[0x1DD] = uc((long_temp >> 24)); /* AC000 */ + boot_record[0x1DC] = uc(((long_temp & 0x00FF0000l) >> 16)); /* AC000 */ + boot_record[0x1DB] = uc(((long_temp & 0x0000FF00l) >> 8)); /* AC000 */ + boot_record[0x1DA] = uc((long_temp & 0x000000FFl)); /* AC000 */ + END + END + boot_record[510] = uc(0x55); /* AC000 */ + boot_record[511] = uc(0xAA); /* AC000 */ + + /* Write the boot record out */ + if (entry != c(23)) /* AC000 */ + BEGIN + write = write_boot_record(ext_table[disk][sort[entry]].start_cyl,disk); + END + else + BEGIN + /* Write the special case of the first entry only having a pointer */ + write = write_boot_record(ext_table[disk][23].start_cyl,disk); + END + return(write); +END + + + + 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 @@ + + +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "stdio.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "doscall.h" /* AN000 */ +#include "fdiskmsg.h" /* AN000 */ +#include "ctype.h" /* AN000 */ + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: DISPLAY */ +/* */ +/* DESCRIPTIVE NAME: Display full screen interface messages */ +/* */ +/* FUNCTION: Displays messages and handles control characters */ +/* */ +/* NOTES: */ +/* FDISK MESSAGES */ +/* Portions of the screen that are handled in the msg are */ +/* indicated on the listing of the screen with the message */ +/* name given. If the text message is defined in another */ +/* screen, then the name is followed by a "#" character */ +/* */ +/* NOTE TO TRANSLATORS The characters inside the <> and the [] */ +/* are control characters and should not be translated. The */ +/* Control characters are defined as follows: */ +/* */ +/* - Highlight the following text */ +/* - Regular text */ +/* - Blink the following text */ +/* - Turn blinking off */ +/* - Print YES character, as set by define */ +/* - Print NO character, as set by define */ +/* - Sound the beep */ +/* - Save cursor position for later use */ +/* - Insert character from insert[] string. This string */ +/* must be set up prior to displaying the message. The */ +/* first will insert Insert[0], the second */ +/* insert[1], etc....This will move the cursor one */ +/* postition. The insert[] string will be initialized */ +/* */ +/* Multiple control characters can be between the <>. */ +/* */ +/* The ^####^indicates Row and column for the text and has the */ +/* format of [rrcc] where the numbers are decimal and zero */ +/* based (first row/col is 00. The numbers are in decimal, */ +/* and must be 2 characters, which means rows/cols 0-9 should */ +/* be listed as 00-09. For example, the 5th row, 3rd column */ +/* on the screen would be listed as ^0402^. */ +/* */ +/* The column number is always the column desired. The row */ +/* number is an offset from the previous row. For example, if */ +/* the text just printed is on row 6, and the next text should */ +/* be printed 2 rows down in column 0, then the control strin */ +/* would be ^0201^. The first row specified in the message is */ +/* assumed to be based off of row 0, it would actually specify */ +/* the actual row for the start of the msg to be printed. */ +/* */ +/* ENTRY POINTS: display(*message_name); */ +/* LINKAGE: Near call */ +/* */ +/* INPUT: char *message_name */ +/* */ +/* EXIT-NORMAL: */ +/* */ +/* EXIT-ERROR: */ +/* */ +/* EFFECTS: */ +/* input_row changed if control character in message */ +/* input_col changed if control character in message */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/* viowrtcharstratt(); */ +/******************** END OF SPECIFICATIONS ********************/ +/* */ +void display(s) + +char far *s; + +BEGIN + unsigned row; + unsigned col; + char attribute; + char far *attribute_ptr = &attribute; + unsigned insert_count; + + + /* Initialize row and col, and index into array */ + row = u(0); /* AC000 */ + col = u(0); /* AC000 */ + insert_count = u(0); /* AC000 */ + /* check for a request to display a null string */ + if (*s == c('\0')) /* AC000 */ + BEGIN + /* Message string error */ + insert[0] = c('1'); /* AC000 */ + display(debug_msg); + END + else + BEGIN + /* There is data there, lets go handle it */ + + attribute = c(0x00); /* AC000 */ + /* Go until end of string */ + while (*s != c('\0')) /* AC000 */ + BEGIN + + /* Check for any imbedded control strings */ + switch (*s) + BEGIN + /* Check for control characters */ + case '<': + BEGIN + s++; + while ( (*s != c('>')) && (*s != c('\0')) ) /* AC000 */ + BEGIN + switch (*s++) + BEGIN + case 'H': if (mono_flag == TRUE) /* AN006 */ + attribute = (attribute & 0x80) | HIWHITE_ON_BLACK; /* AN006 */ + else /* AN006 */ + attribute = (attribute & 0x80) | HIWHITE_ON_BLUE; /* AC006 */ + break; + + + case 'R': if (mono_flag == TRUE) /* AN006 */ + attribute = (attribute & 0x80) | GRAY_ON_BLACK; /* AN006 */ + else /* AN006 */ + attribute = (attribute & 0x80) | WHITE_ON_BLUE; /* AC006 */ + break; + + case 'B': attribute |= 0x80; + break; + + case 'O': attribute &= 0x7F; + break; + + case 'W': DOSBEEP(u(900),u(400)); /* AC000 */ + break; + + case 'I': + BEGIN + /* display next element in the array */ + if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */ + attribute = c(GRAY_ON_BLACK); /* AN006 */ + if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */ + attribute = c(WHITE_ON_BLUE); /* AC006 */ + VIOWRTCHARSTRATT(pinsert+insert_count++,u(1),row,col++,attribute_ptr,u(0)); + break; + END + + + case 'Y': /* AC011 */ + BEGIN + /* display YES character in next location */ + *--s = c(Yes); /* AC000 */ + if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */ + attribute = c(GRAY_ON_BLACK); /* AN006 */ + if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */ + attribute = c(WHITE_ON_BLUE); /* AC006 */ + VIOWRTCHARSTRATT(s,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */ + *s++ = c(Yes); /* AC000 AC011 */ + break; + END + + case 'N': /* AC011 */ + BEGIN + /* display NO character in next location */ + *--s = c(No); /* AC000 */ + if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */ + attribute = c(GRAY_ON_BLACK); /* AN006 */ + if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */ + attribute = c(WHITE_ON_BLUE); /* AC006 */ + VIOWRTCHARSTRATT(s,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */ + *s++ = c(No); /* AC000 AC011 */ + break; + END + + + case 'S': + BEGIN + input_row = row; + input_col = col; + break; + END + + + case 'C': + BEGIN + /* Clear from current position to end of line */ + clear_screen(row,col,row,u(79)); /* AC000 */ + break; + END + + case '\0': + BEGIN + /* Message string error - string ended in the middle of control string*/ + insert[0] = c('7'); /* AC000 */ + display(debug_msg); + break; + END + + default: + BEGIN + /* Message string error - no valid control char found */ + insert[0] = c('6'); /* AC000 */ + display(debug_msg); + break; + END + END /* Switch */ + END /* While */ + /* Get the pointer past the '>' */ + s++; + break; + END /* control characters */ + + /* Check for row,col */ + case '^': /* AC000 */ + BEGIN + s++; + /* determine the row to put the message on */ + if ( !isdigit(*s) ) + BEGIN + /* Message string error */ + insert[0] = c('2'); /* AC000 */ + display(debug_msg); + END + else + BEGIN + row = row+((unsigned)(((*s++ - '0')*10))); + if ( !isdigit(*s) ) + BEGIN + /* Message string error */ + insert[0] = c('2'); /* AC000 */ + display(debug_msg); + END + else + BEGIN + row = row+((unsigned)(*s++ - '0')); + /* determine the col to put the message on */ + if ( !isdigit(*s) ) + BEGIN + /* Message string error */ + insert[0] = c('3'); /* AC000 */ + display(debug_msg); + END + else + BEGIN + col = ((unsigned)(*s++ - '0')); + if ( !isdigit(*s) ) + BEGIN + /* Message string error */ + insert[0] = c('3'); /* AC000 */ + display(debug_msg); + END + else + BEGIN + col = ((unsigned)((col* 10) + (*s++ - '0'))); + if (*s++ != c('^')) /* AC000 */ + BEGIN + /* Message string error */ + insert[0] = c('4'); /* AC000 */ + display(debug_msg); + END /* 2nd sq bracket */ + END /* 2nd digit col */ + END /* 1st digit col */ + END /* 2nd digit row */ + END /* 1st digit row */ + break; + END + /* Handle anything else */ + + + default: + BEGIN + /* See if attribute set to anything */ + if ((mono_flag == FALSE) && (attribute == c(0x00))) /* AN006 */ + attribute = c(WHITE_ON_BLUE); /* AC006 */ + if ((mono_flag == TRUE) && (attribute == c(0x00))) /* AN006 */ + attribute = c(GRAY_ON_BLACK); /* AN006 */ + VIOWRTCHARSTRATT(s++,u(1),row,col++,attribute_ptr,u(0)); /* AC000 */ + break; + END + END + END /* End of string check */ + END /* No characters in string check */ + return; + +END + +/* */ + +void number_in_msg(number,start) + +XFLOAT number; +unsigned start; + +BEGIN + +char mbytes[32]; + + /* Divide the space down and get it into decimal */ + sprintf(mbytes,"%4.0d",number); + insert[start+0] = mbytes[0]; + insert[start+1] = mbytes[1]; + insert[start+2] = mbytes[2]; + insert[start+3] = mbytes[3]; + + return; + +END + + +/* */ +void percent_in_msg(number,start) /* AN000 */ + +unsigned number; /* AN000 */ +unsigned start; /* AN000 */ + +BEGIN /* AN000 */ + + +char percent[32]; + + /* Divide the space down and get it into decimal */ + sprintf(percent,"%3.0d%%",number); /* AC000 */ + insert[start+0] = percent[0]; /* AC000 */ + insert[start+1] = percent[1]; /* AC000 */ + insert[start+2] = percent[2]; /* AC000 */ + insert[start+3] = percent[3]; /* AC000 */ + + return; + +END /* AN000 */ + +/* */ +void string_in_msg(string_ptr,start) /* AN000 */ + +char far *string_ptr; /* AN000 */ +unsigned start; /* AN000 */ + +BEGIN /* AN000 */ + +unsigned i; /* AN000 */ + + /* init the 8 spots to blanks */ + for (i = u(0); i < u(8);i++) /* AN000 */ + BEGIN /* AN000 */ + insert[start+i] = c(' '); /* AN000 */ + END /* AN000 */ + /* Put characters into the array */ + BEGIN /* AN000 */ + insert[start+0] = *(string_ptr+0); /* AN000 */ + insert[start+1] = *(string_ptr+1); /* AN000 */ + insert[start+2] = *(string_ptr+2); /* AN000 */ + insert[start+3] = *(string_ptr+3); /* AN000 */ + insert[start+4] = *(string_ptr+4); /* AN000 */ + insert[start+5] = *(string_ptr+5); /* AN000 */ + insert[start+6] = *(string_ptr+6); /* AN000 */ + insert[start+7] = *(string_ptr+7); /* AN000 */ + END /* AN000 */ + return; /* AN000 */ +END /* AN000 */ + + +/* */ +void volume_in_msg(string_ptr,start) /* AN000 */ + +char far *string_ptr; /* AN000 */ +unsigned start; /* AN000 */ + +BEGIN /* AN000 */ + +unsigned i; /* AN000 */ + + /* init the 11 spots to blanks */ + for (i = u(0); i < u(11);i++) /* AN000 */ + BEGIN /* AN000 */ + insert[start+i] = c(' '); /* AN000 */ + END /* AN000 */ + /* Put characters into the array */ + BEGIN /* AN000 */ + insert[start+0] = *(string_ptr+0); /* AN000 */ + insert[start+1] = *(string_ptr+1); /* AN000 */ + insert[start+2] = *(string_ptr+2); /* AN000 */ + insert[start+3] = *(string_ptr+3); /* AN000 */ + insert[start+4] = *(string_ptr+4); /* AN000 */ + insert[start+5] = *(string_ptr+5); /* AN000 */ + insert[start+6] = *(string_ptr+6); /* AN000 */ + insert[start+7] = *(string_ptr+7); /* AN000 */ + insert[start+8] = *(string_ptr+8); /* AN000 */ + insert[start+9] = *(string_ptr+9); /* AN000 */ + insert[start+10] = *(string_ptr+10); /* AN000 */ + END /* AN000 */ + return; /* AN000 */ +END /* AN000 */ + 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 @@ +/* dos.h + * + * Defines the structs and unions used to handle the input and output + * registers for the DOS interface routines defined in the V2.0 to V3.0 + * compatability package. It also includes macros to access the segment + * and offset values of MS C "far" pointers, so that they may be used by + * these routines. + * + */ + +/* word registers */ + +struct WORDREGS { + unsigned ax; + unsigned bx; + unsigned cx; + unsigned dx; + unsigned si; + unsigned di; + unsigned cflag; + }; + +/* byte registers */ + +struct BYTEREGS { + unsigned char al, ah; + unsigned char bl, bh; + unsigned char cl, ch; + unsigned char dl, dh; + }; + +/* general purpose registers union - overlays the corresponding word and + * byte registers. + */ + +union REGS { + struct WORDREGS x; + struct BYTEREGS h; + }; + +/* segment registers */ + +struct SREGS { + unsigned es; + unsigned cs; + unsigned ss; + unsigned ds; + }; + +/* dosexterror struct */ + +struct DOSERROR { + int exterror; + char class; + char action; + char locus; + }; + +/* macros to break MS C "far" pointers into their segment and offset + * components + */ + +#define FP_SEG(fp) (*((unsigned *)&(fp) + 1)) +#define FP_OFF(fp) (*((unsigned *)&(fp))) + +/* function declarations for those who want strong type checking + * on arguments to library function calls + */ + +#ifdef LINT_ARGS /* arg. checking enabled */ + +int bdos(int, unsigned int, unsigned int); +int dosexterr(struct DOSERROR *); +int intdos(union REGS *, union REGS *); +int intdosx(union REGS *, union REGS *, struct SREGS *); +int int86(int, union REGS *, union REGS *); +int int86x(int, union REGS *, union REGS *, struct SREGS *); +void segread(struct SREGS *); + +#endif /* LINT_ARGS */ + \ 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 @@ +/*static char *SCCSID = "@(#)doscall.h 6.25 86/06/03";*/ +/*** doscall.h + * + * Shirleyd + * (C) Copyright 1988 Microsoft Corporation + * 12/13/85 + * + * Description: + * + * Function declarations to provide strong type checking + * on arguments to DOS 4.0 function calls + * + * Major Modifications 04/28/86 by S. S. + * Major Modifications 04/30/86 by K. D. + * Minor Modifications 04/30/86 by S. S. (DosTimerAsync/Start) + * Major Modifications 05/01/86 by S. S. (fix Sems,add Queues) + * Minor Modifications 05/14/86 by K. D. (DosFileLocks) + * Minor Modifications 05/16/86 by S. S. (NLS routines) + * Minor Modifications 05/20/86 by S. S. (Get/SetPrty,CreateThread) + * Minor Modifications 05/20/86 by S. S. (add DosSetVector) + * Minor Modifications 06/02/86 by S. S. (GetHugeShift, MuxSemWait) + * Major Modifications 06/03/86 by S. S. (Mouse calls) + */ + + + +/*** CursorData - structure that contains the characteristics + * of the cursor + */ + +struct CursorData { + unsigned cur_start; /* Cursor start line */ + unsigned cur_end; /* Cursor end line */ + unsigned cur_width; /* Cursor width */ + unsigned cur_attribute; /* Cursor attribute */ + }; + + + +/*** DateTime - structure for date and time */ + +struct DateTime { + unsigned char hour; /* current hour */ + unsigned char minutes; /* current minute */ + unsigned char seconds; /* current second */ + unsigned char hundredths; /* current hundredths of a second */ + unsigned char day; /* current day */ + unsigned char month; /* current month */ + unsigned year; /* current year */ + unsigned timezone; /* minutes of time west of GMT */ + unsigned char day_of_week; /* current day of week */ + }; + + + +/*** FileFindBuf - structure of area where the filesystem driver + * returns the results of the search + */ + +struct FileFindBuf { + unsigned create_date; /* date of file creation */ + unsigned create_time; /* time of file creation */ + unsigned access_date; /* date of last access */ + unsigned access_time; /* time of last access */ + unsigned write_date; /* date of last write */ + unsigned write_time; /* time of last write */ + unsigned long file_size; /* file size (end of data) */ + unsigned long falloc_size; /* file allocated size */ + unsigned attributes; /* attributes of the file */ + char string_len; /* returned length of ascii name str. */ + /* length does not include null byte */ + char file_name[12]; /* name string */ + }; + + +/*** FileStatus - structure of information list used by DosQFileInfo */ + +struct FileStatus { + unsigned create_date; /* date of file creation */ + unsigned create_time; /* time of file creation */ + unsigned access_date; /* date of last access */ + unsigned access_time; /* time of last access */ + unsigned write_date; /* date of last write */ + unsigned write_time; /* time of last write */ + unsigned long file_size; /* file size (end of data) */ + unsigned long falloc_size; /* file allocated size */ + unsigned block_size; /* blocking factor */ + unsigned attributes; /* attributes of the file */ + }; + + +/*** FSAllocate - structure of file system allocation */ + +struct FSAllocate { + unsigned long filsys_id; /* file system ID */ + unsigned long sec_per_unit; /* number sectors per allocation unit */ + unsigned long num_units; /* number of allocation units */ + unsigned long avail_units; /* avaliable allocation units */ + unsigned bytes_sec; /* bytes per sector */ + }; + + + +/*** KbdStatus - structure in which the keyboard support will information */ + +struct KbdStatus { + unsigned length; /* length in words of data structure */ + unsigned bit_mask; /* bit mask */ + unsigned turn_around_char; /* turnaround character */ + unsigned interim_char_flags; /* interim character flags */ + unsigned shift_state; /* shift state */ + }; + + + +/*** KeyData - structure that contains character data */ + +struct KeyData { + char char_code; /* ASCII character code */ + char scan_code; /* scan code */ + char status; /* indicates state of the character */ + unsigned shift_state; /* state of the shift keys */ + unsigned long time; /* time stamp of the keystroke */ + }; + + + +/*** ModeData - structure that contains characteristics of the mode */ + +struct ModeData { + unsigned length; /* Length of structure */ + char type; /* Text or graphics */ + char color; /* Color or monochrome */ + unsigned col; /* Column resolution */ + unsigned row; /* Row resolution */ + unsigned hres; /* horizontal resolution */ + unsigned vres; /* vertical resolution */ + }; + + + + +/*** ProcIDsArea - structure of the address of the area where the + * ID's will be placed + */ + +struct ProcIDsArea { + unsigned procid_cpid; /* current process' process ID */ + unsigned procid_ctid; /* current process' thread ID */ + unsigned procid_ppid; /* process ID of the parent */ + }; + + + +/*** PVBData - structure that contains information about the + * physical video buffer + */ + +struct PVBData { + unsigned pvb_size; /* size of the structure */ + unsigned long pvb_ptr; /* returns pointer to the pvb buffer */ + unsigned pvb_length; /* length of PVB */ + unsigned pvb_rows; /* buffer dimension (rows) */ + unsigned pvb_cols; /* buffer dimension (cols) */ + char pvb_type; /* color or mono */ + }; + + + +/*** SchedParmsArea - structure of address in which the scheduler + * parms will be placed + */ + +struct SchedParmsArea { + char dynvar_flag; /* dynamic variation flag, 1=enabled */ + char maxwait; /* maxwait (sec) */ + unsigned mintime; /* minimum timeslice (ms) */ + unsigned maxtime; /* maximum timeslice (ms) */ + }; + + + +/*** Tasking Processes: + * + * DosCreateThread + * DosCwait + * DosEnterCritSec + * DosExecPgm + * DosExit + * DosExitCritSec + * DosExitList + * DosGetPID + * DosGetPrty + * DosGetSchedParms + * DosSetFgnd + * DosSetPrty + * DosKillProcess + */ + + + +/*** DosCreateThread - Create another thread of execution + * + * Creates an asynchronous thread of execution under the + * current process + */ + +extern unsigned far pascal DOSCREATETHREAD ( + void (far *)(void), /* Starting Address for new thread */ + unsigned far *, /* Address to put new thread ID */ + unsigned char far * ); /* Address of stack for new thread */ + + + +/*** DosCwait - Wait for child termination + * + * Places the current thread in a wait state until a child process + * has terminated, then returns the ending process' process ID and + * termination code. + */ + +extern unsigned far pascal DOSCWAIT ( + unsigned, /* Action (execution) codes */ + unsigned, /* Wait options */ + unsigned far *, /* Address to put result code */ + unsigned far *, /* Address to put process ID */ + unsigned ); /* ProcessID of process to wait for */ + + + +/*** DosEnterCritSec - Enter critical section of execution + * + * Disables thread switching for the current process + */ + +extern void far pascal DOSENTERCRITSEC (void); + + + +/*** DosExecPgm - Execute a program + * + * Allows a program to request another program be executed as a + * child process. The requestor's process may optionally continue + * to execute asynchronous to the new program + */ + +extern unsigned far pascal DOSEXECPGM ( + unsigned, /* 0=synchronous, 1=asynchronous with */ + /* return code discarded, 2=async */ + /* with return code saved */ + unsigned, /* Trace process */ + char far *, /* Address of argument string */ + char far *, /* Address of environment string */ + unsigned far *, /* Address to put Process ID */ + char far * ); /* Address of program filename */ + + + +/*** DosExit - Exit a program + * + * This call is issued when a thread completes its execution. + * The current thread is ended. + */ + +extern void far pascal DOSEXIT ( + unsigned, /* 0=end current thread, 1=end all */ + unsigned ); /* Result Code to save for DosCwait */ + + + +/*** DosExitCritSec - Exit critical section of execution + * + * Re-enables thread switching for the current process + */ + +extern void far pascal DOSEXITCRITSEC (void); + + + +/*** DosExitList - Routine list for process termination + * + * Maintains a list of routines which are to be executed when the + * current process ends, normally or otherwise + */ + +extern unsigned far pascal DOSEXITLIST ( + unsigned, /* Function request code */ + void (far *)(void) ); /* Address of routine to be executed */ + + + +/*** DosGetPID - Return process ID + * + * Returns the current process's process ID (PID), thread ID, + * and the PID of the process that spawned it + */ + +extern void far pascal DOSGETPID ( + struct ProcIDsArea far *); /* ProcID structure */ + + + +/*** DosGetPrty - Get Process's Priority + * + * Allows the caller to learn the priority of a process or thread + */ + +extern unsigned far pascal DOSGETPRTY ( + unsigned, /* Indicate thread or process ID */ + unsigned far *, /* Address to put priority */ + unsigned ); /* PID of process/thread of interest */ + + + +/*** DosGetSchedParms - Get scheduler's parameters + * + * Gets the scheduler's current configuration parameters + */ + +extern void far pascal DOSGETSCHEDPARMS ( + struct SchedParmsArea far * ); /* Address to put parameters */ + + + +/*** DosSetFgnd - Set Foreground Process + * + * Allows the session manager to designate which process + * is to receive favored dispatching + */ + +extern unsigned far pascal DOSSETFGND ( + unsigned ); /* Process ID of target process */ + + + +/*** DosSetPrty - Set Process Priority + * + * Allows the caller to change the base priority or priority + * class of a child process or a thread in the current process + */ + +extern unsigned far pascal DOSSETPRTY ( + unsigned, /* Indicate scope of change */ + unsigned, /* Priority class to set */ + unsigned, /* Priority delta to apply */ + unsigned ); /* Process or Thread ID of target */ + + + +/*** DosKillProcess - Terminate a Process + * + * Terminates a child process and returns its termination code + * to its parent (if any) + */ + +extern unsigned far pascal DOSKILLPROCESS ( + unsigned, /* 0=kill child processes also, */ + /* 1=kill only indicated process */ + unsigned ); /* Process ID of process to end */ + + + + +/*** Asynchronous Notification (Signals): + * + * DosHoldSignal + * DosSendSignal + * DosSetSigHandler + */ + + + +/*** DosHoldSignal - Disable / Enable signals + * + * Used to termporarily disable or enable signal processing + * for the current process. + */ + +extern void far pascal DOSHOLDSIGNAL ( + unsigned ); /* 0=enable signal, 1=disable signal */ + + + +/*** DosSendSignal - Issue signal + * + * Used to send a signal event to an arbitrary process or + * command subtree. + */ + +extern unsigned far pascal DOSSENDSIGNAL ( + unsigned, /* Process ID to signal */ + unsigned, /* 0=notify entire subtree, 1=notify */ + /* only the indicated process */ + unsigned, /* Signal argument */ + unsigned ); /* Signal number */ + + + +/*** DosSetSigHandler - Handle Signal + * + * Notifies CP/DOS of a handler for a signal. It may also be used + * to ignore a signal or install a default action for a signal. + */ + +extern unsigned far pascal DOSSETSIGHANDLER ( + void (far *)(), /* Signal handler address */ + unsigned long far *, /* Address of previous handler */ + unsigned far *, /* Address of previous action */ + unsigned, /* Indicate request type */ + unsigned ); /* Signal number */ + + + + +/*** Pipes: + * + * DosMakePipe + */ + + + +/*** DosMakePipe - Create a Pipe */ + +extern unsigned far pascal DOSMAKEPIPE ( + unsigned far *, /* Addr to place the read handle */ + unsigned far *, /* Addr to place the write handle */ + unsigned ); /* Size to reserve for the pipe */ + + + + +/*** Queues: + * + * DosCloseQueue + * DosCreateQueue + * DosOpenQueue + * DosPeekQueue + * DosPurgeQueue + * DosQueryQueue + * DosReadQueue + * DosWriteQueue + */ + +/*** DosCloseQueue - Close a Queue + * + * close a queue which is in use by the requesting process + * + */ + +extern unsigned far pascal DOSCLOSEQUEUE ( + unsigned ) ; /* queue handle */ + + +/*** DosCreateQueue - Create a Queue + * + * creates a queue to be owned by the requesting process + * + */ + +extern unsigned far pascal DOSCREATEQUEUE ( + unsigned far *, /* queue handle */ + unsigned, /* queue priority */ + char far * ) ; /* queue name */ + + +/*** DosOpenQueue - Open a Queue + * + * opens a queue for the current process + * + */ + +extern unsigned far pascal DOSOPENQUEUE ( + unsigned far *, /* PID of queue owner */ + unsigned far *, /* queue handle */ + char far * ) ; /* queue name */ + + + +/*** DosPeekQueue - Peek at a Queue + * + * retrieves an element from a queue without removing it from the queue + * + */ + +extern unsigned far pascal DOSPEEKQUEUE ( + unsigned, /* queue handle */ + unsigned long far *, /* pointer to request */ + unsigned far *, /* length of datum returned */ + unsigned long far *, /* pointer to address of datum */ + unsigned far *, /* indicator of datum returned */ + unsigned char, /* wait indicator for empty queue */ + unsigned char far *, /* priority of element */ + unsigned long ) ; /* semaphore handle */ + + + +/*** DosPurgeQueue - Purge a Queue + * + * purges all elements from a queue + * + */ + +extern unsigned far pascal DOSPURGEQUEUE ( + unsigned ) ; /* queue handle */ + + + +/*** DosQueryQueue - Query size of a Queue + * + * returns the number of elements in a queue + * + */ + +extern unsigned far pascal DOSQUERYQUEUE ( + unsigned, /* queue handle */ + unsigned far * ); /* pointer for number of elements */ + + + +/*** DosReadQueue - Read from a Queue + * + * retrieves an element from a queue + * + */ + +extern unsigned far pascal DOSREADQUEUE ( + unsigned, /* queue handle */ + unsigned long far *, /* pointer to request */ + unsigned far *, /* length of datum returned */ + unsigned long far *, /* pointer to address of datum */ + unsigned, /* indicator of datum returned */ + unsigned char, /* wait indicator for empty queue */ + unsigned char far *, /* priority of element */ + unsigned long ) ; /* semaphore handle */ + + + +/*** DosWriteQueue - Write to a Queue + * + * adds an element to a queue + * + */ + +extern unsigned far pascal DOSWRITEQUEUE ( + unsigned, /* queue handle */ + unsigned, /* request */ + unsigned, /* length of datum */ + unsigned char far *, /* address of datum */ + unsigned char ); /* priority of element */ + + + + + +/*** Semaphores: + * + * DosSemClear + * DosSemRequest + * DosSemSet + * DosSemWait + * DosSemSetWait + * DosMuxSemWait + * DosCloseSem + * DosCreatSem + * DosOpenSem + */ + + + +/*** DosSemClear - Unconditionally clears a semaphore + * + * Unconditionally clears a semaphore; i.e., sets the + * state of the specified semaphore to unowned. + */ + +extern unsigned far pascal DOSSEMCLEAR ( + unsigned long ); /* semaphore handle */ + + + +/*** DosSemRequest - Wait until next DosSemClear + * + * Blocks the current thread until the next DosSemClear is + * issued to the indicated semaphore + */ + +extern unsigned far pascal DOSSEMREQUEST ( + unsigned long, /* semaphore handle */ + unsigned long ); /* Timeout, -1=no timeout, */ + /* 0=immediate timeout, >1=number ms */ + + +/*** DosSemSet - Unconditionally take a semaphore + * + * Unconditionally takes a semaphore; i.e., sets the status + * of the specified semaphore to owned. + */ + +extern unsigned far pascal DOSSEMSET ( + unsigned long ); /* semaphore handle */ + + + +/*** DosSemSetWait - Wait for a semaphore to be cleared and set it + * + * Blocks the current thread until the indicated semaphore is + * cleared and then establishes ownership of the semaphore + */ + +extern unsigned far pascal DOSSEMSETWAIT ( + unsigned long, /* semaphore handle */ + unsigned long ); /* Timeout, -1=no timeout, */ + /* 0=immediate timeout, >1=number ms */ + + +/*** DosSemWait - Wait for a semaphore to be cleared + * + * Blocks the current thread until the indicated semaphore is + * cleared but does not establish ownership of the semaphore + */ + +extern unsigned far pascal DOSSEMWAIT ( + unsigned long, /* semaphore handle */ + unsigned long ); /* Timeout, -1=no timeout, */ + /* 0=immediate timeout, >1=number ms */ + + +/*** DosMuxSemWait - Wait for 1 of N semaphores to be cleared + * + * Blocks the current thread until the indicated semaphore is + * cleared but does not establish ownership of the semaphore + */ + +extern unsigned far pascal DOSMUXSEMWAIT ( + unsigned far *, /* address for event index number */ + unsigned far *, /* list of semaphores */ + unsigned long ); /* Timeout, -1=no timeout, */ + /* 0=immediate timeout, >1=number ms */ + + + +/*** DosCloseSem - Close a system semaphore + * + * closed the specified system semaphore + */ + +extern unsigned far pascal DOSCLOSESEM ( + unsigned long ); /* semaphore handle */ + + + +/*** DosCreateSem - Create a system semaphore + * + * create a system semaphore + */ + +extern unsigned far pascal DOSCREATESEM ( + unsigned, /* =0 indicates exclusive ownership */ + unsigned long far *, /* address for semaphore handle */ + char far * ); /* name of semaphore */ + + +/*** DosOpenSem - Open a system semaphore + * + * open a system semaphore + */ + +extern unsigned far pascal DOSOPENSEM ( + unsigned long far *, /* address for semaphore handle */ + char far * ); /* name of semaphore */ + + + + +/*** Timer Services: + * + * DosGetDateTime + * DosSetDateTime + * DosSleep + * DosGetTimerInt + * DosTimerAsync + * DosTimerStart + * DosTimerStop + */ + + + +/*** DosGetDateTime - Get the current date and time + * + * Used to get the current date and time that are maintained by + * the operating system + */ + +extern unsigned far pascal DOSGETDATETIME ( + struct DateTime far * ); + + + +/*** DosSetDateTime - Set the current date and time + * + * Used to set the date and time that are maintained by the + * operating system + */ + +extern unsigned far pascal DOSSETDATETIME ( + struct DateTime far * ); + + + +/*** DosSleep - Delay Process Execution + * + * Suspends the current thread for a specified interval of time, + * or if the requested interval is '0', simply gives up the + * remainder of the current time slice. + */ + +extern unsigned far pascal DOSSLEEP ( + unsigned long ); /* TimeInterval - interval size */ + + + +/*** DosGetTimerInt - Get the timer tick interval in 1/10000 sec. + * + * Gets a word that contains the timer tick interval in ten + * thousandths of a second. This is the amount of time that + * elapses with every timer tick + */ + +extern unsigned far pascal DOSGETTIMERINT ( + unsigned far * ); /* interval size */ + + + +/*** DosTimerAsync - Start an asynchronous time delay + * + * Starts a timer that runs asynchronously to the thread issuing + * the request. It sets a RAM semaphore which can be used by the + * wait facility + */ + +extern unsigned far pascal DOSTIMERASYNC ( + unsigned long, /* Interval size */ + unsigned long, /* handle of semaphore */ + unsigned far * ); /* handle of timer */ + + + +/*** DosTimerStart - Start a Periodic Interval Timer + * + * Starts a periodic interval timer that runs asynchronously to + * the thread issuing the request. It sets a RAM semaphore which + * can be used by the wait facility. The semaphore is continually + * signalled at the specified time interval until the timer is + * turned off by DosTimerStop + */ + +extern unsigned far pascal DOSTIMERSTART ( + unsigned long, /* Interval size */ + unsigned long, /* handle of semaphore */ + unsigned far * ); /* handle of timer */ + + + +/*** DosTimerStop - Stop an interval timer + * + * Stops an interval timer that was started by DosTimerStart + */ + +extern unsigned far pascal DOSTIMERSTOP ( + unsigned ); /* Handle of the timer */ + + + + +/*** Memory Management: + * + * DosAllocSeg + * DosAllocShrSeg + * DosGetShrSeg + * DosReallocSeg + * DosFreeSeg + * DosAllocHuge + * DosGetHugeShift + * DosReallocHuge + * DosCreateCSAlias + */ + + + +/*** DosAllocSeg - Allocate Segment + * + * Allocates a segment of memory to the requesting process. + */ + +extern unsigned far pascal DOSALLOCSEG ( + unsigned, /* Number of bytes requested */ + unsigned far *, /* Selector allocated (returned) */ + unsigned ); /* Indicator for sharing */ + + + +/*** DosAllocShrSeg - Allocate Shared Segment + * + * Allocates a shared memory segment to a process. + */ + +extern unsigned far pascal DOSALLOCSHRSEG ( + unsigned, /* Number of bytes requested */ + char far *, /* Name string */ + unsigned far * ); /* Selector allocated (returned) */ + + + +/*** DosGetShrSeg - Access Shared Segment + * + * Allows a process to access a shared memory segment previously + * allocated by another process. The reference count for the + * shared segment is incremented. + */ + +extern unsigned far pascal DOSGETSHRSEG ( + char far *, /* Name string */ + unsigned far * ); /* Selector (returned) */ + + + +/*** DosGiveSeg - Give access to Segment + * + * Gives another process access to a shares memory segment + */ + +extern unsigned far pascal DOSGIVESEG ( + unsigned, /* Caller's segment handle */ + unsigned, /* Process ID of recipient */ + unsigned far * ); /* Recipient's segment handle */ + + + +/*** DosReallocSeg - Change Segment Size + * + * Changes the size of a segment already allocated. + */ + +extern unsigned far pascal DOSREALLOCSEG ( + unsigned, /* New size requested in bytes */ + unsigned ); /* Selector */ + + + +/*** DosFreeSeg - Free a Segment + * + * Deallocates a segment + */ + +extern unsigned far pascal DOSFREESEG ( + unsigned ); /* Selector */ + + + +/*** DosAllocHuge - Allocate Huge Memory + * + * Allocates memory greater than the maximum segment size + */ + +extern unsigned far pascal DOSALLOCHUGE ( + unsigned, /* Number of 65536 byte segments */ + unsigned, /* Number of bytes in last segment */ + unsigned far *, /* Selector allocated (returned) */ + unsigned ); /* Max number of 65536-byte segments */ + + + +/*** DosGetHugeShift - Get shift count used with Huge Segments + * + * Returns the shift count used in deriving selectors + * to address memory allocated by DosAllocHuge. + */ + +extern unsigned far pascal DOSGETHUGESHIFT ( + unsigned far *); /* Shift Count (returned) */ + + + +/*** DosReallocHuge - Change Huge Memory Size + * + * Changes the size of memory originally allocated by DosAllocHuge + */ + +extern unsigned far pascal DOSREALLOCHUGE ( + unsigned, /* Number of 65536 byte segments */ + unsigned, /* Number of bytes in last segment */ + unsigned ); /* Selector */ + + + +/*** DosCreateCSAlias - Create CS Alias + * + * Creates an alias descriptor for a data type descriptor passed + * as input. The type of the new descriptor is executable. + */ + +extern unsigned far pascal DOSCREATECSALIAS ( + unsigned, /* Data segment selector */ + unsigned far * ); /* Code segment selector (returned) */ + + + + +/*** Memory Sub-Allocation Package (MSP) + * + * DosSubAlloc + * DosSubFree + * DosSubSet + */ + + + +/*** DosSubAlloc - Allocate Memory + * + * Allocates memory from a segment previously allocated by + * DosAllocSeg or DosAllocShrSeg and initialized by DosSubSet + */ + +extern unsigned far pascal DOSSUBALLOC ( + unsigned, /* Segment selector */ + unsigned far *, /* Address of block offset */ + unsigned ); /* Size of requested block */ + + + +/*** DosSubFree - Free Memory + * + * Frees memory previously allocated by DosSubAlloc + */ + +extern unsigned far pascal DOSSUBFREE ( + unsigned, /* Segment selector */ + unsigned, /* Offset of memory block to free */ + unsigned ); /* Size of block in bytes */ + + + +/*** DosSubSet - Initialize or Set Allocated Memory + * + * Can be used either to initialize a segment for sub-allocation + * of to notify MSP of a change in the size of a segment already + * initialized. + */ + +extern unsigned far pascal DOSSUBSET ( + unsigned, /* Segment selector */ + unsigned, /* Parameter flags */ + unsigned ); /* New size of the block */ + + + + +/*** Program Execution Control: + * + * DosLoadModule + * DosFreeModule + * DosGetProcAddr + * DosGetModHandle + * DosGetModName + */ + + + +/*** DosLoadModule - Load Dynamic Link Routines + * + * Loads a dynamic link module and returns a handle for the module + */ + +extern unsigned far pascal DOSLOADMODULE ( + char far *, /* Module name string */ + unsigned far * ); /* Module handle (returned) */ + + + +/*** DosFreeModule - Free Dynamic Link Routines + * + * Frees the reference to the dynamic link module for this process. + * If the dynamic link module is no longer used by any process, the + * module will be freed from system memory. + */ + +extern unsigned far pascal DOSFREEMODULE ( + unsigned ); /* Module handle */ + + + +/*** DosGetProcAddr - Get Dynamic Link Procedure Address + * + * Retruns a far address to the desired procedure within a dynamic + * link module. + */ + +extern unsigned far pascal DOSGETPROCADDR ( + unsigned, /* Module handle */ + char far *, /* Module name string */ + unsigned long far * ); /* Procedure address (returned) */ + + + +/*** DosGetModHandle - Get Dynamic Link Module Handle + * + * Returns the handle to a dynamic link module that was previously + * loaded. The interface provides a mechanism for testing whether + * a dynamic link module is already loaded. + */ + +extern unsigned far pascal DOSGETMODHANDLE ( + char far *, /* Module name string */ + unsigned far *); /* Module handle (returned) */ + + + +/*** DosGetModName - Get Dynamic Link Module Name + * + * returns the fully qualified drive, path, filename, and + * extension associated with the referenced modul handle + */ + +extern unsigned far pascal DOSGETMODNAME ( + unsigned, /* Module handle */ + unsigned, /* Maximum buffer length */ + unsigned far * ); /* Buffer (returned) */ + + + + +/*** Device I/O Services: + * + * DosBeep + * DosDevConfig + * DosDevIOCtl + * DosScrDirectIO + * DosScrRedrawWait + * DosScrLock + * DosScrUnLock + * DosSGInit + * DosSGNum + * DosSGRestore + * DosSGSave + * DosSGSwitch + * DosSGSwitchMe + * DosVioAttach + * DosVioRegister + * KbdCharIn + * KbdFlushBuffer + * KbdGetStatus + * KbdPeek + * KbdSetStatus + * KbdStringIn + * VioRegister + * VioFreePhysBuf + * VioGetBuf + * VioGetCurPos + * VioGetCurType + * VioGetMode + * VioGetPhysBuf + * VioReadCellStr + * VioReadCharStr + * VioScrollDn + * VioScrollUp + * VioScrollLf + * VioScrollRt + * VioSetCurPos + * VioSetCurType + * VioSetMode + * VioShowBuf + * VioWrtCellStr + * VioWrtCharStr + * VioWrtCharStrAtt + * VioWrtNAttr + * VioWrtNCell + * VioWrtNChar + * VioWrtTTY + * VioSetANSI + * VioGetANSI + * VioPrtScreen + * VioSaveRedrawWait + * VioSaveRedrawWaitUndo + * VioScrLock + * VioScrUnlock + * VioSetMnLockTime + * VioSetMXSaveTime + * VioGetTimes + * VioPopUp + * VioEndPopUp + */ + + + +/*** DosBeep - Generate Sound From Speaker */ + +extern unsigned far pascal DOSBEEP ( + unsigned, /* Hertz (25H-7FFFH) */ + unsigned ); /* Length of sound in ms */ + + + +/*** DosDevConfig - Get Device Configurations + * + * Get information about attached devices + */ + +extern unsigned far pascal DOSDEVCONFIG ( + unsigned char far *, /* Returned information */ + unsigned, /* Item number */ + unsigned ); /* Reserved */ + + + +/*** DosDevIOCtl - Preform Control Functions Directly On Device + * + * Control functions on the device specified by the opened + * handle + */ + +extern unsigned far pascal DOSDEVIOCTL ( + char far *, /* Data area */ + char far *, /* Command-specific argument list */ + unsigned, /* Device-specific function code */ + unsigned, /* Device category */ + unsigned ); /* Device handle returned by Open */ + + + +/*** DosScrDirectIO - Direct Screen I/O + * + * Indicate direct screen I/O + */ + +extern unsigned far pascal DOSSCRDIRECTIO ( + unsigned ); /* Indicates state of direct I/O */ + /* 0=on, 1=off */ + + + +/*** DosScrRedrawWait - Screen Refresh + * + * Wait for notification to refresh or redraw screen + */ + +extern unsigned far pascal DOSSCRREDRAWWAIT (void); + + + +/*** DosScrLock - Lock Screen + * + * Lock the screen for I/O + */ + +extern unsigned far pascal DOSSCRLOCK ( + unsigned, /* Block or not - 0=return if */ + /* screen unavailable, 1=wait */ + unsigned far *); /* Return status of lock - */ + /* 0=sucessful, 1=unsuccessful */ + + + +/*** DosScrUnLock - Unlock Screen + * + * Unlock the screen for I/O + */ + +extern unsigned far pascal DOSSCRUNLOCK (void) ; + + + +/*** DosSGInit - Initialize Screen Group + * + * Initialize the specified screen group + */ + +extern unsigned far pascal DOSSGINIT ( + unsigned ); /* Number of screen group */ + + + +/*** DosSGNum - Get Number of Screen Groups + * + * Get the number of screen groups + */ + +extern unsigned far pascal DOSSGNUM ( + unsigned far *); /* Total number of screen groups */ + + + +/*** DosSGRestore - Restore Screen Group + * + * Restore the current screen group + */ + +extern unsigned far pascal DOSSGRESTORE (void); + + + +/*** DosSGSave - Save Screen Group + * + * Save the current screen group + */ + +extern unsigned far pascal DOSSGSAVE (void); + + + +/*** DosSGSwitch - Switch Screen Groups + * + * Switch the specified screen group to the active screen group + */ + +extern unsigned far pascal DOSSGSWITCH ( + unsigned ); /* Number of screen group */ + + + +/*** DosSGSwitchMe - Put Process in Screen Group + * + * Switch the caller into the specified screen group + */ + +extern unsigned far pascal DOSSGSWITCHME ( + unsigned ); /* Number of screen groups */ + + + +/*** DosVioAttach - Attach to Video Subsystem + * + * Attach to the current video subsystem for the current screen + * group. This must be done prior to using any VIO functions. + */ + +extern unsigned far pascal DOSVIOATTACH (void); + + + +/*** DosVioRegister - Register Video Subsystem + * + * Register a video subsystem for a screen group + */ + +extern unsigned far pascal DOSVIOREGISTER ( + char far *, /* Module name */ + char far * ); /* Table of entries supported by */ + /* the VIO dynamic link module */ + + + +/*** KbdCharIn - Read Character, Scan Code + * + * Return a character and scan code from the standard input device + */ + +extern unsigned far pascal KBDCHARIN ( + struct KeyData far *, /* Buffer for character code */ + unsigned, /* I/O wait - 0=wait for a */ + /* character, 1=no wait */ + unsigned ); /* keyboard handle */ + + + +/*** KbdFlushBuffer - Flush Keystroke Buffer + * + * Clear the keystroke buffer + */ + +extern unsigned far pascal KBDFLUSHBUFFER ( + unsigned ); /* keyboard handle */ + + + +/*** KbdGetStatus - Get Keyboard Status + * + * Gets the current state of the keyboard. + */ + +extern unsigned far pascal KBDGETSTATUS ( + struct KbdStatus far *, /* data structure */ + unsigned ); /* Keyboard device handle */ + + + +/*** KbdPeek - Peek at Character, Scan Code + * + * Return the character/scan code, if available, from the + * standard input device without removing it from the buffer. + */ + +extern unsigned far pascal KBDPEEK ( + struct KeyData far *, /* buffer for data */ + unsigned ); /* keyboard handle */ + + + +/*** KbdSetStatus - Set Keyboard Status + * + * Sets the characteristics of the keyboard. + */ + +extern unsigned far pascal KBDSETSTATUS ( + struct KbdStatus far *, /* data structure */ + unsigned ); /* device handle */ + + + +/*** KbdStringIn - Read Character String + * + * Read a character string (character codes only) from the + * standard input device. The character string may optionally + * be echoed at the standard output device if the echo mode + * is set (KbdSetEchoMode) + */ + +extern unsigned far pascal KBDSTRINGIN ( + char far *, /* Char string buffer */ + unsigned far *, /* Length of buffer */ + unsigned, /* I/O wait- 0=wait for a */ + /* character, 1=no wait */ + unsigned ); /* keyboard handle */ + + + +/*** VioRegister - Register Video Subsystem + * + * Register a video subsystem within a screen group + * + */ + +extern unsigned far pascal VIOREGISTER ( + char far *, /* Module name */ + char far *, /* Entry Point name */ + unsigned long, /* Function mask 1 */ + unsigned long ); /* Function mask 2 */ + + + +/*** VioFreePhysBuf - Free Physical Video Buffer + * + * Release the physical video buffer + */ + +extern unsigned far pascal VIOFREEPHYSBUF ( + char far * ); /* Physical video buffer */ + + + +/*** VioGetBuf - Get Logical Video Buffer + * + * Return the address of the logical video buffer + */ + +extern unsigned far pascal VIOGETBUF ( + unsigned long far *, /* Will point to logical video buffer */ + unsigned far *, /* Length of Buffer */ + unsigned ); /* Vio Handle */ + + + +/*** VioGetCurPos - Get Cursor Position + * + * Return the cursor position + */ + +extern unsigned far pascal VIOGETCURPOS ( + unsigned far *, /* Current row position */ + unsigned far *, /* Current column position */ + unsigned ); /* Vio Handle */ + + + +/*** VioGetCurType - Get Cursor Type + * + * Return the cursor type + */ + +extern unsigned far pascal VIOGETCURTYPE ( + struct CursorData far *, /* Cursor characteristics */ + unsigned ); /* Vio Handle */ + + + +/*** VioGetMode - Get Display Mode + * + * Return the mode of the display + */ + +extern unsigned far pascal VIOGETMODE ( + struct ModeData far *, /* Length of Buffer */ + unsigned ); /* Vio Handle */ + + + +/*** VioGetPhysBuf - Get Physical Video Buffer + * + * Return the address of the physical video buffer + */ + +extern unsigned far pascal VIOGETPHYSBUF ( + char far *, /* Buffer start address */ + char far *, /* Buffer end address */ + unsigned far *, /* Address of selector list */ + unsigned ); /* Length of selector list */ + + + +/*** VioReadCellStr - Read Character/Attributes String + * + * Read a string of character/attributes (or cells) from the + * screen starting at the specified location. + */ + +extern unsigned far pascal VIOREADCELLSTR ( + char far *, /* Character Buffer */ + unsigned far *, /* Length of cell string buffer */ + unsigned, /* Starting location (row) */ + unsigned, /* Starting location (col) */ + unsigned ); /* Vio Handle */ + + + +/*** VioReadCharStr - Read Character String + * + * Read a character string from the display starting at the + * current cursor position + */ + +extern unsigned far pascal VIOREADCHARSTR ( + char far *, /* Character Buffer */ + unsigned far *, /* Length of cell string buffer */ + unsigned, /* Starting location (row) */ + unsigned, /* Starting location (col) */ + unsigned ); /* Vio Handle */ + + + +/*** VioScrollDn - Scroll Screen Down + * + * Scroll the current screen down + */ + +extern unsigned far pascal VIOSCROLLDN ( + unsigned, /* Top row of section to scroll */ + unsigned, /* Left column of section to scroll */ + unsigned, /* Bottom row of section to scroll */ + unsigned, /* Right column of section to scroll */ + unsigned, /* Number of blank lines at bottom */ + char far *, /* pointer to blank Char,Attr */ + unsigned ); /* Vio Handle */ + + + +/*** VioScrollUp - Scroll Screen Up + * + * Scroll the active page (or display) up + */ + +extern unsigned far pascal VIOSCROLLUP ( + unsigned, /* Top row of section to scroll */ + unsigned, /* Left column of section to scroll */ + unsigned, /* Bottom row of section to scroll */ + unsigned, /* Right column of section to scroll */ + unsigned, /* Number of blank lines at bottom */ + char far *, /* pointer to blank Char,Attr */ + unsigned ); /* Vio Handle */ + + + +/*** VioScrollLf - Scroll Screen Left + * + * Scroll the current screen left + */ + +extern unsigned far pascal VIOSCROLLLF ( + unsigned, /* Top row of section to scroll */ + unsigned, /* Left column of section to scroll */ + unsigned, /* Bottom row of section to scroll */ + unsigned, /* Right column of section to scroll */ + unsigned, /* Number of blank columsn at right */ + char far *, /* pointer to blank Char,Attr */ + unsigned ); /* Vio Handle */ + + + +/*** VioScrollLf - Scroll Screen Right + * + * Scroll the current screen right + */ + +extern unsigned far pascal VIOSCROLLRT ( + unsigned, /* Top row of section to scroll */ + unsigned, /* Left column of section to scroll */ + unsigned, /* Bottom row of section to scroll */ + unsigned, /* Right column of section to scroll */ + unsigned, /* Number of blank columsn at left */ + char far *, /* pointer to blank Char,Attr */ + unsigned ); /* Vio Handle */ + + + +/*** VioSetCurPos - Set Cursor Position + * + * Set the cursor position + */ + +extern unsigned far pascal VIOSETCURPOS ( + unsigned, /* Row return data */ + unsigned, /* Column return data */ + unsigned ); /* Vio Handle */ + + + +/*** VioSetCurType - Set Cursor Type + * + * Set the cursor type + */ + +extern unsigned far pascal VIOSETCURTYPE ( + struct CursorData far *, /* Cursor characteristics */ + unsigned ); /* Vio Handle */ + + + +/*** VioSetMode - Set Display Mode + * + * Set the mode of the display + */ + +extern unsigned far pascal VIOSETMODE ( + struct ModeData far *, /* Mode characteristics */ + unsigned ); /* Vio Handle */ + + + +/*** VioShowBuf - Display Logical Buffer + * + * Update the display with the logical video buffer + */ + +extern unsigned far pascal VIOSHOWBUF ( + unsigned, /* Offset into buffer */ + unsigned, /* Length of area to be updated */ + unsigned ); /* Vio Handle */ + + + +/*** VioWrtCellStr - Write Character/Attribute String + * + * Write a character,attribute string to the display + */ + +extern unsigned far pascal VIOWRTCELLSTR ( + char far *, /* String to be written */ + unsigned, /* Length of string */ + unsigned, /* Starting position for output (row) */ + unsigned, /* Starting position for output (col) */ + unsigned ); /* Vio Handle */ + + + +/*** VioWrtCharStr - Write Character String + * + * Write a character string to the display + */ + +extern unsigned far pascal VIOWRTCHARSTR ( + char far *, /* String to be written */ + unsigned, /* Length of string */ + unsigned, /* Starting position for output (row) */ + unsigned, /* Starting position for output (col) */ + unsigned ); /* Vio Handle */ + + + +/*** VioWrtCharStrAtt - Write Character String With Attribute + * + * Write a character string with repeated attribute to the display + */ + +extern unsigned far pascal VIOWRTCHARSTRATT ( + char far *, /* String to be written */ + unsigned, /* Length of string */ + unsigned, /* Starting position for output (row) */ + unsigned, /* Starting position for output (col) */ + char far *, /* Attribute to be replicated */ + unsigned ); /* Vio Handle */ + + + +/*** VioWrtNAttr - Write N Attributes + * + * Write an attribute to the display a specified number of times + */ + +extern unsigned far pascal VIOWRTNATTR ( + char far *, /* Attribute to be written */ + unsigned, /* Length of write */ + unsigned, /* Starting position for output (row) */ + unsigned, /* Starting position for output (col) */ + unsigned ); /* Vio Handle */ + + + +/*** VioWrtNCell - Write N Character/Attributes + * + * Write a cell (or character/attribute) to the display a + * specified number of times + */ + +extern unsigned far pascal VIOWRTNCELL ( + char far *, /* Cell to be written */ + unsigned, /* Length of write */ + unsigned, /* Starting position for output (row) */ + unsigned, /* Starting position for output (col) */ + unsigned ); /* Vio Handle */ + + + +/*** VioWrtNChar - Write N Characters + * + * Write a character to the display a specified number of times + */ + +extern unsigned far pascal VIOWRTNCHAR ( + unsigned, /* Character to be written */ + unsigned, /* Length of write */ + unsigned, /* Starting position for output (row) */ + unsigned, /* Starting position for output (col) */ + unsigned ); /* Vio Handle */ + + + +/*** VioWrtTTY - Write TTY String + * + * Write a character string from the current cursor position in + * TTY mode to the display. The cursor will be positioned at the + * end of the string+1 at the end of the write. + */ + +extern unsigned far pascal VIOWRTTTY ( + char far *, /* String to be written */ + unsigned, /* Length of string */ + unsigned ); /* Vio Handle */ + + + +/*** VioSetAnsi - Set ANSI On or Off + * + * Activates or deactivates ANSI support + * + */ + +extern unsigned far pascal VIOSETANSI ( + unsigned, /* ON (=1) or OFF (=0) indicator */ + unsigned ); /* Vio Handle */ + + + +/*** VioGetAnsi - Get ANSI State + * + * Returns the current ANSI state (0=inactive, 1=active) + * + */ + +extern unsigned far pascal VIOGETANSI ( + unsigned far *, /* ANSI state (returned) */ + unsigned ); /* Vio Handle */ + + + +/*** VioPrtScreen - Print Screen + * + * Copies the screen to the printer + * + */ + +extern unsigned far pascal VIOPRTSCREEN ( + unsigned ); /* Vio Handle */ + + + +/*** VioSaveRedrWait - Screen Save Redraw Wait + * + * Allows a process to be notified when it must + * save or redraw its screen + * + */ + +extern unsigned far pascal VIOSAVEREDRAWWAIT ( + unsigned, /* Save/Redraw Indicator */ + unsigned far *, /* Notify type (returned) */ + unsigned ); /* Vio Handle */ + + + +/*** VioSaveRedrWaitUndo - Undo Screen Save Redraw Wait + * + * Allows a one thread within a process to cancel a + * VIOSAVREDRAWWAIT issued by another thread within + * that same process. Ownership of the VIOSAVREDRAWWAIT + * can either be reserved or given up. + * + */ + +extern unsigned far pascal VIOSAVEREDRAWWAITUNDO ( + unsigned, /* Ownership Indicator */ + unsigned, /* Terminate Indicator */ + unsigned ); /* Vio Handle */ + + + +/*** VioScrLock - Lock Screen + * + * Tells a process if I/O to the physical screen buffer can occur. + * + */ + +extern unsigned far pascal VIOSCRLOCK ( + unsigned, /* Wait Flag */ + unsigned char far *, /* Status of lock (returned) */ + unsigned ); /* Vio Handle */ + + + +/*** VioScrUnlock - Unlock Screen + * + * Unlocks the physical screen buffer for I/O. + * + */ + +extern unsigned far pascal VIOSCRUNLOCK ( + unsigned ); /* Vio Handle */ + + + +/*** VioSetMnLockTime - Set Minimum Screen Lock Time + * + * Sets the minimum amount of time that the system will allow a + * process to have exclusive use of the screen via VIOSCRLOCK. + * + */ + +extern unsigned far pascal VIOSETMNLOCKTIME ( + unsigned, /* Number of seconds */ + unsigned ); /* Vio Handle */ + + + +/*** VioSetMxSaveTime - Set Maximum Screen Save/Restore Time + * + * Sets the maximum amount of time (in msec) that the system will + * allow a process to take before issuing a VIOSAVREDRWAIT call + * after being notified by the Session Mgr that one is needed. + * + */ + +extern unsigned far pascal VIOSETMXSAVETIME ( + unsigned, /* Number of milliseconds */ + unsigned ); /* Vio Handle */ + + + +/*** VioGetTimes - Return VIO Lock and Save/Redraw Times + * + * Returns the 2 word values set by the calls + * VIOSETMNLOCKTIME and VIOSETMXSAVETIME. + * + */ + +extern unsigned far pascal VIOGETTIMES ( + unsigned far *, /* Min. Lock time (in seconds) */ + unsigned far *, /* Max. Save time (in msec) */ + unsigned ); /* Vio Handle */ + + + +/*** VioPopUp - Allocate a PopUp Display Screen + * + * Creates a temporary window to display a momentary message + * + */ + +extern unsigned far pascal VIOPOPUP ( + unsigned far *, /* Wait/Nowait Bit flags */ + unsigned ); /* Vio Handle */ + + + +/*** VioEndPopUp - Deallocate a PopUp Display Screen + * + * Closes a PopUp window + * + */ + +extern unsigned far pascal VIOENDPOPUP ( + unsigned ); /* Vio Handle */ + + + + +/*** Mouse Services + * + * MouRegister + * MouGetNumButtons + * MouGetNumMickeys + * MouGetDevStatus + * MouReadEventQueue + * MouGetNumQueEl + * MouGetEventMask + * MouGetScaleFact + * MouSetScaleFact + * MouSetEventMask + * MouOpen + * MouClose + * MouSetPtrShape + * MouRemovePtr + * MouDrawPtr + * MouSetHotKey + */ + + +/*** MouRegister - Register a Mouse Subsystem or Environment Manager + * + */ + +extern unsigned far pascal MOUREGISTER ( + char far *, /* Module name */ + char far *, /* Entry Point name */ + unsigned long, /* Function mask */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouGetNumButtons - returns the number of mouse buttons supported + * + */ + +extern unsigned far pascal MOUGETNUMBUTTONS ( + unsigned far *, /* Number of mouse buttons (returned) */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouGetNumMickeys - returns the number of mickeys per centimeter + * + */ + +extern unsigned far pascal MOUGETNUMMICKEYS ( + unsigned far *, /* Number of Mickeys/cm (returned) */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouGetDevStatus - returns the mouse driver status flags + * + */ + +extern unsigned far pascal MOUGETDEVSTATUS ( + unsigned far *, /* Device Status (returned) */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouReadEventQueue - reads an event from the mouse event queue + * + */ + +extern unsigned far pascal MOUREADEVENTQUEUE ( + unsigned, /* Type of read operation */ + unsigned char far *, /* Event Queue Entry (returned) */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouGetNumQueEl - returns the status of the Mouse Event Queue + * + */ + +extern unsigned far pascal MOUGETNUMQUEEL ( + unsigned far *, /* Maximum # of Elements in Queue */ + unsigned far *, /* Current # of Elements in Queue */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouGetEventMask - Returns the current mouse 1-word event mask + * + */ + +extern unsigned far pascal MOUGETEVENTMASK ( + unsigned far *, /* Event Mask (returned) */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouGetScaleFact - Returns the current mouse scaling factors + * + */ + +extern unsigned far pascal MOUGETSCALEFACT ( + unsigned far *, /* Y Coordinate Scaling Factor */ + unsigned far *, /* X Coordinate Scaling Factor */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouSetScaleFact - Sets the current mouse scaling factors + * + */ + +extern unsigned far pascal MOUSETSCALEFACT ( + unsigned, /* Y Coordinate Scaling Factor */ + unsigned, /* X Coordinate Scaling Factor */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouSetEventMask - Set the current mouse 1-word event mask + * + */ + +extern unsigned far pascal MOUSETEVENTMASK ( + unsigned, /* Event Mask */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouOpen - Open the mouse device + * + */ + +extern unsigned far pascal MOUOPEN ( + unsigned far * ); /* Mouse Device Handle (returned) */ + + + +/*** MouClose - Close the mouse device + * + */ + +extern unsigned far pascal MOUCLOSE ( + unsigned ); /* Mouse Device Handle */ + + + +/*** MouSetPtrShape - Set the shape and size of the mouse pointer image + * + */ + +extern unsigned far pascal MOUSETPTRSHAPE ( + unsigned char far *, /* Pointer Shape (returned) */ + unsigned long, /* Size of data passed */ + unsigned, /* Height of Ptr Shape */ + unsigned, /* Width of Ptr Shape */ + unsigned, /* Offset to Ptr Column Center */ + unsigned, /* Offset to Ptr Row Center */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouRemovePtr - Restricts the Mouse Ptr from occurring in a region + * + */ + +extern unsigned far pascal MOUREMOVEPTR ( + unsigned far *, /* Pointer Area */ + unsigned ); /* Mouse Device Handle */ + + + +/*** MouDrawPtr - Unrestricts the Mouse Ptr + * + */ + +extern unsigned far pascal MOUDRAWPTR ( + unsigned ); /* Mouse Device Handle */ + + +/*** MouSetHotKey - Determines which Mouse Key is the system hot key + * + */ + +extern unsigned far pascal MOUSETHOTKEY ( + unsigned, /* Mouse Button Mask */ + unsigned ); /* Mouse Device Handle */ + + + + +/*** Device Monitor Services + * + * DosMonOpen + * DosMonClose + * DosMonReg + * DosMonRead + * DosMonWrite + */ + + + +/*** DosMonOpen - Open a Connection to a CP/DOS Device Monitor + * + * This call is issued once by a process which wishes to use + * device monitors + */ + +extern unsigned far pascal DOSMONOPEN ( + char far *, /* Ascii string of device name */ + unsigned far * ); /* Address for handle return value */ + + + +/*** DosMonClose - Close a Connection to a CP/DOS Device Monitor + * + * This call is issued once by a process which wishes to terminate + * monitoring. This call causes all monitor buffers associated to + * be flushed and closed. + */ + +extern unsigned far pascal DOSMONCLOSE ( + unsigned ); /* Handle from DosMonOpen */ + + + +/*** DosMonReg - Register a Set of Buffers as a Monitor + * + * This call is issued to establish a pair of buffer structures - + * one input and one output - to monitor an I/O stream + */ + +extern unsigned far pascal DOSMONREG ( + unsigned, /* Handle from DosMonOpen */ + unsigned char far *, /* Address of monitor input buffer */ + unsigned char far *, /* Address of monitor output buffer */ + unsigned, /* Position flag - 0=no positional */ + /* preference, 1=front of list, */ + /* 2=back of the list */ + unsigned ); /* Index */ + + + +/*** DosMonRead - Read Input From Monitor Structure + * + * This call is issued to wait for and read input records from + * the monitor buffer structure + */ + +extern unsigned far pascal DOSMONREAD ( + unsigned char far *, /* Address of monitor input buffer */ + unsigned char, /* Block/Run indicator - 0=block */ + /* input ready, 1=return */ + unsigned char far *, /* Address of data buffer */ + unsigned far * ); /* Number of bytes in the data record */ + + + +/*** DosMonWrite - Write Output to Monitor Structure + * + * Writes data to the monitor output buffer structure + */ + +extern unsigned far pascal DOSMONWRITE ( + unsigned char far *, /* Address of monitor output buffer */ + unsigned char far *, /* Address of data buffer */ + unsigned ); /* Number of bytes in data record */ + + + + +/*** File I/O Services: + * + * DosBufReset + * DosChdir + * DosChgFilePtr + * DosClose + * DosCreateUn + * DosDelete + * DosDupHandle + * DosFindClose + * DosFindFirst + * DosFindNext + * DosFileLocks + * DosGetInfoSeg + * DosMkdir + * DosMove + * DosNewSize + * DosOpen + * DosQCurDir + * DosQCurDisk + * DosQFHandState + * DosQFileInfo + * DosQFileMode + * DosQFSInfo + * DosQHandType + * DosQSwitChar + * DosQVerify + * DosRead + * DosReadAsync + * DosRmdir + * DosSelectDisk + * DosSetFileInfo + * DosSetFileMode + * DosSetFHandState + * DosSetFSInfo + * DosSetMaxFH + * DosSetVerify + * DosWrite + * DosWriteAsync + */ + + + +/*** DosBufReset - Commit File's Cache Buffers + * + * Flushes requesting process's cache buffers for the specified + * format + */ + +extern unsigned far pascal DOSBUFRESET ( + unsigned ); /* File handle */ + + + +/*** DosChdir - Change The Current Directory + * + * Define the current directory for the requesting process + */ + +extern unsigned far pascal DOSCHDIR ( + char far *, /* Directory path name */ + unsigned long ); /* Reserved (must be 0) */ + + + +/*** DosChgFilePtr - Change (Move) File Read Write Pointer + * + * Move the read/write pointer according to the method specified + */ + +extern unsigned far pascal DOSCHGFILEPTR ( + unsigned, /* File handle */ + long, /* Distance to move in bytes */ + unsigned, /* Method of moving (0,1,2) */ + unsigned long far * ); /* New pointer location */ + + + +/*** DosClose - Close a File Handle + * + * Closes the specified file handle + */ + +extern unsigned far pascal DOSCLOSE ( + unsigned ); /* File handle */ + + + +/*** DosCreateUn - Create a Unique File Path Name + * + * Generates a unique file path name + */ + +extern unsigned far pascal DOSCREATEUN ( + char far * ); /* File path name area */ + + + +/*** DosDelete - Delete a File + * + * Removes a directory entry associated with a filename + */ + +extern unsigned far pascal DOSDELETE ( + char far *, /* Filename path */ + unsigned long ); /* Reserved (must be 0) */ + + + +/*** DosDupHandle - Duplicate a File Handle + * + * Returns a new file handle for an open file that refers to the + * same file at the same position + */ + +extern unsigned far pascal DOSDUPHANDLE ( + unsigned, /* Existing file handle */ + unsigned far * ); /* New file handle */ + + + +/*** DosFindClose - Close Find Handle + * + * Closes the association between a directory handle and a + * DosFindFirst or DosFindNext directory search function + */ + +extern unsigned far pascal DOSFINDCLOSE ( + unsigned ); /* Directory search handle */ + + + +/*** DosFindFirst - Find First Matching File + * + * Finds the first filename that matches the specified file + * specification + */ + +extern unsigned far pascal DOSFINDFIRST ( + char far *, /* File path name */ + unsigned far *, /* Directory search handle */ + unsigned, /* Search attribute */ + struct FileFindBuf far *, /* Result buffer */ + unsigned, /* Result buffer length */ + unsigned far *, /* Number of entries to find */ + unsigned long ); /* Reserved (must be 0) */ + + + +/*** DosFindNext - Find Next Matching File + * + * Finds the next directory entry matching the name that was + * specified on the previous DosFindFirst or DosFindNext function + * call + */ + +extern unsigned far pascal DOSFINDNEXT ( + unsigned, /* Directory handle */ + struct FileFindBuf far *, /* Result buffer */ + unsigned, /* Result buffer length */ + unsigned far * ); /* Number of entries to find */ + + + +/*** DosFileLocks - File Lock Manager + * + * Unlock and/or lock multiple ranges in an opened file + */ + +extern unsigned far pascal DOSFILELOCKS ( + unsigned, /* File handle */ + long far *, /* Unlock Range */ + long far * ); /* Lock Range */ + + + +/*** DosGetInfoSeg - Get addresses of system variable segments + * + * Returns 2 selectors: one for the global information segment, + * the other for a process information segment + */ + +extern unsigned far pascal DOSGETINFOSEG ( + unsigned far *, /* Selector for Global Info Seg */ + unsigned far * ); /* Selector for Process Info Seg */ + + + +/*** DosMkdir - Make Subdirectory + * + * Creates the specified directory + */ + +extern unsigned far pascal DOSMKDIR ( + char far *, /* New directory name */ + unsigned long ); /* Reserved (must be 0) */ + + + +/*** DosMove - Move a file or SubDirectory + * + * Moves the specified file or directory + */ + +extern unsigned far pascal DOSMOVE ( + char far *, /* Old path name */ + char far *, /* New path name */ + unsigned long ); /* Reserved (must be 0) */ + + + +/*** DosNewSize - Change File's Size + * + * Changes a file's size + */ + +extern unsigned far pascal DOSNEWSIZE ( + unsigned, /* File handle */ + unsigned long ); /* File's new size */ + + + +/*** DosOpen - Open a File + * + * Creates the specified file (if necessary) and opens it + */ + +extern unsigned far pascal DOSOPEN ( + char far *, /* File path name */ + unsigned far *, /* New file's handle */ + unsigned far *, /* Action taken - 1=file existed, */ + /* 2=file was created */ + unsigned long, /* File primary allocation */ + unsigned, /* File attributes */ + unsigned, /* Open function type */ + unsigned, /* Open mode of the file */ + unsigned long ); /* Reserved (must be zero) */ + + + +/*** DosQCurDir - Query Current Directory + * + * Get the full path name of the current directory for the + * requesting process for the specified drive + */ + +extern unsigned far pascal DOSQCURDIR ( + unsigned, /* Drive number - 1=A, etc */ + char far *, /* Directory path buffer */ + unsigned far * ); /* Directory path buffer length */ + + + +/*** DosQCurDisk - Query Current Disk + * + * Determine the current default drive for the requesting process + */ + +extern unsigned far pascal DOSQCURDISK ( + unsigned far *, /* Default drive number */ + unsigned long far * ); /* Drive-map area */ + + + + +/*** DosQFHandState - Query file handle state + * + * Query the state of the specified handle + */ + +extern unsigned far pascal DOSQFHANDSTATE ( + unsigned, /* File Handle */ + unsigned far * ); /* File handle state */ + + + +/*** DosQFileInfo - Query a File's Information + * + * Returns information for a specific file + */ + +extern unsigned far pascal DOSQFILEINFO ( + unsigned, /* File handle */ + unsigned, /* File data required */ + char far *, /* File data buffer */ + unsigned ); /* File data buffer size */ + + +/*** DosQFileMode - Query File Mode + * + * Get the mode (attribute) of the specified file + */ + +extern unsigned far pascal DOSQFILEMODE ( + char far *, /* File path name */ + unsigned far *, /* Data area */ + unsigned long ); /* Reserved (must be zero) */ + + + +/*** DosQFSInfo - Query File System Information + * + * Gets information from a file system device + */ + +extern unsigned far pascal DOSQFSINFO ( + unsigned, /* Drive number - 0=default, 1=A, etc */ + unsigned, /* File system info required */ + char far *, /* File system info buffer */ + unsigned ); /* File system info buffer size */ + + + +/*** DosQHandType - Query Handle type + * + * Returns a flag as to whether a handle references a device or + * a file, and if a device, returns device driver attribute word + */ + +extern unsigned far pascal DOSQHANDTYPE ( + unsigned, /* File Handle */ + unsigned far *, /* Handle Type (0=file, 1=device) */ + unsigned far * ); /* Device Driver Attribute Word */ + + + +/*** DosQSwitChar - Query Switch Character + * + * Returns the system switch character + */ + +extern unsigned far pascal DOSQSWITCHAR ( + unsigned char far * ); /* Switch Character (returned) */ + + + +/*** DosQVerify - Query Verify Setting + * + * Returns the value of the Verify flag + */ + +extern unsigned far pascal DOSQVERIFY ( + unsigned far * ); /* Verify setting - 0=verify mode */ + /* not active, 1=verify mode active */ + + + +/*** DosRead - Read from a File + * + * Reads the specified number of bytes from a file to a + * buffer location + */ + +extern unsigned far pascal DOSREAD ( + unsigned, /* File handle */ + char far *, /* Address of user buffer */ + unsigned, /* Buffer length */ + unsigned far * ); /* Bytes read */ + + + +/*** DosReadAsync - Async Read from a File + * + * Reads the specified number of bytes from a file to a buffer + * location asynchronously with respect to the requesting process's + * execution + */ + +extern unsigned far pascal DOSREADASYNC ( + unsigned, /* File handle */ + unsigned long far *, /* Address of Ram semaphore */ + unsigned far *, /* Address of I/O error return code */ + char far *, /* Address of user buffer */ + unsigned, /* Buffer length */ + unsigned far * ); /* Number of bytes actually read */ + + + +/*** DosRmDir - Remove Subdirectory + * + * Removes a subdirectory from the specified disk + */ + +extern unsigned far pascal DOSRMDIR ( + char far *, /* Directory name */ + unsigned long ); /* Reserved (must be zero) */ + + + +/*** DosSelectDisk - Select Default Drive + * + * Select the drive specified as the default drive for the + * calling process + */ + +extern unsigned far pascal DOSSELECTDISK ( + unsigned ); /* Default drive number */ + + + +/*** DosSetFHandState - Set File Handle State + * + * Get the state of the specified file + */ + +extern unsigned far pascal DOSSETFHANDSTATE ( + unsigned, /* File handle */ + unsigned); /* File handle state */ + + +/*** DosSetFSInfo - Set File System Information + * + * Set information for a file system device + */ + +extern unsigned far pascal DOSSETFSINFO ( + unsigned, /* Drive number - 0=default, 1=A, etc */ + unsigned, /* File system info required */ + char far *, /* File system info buffer */ + unsigned ); /* File system info buffer size */ + + + +/*** DosSetFileInfo - Set a File's Information + * + * Specifies information for a file + */ + +extern unsigned far pascal DOSSETFILEINFO ( + unsigned, /* File handle */ + unsigned, /* File info data required */ + char far *, /* File info buffer */ + unsigned ); /* File info buffer size */ + + + +/*** DosSetFileMode - Set File Mode + * + * Change the mode (attribute) of the specified file + */ + +extern unsigned far pascal DOSSETFILEMODE ( + char far *, /* File path name */ + unsigned, /* New attribute of file */ + unsigned long ); /* Reserved (must be zero) */ + + + +/*** DosSetMaxFH - Set Maximum File Handles + * + * Defines the maximum number of file handles for the + * current process + */ + +extern unsigned far pascal DOSSETMAXFH ( + unsigned ); /* Number of file handles */ + + + +/*** DosSetVerify - Set/Reset Verify Switch + * + * Sets the verify switch + */ + +extern unsigned far pascal DOSSETVERIFY ( + unsigned ); /* New value of verify switch */ + + + +/*** DosWrite - Synchronous Write to a File + * + * Transfers the specified number of bytes from a buffer to + * the specified file, synchronously with respect to the + * requesting process's execution + */ + +extern unsigned far pascal DOSWRITE ( + unsigned, /* File handle */ + char far *, /* Address of user buffer */ + unsigned, /* Buffer length */ + unsigned far * ); /* Bytes written */ + + + +/*** DosWriteAsync - Asynchronous Write to a File + * + * Transfers the specified number of bytes from a buffer to + * the specified file, asynchronously with respect to the + * requesting process's execution + */ + +extern unsigned far pascal DOSWRITEASYNC ( + unsigned, /* File handle */ + unsigned long far *, /* Address of RAM semaphore */ + unsigned far *, /* Address of I/O error return code */ + char far *, /* Address of user buffer */ + unsigned, /* Buffer length */ + unsigned far * ); /* Bytes written */ + + + + +/*** Hard Error Handling + * + * DosError + */ + + + +/*** DosError - Enable Hard Error Processing + * + * Allows a CP/DOS process to receive hard error notification + * without generating a hard error signal. Hard errors generated + * under a process which has issued a DosError call are FAILed and + * the appropriate error code is returned. + */ + +extern unsigned far pascal DOSERROR ( + unsigned ); /* Action flag */ + + + +/*** Machine Exception Handling + * + * DosSetVector + */ + + + +/*** DosSetVec - Establish a handler for an Exception + * + * Allows a process to register an address to be + * called when a 286 processor exception occurs. + */ + +extern unsigned far pascal DOSSETVEC ( + unsigned, /* Exception Vector */ + void (far *)(void), /* Address of exception handler */ + void (far * far *)(void) ); /* Address to store previous handler */ + + + +/*** Message Functions + * + * DosGetMessage + * DosInsMessage + * DosPutMessage + */ + + + +/*** DosGetMessage - Return System Message With Variable Text + * + * Retrieves a message from the specified system message file + * and inserts variable information into the body of the message + */ + +extern unsigned far pascal DOSGETMESSAGE ( + char far * far *, /* Table of variables to insert */ + unsigned, /* Number of variables */ + char far *, /* Address of message buffer */ + unsigned, /* Length of buffer */ + unsigned, /* Number of the message */ + char far *, /* Message file name */ + unsigned far * ); /* Length of returned message */ + + + +/*** DosInsMessage - Insert Variable Text into Message + * + * Inserts variable text string information into the body ofa message. + */ + +extern unsigned far pascal DOSINSMESSAGE ( + char far * far *, /* Table of variables to insert */ + unsigned, /* Number of variables */ + char far *, /* Address of output buffer */ + unsigned, /* Length of output buffer */ + unsigned, /* Length of message */ + char far *, /* Address of input string */ + unsigned far * ); /* Length of returned message */ + + + +/*** DosPutMessage - Output Message Text to Indicated Handle + * + * Outputs a message in a buffer passed by a caller to the + * specified handle. The function formats the buffer to + * prevent words from wrapping if displayed to a screen. + */ + +extern unsigned far pascal DOSPUTMESSAGE ( + unsigned, /* Handle of output file/device */ + unsigned, /* Length of message buffer */ + char far * ); /* Message buffer */ + + + +/*** RAS Services + * + * DosSysTrace + */ + + + +/*** DosSysTrace - Add a Trace record to the System Trace Buffer + * + * Allows a subsystem or system extension to add information to the + * System trace buffer. This call can only be made from protected + * mode. + */ + +extern unsigned far pascal DOSSYSTRACE ( + unsigned, /* Major trace event code (0-255) */ + unsigned, /* Length of area to be recorded */ + unsigned, /* Minor trace event code (0-FFFFH) */ + char far * ); /* Pointer to area to be traced */ + + + +/*** Program Startup Conventions + * + * DosGetEnv + * DosGetVersion + */ + + + +/*** DosGetEnv - Get the Address of Process' Environment String + * + * Return the address of the current process' environment string + */ + +extern unsigned far pascal DOSGETENV ( + unsigned far *, /* Address to place segment handle */ + unsigned far * ); /* Address for command line start */ + + + +/*** DosGetVersion - Get DOS Version + * + * Returns the DOS version number + */ + +extern unsigned far pascal DOSGETVERSION ( + unsigned far * ); /* Address to put version number */ + + + +/*** World Trade Support + * + * All of these functions declarations have the string NLS in a comment. + * This is required in the generation of the Imports Library DOSCALLS.LIB + * + * DosGetCtryInfo + * DosSetCtryCode + * DosGetDBCSEv + * DosCaseMap + * DosGetSpecChar + * DosCollate + */ + + + +/*** DosGetCtryInfo + * + * Returns the country dependant formatting information that + * resides in the NLSCDIT.SYS World Trade Support file + */ + +extern unsigned far pascal DOSGETCTRYINFO ( /**/ + unsigned, /* Length of data area provided */ + unsigned long far *, /* Country code */ + char far *, /* Memory buffer */ + unsigned far * ); /* Length of returned data */ + + + +/*** DosSetCrtyCode + * + * Sets the current country code for the system + */ + +extern unsigned far pascal DOSSETCTRYCODE ( /**/ + unsigned long far * ); /* Country code */ + + + +/*** DosGetDBCSEv - Get the DBCS Environment Vector + * + * Used to obtain the DBCS environmental vector that resides in + * the NLSDBCS.SYS World Trade Support file. + */ + +extern unsigned far pascal DOSGETDBCSEV ( /**/ + unsigned, /* Length of data area provided */ + unsigned long far *, /* Country code */ + char far * ); /* Pointer to data area */ + + + +/*** DosCaseMap + * + * Used to perform case mapping on a string of binary values which + * represent ASCII characters. + */ + +extern unsigned far pascal DOSCASEMAP ( /**/ + unsigned, /* Length of string to case map */ + unsigned long far *, /* Country code */ + char far * ); /* Address of string of binary values */ + + + +/*** DosGetSpecChar + * + * Gets a list of special characters that are valid in file names, etc. + * The list corresponds to the byte values 128-255. + */ + +extern unsigned far pascal DOSGETSPECCHAR ( /**/ + unsigned, /* Length of data area provided */ + unsigned long far *, /* Country Code */ + unsigned char far * ); /* Data area */ + + + +/*** DosCollate + * + * Undocumented NLS feature + */ + +extern unsigned far pascal DOSCOLLATE ( /**/ + unsigned, /* Buffer Length */ + unsigned long far *, /* Country Code */ + char far * ); /* Buffer Address */ + + + +/* 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 @@ + +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "fdiskmsg.h" /* AN000 */ +#include "string.h" /* AN000 */ +#include "ctype.h" /* AN000 */ +#include "stdio.h" /* AN000 */ + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: DELETE_PARTITION */ +/* */ +/* DESCRIPTIVE NAME: Delete partition selection menu */ +/* */ +/* FUNCTION: User is prompted as to what type of DOS partition */ +/* he wishes to delete. */ +/* */ +/* NOTES: The delete volume option is only displayed if some */ +/* disk volumes exist */ +/* */ +/* The following screen is managed */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³Delete DOS Partition ³ */ +/* 05³ ³ */ +/* 06³Current Fixed Disk Drive: # ³ */ +/* 07³ ³ */ +/* 08³Enter the type of DOS partition you ³ */ +/* 09³wish to delete..............? ³ */ +/* 10³ ³ */ +/* 11³ 1. Normal DOS partition ³ */ +/* 12³ 2. EXTENDED DOS Partition ³ */ +/* 13³ 3. Disk volume in the EXTENDED ³ */ +/* 14³ DOS Partition ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³Enter choice: [#] ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: Delete_Partition */ +/* LINKAGE: delete_partition() */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if case statement */ +/* failure when branching to requested function */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* clear_screen */ +/* wait_for_ESC */ +/* get_num_input */ +/* internal_program_error */ +/* dos_delete */ +/* ext_delete */ +/* vol_delete */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void delete_partition() + +BEGIN + + unsigned i; + char input; + char temp; + char max_input; + + + input = c(NUL); /* AC000 */ + /* clear_screen */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + /* Display header */ + display(menu_25); + + /* Setup and print current disk */ + insert[0] = cur_disk+1+'0'; + display(menu_5); + + /* print ESC prompt */ + display(menu_11); + + /* check to see if there is an avail partition */ + temp = c(0); /* AC000 */ + for (i = u(0); i < u(4);i++) /* AC000 */ + BEGIN + + /* See if any non - zero system id bytes */ + temp = temp | part_table[cur_disk][i].sys_id ; + END + /* Any entry that isn't zero means */ + if (temp != c(0)) /* AC000 */ + BEGIN + /* ############# ADD CODE HERE FOR THIS FUNCTION ############## */ + /* Do something about defaults and highlighting */ + /* */ + /* ############################################################ */ + + /* Display enter prompts */ + /* display dos delete menu without input prompt */ + display(menu_3); + display(menu_25); + display(menu_26); + display(menu_7); + + display(menu_27); /* AC000 */ + max_input = c(3); /* AC000 */ + + input = get_num_input(c(NUL),max_input,input_row,input_col); /* AC000 */ + /* Go branch to the requested function */ + switch(input) + BEGIN + case '1': + if (find_partition_type(uc(DOS12)) || /* AN016 AC016 */ + find_partition_type(uc(DOS16)) || /* AN016 AC016 */ + find_partition_type(uc(DOSNEW))) /* AN016 AC016 */ + dos_delete(); + else /* AN000 */ + BEGIN /* AN000 */ + /* No Pri partition to delete */ + clear_screen(u(17),u(0),u(17),u(79)); /* AN000 */ + display(error_6); /* AN000 */ + wait_for_ESC(); /* AN000 */ + END /* AN000 */ + break; + + case '2': + if (find_partition_type(uc(EXTENDED))) /* AN000 */ + ext_delete(); + else /* AN000 */ + BEGIN /* AN000 */ + /* No Ext partition to delete */ + clear_screen(u(17),u(0),u(17),u(79)); /* AN000 */ + display(error_7); /* AN000 */ + wait_for_ESC(); /* AN000 */ + END /* AN000 */ + break; + + case '3': + if ((find_partition_type(uc(EXTENDED))) && (find_logical_drive())) /* AC000 */ + volume_delete(); + else + BEGIN + clear_screen(u(17),u(0),u(17),u(79)); /* AN000 */ + display(error_36); /* AN000 */ + wait_for_ESC(); /* AN000 */ + END /* AN000 */ + break; + + case ESC: break; + + default : internal_program_error(); + break; + END + END + else + BEGIN + display(error_14); + wait_for_ESC(); + END + /* clear the screen before going back to main menu */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + return; +END + + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: DOS_DELETE */ +/* */ +/* DESCRIPTIVE NAME: Delete DOS partition */ +/* */ +/* FUNCTION: Delete the DOS partition. Prompt user with dire */ +/* warning first. Default entry on prompt is (N) */ +/* */ +/* NOTES: Screen can be exited via the ESC command before */ +/* partition is deleted and nothing will change */ +/* */ +/* The following screen is managed */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³Delete DOS Partition ³ */ +/* 05³ ³ */ +/* 06³Current Fixed Disk Drive: # ³ */ +/* 07³ ³ */ +/* 08³Partition Status Type Start End Size³ */ +/* 09³ # # ####### #### #### ####³ */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³Total disk space is #### cylinders. ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³Warning! Data in the DOS partition ³ */ +/* 19³will be lost. Do you wish to ³ */ +/* 20³continue..........................? [N] ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: DOS_Delete */ +/* LINKAGE: dos_delete */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if invalid input */ +/* returned to this level */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES */ +/* table_display */ +/* clear_screen */ +/* wait_for_ESC */ +/* get_yn_input */ +/* display */ +/* Write_Boot_Record */ +/* find_part_free_space */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void dos_delete() + +BEGIN + + char input; + unsigned i; + + + input = c(NUL); /* AC000 */ + /* clear screen */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + /* Display header */ + display(menu_28); + + /* Setup and print current disk */ + insert[0] = cur_disk+1+'0'; + display(menu_5); + + /* print ESC prompt */ + display(menu_11); + + /* Display partition data and double check if partition exists*/ + if (table_display()) + BEGIN + + sprintf(insert,"%4.0d",total_mbytes[cur_disk]); + display(menu_15); + + /* See if drive 1 and extended partition exists */ + + if (!(find_partition_type(uc(EXTENDED)) && (cur_disk == c(0)))) /* AC000 */ + BEGIN + + /* Nope, we can keep going */ + /* Display Y/N prompt */ + display(menu_29); + + /* Get yes/no prompt */ + input = get_yn_input(c(No),input_row,input_col); /* AC000 AC011 */ + switch(input) + BEGIN + case 1: /* AC000 */ + BEGIN + for (i=u(0); i < u(4); i++) /* AC000 */ + BEGIN + + if ( (part_table[cur_disk][i].sys_id==uc(DOS12)) || + (part_table[cur_disk][i].sys_id==uc(DOS16)) || + (part_table[cur_disk][i].sys_id==uc(DOSNEW)) ) /* AC000 */ + + BEGIN + /* Set Partition entry to zero */ + part_table[cur_disk][i].boot_ind = uc(0); /* AC000 */ + part_table[cur_disk][i].start_head = uc(0); /* AC000 */ + part_table[cur_disk][i].start_sector = uc(0); /* AC000 */ + part_table[cur_disk][i].start_cyl = u(0); /* AC000 */ + part_table[cur_disk][i].sys_id = uc(0); /* AC000 */ + part_table[cur_disk][i].end_head = uc(0); /* AC000 */ + part_table[cur_disk][i].end_sector = uc(0); /* AC000 */ + part_table[cur_disk][i].end_cyl = u(0); /* AC000 */ + part_table[cur_disk][i].rel_sec = ul(0); /* AC000 */ + part_table[cur_disk][i].num_sec = ul(0); /* AC000 */ + part_table[cur_disk][i].changed = (FLAG)TRUE; /* AC000 */ + part_table[cur_disk][i].mbytes_used = f(0); /* AN000 */ + part_table[cur_disk][i].percent_used = u(0); /* AN000 */ + + strcpy(part_table[cur_disk][i].system,c(NUL)); /* AN000 */ + strcpy(part_table[cur_disk][i].vol_label,c(NUL)); /* AN000 */ + + /* Redisplay the partition info */ + table_display(); + + /* clear the prompt off */ + clear_screen(u(16),u(0),u(23),u(79)); /* AC000 */ + + /* Set the reboot flag */ + reboot_flag = (FLAG)TRUE; /* AC000 */ + + /* Say that you deleted it */ + display(status_1); + + wait_for_ESC(); + break; + END + END + END + break; + + case 0: break; /* AC000 */ + + case ESC: break; + + default: + BEGIN + internal_program_error(); + break; + END + END + END + else + BEGIN + /* Tell user he can't do it while extended exists on drive 1 */ + display(error_32); + wait_for_ESC(); + END + END + + else + BEGIN + internal_program_error(); + END + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + return; +END + + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: EXT_DELETE */ +/* */ +/* DESCRIPTIVE NAME: Delete EXTENDED DOS partition */ +/* */ +/* FUNCTION: Delete the EXTENDED DOS partition. Prompt with */ +/* warning first. Default entry on prompt is (N) */ +/* */ +/* NOTES: Screen can be exited via the ESC command before */ +/* partition is deleted and nothing will change */ +/* */ +/* The following screen is managed */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³Delete EXTENDED DOS Partition ³ */ +/* 05³ ³ */ +/* 06³Current Fixed Disk Drive: # ³ */ +/* 07³ ³ */ +/* 08³Partition Status Type Start End Size³ */ +/* 09³ # # ####### #### #### ####³ */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³Total disk space is #### cylinders. ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³Warning! Data in the EXTENDED DOS ³ */ +/* 19³partition will be lost. Do you wish ³ */ +/* 20³to continue.......................? [N] ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: Ext_Delete */ +/* LINKAGE: ext_delete () */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if invalid input */ +/* returned to this routine */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* table_display */ +/* clear_screen */ +/* wait_for_ESC */ +/* get_yn_input */ +/* display */ +/* Write_Boot_Record */ +/* Internal_Program_Error */ +/* Find_Free_Space */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void ext_delete() + + +BEGIN + + char input; + unsigned i; + unsigned j; /* AN000 */ + + + input = c(NUL); /* AC000 */ + /* Clear the screen */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + /* Display header */ + display(menu_30); + + /* Setup and print current disk */ + insert[0] = cur_disk+1+'0'; + display(menu_5); + + /* print ESC prompt */ + display(menu_11); + + /* Display partition data and double check if partition exists*/ + table_display(); /* AC000 */ + sprintf(insert,"%4.0d",total_mbytes[cur_disk]); + display(menu_15); + + BEGIN + /* See if there are still volumes */ + if (!find_logical_drive()) + BEGIN + /* Display Y/N prompt */ + display(menu_31); + + /* Get yes/no prompt */ + input = get_yn_input(c(No),input_row,input_col); /* AC000 AC011 */ + switch(input) + BEGIN + case 1: /* AC000 */ + BEGIN + for (i=u(0); i < u(4); i++) /* AC000 */ + /* Note: This will delete all occurances of EXTENDED DOS partitions found */ + BEGIN + if (part_table[cur_disk][i].sys_id == uc(EXTENDED)) /* AC000 */ + BEGIN + /* Set Partition entry to zero */ + part_table[cur_disk][i].boot_ind = uc(0); /* AC000 */ + part_table[cur_disk][i].start_head = uc(0); /* AC000 */ + part_table[cur_disk][i].start_sector = uc(0); /* AC000 */ + part_table[cur_disk][i].start_cyl = u(0); /* AC000 */ + part_table[cur_disk][i].sys_id = uc(0); /* AC000 */ + part_table[cur_disk][i].end_head = uc(0); /* AC000 */ + part_table[cur_disk][i].end_sector = uc(0); /* AC000 */ + part_table[cur_disk][i].end_cyl = u(0); /* AC000 */ + part_table[cur_disk][i].rel_sec = ul(0); /* AC000 */ + part_table[cur_disk][i].num_sec = ul(0); /* AC000 */ + part_table[cur_disk][i].changed = (FLAG)TRUE; /* AC000 */ + part_table[cur_disk][i].mbytes_used = f(0); /* AN000 */ + part_table[cur_disk][i].percent_used = u(0); /* AN000 */ + + strcpy(part_table[cur_disk][i].system,c(NUL)); /* AN000 */ + strcpy(part_table[cur_disk][i].vol_label,c(NUL)); /* AN000 */ + + /* Redisplay the partition info */ + table_display(); + + /* clear the prompt off */ + clear_screen(u(17),u(0),u(23),u(79)); /* AC000 */ + + /* Say that you deleted it */ + display(status_2); + + /* Set the reboot flag */ + reboot_flag = (FLAG)TRUE; /* AC000 */ + END + END + wait_for_ESC(); + break; + END + + case 0: break; /* AC000 */ + + case ESC: break; + + default: internal_program_error(); + break; + END + END + else + BEGIN + /* Logical drives still exist, can't delete partition */ + display(error_21); + wait_for_ESC(); + END + END + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + return; +END + + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: VOL_DELETE */ +/* */ +/* DESCRIPTIVE NAME: Delete DOS disk Volume */ +/* */ +/* FUNCTION: Prompts user to delete a DOS disk volume */ +/* */ +/* NOTES: Screen can be exited via the ESC command before */ +/* partition is deleted and nothing will change */ +/* */ +/* The following screen is managed */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³Delete DOS Disk Volume ³ */ +/* 01³ ³ */ +/* 02³Vol Start End Size ³ */ +/* 03³ # #### #### #### ³ */ +/* 04³ ³ */ +/* 05³ ³ */ +/* 06³ ³ */ +/* 07³ ³ */ +/* 08³ ³ */ +/* 09³ ³ */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³ ³ */ +/* 15³ ³ */ +/* 16³Total partition size is #### cylinders. ³ */ +/* 17³ ³ */ +/* 18³Warning! Data in the DOS disk volume ³ */ +/* 19³will be lost. What volume do you wish ³ */ +/* 20³to delete.........................? [#] ³ */ +/* 21³ ³ */ +/* 22³Are you sure......................? [N] ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: Vol_Delete */ +/* LINKAGE: vol_delete () */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if invalid input */ +/* returned to this routine */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* clear_screen */ +/* display */ +/* volume_display */ +/* get_num_input */ +/* wait_for_ESC */ +/* get_yn_input */ +/* Write_Boot_Record */ +/* Find_Free_Space */ +/* Internal_Program_Error */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void volume_delete() + +BEGIN + + char input; + char drive_input; + char high_drive; + char low_drive; + char error_low_drive; + char error_high_drive; + char drives_reassigned; + int list_index; + int i; + int j; /* AN011 */ + int point; + FLAG delete_drive; + unsigned char drive_list[23][2]; + int column; + int row; + FLAG drives_exist; + FLAG vol_matches; + char temp; + unsigned char drive_temp; + char far *s; + unsigned char string_input[12]; /* AN000 */ + + input = c(NUL); + string_input[0] = uc(NUL); /* AN000 */ + + /* Clear screen */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + /* Display header */ + display(menu_32); + + /* print ESC prompt */ + display(menu_11); + + /* Display logical drives and get the highest drive letter assigned*/ + high_drive = volume_display(); + + /* Get the first avail drive letter to be deleted */ + low_drive = (high_drive - get_num_logical_dos_drives()+1); + temp = low_drive; + + /* Initialize array of drive letters that exist at this point */ + for (i=(int)0; i < (int)23; i++) /* AC000 */ + BEGIN + /* See if we've exceeded the drive letter range */ + if (temp <= high_drive) + BEGIN + /* Put in drive letter */ + drive_list[i][0] = ((unsigned char)(temp)); + /* Initialize the offsets into the array to something harmless */ + drive_list[i][1] = uc(INVALID); /* AC000 */ + END + else + BEGIN + /* No drive there, put in NUL */ + drive_list[i][0] = uc(NUL); /* AC000 */ + drive_list[i][1] = uc(INVALID); /* AC000 */ + END + + /* Check for next drive */ + temp++; + END + + /* Set up partition size message */ + sprintf(insert,"%4.0d",get_partition_size( uc(EXTENDED) ) ); + display(menu_21); + + /* Assume no drives deleted */ + drives_reassigned = (FLAG)FALSE; /* AC000 */ + + /* Loop until ESC or all deleted */ + while (input != c(ESC)) /* AC000 */ + BEGIN + + /* Are there any drives left?*/ + drives_exist = (FLAG)FALSE; /* AC000 */ + error_low_drive = ((char)(NUL)); + error_high_drive = ((char)(NUL)); + + for (i=(int)0;i < (int)23; i++) /* AC000 */ + BEGIN + drive_temp = drive_list[i][0]; + if ((drive_temp != uc(NUL)) && (drive_list[i][1] != uc(DELETED))) /* AC011 */ + BEGIN + drives_exist = (FLAG)TRUE; /* AC000 */ + + /* Find last existing drive letter */ + error_high_drive = ((char)(drive_temp)); + + /* See if we've found the first drive yet */ + if (error_low_drive == ((char)(NUL))) + error_low_drive = ((char)(drive_temp)); + END + END + + /* If there are drives, go let user try to delete them */ + if (drives_exist) + BEGIN + + /* Get input until given a correct drive */ + valid_input = (FLAG)FALSE; /* AC000 */ + while ( (!valid_input) && (input != c(ESC)) ) + BEGIN + + /* Prompt for input */ + display(menu_33); + + /* Get input between first and highest drive letters */ + clear_screen( u(21), u(0), u(21), u(79) ); + input = get_alpha_input(low_drive,high_drive,input_row,input_col,error_low_drive,error_high_drive); + drive_input = input; + + /* See if it has been deleted already or ESC pressed */ + drives_exist = FALSE; + for (i=(int)0;i < (int)23; i++) /* AC000 */ + BEGIN + if (drive_list[i][0] == ((unsigned char)(drive_input)) && + (drive_list[i][1] != ((unsigned char) DELETED))) /* AC013 */ + BEGIN + drives_exist = TRUE; + list_index = i; + END + if (ext_table[cur_disk][i].drive_letter == c(drive_input) ) + point = i; + END + END + + /* Input volume string to confirm delete */ + vol_matches = FALSE; + if (input != c(ESC)) + BEGIN + if (drives_exist) + BEGIN + /* delete privious volume mismatch message */ + string_input[0] = uc(NUL); /* AN000 */ + clear_screen( u(22), u(0), u(23), u(79) ); + /* Get input volume label */ + display(menu_41); /* AN000 */ + get_string_input(input_row,input_col,string_input); /* AN000 */ + if (string_input[0] == uc(ESC)) input = c(ESC); + + /* See if the volume id matches the selected drive */ /* AN000 */ + if (strcmp(ext_table[cur_disk][point].vol_label,string_input) == (int)ZERO) + vol_matches = TRUE; /* AN000 */ + else if (input != c(ESC)) display(error_34); + END + else + BEGIN + /* Tell user the drive has already been deleted */ + insert[0] = dos_upper(drive_input); /* AC000 */ + insert[1] = c(DRIVE_INDICATOR); /* AC000 */ + clear_screen( u(21), u(0), u(22), u(79) ); /* AN000 */ + display(error_29); + END + + END + + /* If it is a valid drive indicate that the input was ok */ + if ( (input != c(ESC)) && (drives_exist) && (vol_matches) ) /* AC000 */ + BEGIN + valid_input = TRUE; + + /* At this point we have a valid drive letter to delete */ + + /* Get the offset into the array for the drive to be deleted */ + delete_drive = find_ext_drive(drive_input - low_drive); + + /* Got a drive letter - prompt are you sure */ + display(menu_34); + + /* Get Y/N input, default is NO */ + input = get_yn_input(c(No),input_row,input_col); /* AC000 AC011 */ + + /* Clear everything out on screen in prompt area */ + clear_screen(u(23),u(0),u(23),u(79)); /* AC000 */ + + /* Go handle the delete */ + switch(input) + BEGIN + case 1: /* AC000 */ + BEGIN + /* Go ahead and mark it deleted in list array */ + + /* Throw up a flag to indicate we need to delete this one for real later */ + /* This is because if we change the ext_table array now, we lose the ability */ + /* to match up drive letters with locations, or at least it become more */ + /* complicated than I felt like figuring out, so mark it now and do it later */ + drive_list[list_index][1] = (unsigned char)DELETED; /* AC011 */ + + drives_reassigned = TRUE; + + /* Put prompt up on screen */ + for (i=(int)0; i < (int)23; i++) /* AC000 */ + BEGIN + /* See if drive deleted */ + if (drive_list[i][1] == uc(DELETED)) /* AC011 */ + BEGIN + /* Wipe out the drive info and print deleted message */ + /* See what column it is in */ + if (i < (int)12) /* AC000 */ + BEGIN + column = (int)4; /* AC000 */ + row = (int)(4 + i - (int)0); + clear_screen( (unsigned)row, (unsigned)column, + (unsigned)row, (unsigned)39 ); + END + else + BEGIN + column = (int)45; /* AC000 */ + row = (int)(4 + i - (int)12); + clear_screen( (unsigned)row, (unsigned)column, + (unsigned)row, (unsigned)79 ); + END + + /* Put the start row,col of message in the message string */ + s=status_3; + s++; + *s++ = ((char)(row/10))+'0'; + *s++ = ((char)(row%10))+'0'; + *s++ = ((char)(column/10))+'0'; + *s = ((char)(column%10))+'0'; + display(status_3); + END + END + /* Set the reboot flag */ + reboot_flag = TRUE; + clear_screen( u(21), u(0), u(23), u(79) ); /* AN000 */ + break; + END + + case ESC: + case 0: + clear_screen( u(21), u(0), u(23), u(79) ); /* AN000 */ + break; /* AC000 */ + + default: + internal_program_error(); + break; + END + END + + END + else /* drives do not exist! */ + BEGIN + /* No more logical drives to delete */ + clear_screen(u(16),u(0),u(21),u(79)); /* AC000 */ + display(error_22); + input = wait_for_ESC(); + END + END /* while input != esc */ + + if (drives_reassigned) + BEGIN + /* If anything got deleted, lets go do it for real */ + for (i=(int)0; i < (int)23;i++) /* AC000 */ + BEGIN + if (drive_list[i][1] == uc(DELETED)) /* AC011 */ + BEGIN /* AN011 */ + for (j=(int)0; j < (int)23;j++) /* AN011 */ + BEGIN /* AN011 */ + if (drive_list[i][0] == ext_table[cur_disk][j].drive_letter) /* AN011 */ + BEGIN + /* Zero sys id and show it changed */ + ext_table[cur_disk][j].boot_ind = uc(0); /* AC000 */ + ext_table[cur_disk][j].start_head = uc(0); /* AC000 */ + ext_table[cur_disk][j].start_sector = uc(0); /* AC000 */ + ext_table[cur_disk][j].start_cyl = u(0); /* AC000 */ + ext_table[cur_disk][j].sys_id = uc(0); /* AC000 */ + ext_table[cur_disk][j].end_head = uc(0); /* AC000 */ + ext_table[cur_disk][j].end_sector = uc(0); /* AC000 */ + ext_table[cur_disk][j].end_cyl = u(0); /* AC000 */ + ext_table[cur_disk][j].rel_sec = ul(0); /* AC000 */ + ext_table[cur_disk][j].num_sec = ul(0); /* AC000 */ + ext_table[cur_disk][j].mbytes_used = f(0); /* AN000 */ + ext_table[cur_disk][j].percent_used = u(0); /* AN000 */ + ext_table[cur_disk][j].changed = TRUE; /* AN000 */ + ext_table[cur_disk][j].drive_letter = NUL; /* AN000 */ + strcpy(ext_table[cur_disk][j].system,c(NUL)); /* AN000 */ + strcpy(ext_table[cur_disk][j].vol_label,c(NUL)); /* AN000 */ + END /* AN011 */ + END /* AN011 */ + END + END + + /* Show new drive letters */ + volume_display(); + + /* Say that drive letters changed */ + clear_screen(u(16),u(0),u(23),u(79)); /* AC000 */ + display(status_10); + wait_for_ESC(); + END + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + return; + +END + 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 @@ + +/* */ +/* */ +/****************************************************************************/ +/* Declare Global variables */ +/****************************************************************************/ +/* */ + + + +extern char cur_disk; +extern FLAG good_disk[2]; +extern unsigned char number_of_drives; +extern FLAG reboot_flag; +extern char errorlevel; +extern char max_partition_size; +extern char sort[24]; +extern FLAG no_fatal_error; /* AC000 */ +extern char valid_input; +extern unsigned char video_mode; +extern unsigned char display_page; +extern unsigned char video_attribute; /* AN006 */ + +extern unsigned total_disk[2]; /* AN000 */ +extern XFLOAT total_mbytes[2]; /* AN000 */ +extern unsigned char max_sector[2]; +extern unsigned max_head[2]; /* AC004 */ +extern unsigned required_cyls[2]; + +extern unsigned input_row; +extern unsigned input_col; +extern char insert[800]; /* AC000 */ +extern char *pinsert; + +extern unsigned char master_boot_record[2][512]; +extern unsigned char boot_record[512]; + +extern char next_letter; /* AN000 */ +extern FLAG primary_flag; /* AN000 */ +extern FLAG extended_flag; /* AN000 */ +extern FLAG logical_flag; /* AN000 */ +extern FLAG disk_flag; /* AN000 */ +extern FLAG quiet_flag; /* AN000 */ +extern unsigned primary_buff; /* AN000 */ +extern unsigned extended_buff; /* AN000 */ +extern unsigned logical_buff; /* AN000 */ +extern char cur_disk_buff; /* AN000 */ +extern unsigned long NOVAL; /* AN000 */ +extern char next_letter; /* AN000 */ +extern FLAG PercentFlag; /* AN000 */ + +extern FLAG mono_flag; /* AN006 */ + +extern char Yes; /* AN012 */ +extern char No; /* AN012 */ + +extern unsigned Parse_Ptr; /* AN010 */ +/* */ +/* */ +/****************************************************************************/ +/* Define Global structures */ +/****************************************************************************/ +/* */ + +extern struct entry part_table[2][4]; +extern struct entry ext_table[2][24]; +extern struct freespace free_space[24]; +extern struct KeyData *input_data; +extern struct dx_buffer_ioctl dx_buff; /* AN000 */ +extern struct SREGS segregs; +extern struct subst_list sublist; /* AN000 */ +extern struct diskaccess disk_access; /* AN002 */ +extern struct sublistx sublistp[1]; /* AN010 */ + +/* */ +/****************************************************************************/ +/* Define UNIONS */ +/****************************************************************************/ +/* */ + +extern union REGS regs; + 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 @@ +; BOOT - IBM hard disk boot record 6/8/82 +; +; +; This is the standard boot record that will be shipped on all hard disks. It contains: +; +; 1. Code to load (and give control to) the boot record for 1 of 4 possible +; operating systems. +; +; 2. A partition table at the end of the boot record, followed by the required signature. +; +; +_data segment public + assume cs:_data,ds:_data + + org 600h + + cli ;no interrupts for now + xor ax,ax + mov ss,ax + mov sp,7c00h ;new stack at 0:7c00 + mov si,sp ;where this boot record starts - 0:7c00 + push ax + pop es ;seg regs the same + push ax + pop ds + sti ;interrupts ok now + cld + mov di,0600h ;where to relocate this boot record to + mov cx,100h + repnz movsw ;relocate to 0:0600 +; jmp entry2 + db 0eah + dw $+4,0 +entry2: + mov si,offset tab ;partition table + mov bl,4 ;number of table entries +next: + cmp byte ptr[si],80h ;is this a bootable entry? + je boot ;yes + cmp byte ptr[si],0 ;no, is boot indicator zero? + jne bad ;no, it must be x"00" or x"80" to be valid + add si,16 ;yes, go to next entry + dec bl + jnz next + int 18h ;no bootable entries - go to rom basic +boot: + mov dx,[si] ;head and drive to boot from + mov cx,[si+2] ;cyl, sector to boot from + mov bp,si ;save table entry address to pass to partition boot record +next1: + add si,16 ;next table entry + dec bl ;# entries left + jz tabok ;all entries look ok + cmp byte ptr[si],0 ;all remaining entries should begin with zero + je next1 ;this one is ok +bad: + mov si,offset m1 ;oops - found a non-zero entry - the table is bad +msg: + lodsb ;get a message character + cmp al,0 + je hold + push si + mov bx,7 + mov ah,14 + int 10h ;and display it + pop si + jmp msg ;do the entire message +; +hold: jmp hold ;spin here - nothing more to do +tabok: + mov di,5 ;retry count +rdboot: + mov bx,7c00h ;where to read system boot record + mov ax,0201h ;read 1 sector + push di + int 13h ;get the boot record + pop di + jnc goboot ;successful - now give it control + xor ax,ax ;had an error, so + int 13h ;recalibrate + dec di ;reduce retry count + jnz rdboot ;if retry count above zero, go retry + mov si,offset m2 ;all retries done - permanent error - point to message, + jmp msg ;go display message and loop +goboot: + mov si,offset m3 ;prepare for invalid boot record + mov di,07dfeh + cmp word ptr [di],0aa55h ;does the boot record have the + ; required signature? + jne msg ;no, display invalid system boot record message + mov si,bp ;yes, pass partition table entry address + db 0eah + dw 7c00h,0 + +include fdisk5.cl1 + + org 7beh +tab: ;partition table + dw 0,0 ;partition 1 begin + dw 0,0 ;partition 1 end + dw 0,0 ;partition 1 relative sector (low, high parts) + dw 0,0 ;partition 1 # of sectors (low, high parts) + dw 0,0 ;partition 2 begin + dw 0,0 ;partition 2 end + dw 0,0 ;partition 2 relative sector + dw 0,0 ;partition 2 # of sectors + dw 0,0 ;partition 3 begin + dw 0,0 ;partition 3 end + dw 0,0 ;partition 3 relative sector + dw 0,0 ;partition 3 # of sectors + dw 0,0 ;partition 4 begin + dw 0,0 ;partition 4 end + dw 0,0 ;partition 4 relative sector + dw 0,0 ;partition 4 # of sectors +signa db 55h,0aah ;signature + +_data ends + end + \ 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 @@ +.xlist +; +; +;***************************************************************************** +;* * +;* Change list to FDISK modules * +;* * +;* Lines are tagged ANxxx for new, ACxxx for changed * +;* --------------------------------------------------------------------------* +;* 000 - DOS 4.0 Spec additions and DCR's thru unit/function test * +;* Date: 12/31/87 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 001 - DOS 4.0 DCR D468 Add errorlevel 1 on exit if there is no PRIMARY * +;* partition and the /Q switch is specified. This was done for * +;* SELECT. * +;* Date: 02/06/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 002 - DOS 4.0 PTM P3383 Add logic to use undocumented int 21 to check * +;* media to see if it has been formatted or not. CHECK_FORMAT added. * +;* Date: 02/08/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 003 - DOS 4.0 PTM P3589 Change CONVERT.C to compare for a period in the * +;* get_volume_string routine. It does a find first on the logical * +;* drive for the volume name and must copy it without the period. * +;* Date: 02/22/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 004 - DOS 4.0 PTM P3744 Change FDISK logic to display and handle a hard * +;* file of up to 4,000 MB. * +;* Date: 03/04/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 005 - DOS 4.0 PTM P3618 Add errorlevel 2 on exit if there is no changes * +;* made and the /Q switch is specified. This was done for * +;* SELECT. * +;* Date: 02/25/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 006 - DOS 4.0 PTM P3617 Change FDISK to color screens. This is done for * +;* SELECT. * +;* Date: 02/25/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 007 - DOS 4.0 DCR D490 Change FDISK IOCTL 63 to 66 in FDISK.H. * +;* Date: 02/26/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 008 - DOS 4.0 PTM P3698 Logic change for PTM 3618 was bad and had to * +;* to be corrected. * +;* Also changed FDISK IOCTL 64 to 67 in FDISK.H. * +;* Date: 02/26/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 009 - DOS 4.0 PTM P3938 A variable (temp) in subroutine * +;* write_info_to_disk was not initialized on entry. * +;* Date: 03/22/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 010 - DOS 4.0 PTM P4071 Changed the parsar logic to output the correct * +;* error message when parse is not correct. * +;* Date: 03/30/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 011 - DOS 4.0 PTM P4837 When deleting and allocating FDISK logical drives* +;* FDISK was deleting the wrong drives. * +;* Date: 05/12/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 012 - DOS 4.0 PTM P4835 FDISK had Y and N hard coded for YES and NO. * +;* Need to pick up 'Y' and 'N' translations from message file. * +;* Date: 05/12/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 013 - DOS 4.0 PTM P4883 FDISK will allow the deletion of a logical * +;* drive that has already been deleted. This error was caused by * +;* the logic change of P4837. * +;* Date: 05/17/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 014 - DOS 4.0 PTM P4953 FDISK displays too many files open error message * +;* when Cannot FDISK with Network Loaded message should be displayed.* +;* Date: 05/23/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 015 - DOS 4.0 PTM P5019 FDISK displays Insufficient memory error message * +;* when Invalid Parameter should be displayed. * +;* Logic has also been added to only get the volume ID of a logical * +;* drive by doing a Int 21 11h instead of IOCTL call 0866h. * +;* Date: 06/02/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;* 016 - DOS 4.0 PTM P5031 FDISK displays the wrong error message with 4 * +;* partitions allocated on same disk and trying to delete primary * +;* partition. * +;* Date: 06/06/88 Developer: Dennis M * +;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * +;***************************************************************************** +;* Note: This is file FDCHNG.INC for updating purposes * +;***************************************************************************** +.list + 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 @@ + +/* */ + + + +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SOURCE FILE NAME: FDISK */ +/* */ +/* DESCRIPTIVE NAME: FIXED DISK PARTITIONING UTILITY */ +/* */ +/* FUNCTION: */ +/* Allows creation and deletion of DOS related partitions */ +/* on fixed disk devices 80-81h (int 13h BIOS defined, */ +/* DOS). Also allows display of all partitions, and will */ +/* allow a partition to be marked active (bootable). The */ +/* user will be prompted for action thru a full screen */ +/* interface. The user can also create, delete and display */ +/* logical DOS drives within a EXTENDED DOS Partition. If a*/ +/* regular DOS partition is created, the beginning of the */ +/* partition will be scanned to insure a contiguous area of*/ +/* good sectors on the disk large enough to satisfy the */ +/* DOS system requirements. If a bad spot is found, the */ +/* start of the partition will be moved out until a good */ +/* area is located */ +/* */ +/* NOTES: The program will work by setting up a logical image */ +/* of all relevant disk information at initilization */ +/* time. All operations will be performed on this */ +/* logical image, thus reducing disk accesses to only */ +/* those required to initially set up the logical image,*/ +/* and to write the changed information at the end. The */ +/* user will be informed if there is a problem writing */ +/* the logical image back to the disk. */ +/* */ +/* FDISK will interface with the partition table in the */ +/* master boot record as defined in the PC-DOS technical*/ +/* reference manual. It will also create and manage the */ +/* EXTENDED DOS partition architecture as defined in the*/ +/* PC-DOS 3.30 functional spec (CP/DOS spec dcr pending)*/ +/* */ +/* ENTRY POINTS: MAIN */ +/* LINKAGE: [d:] [path] FDISK */ +/* */ +/* EXTERNAL REFERENCES: */ +/* Fixed Disk Master Boot Record */ +/* EXTENDED Partition Volume Boot Records */ +/* Note: Both of the above are physical data structures on */ +/* the surface of the disk */ +/* */ +/* P.S. - To whoever winds up maintaining this, I will */ +/* apoligize in advance. I had just learned 'C' when */ +/* writing this, so out of ignorance of the finer points*/ +/* of the langauge I did a lot of things by brute force.*/ +/* Hope this doesn't mess you up too much - MT 5/20/86 */ +/******************** END OF SPECIFICATIONS ********************/ + +#include +#include +#include +#include +#include +#include +#include /* AN000 */ +#include /* AN000 */ +#include /* AN000 */ +#include /* AN000 */ +#include /* AN000 */ + +/* */ +/**************************************************************************/ +/* */ +/* UTILITY NAME: FDISK.com */ +/* SOURCE FILE NAME: FDISK.c */ +/* STATUS: FDISK utility, DOS 3.3 */ +/* CHANGE HISTORY: UPDATED 5-29-87 DOS4.0 DRM */ +/* SYNTAX (Command line) */ +/* */ +/* [d:][path]FDISK */ +/* */ +/* or */ +/* */ +/* [d:][path]FDISK d [/PRI:m | /EXT:n | /LOG:o ...] */ +/* */ +/* d: Drive to load FDISK utility from */ +/* */ +/* path path to the directory on specified drive to */ +/* load FDISK from */ +/* */ +/* d Drive (1 or 2) that FDISK should operate on */ +/* */ +/* /PRI:m Size of Primary DOS partition to create in K */ +/* */ +/* /EXT:n Size of Extended DOS partition to create in K */ +/* */ +/* /LOG:o Size of Logical drive to create in K in the */ +/* extended partition */ +/* */ +/* UTILITY FUNCTION: */ +/* Allows you to create, set up, display, and delete the */ +/* DOS partitions on a fixed disk. */ +/* */ +/**************************************************************************/ + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: CHANGE_ACTIVE_PARTITION */ +/* */ +/* DESCRIPTIVE NAME: Change bootable partition */ +/* */ +/* FUNCTION: Will allow user to select the partition that will */ +/* recieve control when system is IPL'd. This is */ +/* only for the first hardfile as far as booting is */ +/* concerned, although partitions can be set active */ +/* the second. There are reserved partitions that may*/ +/* not be set active and this routine will enforce */ +/* that. */ +/* */ +/* NOTES: If no valid partition is specified, then the active */ +/* partition setting is left unchanged. Screen can be */ +/* exited via the ESC command before active partition */ +/* is changed and no action will take place */ +/* */ +/* The following screen is managed */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³Change Active Partition ³ */ +/* 05³ ³ */ +/* 06³Current Fixed Disk Drive: # ³ */ +/* 07³ ³ */ +/* 08³Partition Status Type Start End Size³ */ +/* 09³ # # ####### #### #### ####³ */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³Total disk space is #### cylinders. ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³Enter the number of the partition you ³ */ +/* 19³want to make active...............: [#] ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: Change_Active_Partition */ +/* LINKAGE: change_active_partition () */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if invalid num */ +/* input is returned to this level */ +/* */ +/* EFFECTS: Display prompts needed to guide user input, and */ +/* gets input from user. */ +/* */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* clear_screen */ +/* display */ +/* get_num_input */ +/* table_display */ +/* wait_for_ESC */ +/* internal_program_error */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void change_active_partition() + +BEGIN + + char temp; + char default_value; + char input; + unsigned i; + unsigned x; + char num_partitions; + char valid_partitions; + char num_of_bootable_partitions; + char valid_input; + char input_default; + + + + input = c(NUL); + /* Clear screen */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + /* Display header */ + display(menu_23); + + /* Setup and print current disk */ + insert[0] = cur_disk+1+'0'; + display(menu_5); + + /* print ESC prompt */ + display(menu_11); + + /* Only allow active partitions on the first (and bootable) disk */ + if (cur_disk == c(0)) /* AC000 */ + + BEGIN + /* Display partition info and see if any partitions exist*/ + if (table_display()) + + BEGIN + /* See if active partition is bootable */ + for (i=u(0); i < u(4); i++) /* AC000 */ + BEGIN + if (part_table[0][i].sys_id != uc(0) && + part_table[0][i].boot_ind == uc(0x80)) /* AC000 */ + BEGIN + if ((part_table[0][i].sys_id == uc(BAD_BLOCK)) || + (part_table[0][i].sys_id==uc(EXTENDED))) /* AC000 */ + BEGIN + /* The active partition is not bootable, so warn user */ + display(error_24); + END + END + END + + /* Check to see if only one partition */ + num_partitions = c(0) ; /* AC000 */ + num_of_bootable_partitions = c(0); /* AC000 */ + for (i=u(0); i < u(4); i++) /* AC000 */ + + BEGIN + if (part_table[0][i].sys_id != uc(0)) /* AC000 */ + BEGIN + /* Get a count of partitions */ + num_partitions++; + + /* Get a count of the number of defined partitions but don't*/ + /* count those we know aren't bootable */ + if ((part_table[0][i].sys_id != uc(BAD_BLOCK)) && + (part_table[0][i].sys_id != uc(EXTENDED))) /* AC000 */ + BEGIN + num_of_bootable_partitions++; + END + END + END + /* If only one partition found, see if it is active already */ + if (num_of_bootable_partitions == c(1)) /* AC000 */ + BEGIN + + /* Find the partition and see if it is already active */ + for (i=u(0); i < u(4); i++) /* AC000 */ + + BEGIN + if (part_table[0][i].sys_id !=uc(0) && + part_table[0][i].boot_ind == uc(0x80)) /* AC000 */ + + BEGIN + /* Make sure it is not unbootable partition again*/ + if ((part_table[0][i].sys_id != uc(BAD_BLOCK)) && + (part_table[0][i].sys_id!=uc(EXTENDED))) /* AC000 */ + + BEGIN + /* Once it is found, put out the message */ + display(error_15); + + /* Wait for ESC, then get out */ + wait_for_ESC(); + + /* clear the screen before going back to main menu*/ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + return; + END + END + END + END + /* See if any bootable partitions exist */ + if (num_of_bootable_partitions == c(0)) /* AC000 */ + BEGIN + /* At this point, we know at least one partition does exist due to*/ + /* getting past the table_display call, so the only ones around */ + /* must be unbootable */ + + /* Display this fact then get out of here */ + display(error_25); + END + else + BEGIN + /* All is okay to go and set one, do display prompts */ + number_in_msg((XFLOAT)total_mbytes[cur_disk],u(0)); /* AC000 */ + display(menu_15); + + /* Put up input prompt*/ + display(menu_24); + + /* Assume bad input until proven otherwise */ + valid_input = FALSE; + valid_partitions = num_partitions; + input_default = c(NUL); /* AC000 */ + + while (!valid_input) + BEGIN + /* Go get partition to make active */ + input = get_num_input(input_default,num_partitions,input_row,input_col); + + /* Save the input for next time in case CR pressed */ + input_default = input-'0'; + + clear_screen(u(18),u(0),u(23),u(79)); /* AC000 */ + + if (input != c(ESC)) /* AC000 */ + BEGIN + /* See if known unbootable partition */ + /* Set the new one */ + valid_partitions = c(0); /* AC000 */ + + /* Make sure the partitions are in physical order*/ + sort_part_table(c(4)); /* AC000 */ + + /* Go find existing partitiona */ + for (i=u(0);i < u(4); i++) /* AC000 */ + BEGIN + /* First we have to find it */ + if (part_table[0][sort[i]].sys_id != uc(0)) /* AC000 */ + BEGIN + /* If this is the 'input'th one, then we got it */ + if (valid_partitions == (input-'1')) + BEGIN + /* See if it is an unbootable partition */ + if ((part_table[0][sort[i]].sys_id != uc(BAD_BLOCK)) && + (part_table[0][sort[i]].sys_id != uc(EXTENDED))) /* AC000 */ + + BEGIN + /* Its bootable, so we have good input */ + valid_input = c(TRUE); /* AC000 */ + + /* Remove the active indicator from the old partition */ + for (x=u(0); x < u(4); x++) /* AC000 */ + BEGIN + + if (part_table[0][x].boot_ind == uc(0x80)) /* AC000 */ + BEGIN + part_table[0][x].changed = TRUE; + part_table[0][x].boot_ind = uc(0); /* AC000 */ + END + END + + /* Put in new active indicator */ + part_table[0][sort[i]].boot_ind = uc(0x80); /* AC000 */ + + /* Indicate that it is changed */ + part_table[0][sort[i]].changed = TRUE; + + /* Update the partition info display */ + table_display(); + + /* Clear off the old prompts */ + clear_screen(u(16),u(0),u(21),u(79)); /* AC000 */ + + /* Say you did it */ + insert[0] = input; + display(status_4); + break; + END + else + BEGIN + /* It is, so setup message and tell user */ + insert[0] = input; + display(error_17); + break; + END + END + else + BEGIN + /* Indicate we found one but keep going */ + valid_partitions++; + END + END + END + END + else + BEGIN + /* Mark ESC as ok input so we can get out of here */ + valid_input = c(TRUE); /* AC000 */ + END + END /* While loop */ + END + END /* table display test endif */ + else + BEGIN + /* No partitions to make active */ + display(error_16); + END + END + else + BEGIN + display(error_26); + END + /* clear the screen before going back to main menu */ + if (input != c(ESC)) /* AC000 */ + BEGIN + wait_for_ESC(); + END + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + return; +END + + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: DISPLAY_PARTITION_INFORMATION */ +/* */ +/* DESCRIPTIVE NAME: Display partition information */ +/* */ +/* FUNCTION: Displays defined partition information and prompt */ +/* user to display disk volumes if they exist */ +/* */ +/* NOTES: */ +/* */ +/* The following screen is managed */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³Display Partition Information ³ */ +/* 05³ ³ */ +/* 06³Current Fixed Disk Drive: # ³ */ +/* 07³ ³ */ +/* 08³Partition Status Type Start End Size³ */ +/* 09³ # # ####### #### #### ####³ */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³Total disk space is #### cylinders. ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³The EXTENDED DOS partition contains DOS ³ */ +/* 19³disk volumes. Do you want to display ³ */ +/* 20³the volume information............? [Y] ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: Display_Partition_Information */ +/* LINKAGE: display_partition_information () */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if invalid input */ +/* returned to this routine */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* clear_screen */ +/* wait_for_ESC */ +/* display */ +/* table_display */ +/* get_yn_input */ +/* find_partition_type */ +/* display_volume_information */ +/* internal_program_error */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void display_partition_information() + +BEGIN + + char input; + char temp; + + input = c(NUL); /* AC000 */ + /* Clear_screen */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + /* Display Header */ + display(menu_35); + + /* Setup and print current disk */ + insert[0] = cur_disk+1+'0'; + display(menu_5); + + /* print ESC prompt */ + display(menu_11); + + /* Display information */ + if (table_display()) + BEGIN + + /* Setup and print disk space msg */ + number_in_msg((XFLOAT)total_mbytes[cur_disk],u(0)); /* AC000 */ + display(menu_15); + + /* See if any logical drive stuff to display */ + if (find_partition_type(uc(EXTENDED))) /* AC000 */ + BEGIN + /* See if any logical drives exist */ + if (find_logical_drive()) + BEGIN + + /* Prompt to see if they want to see EXTENDED info */ + display(menu_36); + + /* Get Y/N input, default is YES */ + input = get_yn_input(c(Yes),input_row,input_col); /* AC000 AC011 */ + switch(input) + BEGIN + + case 1: display_volume_information(); /* AC000 */ + break; + + case 0: break; /* AC000 */ + + case ESC: break; + + default: internal_program_error(); + break; + END + END + else + input = wait_for_ESC(); + END + else + input = wait_for_ESC(); + END + else + input = wait_for_ESC(); + /* clear the screen before going back to main menu */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + return; +END + + + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: DISPLAY_VOLUME_INFORMATION */ +/* */ +/* DESCRIPTIVE NAME: Display DOS disk Volume Information */ +/* */ +/* FUNCTION: Displays disk volume size and existence */ +/* */ +/* NOTES: */ +/* */ +/* The following screen is managed */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 01³Display DOS Disk Volume Information ³ */ +/* 02³ ³ */ +/* 03³Vol Start End Size Vol Start End Size³ */ +/* 04³ # #### #### #### # #### #### ####³ */ +/* 05³ ³ */ +/* 06³ ³ */ +/* 07³ ³ */ +/* 08³ ³ */ +/* 09³ ³ */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³ ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to FDISK Options ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: Display_Volume_Information */ +/* LINKAGE: display_volume_information () */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* clear_screen */ +/* wait_for_ESC */ +/* display */ +/* volume_display */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void display_volume_information() + +BEGIN + + char input; + char temp; + + input = c(NUL); /* AC000 */ + /* clear the screen */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + + /* Display Header */ + display(menu_37); + + /* Display information */ + temp = volume_display(); + + /* Set up partition size message */ + sprintf(insert,"%4.0d",get_partition_size( uc(EXTENDED) ) ); + display(menu_21); + + /* print ESC prompt */ + display(menu_11); + + /* Wait to exit */ + input = wait_for_ESC(); + return; +END + +/* */ +char check_valid_environment() +BEGIN + + /* See if the net is there */ + regs.x.ax = u(INSTALLATION_CHECK); /* AC000 */ + int86((int)NETWORK,®s,®s); /* AC000 */ + +#ifdef DEBUG /* AN006 */ + regs.h.al = uc(0); /* AN006 */ +#endif /* AN006 */ + + /* Is it ? */ + if (regs.h.al != uc(0)) /* AC000 */ + BEGIN + + /* See if server is loaded, otherwise okay */ + if ((regs.x.bx & SERVER_CHECK) != u(0)) /* AC000 */ + BEGIN + no_fatal_error = FALSE; + display_msg((int)4,(int)DosStdEr,(int)nosubcnt,(int)nosubptr,c(noinput),c(Utility_Msg_Class)); /* AN000 AC014*/ + return(FALSE); + END + END + return(TRUE); +END + + + +/* */ +void init_partition_tables() +BEGIN + +unsigned i; +unsigned char j; +unsigned k; +unsigned l; +unsigned partition_location; +char temp; +char more_drives_exist; +char num_logical_drives; +unsigned insert; +unsigned index; + + /* initialize first drive found to "C" */ + next_letter = c(SEA); /* AC000 */ + + /* Look at both disks */ + for (j = uc(0); j < number_of_drives; j++) /* AC000 */ + BEGIN + + /* Initialize the cur_disk field to the drive in question so */ + /* that the calls to the partition information routines will work */ + cur_disk = ((char)(j)); + + /* Read in the master boot record and see if it was okay */ + if (read_boot_record(u(0),j,uc(0),uc(1))) /* AC000 */ + BEGIN + + /* See if there was a valid boot record there */ + if ((boot_record[510] == uc(0x55)) && (boot_record[511] == uc(0xAA))) /* AC000 */ + BEGIN + + /* What was on the disk is a valid boot record, so save it */ + for (i=u(0);i < u(BYTES_PER_SECTOR); i++) /* AC000 */ + BEGIN + master_boot_record[j][i] = boot_record[i]; + END + END + /* We've now got a copy of the master boot record saved. Now we need */ + /* to translate what in the boot record to the area that it's going */ + /* to be worked on (part_table) */ + + /* Read in the data from the master boot record partition entries*/ + for (i=u(0); i < u(4); i++) /* AC000 */ + BEGIN + index = i*16; + + /* Get boot ind */ + part_table[j][i].boot_ind = master_boot_record[j][0x1BE+index]; + + /* Start head */ + part_table[j][i].start_head = master_boot_record[j][0x1BF+index]; + + /* Start sector - unscramble it from INT 13 format*/ + part_table[j][i].start_sector= (master_boot_record[j][0x1C0+index] & 0x3F); + + /* Start cyl - unscramble it from INT 13 format*/ + part_table[j][i].start_cyl= ((((unsigned)master_boot_record[j][0x1C0+index]) & 0x00C0) << 2) + + ((unsigned)master_boot_record[j][0x1C1+index]); + + /* System id */ + part_table[j][i].sys_id = master_boot_record[j][0x1C2+index]; + + /* End head */ + part_table[j][i].end_head = master_boot_record[j][0x1C3+index]; + + /* End sector - unscramble it from INT 13 format*/ + part_table[j][i].end_sector= (master_boot_record[j][0x1C4+index] & 0x3F); + + /* End cyl - unscramble it from INT 13 format*/ + part_table[j][i].end_cyl= ((((unsigned)master_boot_record[j][0x1C4+index]) & 0x00C0) << 2) + + ((unsigned)master_boot_record[j][0x1C5+index]); + + /* Relative sectors */ + + part_table[j][i].rel_sec = + ((unsigned long)master_boot_record[j][0x1C9+index]) << 24; + + part_table[j][i].rel_sec = part_table[j][i].rel_sec + + (((unsigned long)master_boot_record[j][0x1C8+index]) << 16); + + part_table[j][i].rel_sec = part_table[j][i].rel_sec + + (((unsigned long)master_boot_record[j][0x1C7+index]) << 8); + + part_table[j][i].rel_sec = part_table[j][i].rel_sec + + ((unsigned long)master_boot_record[j][0x1C6+index]); + + /* Number of sectors */ + part_table[j][i].num_sec = + ((unsigned long)master_boot_record[j][0x1CD+index]) << 24; + + part_table[j][i].num_sec = part_table[j][i].num_sec + + (((unsigned long)master_boot_record[j][0x1CC+index]) << 16); + + part_table[j][i].num_sec = part_table[j][i].num_sec + + (((unsigned long)master_boot_record[j][0x1CB+index]) << 8); + + part_table[j][i].num_sec = part_table[j][i].num_sec + + ((unsigned long)master_boot_record[j][0x1CA+index]); + + part_table[j][i].mbytes_used = + cylinders_to_mbytes(((part_table[j][i].end_cyl-part_table[j][i].start_cyl)+1), + cur_disk); /* AN004 */ + + part_table[j][i].percent_used = + cylinders_to_percent(((part_table[j][i].end_cyl-part_table[j][i].start_cyl)+1), + total_disk[cur_disk]); /* AN000 */ + + /* Set drive letter */ + if ( (part_table[j][i].sys_id == DOS12) || /* AN000 */ + (part_table[j][i].sys_id == DOS16) || /* AN000 */ + (part_table[j][i].sys_id == DOSNEW) ) /* AN000 */ + part_table[j][i].drive_letter = next_letter++; /* AN000 */ + + /* Set changed flag */ + part_table[j][i].changed = FALSE; + END + END + else + BEGIN + return; + END + END + + /* Look at both disks */ + for (j = uc(0); j < number_of_drives; j++) /* AC000 */ + BEGIN + + /* Initialize the cur_disk field to the drive in question so */ + /* that the calls to the partition information routines will work */ + cur_disk = ((char)(j)); + + /* Read in the master boot record and see if it was okay */ + if (read_boot_record(u(0),j,uc(0),uc(1))) /* AC000 */ + BEGIN + /* Now, go read in extended partition info */ + if (find_partition_type(uc(EXTENDED))) /* AC000 */ + BEGIN + /* Initialize the array to zero's - include one dummy entry */ + for (i=u(0); i < u(24); i++) /* AC000 */ + BEGIN + ext_table[j][i].boot_ind = uc(0); /* AC000 */ + ext_table[j][i].start_head = uc(0); /* AC000 */ + ext_table[j][i].start_sector = uc(0); /* AC000 */ + ext_table[j][i].start_cyl = u(0); /* AC000 */ + ext_table[j][i].sys_id = uc(0); /* AC000 */ + ext_table[j][i].end_head = uc(0); /* AC000 */ + ext_table[j][i].end_sector = uc(0); /* AC000 */ + ext_table[j][i].end_cyl = u(0); /* AC000 */ + ext_table[j][i].rel_sec = ul(0); /* AC000 */ + ext_table[j][i].num_sec = ul(0); /* AC000 */ + ext_table[j][i].mbytes_used = f(0); /* AN000 */ + ext_table[j][i].percent_used = u(0); /* AN000 */ + ext_table[j][i].changed = FALSE; + ext_table[j][i].drive_letter = NUL; /* AN000 */ + + strcpy(ext_table[cur_disk][i].system,NUL); /* AN000 */ + strcpy(ext_table[cur_disk][i].vol_label,NUL); /* AN000 */ + + END + + /* Find where the first extended boot record is */ + temp = find_partition_location(uc(EXTENDED)); /* AC000 */ + partition_location = part_table[j][temp].start_cyl; + + /* Go find extended boot records as long as there are more of them */ + more_drives_exist = TRUE; + + /* Init the number of logical drives, for a array index */ + num_logical_drives = c(0); /* AC000 */ + + while (more_drives_exist) + BEGIN + /* Assume we won't find another logical drive */ + more_drives_exist = FALSE; + + /*Read in the extended boot record */ + if (read_boot_record(partition_location, + j, + uc(0), + uc(1))) /* AC000 */ + BEGIN + load_logical_drive(num_logical_drives,j); + + + /* find the next logical drive */ + for (i = u(0); i < u(4); i++) /* AC000 */ + BEGIN + index = i*16; + /* See if a sys id byte of exteneded exists */ + if (boot_record[0x1C2+index] == uc(EXTENDED)) /* AC000 */ + BEGIN + /* Found another drive, now get its location */ + partition_location= (((((unsigned)(boot_record[0x1C0 + index])) & 0x00C0) << 2)); + partition_location = partition_location + ((unsigned)(boot_record[0x1C1+index])); + + /* Indicate we found another one */ + more_drives_exist = TRUE; + + /* Up the count of found ones */ + num_logical_drives++; + break; + END + END + END + END + END + END + END + return; +END + + +/* */ +void load_logical_drive(point,drive) + +char point; +unsigned char drive; + +BEGIN + +char volume_label[13]; /* AC000 *//*Used be 11*/ +unsigned ext_part_num; /* AN000 */ +unsigned i; +unsigned j; /* AN000 */ +unsigned k; /* AN000 */ +unsigned length; /* AN000 */ +unsigned index; +unsigned dx_pointer; /* AN000 */ +unsigned partition_location; /* AN000 */ + + /* Check to see if anything is there */ + if ((boot_record[510] == uc(0x55)) && (boot_record[511] == uc(0xAA))) /* AC000 */ + BEGIN + /* The boot record is there - read in the logical drive if it is there */ + for (i = u(0); i < u(4); i++) /* AC000 */ + BEGIN + + index = i*16; + /* See if it is a defined extended drive*/ + if ((boot_record[0x1C2 + index] != uc(0)) && (boot_record[0x1C2 + index] != uc(EXTENDED))) /* AC000 */ + BEGIN + /* Get boot ind */ + ext_table[drive][point].boot_ind = boot_record[0x1BE + index]; + + /* Start head */ + ext_table[drive][point].start_head = boot_record[0x1BF + index]; + + /* Start sector - unscramble it from INT 13 format*/ + ext_table[drive][point].start_sector= (boot_record[0x1C0 + index] & 0x3F); + + /* Start cyl - unscramble it from INT 13 format*/ + ext_table[drive][point].start_cyl= ((((unsigned)boot_record[0x1C0+index]) & 0x00C0) << 2) + + ((unsigned)boot_record[0x1C1+index]); + + + /* System id */ + ext_table[drive][point].sys_id = boot_record[0x1C2+index]; + + /* End head */ + ext_table[drive][point].end_head = boot_record[0x1C3+index]; + + /* End sector - unscramble it from INT 13 format*/ + ext_table[drive][point].end_sector= (boot_record[0x1C4+index] & 0x3F); + + + /* End cyl - unscramble it from INT 13 format*/ + ext_table[drive][point].end_cyl= ((((unsigned)boot_record[0x1C4+index]) & 0x00C0) << 2) + + ((unsigned)boot_record[0x1C5+index]); + + /* Relative sectors */ + ext_table[drive][point].rel_sec = + ((unsigned long)boot_record[0x1C9+index]) << 24; + + ext_table[drive][point].rel_sec = + ext_table[drive][point].rel_sec+(((unsigned long)boot_record[0x1C8+index]) << 16); + + ext_table[drive][point].rel_sec = + ext_table[drive][point].rel_sec + (((unsigned long)boot_record[0x1C7+index]) << 8); + + ext_table[drive][point].rel_sec = + ext_table[drive][point].rel_sec + ((unsigned long)boot_record[0x1C6+index]); + + /* Number of sectors */ + + ext_table[drive][point].num_sec = + ((unsigned long)boot_record[0x1CD+index]) << 24; + + ext_table[drive][point].num_sec = + ext_table[drive][point].num_sec+(((unsigned long)boot_record[0x1CC+index]) << 16); + + ext_table[drive][point].num_sec = + ext_table[drive][point].num_sec + (((unsigned long)boot_record[0x1CB+index]) << 8); + + ext_table[drive][point].num_sec = + ext_table[drive][point].num_sec + ((unsigned long)boot_record[0x1CA+index]); + + ext_table[drive][point].mbytes_used = + cylinders_to_mbytes(((ext_table[drive][point].end_cyl - ext_table[drive][point].start_cyl)+1), + cur_disk); /* AN004 */ + + ext_part_num = find_partition_location(uc(EXTENDED)); + + ext_table[drive][point].percent_used = + cylinders_to_percent(((ext_table[drive][point].end_cyl-ext_table[drive][point].start_cyl)+1), + ((part_table[drive][ext_part_num].end_cyl-part_table[drive][ext_part_num].start_cyl)+1)); /* AN000 */ + + ext_table[drive][point].drive_letter = next_letter++; /* AN000 */ + + partition_location = ext_table[drive][point].start_cyl; + + if (read_boot_record(ext_table[drive][point].start_cyl, + drive, + ext_table[drive][point].start_head, + ext_table[drive][point].start_sector)); + BEGIN /* AN000 */ + /* See if the disk has already been formated */ + if (check_format(ext_table[drive][point].drive_letter) == TRUE ) /* AN002 */ + BEGIN /* AN000 */ + /* get volume and system info */ + + /* AC000 Just for cleaning up purposes */ + + for (k = u(0); k < u(12); k++) /* AC000 */ + BEGIN /* AC000 */ + ext_table[drive][point].vol_label[k]=u(0); /* AC000 */ + END /* AC000 */ + + for (k = u(0); k < u(9); k++) /* AC000 */ + BEGIN /* AC000 */ + ext_table[drive][point].system[k]=u(0); /* AC000 */ + END /* AC000 */ + + get_volume_string(ext_table[drive][point].drive_letter,&volume_label[0]); /* AN000 AC015 */ + + for (k = u(0); k < strlen(volume_label); k++) /* AC000 AC015 */ + BEGIN /* AC000 AC015 */ + ext_table[drive][point].vol_label[k]=volume_label[k]; /* AC000 AC015 */ + END /* AC000 AC015 */ + + /* Now try to get it using GET MEDIA ID function */ + if (get_fs_and_vol(ext_table[drive][point].drive_letter)) /* AN000 */ + + BEGIN /* AN000 */ + /* AC000 Just use more conceptually simple logic */ + for (k=u(0); k < u(8); k++) /* AC000 */ + + BEGIN /* AC000 */ + if (dx_buff.file_system[k] != ' ') /* AC000 */ + length = k+1; /* AC000 */ + END /* AC000 */ + + strncpy(ext_table[drive][point].system,&dx_buff.file_system[0],u(length)); /* AN000 */ + END /* AN000 */ + + else /* AN000 */ + + BEGIN /* AN000 */ + if (ext_table[drive][point].num_sec > (unsigned long)FAT16_SIZE) /* AN000 */ + strcpy(ext_table[drive][point].system,FAT16); /* AN000 */ + else + strcpy(ext_table[drive][point].system,FAT12); /* AN000 */ + END /* AN000 */ + END /* AN000 */ + else /* AN000 */ + BEGIN /* AN000 */ + /* set up array to say no file system or volume label */ + strcpy(ext_table[drive][point].vol_label,NOVOLUME); /* AN000 */ + strcpy(ext_table[drive][point].system,NOFORMAT); /* AN000 */ + END /* AN000 */ + + regs.x.dx = u(0); + regs.x.ax = NETWORK_IOCTL; + regs.h.bl = ((ext_table[drive][point].drive_letter - 'A') + 1); + intdos(®s,®s); + if (regs.x.dx & 0x1000) strcpy(ext_table[drive][point].vol_label,"* Remote * "); + END + read_boot_record(ext_table[drive][point].start_cyl, + drive, + uc(0), + uc(1)); /* AN000 */ + END + END + END + + return; + +END + + + +/* */ +void reboot_system() +BEGIN + + + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + if (quiet_flag == FALSE) + BEGIN + display(menu_38); + getch(); + reboot(); + END + else + BEGIN + cur_disk = c(0); /* AN001 */ + reset_video_information(); /* AN006 */ + if ( (find_partition_type(uc(DOS12))) || + (find_partition_type(uc(DOS16))) || + (find_partition_type(uc(DOSNEW))) ) /* AN001 */ + exit(ERR_LEVEL_0); /* AN001 */ + else /* AN001 */ + exit(ERR_LEVEL_1); /* AN001 */ + END +END + + +/* */ +void internal_program_error() + +BEGIN + display(internal_error); + DOSEXIT(u(0),u(0)); /* AC000 */ + return; +END + + 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 @@ +/* */ +/* */ +/****************************************************************************/ +/* Define statements */ +/****************************************************************************/ +/* */ + +#define FLAG char /* AN000 */ +#define BEGIN { +#define END } +#define ESC 0x1B +#define ESC_FLAG -2 /* AN000 */ +#define NUL 0x00 +#define NOT_FOUND 0xFF +#define DELETED -2 /* AC011 */ +#define INVALID 0xFF +#define PRIMARY 0x00 +#define EXTENDED 0x05 +#define BAD_BLOCK 0xFF +#define XENIX1 0x02 +#define XENIX2 0x03 +#define PCIX 0x75 +#define DOS12 0x01 +#define DOS16 0x04 +#define DOSNEW 0x06 /* AN000 */ +#define FAT16_SIZE 32680 +#define VOLUME 0x00 +#define FALSE (char) (1==0) /* AC000 */ +#define TRUE (char) !FALSE /* AC000 */ +#define LOGICAL 0x05 +#define CR 0x0D +#define BACKSPACE 0x08 +#define ACTIVE 0x80 +#define DOS_MAX 65535 /* Allow exactly 32mb worth of partitions */ +#define SYSTEM_FILE_SECTORS 250 +#define BYTES_PER_SECTOR 512 /* AN000 */ + +#include + +#define NETWORK 0x2F +#define INSTALLATION_CHECK 0xB800 +#define SERVER_CHECK 0x40 + + +#define FILE_NAME ":\\????????.???" /* AN000 */ +#define NOVOLUME "" /* AN000 */ +#define NOFORMAT "UNKNOWN " /* AN000 */ +#define FAT12 "FAT12 " /* AN000 */ +#define FAT16 "FAT16 " /* AN000 */ +#define SEA 'C' /* AN000 */ +#define ZERO 0 /* AN000 */ +#define NO_GOOD 0x02 /* AN000 */ +#define FIND_FIRST_MATCH 0x4E /* AN000 */ +#define GET_DTA 0x2F /* AN000 */ +#define NETWORK_IOCTL 0x4409 /* AN000 */ +#define GENERIC_IOCTL 0x440D /* AN000 */ +#define GET_MEDIA_ID 0x0866 /* AN007 */ +#define SPECIAL_FUNCTION 0x0867 /* AN002 AC008 */ +#define CAPCHAR 0x6520 /* AN000 */ +#define CAPSTRING 0x6521 /* AN000 */ +#define CAP_YN 0x6523 /* AN000 */ +#define INT21 0x21 /* AN000 */ +#define DISK 0x13 /* AN000 */ +#define NOERROR 0 /* AN000 */ +#define BLANKS " " /* AN000 */ +#define MAX_STRING_INPUT_LENGTH 11 /* AN000 */ +#define ERR_LEVEL_0 0 /* AN001 */ +#define ERR_LEVEL_1 1 /* AN001 */ +#define ERR_LEVEL_2 2 /* AN005 */ + +#define READ_DISK 2 +#define WRITE_DISK 3 +#define DISK_INFO 8 + +#define CURRENT_VIDEO_ATTRIBUTE 8 /* AN006 */ +#define CURRENT_VIDEO_STATE 15 +#define SET_ACTIVE_DISPLAY_PAGE 5 +#define SET_MODE 0 +#define SET_PAGE 5 +#define SET_CURSOR 0x02 /* AN006 */ +#define WRITE_ATTRCHAR 0x09 /* AN006 */ +#define VIDEO 0x10 +#define SCROLL_PAGE_UP 0x0600 /* AN006 */ +#define BW40_25 0 +#define Color40_25 1 +#define BW80_25 2 +#define Color80_25 3 +#define Color320_200 4 +#define BW320_200 5 +#define BW640_200 6 +#define MONO80_25 7 +#define MONO80_25A 15 /* AN006 */ + +#define NORMAL_PRELOAD 0 /* AN000 */ +#define ALL_UTILITY_MESSAGES -1 /* AN000 */ +#define NO_SUBST_TEXT 0 /* AN000 */ +#define NO_RESPONSE 0 /* AN000 */ +#define CLASS -1 /* AN000 */ * AN000 */ +#define NUL_POINTER 0 /* AN000 */ +#define SUBST_LIST 0 /* AN000 */ +#define SUBST_COUNT 0 /* AN000 */ + +#define VOL_LABEL 0x08 /* AN000 */ +#define PERCENT 0x25 /* AN000 */ +#define DECIMAL 0x2E /* AN000 */ +#define PERIOD 0x2E /* AN000 */ +#define ONE_MEG 1048576 /* AN000 */ + + #if IBMCOPYRIGHT +#define HIWHITE_ON_BLUE 0x1F /* AN006 */ +#define WHITE_ON_BLUE 0x17 /* AN006 */ +#define BLINK_HIWHITE_ON_BLUE 0x9F /* AN006 */ +#define HIWHITE_ON_BLACK 0x0F /* AN006 */ +#define GRAY_ON_BLACK 0x07 /* AN006 */ + #else +#define HIWHITE_ON_BLUE 0x0F /* AN006 */ +#define WHITE_ON_BLUE 0x07 /* AN006 */ +#define BLINK_HIWHITE_ON_BLUE 0x8F /* AN006 */ +#define HIWHITE_ON_BLACK 0x0F /* AN006 */ +#define GRAY_ON_BLACK 0x07 + #endif + + +#define BYTE unsigned char /* AN000 */ +#define WORD unsigned short /* AN000 */ +#define DWORD unsigned long /* AN000 */ +#define sw_type /* AN000 */ +#define sw_item_tag /* AN000 */ +#define sw_synonym /* AN000 */ +#define sw_value /* AN000 */ + +#define CARRY_FLAG 0x0001 /* mask for carry flag */ /* AN000 */ +#define PARITY_FLAG 0x0004 /* mask for parity flag */ /* AN000 */ +#define ACARRY_FLAG 0x0010 /* mask for aux carry flag */ /* AN000 */ +#define ZERO_FLAG 0x0040 /* mask for zero flag */ /* AN000 */ +#define SIGN_FLAG 0x0080 /* mask for sign flag */ /* AN000 */ +#define TRAP_FLAG 0x0100 /* mask for trap flag */ /* AN000 */ +#define INTERRUPT_FLAG 0x0200 /* mask for interrupt flag */ /* AN000 */ +#define DIRECTION_FLAG 0x0400 /* mask for direction flag */ /* AN000 */ +#define OVERFLOW_FLAG 0x0800 /* mask for overflow flag */ /* AN000 */ + +#define SEMICOLON 0x3B /* AN000 - VALID COMMAND LINE DELIMITER*/ + +#define XFLOAT unsigned + +#define u(c) ((unsigned)(c)) /* AN000 */ +#define f(c) ((XFLOAT)(c)) /* AN000 */ +#define c(c) ((char)(c)) /* AN000 */ +#define d(c) ((double)(c)) /* AN004 */ +#define uc(c) ((unsigned char)(c)) /* AN000 */ +#define ui(c) ((unsigned int)(c)) /* AN000 */ +#define ul(c) ((unsigned long)(c)) /* AN000 */ + + +struct entry + BEGIN + unsigned char boot_ind; + unsigned char start_head; + unsigned char start_sector; + unsigned start_cyl; + unsigned char sys_id; + unsigned char end_head; + unsigned char end_sector; + unsigned end_cyl; + unsigned long rel_sec; + unsigned long num_sec; + char order; + FLAG changed; + unsigned mbytes_used; /* AN000 */ + unsigned percent_used; /* AN000 */ + char vol_label[12]; /* AN000 */ + char system[9]; /* AN000 */ + char drive_letter; /* AN000 */ + END; + +struct freespace + BEGIN + unsigned space; + unsigned start; + unsigned end; + unsigned mbytes_unused; /* AN000 */ + unsigned percent_unused; /* AN000 */ + char volume_id[12]; /* AN000 */ + END; + +struct diskaccess /* AN002 */ + BEGIN /* AN002 */ + char dac_special_func; /* AN002 */ + char dac_access_flag; /* AN002 */ + END; /* AN002 */ + +struct dx_buffer_ioctl /* AN000 */ + BEGIN /* AN000 */ + unsigned int info_level; /* Information level */ /* AN000 */ + unsigned long serial_num; /* serial number */ /* AN000 */ + char vol_label[11]; /* volume label */ /* AN000 */ + char file_system[8]; /* file system */ /* AN000 */ + END; /* AN000 */ + +struct subst_list /* AN000 */ + BEGIN /* AN000 */ + char sl_size1; /* Size of List */ /* AN000 */ + char zero1; /* Reserved */ /* AN000 */ + char far *value1; /* Time, date, or ptr to data item*/ /* AN000 */ + char one; /* n of %n */ /* AN000 */ + char flags1; /* Data Type flags */ /* AN000 */ + char max_width1; /* Maximum FIELD width */ /* AN000 */ + char min_width1; /* Minimum FIELD width */ /* AN000 */ + char pad_char1; /* Character for pad FIELD */ /* AN000 */ + END; /* AN000 */ + +struct sublistx /* ;an000; */ + BEGIN /* ;an000; */ + unsigned char size; /* sublist size */ /* ;an000; */ + unsigned char reserved; /* reserved for future growth */ /* ;an000; */ + unsigned far *value; /* pointer to replaceable parm */ /* ;an000; */ + unsigned char id; /* type of replaceable parm */ /* ;an000; */ + unsigned char flags; /* how parm is to be displayed */ /* ;an000; */ + unsigned char max_width; /* max width of replaceable field */ /* ;an000; */ + unsigned char min_width; /* min width of replaceable field */ /* ;an000; */ + unsigned char pad_char; /* pad character for replaceable field */ /* ;an000; */ + END; + /* ;an000; */ + \ 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 @@ +/DOSSEG /MAP /CPA:1000 /SEG:1024 /E+ + main.obj + + mainmenu.obj + + d_menus.obj + + c_menus.obj + + fdisk.obj + + reboot.obj + + bootrec.obj + + fdboot.obj + + display.obj + + input.obj + + tdisplay.obj + + vdisplay.obj + + space.obj + + partinfo.obj + + video.obj + + makepart.obj + + int13.obj + + diskout.obj + + messages.obj + + fdparse.obj + + convert.obj + + global.obj + + _parse.obj + + _msgret.obj + + fdiskm.obj +fdisk.exe, +fdisk.map, +..\..\mapper\MAPPER.lib + +..\..\inc\comsubs.lib; + \ 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 @@ +/* FDISK MESSAGE FILE */ + +/************************************************************************/ +/* Please log all modifications to this file: */ +/*----------------------------------------------------------------------*/ +/* Date: 04/04/86 */ +/* Changed by: Mark T */ +/* Message changed: menu_1 - menu_38 */ +/* Reason: Creation of file */ +/*----------------------------------------------------------------------*/ +/* Date: 05/04/87 */ +/* Changed by: Dennis M */ +/* Message changed: menu_1 - menu_44 */ +/* Reason: DOS 3.3 */ +/*----------------------------------------------------------------------*/ +/* Date: */ +/* Changed by: */ +/* Message changed: */ +/* Reason: */ +/*----------------------------------------------------------------------*/ +/***********************************************************************/ + +/************************************************************************/ +/* FDISK MESSAGES */ +/* */ +/* Portions of the screen that are handled in the msg are indicated on */ +/* the listing of the screen with the message name given. If the text */ +/* message is defined in another screen, then the name is followed by */ +/* a "#" character */ +/* */ +/* NOTE TO TRANSLATORS */ +/* The characters inside the <> and the ^^ are control characters and */ +/* should not be translated. The Control characters are defined as */ +/* follows: */ +/* */ +/* - Highlight the following text */ +/* - Regular text */ +/* - Underline the following text */ +/* - Blink the following text */ +/* - Turn off Blink */ +/* - Print YES character, as set by define */ +/* - Print NO character, as set by define */ +/* - Sound the beep */ +/* - Save cursor position for later use */ +/* - Cursor position left justified and regular proceed to right */ +/* - Clear the screen out from control char to end of line */ +/* - Insert character from Insert[] string. This string must be set */ +/* up prior to displaying the message. The first will insert */ +/* Insert[0], the second Insert[1], etc....This will move the */ +/* cursor one postition. The Insert%% string will be initialized */ +/* */ +/* */ +/* Multiple control characters can be between the <>. */ +/* */ +/* The ^^ indicates Row and column for the text and has the format of */ +/* ^rrcc^ where the numbers are decimal and zero based .first row/col */ +/* is 00. The numbers are in decimal, and must be 2 characters, which */ +/* means rows/cols 0-9 should be listed as 00-09. For example, the 5th */ +/* row, 3rd column on the screen would be listed as ^0402^. */ +/* */ +/* The column number is always the column desired. The row number is */ +/* an offset from the previous row. For example, if the text just */ +/* printed is on row 6, and the next text should be printed 2 rows */ +/* down in column 0, then the control strin would be ^0201^. The first */ +/* row specified in the message is assumed to be based off of row 0, */ +/* it would actually specify the actual row for the start of the msg */ +/* to be printed. */ +/* */ +/* NOTE: ALWAYS SAVE THIS FILE WITH NO TABS CHARACTERS */ +/************************************************************************/ + + +/************************************************************************/ +/* */ +/* Define Area for text variables */ +/* */ +/************************************************************************/ + +#define ACTIVE_PART 'A' /* Character to indicate active status */ +#define DRIVE_INDICATOR ':' /* Character displayed to indicate drive letter */ + +/* */ +/* */ +/* The following character strings are required to display the */ +/* menu screens for FDISK. The messages have a label type of: menu_xx */ +/* */ +/* */ + +/*******************************************************************************************************/ +/* Screen for DO_MAIN_MENU */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ IBM Personal Computer ³menu_1 */ +/* 01³ Fixed Disk Setup Program Version 3.40 ³menu_1 */ +/* 02³ (C%Copyright IBM Corp. 1983,1988 ³menu_1 */ +/* 03³ ³ */ +/* 04³ FDISK Options ³menu_2 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 */ +/* 07³ ³ */ +/* 08³ Choose one of the following: ³menu_3 */ +/* 09³ ³ */ +/* 10³ 1. Create DOS Partition or Logical DOS Drive ³menu_2 */ +/* 11³ 2. Set active partition ³menu_2 */ +/* 12³ 3. Delete DOS Partition or Logical DOS Drive ³menu_2 */ +/* 13³ 4. Display partition information ³menu_2 */ +/* 14³ 5. Select next fixed disk drive ³menu_4 */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ Enter choice: [#] ³menu_7 */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ Warning! No partitions are set active - disk 1 is not startable unless ³menu_6 */ +/* 21³ a partition is set active. ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to exit FDISK ³menu_2 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*******************************************************************************************************/ + + +/*-------------------------------------------------------------*/ + char far *menu_1 = + +"^0030^è1001\ + ^0128^è1002\ + ^0124^è1003"; + + + +/*-------------------------------------------------------------*/ + char far *menu_2 = + +"^0433^è1004\ + ^0604^è1005\ + ^0104^è1006\ + ^0104^è1007\ + ^0104^è1008\ + ^1104^è1009"; + +/*-------------------------------------------------------------*/ + char far *menu_3 = + +"^0804^è1010"; + +/*-------------------------------------------------------------*/ + char far *menu_4 = + +"^1404^è1011"; + +/*-------------------------------------------------------------*/ + char far *menu_5 = + +"^0604^è1012"; + +/*-------------------------------------------------------------*/ + char far *menu_6 = + +"^2004^è1013\ + ^0104^è1014"; + +/*-------------------------------------------------------------*/ + char far *menu_7 = + +"^1704^è1015"; + +/*******************************************************************************************************/ +/* Screen for CREATE_PARTITION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Create DOS Partition or Logical DOS Drive ³menu_8 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Choose one of the following: ³menu_3 # */ +/* 09³ ³ */ +/* 10³ 1. Create Primary DOS Partition ³menu_9 */ +/* 11³ 2. Create Extended DOS Partition ³menu_9 */ +/* 12³ 3. Create logical DOS Drive(s) in the Extended DOS Partition ³menu_10 */ +/* 13³ ³ */ +/* 14³ ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ Enter choice: [ ] ³menu_7 # */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*******************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_8 = + +"^0420^è1016"; + +/*-------------------------------------------------------------*/ + char far *menu_9 = + +"^1004^è1017\ + ^0104^è1018"; + +/*-------------------------------------------------------------*/ + char far *menu_10 = + +"^1204^è1019"; + +/*-------------------------------------------------------------*/ + char far *menu_11 = + +"^2404^è1020"; + + +/*******************************************************************************************************/ +/* Screen for DOS_CREATE_PARTITION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Create Primary DOS Partition ³menu_12 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Do you wish to use the maximum available size for a Primary DOS Partition ³menu_13 */ +/* 09³ and make the partition active (Y/N).....................? [Y] ³menu_13 */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³ ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*******************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_12 = + +"^0427^è1021"; + +/*-------------------------------------------------------------*/ + char far *menu_13 = + +"^0804^è1022\ + ^0104^è1023"; + +/*-------------------------------------------------------------*/ + char far *menu_45 = + +"^0804^è1022\ + ^0104^è1024"; + + +/*******************************************************************************************************/ +/* Screen for INPUT_DOS_CREATE */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Create Primary DOS Partition ³menu_12 # */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 */ +/* 09³ ## # # ####### #### ###% ³ */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 */ +/* 15³ Maximum space available for partition is #### Mbytes (###%) ³menu_16 */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³ Enter partition size in Mbytes or percent of disk space (%) to ³menu_39 */ +/* 19³ create a Primary DOS Partition..................................[####] ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/****************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_14 = + +"^0804^è1025\ + ^0104^ \ + ^0104^ \ + ^0104^ \ + ^0104^ "; + +/*-------------------------------------------------------------*/ + char far *menu_15 = + +"^1404^è1026"; + +/*-------------------------------------------------------------*/ + char far *menu_16 = + +"^1504^è1027"; + +/*-------------------------------------------------------------*/ + char far *menu_39 = + +"^1804^è1028\ + ^0104^è1029"; + + +/****************************************************************************************************/ +/* Screen for EXT_CREATE_PARTITION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Create Extended DOS Partition ³menu_17 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */ +/* 09³ ## # # ####### #### ###% ³ */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */ +/* 15³ Maximum space available for partition is #### Mbytes (##%) ³menu_16 # */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³ Enter partition size in Mbytes or percent of disk space (%) to ³menu_42 # */ +/* 19³ create an Extended DOS Partition................................[####] ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to continue ³menu_46 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/***************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_17 = + +"^0427^è1030"; + +/*-------------------------------------------------------------*/ + char far *menu_42 = + +"^1804^è1028\ + ^0104^è1031"; + + +/*-------------------------------------------------------------*/ + char far *menu_46 = + +"^2404^è1032"; + + + + +/*****************************************************************************************************/ +/* Screen for VOLUME_CREATE */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ Create Logical DOS Drive(s) in the Extended Partition ³menu_18 */ +/* 02³ ³ */ +/* 03³Drv Volume Label Mbytes System Usage Drv Volume Label Mbytes System Usage³menu_19/20 */ +/* 04³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 05³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 06³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 07³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 08³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 09³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 10³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 11³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 12³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 13³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 14³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 15³## ########### #### ######## ###% ³ */ +/* 16³ ³ */ +/* 17³ Total Extended DOS partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_17 */ +/* 18³ Maximum space available for logical drive is #### Mbytes (###%) ³menu_22 */ +/* 19³ ³ */ +/* 20³ Enter logical drive size in Mbytes or percent of disk space (%)...[####] ³menu_40 */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/***************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_18 = + +"^0112^è1033"; + +/*-------------------------------------------------------------*/ + char far *menu_19 = + +"^0300^è1034\ +^0100^ \ +^0100^ \ +^0100^ \ +^0100^ \ +^0100^ \ +^0100^ "; + +/*----------------------------------------------------------*/ + char far *menu_43 = + +"^1000^ \ +^0100^ \ +^0100^ \ +^0100^ \ +^0100^ \ +^0100^ "; + +/*-------------------------------------------------------------*/ + char far *menu_20 = + +"^0341^è1034\ +^0141^ \ +^0141^ \ +^0141^ \ +^0141^ \ +^0141^ \ +^0141^ "; + +/*---------------------------------------------------------*/ + char far *menu_44 = + +"^1041^ \ +^0141^ \ +^0141^ \ +^0141^ \ +^0141^ "; + +/*-------------------------------------------------------------*/ + char far *menu_21 = + +"^1704^è1035"; + +/*-------------------------------------------------------------*/ + char far *menu_22 = + +"^1804^è1036"; + +/*-------------------------------------------------------------*/ + char far *menu_40 = + +"^2004^è1037"; + + +/*****************************************************************************************************/ +/* Screen for CHANGE_ACTIVE_PARTITION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ Set Active Partition ³menu_23 */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ ³ */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */ +/* 09³ ## # # ####### #### ###% ³ */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */ +/* 15³ ³ */ +/* 16³ Enter the number of the partition you want to make active............:[#] ³menu_24 */ +/* 17³ ³ */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_23 = + +"^0430^è1038"; + +/*-------------------------------------------------------------*/ + char far *menu_24 = + +"^1604^è1039"; + + +/*****************************************************************************************************/ +/* Screen for DELETE_PARTITION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Delete DOS Partition or Logical DOS Drive ³menu_25 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Choose one of the following: ³menu_3 # */ +/* 09³ ³ */ +/* 10³ 1. Delete Primary DOS Partition ³menu_26 */ +/* 11³ 2. Delete Extended DOS Partition ³menu_26 */ +/* 12³ 3. Delete Logical DOS Drive(s) in the Extended DOS Partition ³menu_27 */ +/* 13³ ³ */ +/* 14³ ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ Enter choice: [ ] ³menu_7 # */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_25 = + +"^0419^è1040"; + +/*-------------------------------------------------------------*/ + char far *menu_26 = + +"^1004^è1041\ + ^0104^è1042"; + +/*-------------------------------------------------------------*/ + char far *menu_27 = + +"^1204^è1043"; + +/*****************************************************************************************************/ +/* Screen for DOS_DELETE */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Delete Primary DOS Partition ³menu_28 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */ +/* 09³ ## # # ####### #### ###% ³menu_14 # */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */ +/* 15³ ³ */ +/* 16³ Warning! Data in the deleted Primary DOS Partition will be lost. ³menu_29 */ +/* 17³ Do you wish to continue (Y/N).................? [N] ³menu_29 */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_28 = + +"^0426^è1044"; + +/*-------------------------------------------------------------*/ + char far *menu_29 = + +"^1604^è1045\ + ^0104^è1046"; + +/*****************************************************************************************************/ +/* Screen for EXT_DELETE */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Delete Extended DOS Partition ³menu_30 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */ +/* 09³ ## # # ####### #### ###% ³menu_14 # */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */ +/* 15³ ³ */ +/* 16³ Warning! Data in the deleted Extended DOS partition will be lost. ³menu_31 */ +/* 17³ Do you wish to continue (Y/N).................? [N] ³menu_31 */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_30 = + +"^0426^è1047"; + +/*-------------------------------------------------------------*/ + char far *menu_31 = + +"^1604^è1048\ + ^0104^è1049"; + +/******************************************************************************************************/ +/* Screen for VOL_DELETE */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ Delete Logical DOS Drive(s) in the Extended DOS Partition ³menu_32 */ +/* 02³ ³ */ +/* 03³Drv Volume Label MBytes System Usage Drv Volume Label MBytes System Usage³menu_19/20 # */ +/* 04³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 05³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 06³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 07³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 08³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 09³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 10³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 11³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 12³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 13³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 14³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 15³## ############# #### ######## ###% ³ */ +/* 16³ ³ */ +/* 17³ Total Extended DOS Partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_21 */ +/* 18³ ³ */ +/* 19³ Warning! Data in a deleted Logical DOS Drive will be lost. ³menu_33 */ +/* 20³ What drive do you want to delete...........................? [ ] ³menu_33 */ +/* 21³ Enter Volume Label.............................? [ ] ³menu_41 */ +/* 22³ Are you sure (Y/N).............................? [N] ³menu_34 */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/******************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_32 = + +"^0112^è1050"; + +/*-------------------------------------------------------------*/ + char far *menu_33 = + +"^1904^è1051\ + ^0104^è1052"; + +/*-------------------------------------------------------------*/ + char far *menu_34 = + +"^2204^è1053"; + +/*-------------------------------------------------------------*/ + char far *menu_41 = + +"^2104^è1054"; + +/******************************************************************************************************/ +/* Screen for DISPLAY_PARTITION_INFORMATION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Display Partition Information ³menu_35 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */ +/* 09³ ## # # ####### #### ###% ³menu_14 # */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ The Extended DOS partition contains Logical DOS Drives. ³menu_36 */ +/* 18³ Do you want to display the logical drive information (Y/N)......? [Y] ³menu_36 */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/******************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_35 = + +"^0426^è1055"; + +/*-------------------------------------------------------------*/ + char far *menu_36 = + +"^1704^è1056\ + ^0104^è1057"; + +/*****************************************************************************************************/ +/* Screen for DISPLAY_VOLUME_INFORMATION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ Display Logical DOS Drive Information ³menu_37 */ +/* 02³ ³ */ +/* 03³Drv Volume Label Mbytes System Usage Drv Volume Label Mbytes System Usage³menu_19/20 */ +/* 04³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 05³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 16³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 17³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 18³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 19³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 10³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 11³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 12³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 13³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 14³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 15³## ############# #### ######## ###% ³ */ +/* 16³ ³ */ +/* 17³ Total Extended DOS partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_17 */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_37 = + +"^0121^è1058"; + +/*****************************************************************************************************/ +/* Screen for SYSTEM_REBOOT */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ ³ */ +/* 05³ ³ */ +/* 06³ ³ */ +/* 07³ ³ */ +/* 08³ ³ */ +/* 09³ ³ */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ System will now restart ³menu_38 */ +/* 14³ ³ */ +/* 15³ Insert DOS diskette in drive A: ³menu_38 */ +/* 16³ Press any key when ready . . . ³menu_38 */ +/* 17³ ³ */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_38 = + +"^1304^è1059\ + ^0204^è1060\ + ^0104^è1061"; + + +/* */ +/* */ +/* The following character strings are required to display the */ +/* status messages indicating successful operation. These messages */ +/* have the form: status_xx */ +/* */ +/* Note: In order to overlay any previous message on the screen, these */ +/* messages are all 2 lines long. The second line may only be */ +/* a blank line. If 2 lines are needed for translation, use the */ +/* second line for text. Exceptions are those msgs on line 0, */ +/* and status_3. */ +/* */ + +/*-------------------------------------------------------------*/ + char far *status_1 = + +"^2104^è1062\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_2 = + +"^2104^è1063\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_3 = + +"^0004^è1064"; +/* NOTE - the ^rrcc^ must be the first thing in this string */ + +/*-------------------------------------------------------------*/ + char far *status_4 = + +"^2104^è1065\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_5 = + +"^2104^è1066\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_6 = + +"^2104^è1067\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_7 = + +"^2204^è1068"; + +/*-------------------------------------------------------------*/ + char far *status_8 = + +"^2104^è1069\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_9 = + +"^1004^è1070\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_10 = + +"^1804^è1071"; + +/*-------------------------------------------------------------*/ + char far *status_11 = + +"^0004^è1072"; +/* NOTE - the ^rrcc^ must be the first thing in this string */ + +/*-------------------------------------------------------------*/ + char far *status_12 = + +"^2104^è1073\ + ^0100^"; + +/*-------------------------------------------------------------*/ + +/* */ +/* */ +/* The following character strings are required to display the */ +/* error messages. These have form: error_xx */ +/* */ +/* Note: In order to overlay any previous message on the screen, these */ +/* messages are all 2 lines long. The second line may only be */ +/* a blank line. If 2 lines are needed for translation, use the */ +/* second line for text. Exceptions are those msgs on line 0. */ +/* and those messages that start on line 23 */ +/* */ + + +/*-------------------------------------------------------------*/ + char far *error_1 = + +"^0004^è1074\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_2 = + +"^2204^è1075\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_3 = + +"^2204^è1076\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_4 = + +"^0004^è1077"; + +/*-------------------------------------------------------------*/ + char far *error_5 = + +"^0004^è1078"; + +/*-------------------------------------------------------------*/ + char far *error_6 = + +"^2204^è1079\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_7 = + +"^2204^è1080\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_8 = + +"^2204^è1081\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_9 = + +"^2204^è1082\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_10 = + +"^2204^è1083\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_12 = + +"^2204^è1084\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_13 = + +"^2204^è1085\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_14 = + +"^2204^è1086\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_15 = + +"^2204^è1087\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_16 = + +"^2204^è1088\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_17 = + +"^2204^è1089"; + +/*-------------------------------------------------------------*/ + char far *error_19 = + +"^2204^è1090\ + ^0104^è1091"; + +/*-------------------------------------------------------------*/ + char far *error_20 = + +"^2204^è1092\ + ^0104^è1093"; + +/*-------------------------------------------------------------*/ + char far *error_21 = + +"^2204^è1094"; + +/*-------------------------------------------------------------*/ + char far *error_22 = + +"^2204^è1095"; + +/*-------------------------------------------------------------*/ + char far *error_23 = + +"^2204^\ + ^0104^è1096"; + +/*-------------------------------------------------------------*/ + char far *error_24 = + +"^2204^è1097"; + +/*-------------------------------------------------------------*/ + char far *error_25 = + +"^2204^è1098\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_26 = + +"^2204^è1099"; + +/*-------------------------------------------------------------*/ + char far *error_27 = + +"^2204^è1100"; + +/*-------------------------------------------------------------*/ + char far *error_28 = + +"^2204^è1101\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_29 = + +"^2204^è1102\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_30 = + +"^2204^è1103"; + +/*-------------------------------------------------------------*/ + char far *error_31 = + +"^2304^è1104"; + +/*-------------------------------------------------------------*/ + char far *error_32 = + +"^2204^è1105\ + ^0104^è1106"; + +/*-------------------------------------------------------------*/ + char far *error_33 = + +"^2200^\ + ^0104^è1107"; + +/*-------------------------------------------------------------*/ + char far *error_34 = + +"^2204^è1108"; + +/*-------------------------------------------------------------*/ + char far *error_35 = + +"^2204^è1109\ + ^0104^è1110"; + +/*-------------------------------------------------------------*/ + char far *error_36 = + +"^2204^è1111\ + ^0100^"; + +/*-------------------------------------------------------------*/ + + +/* */ +/* */ +/* The following message is only included as an aide to debug message */ +/* strings during translations. The FDISK message formatter will attempt*/ +/* to the best of its ability to catch invalid message strings and */ +/* print the error. This message should NEVER appear for a user, so it */ +/* is not neccessary to translate this message */ +/* */ +/* */ + + +/*-------------------------------------------------------------*/ + + char far *debug_msg = + +"^2200^è1112"; + +/*-------------------------------------------------------------*/ + char far *internal_error = + +"^2204^è1113"; +/* */ +/* The following are not translatable. They are the partition names */ +/* */ + + char *DOS_part = "PRI DOS"; + char *XENIX_part = " XENIX "; + char *EXTENDED_part = "EXT DOS"; + char *BAD_BLOCK_part= " Table "; + char *PCIX_part = " PC/IX "; + 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 @@ +:util FDISK ;utility name +:class A ;system messages +; +:use 1 COMMON1 ;"Incorrect DOS version" +:use 2 COMMON2 ;"Insufficient Memory" +:use 3 COMMON3 ;"Internal error loading messages" +:use 8 EXTEND87 ;"Invalid parameter" +:def 9 "Y",0 ;"Y" +:def 10 "N",0 ;"N" +; +:class B +:def 4 "Cannot FDISK with network loaded",CR,LF +:def 5 "No fixed disks present",CR,LF +:def 6 "Error reading fixed disk",CR,LF +:def 7 "Error writing fixed disk",CR,LF +; +; +: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 @@ +:class 1 +; +;******** messages for the Fixed Disk Boot Record ****** +; +;m1: db "Invalid partition table",0 ;23 +:use 1114 fdisk m1: +; +;m2: db "Error loading operating system",0 ;30 +:use 1115 fdisk m2: +; +;m3: db "Missing operating system",0 ;24 +:use 1116 fdisk m3: +; +:end + \ 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 @@ +/* FDISK MESSAGE FILE */ + +/************************************************************************/ +/* Please log all modifications to this file: */ +/*----------------------------------------------------------------------*/ +/* Date: 04/04/86 */ +/* Changed by: Mark T */ +/* Message changed: menu_1 - menu_38 */ +/* Reason: Creation of file */ +/*----------------------------------------------------------------------*/ +/* Date: 05/04/87 */ +/* Changed by: Dennis M */ +/* Message changed: menu_1 - menu_44 */ +/* Reason: DOS 3.3 */ +/*----------------------------------------------------------------------*/ +/* Date: */ +/* Changed by: */ +/* Message changed: */ +/* Reason: */ +/*----------------------------------------------------------------------*/ +/***********************************************************************/ + +/************************************************************************/ +/* FDISK MESSAGES */ +/* */ +/* Portions of the screen that are handled in the msg are indicated on */ +/* the listing of the screen with the message name given. If the text */ +/* message is defined in another screen, then the name is followed by */ +/* a "#" character */ +/* */ +/* NOTE TO TRANSLATORS */ +/* The characters inside the <> and the ^^ are control characters and */ +/* should not be translated. The Control characters are defined as */ +/* follows: */ +/* */ +/* - Highlight the following text */ +/* - Regular text */ +/* - Underline the following text */ +/* - Blink the following text */ +/* - Turn off Blink */ +/* - Print YES character, as set by define */ +/* - Print NO character, as set by define */ +/* - Sound the beep */ +/* - Save cursor position for later use */ +/* - Cursor position left justified and regular proceed to right */ +/* - Clear the screen out from control char to end of line */ +/* - Insert character from Insert[] string. This string must be set */ +/* up prior to displaying the message. The first will insert */ +/* Insert[0], the second Insert[1], etc....This will move the */ +/* cursor one postition. The Insert%% string will be initialized */ +/* */ +/* */ +/* Multiple control characters can be between the <>. */ +/* */ +/* The ^^ indicates Row and column for the text and has the format of */ +/* ^rrcc^ where the numbers are decimal and zero based .first row/col */ +/* is 00. The numbers are in decimal, and must be 2 characters, which */ +/* means rows/cols 0-9 should be listed as 00-09. For example, the 5th */ +/* row, 3rd column on the screen would be listed as ^0402^. */ +/* */ +/* The column number is always the column desired. The row number is */ +/* an offset from the previous row. For example, if the text just */ +/* printed is on row 6, and the next text should be printed 2 rows */ +/* down in column 0, then the control strin would be ^0201^. The first */ +/* row specified in the message is assumed to be based off of row 0, */ +/* it would actually specify the actual row for the start of the msg */ +/* to be printed. */ +/* */ +/* NOTE: ALWAYS SAVE THIS FILE WITH NO TABS CHARACTERS */ +/************************************************************************/ + + +/************************************************************************/ +/* */ +/* Define Area for text variables */ +/* */ +/************************************************************************/ + +#define YES 'Y' +#define NO 'N' +#define ACTIVE_PART 'A' /* Character to indicate active status */ +#define DRIVE_INDICATOR ':' /* Character displayed to indicate drive letter */ + +/* */ +/* */ +/* The following character strings are required to display the */ +/* menu screens for FDISK. The messages have a label type of: menu_xx */ +/* */ +/* */ + +/*******************************************************************************************************/ +/* Screen for DO_MAIN_MENU */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ IBM Personal Computer ³menu_1 */ +/* 01³ Fixed Disk Setup Program Version 3.40 ³menu_1 */ +/* 02³ (C%Copyright IBM Corp. 1983,1988 ³menu_1 */ +/* 03³ ³ */ +/* 04³ FDISK Options ³menu_2 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 */ +/* 07³ ³ */ +/* 08³ Choose one of the following: ³menu_3 */ +/* 09³ ³ */ +/* 10³ 1. Create DOS Partition or Logical DOS Drive ³menu_2 */ +/* 11³ 2. Set active partition ³menu_2 */ +/* 12³ 3. Delete DOS Partition or Logical DOS Drive ³menu_2 */ +/* 13³ 4. Display partition information ³menu_2 */ +/* 14³ 5. Select next fixed disk drive ³menu_4 */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ Enter choice: [#] ³menu_7 */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ Warning! No partitions are set active - disk 1 is not startable unless ³menu_6 */ +/* 21³ a partition is set active. ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to exit FDISK ³menu_2 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*******************************************************************************************************/ + + +/*-------------------------------------------------------------*/ + char far *menu_1 = + +"^0029^Microsoft DOS \ + ^0121^Fixed Disk Setup Program Version 4.00\ + ^0124^(C)Copyright 1988 Microsoft Corp"; + + + +/*-------------------------------------------------------------*/ + char far *menu_2 = + +"^0433^FDISK Options\ + ^0604^1. Create DOS Partition or Logical DOS Drive\ + ^0104^2. Set active partition\ + ^0104^3. Delete DOS Partition or Logical DOS Drive\ + ^0104^4. Display partition information\ + ^1104^Press Esc to exit FDISK"; + +/*-------------------------------------------------------------*/ + char far *menu_3 = + +"^0804^Choose one of the following:"; + +/*-------------------------------------------------------------*/ + char far *menu_4 = + +"^1404^5. Select next fixed disk drive"; + +/*-------------------------------------------------------------*/ + char far *menu_5 = + +"^0604^Current fixed disk drive: "; + +/*-------------------------------------------------------------*/ + char far *menu_6 = + +"^2004^Warning! No partitions are set active - disk 1 is not startable unless\ + ^0104^a partition is set active"; + +/*-------------------------------------------------------------*/ + char far *menu_7 = + +"^1704^Enter choice: [ ]"; + +/*******************************************************************************************************/ +/* Screen for CREATE_PARTITION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Create DOS Partition or Logical DOS Drive ³menu_8 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Choose one of the following: ³menu_3 # */ +/* 09³ ³ */ +/* 10³ 1. Create Primary DOS Partition ³menu_9 */ +/* 11³ 2. Create Extended DOS Partition ³menu_9 */ +/* 12³ 3. Create logical DOS Drive(s) in the Extended DOS Partition ³menu_10 */ +/* 13³ ³ */ +/* 14³ ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ Enter choice: [ ] ³menu_7 # */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*******************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_8 = + +"^0420^Create DOS Partition or Logical DOS Drive"; + +/*-------------------------------------------------------------*/ + char far *menu_9 = + +"^1004^1. Create Primary DOS Partition\ + ^0104^2. Create Extended DOS Partition"; + +/*-------------------------------------------------------------*/ + char far *menu_10 = + +"^1204^3. Create Logical DOS Drive(s) in the Extended DOS Partition"; + +/*-------------------------------------------------------------*/ + char far *menu_11 = + +"^2404^Press Esc to return to FDISK Options"; + + +/*******************************************************************************************************/ +/* Screen for DOS_CREATE_PARTITION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Create Primary DOS Partition ³menu_12 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Do you wish to use the maximum available size for a Primary DOS Partition ³menu_13 */ +/* 09³ and make the partition active (Y/N).....................? [Y] ³menu_13 */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ ³ */ +/* 14³ ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*******************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_12 = + +"^0427^Create Primary DOS Partition"; + +/*-------------------------------------------------------------*/ + char far *menu_13 = + +"^0804^Do you wish to use the maximum available size for a Primary DOS Partition\ + ^0104^and make the partition active (/).....................? [ ]"; + +/*-------------------------------------------------------------*/ + char far *menu_45 = + +"^0804^Do you wish to use the maximum available size for a Primary DOS Partition\ + ^0104^(/)...................................................? [ ]"; + + +/*******************************************************************************************************/ +/* Screen for INPUT_DOS_CREATE */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Create Primary DOS Partition ³menu_12 # */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 */ +/* 09³ ## # # ####### #### ###% ³ */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 */ +/* 15³ Maximum space available for partition is #### Mbytes (###%) ³menu_16 */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³ Enter partition size in Mbytes or percent of disk space (%) to ³menu_39 */ +/* 19³ create a Primary DOS Partition..................................[####] ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/****************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_14 = + +"^0804^Partition Status Type Size in Mbytes Percentage of Disk Used\ + ^0104^ \ + ^0104^ \ + ^0104^ \ + ^0104^ "; + +/*-------------------------------------------------------------*/ + char far *menu_15 = + +"^1404^Total disk space is Mbytes (1 Mbyte = 1048576 bytes)"; + +/*-------------------------------------------------------------*/ + char far *menu_16 = + +"^1504^Maximum space available for partition is Mbytes ()"; + +/*-------------------------------------------------------------*/ + char far *menu_39 = + +"^1804^Enter partition size in Mbytes or percent of disk space (%) to\ + ^0104^create a Primary DOS Partition.................................: []"; + + +/****************************************************************************************************/ +/* Screen for EXT_CREATE_PARTITION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Create Extended DOS Partition ³menu_17 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */ +/* 09³ ## # # ####### #### ###% ³ */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */ +/* 15³ Maximum space available for partition is #### Mbytes (##%) ³menu_16 # */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³ Enter partition size in Mbytes or percent of disk space (%) to ³menu_42 # */ +/* 19³ create an Extended DOS Partition................................[####] ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to continue ³menu_46 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/***************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_17 = + +"^0427^Create Extended DOS Partition"; + +/*-------------------------------------------------------------*/ + char far *menu_42 = + +"^1804^Enter partition size in Mbytes or percent of disk space (%) to\ + ^0104^create an Extended DOS Partition..............................: []"; + + +/*-------------------------------------------------------------*/ + char far *menu_46 = + +"^2404^Press Esc to continue"; + + + + +/*****************************************************************************************************/ +/* Screen for VOLUME_CREATE */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ Create Logical DOS Drive(s) in the Extended Partition ³menu_18 */ +/* 02³ ³ */ +/* 03³Drv Volume Label Mbytes System Usage Drv Volume Label Mbytes System Usage³menu_19/20 */ +/* 04³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 05³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 06³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 07³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 08³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 09³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 10³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 11³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 12³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 13³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 14³## ########### #### ######## ###% ## ########### #### ######## ###%³ */ +/* 15³## ########### #### ######## ###% ³ */ +/* 16³ ³ */ +/* 17³ Total Extended DOS partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_17 */ +/* 18³ Maximum space available for logical drive is #### Mbytes (###%) ³menu_22 */ +/* 19³ ³ */ +/* 20³ Enter logical drive size in Mbytes or percent of disk space (%)...[####] ³menu_40 */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/***************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_18 = + +"^0112^Create Logical DOS Drive(s) in the Extended DOS Partition"; + +/*-------------------------------------------------------------*/ + char far *menu_19 = + +"^0300^Drv Volume Label Mbytes System Usage\ +^0100^ \ +^0100^ \ +^0100^ \ +^0100^ \ +^0100^ \ +^0100^ "; + +/*----------------------------------------------------------*/ + char far *menu_43 = + +"^1000^ \ +^0100^ \ +^0100^ \ +^0100^ \ +^0100^ \ +^0100^ "; + +/*-------------------------------------------------------------*/ + char far *menu_20 = + +"^0341^Drv Volume Label Mbytes System Usage\ +^0141^ \ +^0141^ \ +^0141^ \ +^0141^ \ +^0141^ \ +^0141^ "; + +/*---------------------------------------------------------*/ + char far *menu_44 = + +"^1041^ \ +^0141^ \ +^0141^ \ +^0141^ \ +^0141^ "; + +/*-------------------------------------------------------------*/ + char far *menu_21 = + +"^1704^Total Extended DOS Partition size is Mbytes (1 MByte = 1048576 bytes)"; + +/*-------------------------------------------------------------*/ + char far *menu_22 = + +"^1804^Maximum space available for logical drive is Mbytes ()"; + +/*-------------------------------------------------------------*/ + char far *menu_40 = + +"^2004^Enter logical drive size in Mbytes or percent of disk space (%)...[]"; + + +/*****************************************************************************************************/ +/* Screen for CHANGE_ACTIVE_PARTITION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ Set Active Partition ³menu_23 */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ ³ */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */ +/* 09³ ## # # ####### #### ###% ³ */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */ +/* 15³ ³ */ +/* 16³ Enter the number of the partition you want to make active............:[#] ³menu_24 */ +/* 17³ ³ */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_23 = + +"^0430^Set Active Partition"; + +/*-------------------------------------------------------------*/ + char far *menu_24 = + +"^1604^Enter the number of the partition you want to make active...........: [ ]"; + + +/*****************************************************************************************************/ +/* Screen for DELETE_PARTITION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Delete DOS Partition or Logical DOS Drive ³menu_25 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Choose one of the following: ³menu_3 # */ +/* 09³ ³ */ +/* 10³ 1. Delete Primary DOS Partition ³menu_26 */ +/* 11³ 2. Delete Extended DOS Partition ³menu_26 */ +/* 12³ 3. Delete Logical DOS Drive(s) in the Extended DOS Partition ³menu_27 */ +/* 13³ ³ */ +/* 14³ ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ Enter choice: [ ] ³menu_7 # */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_25 = + +"^0419^Delete DOS Partition or Logical DOS Drive"; + +/*-------------------------------------------------------------*/ + char far *menu_26 = + +"^1004^1. Delete Primary DOS Partition\ + ^0104^2. Delete Extended DOS Partition"; + +/*-------------------------------------------------------------*/ + char far *menu_27 = + +"^1204^3. Delete Logical DOS Drive(s) in the Extended DOS Partition"; + +/*****************************************************************************************************/ +/* Screen for DOS_DELETE */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Delete Primary DOS Partition ³menu_28 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */ +/* 09³ ## # # ####### #### ###% ³menu_14 # */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */ +/* 15³ ³ */ +/* 16³ Warning! Data in the deleted Primary DOS Partition will be lost. ³menu_29 */ +/* 17³ Do you wish to continue (Y/N).................? [N] ³menu_29 */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_28 = + +"^0426^Delete Primary DOS Partition"; + +/*-------------------------------------------------------------*/ + char far *menu_29 = + +"^1604^Warning! Data in the deleted Primary DOS Partition will be lost.\ + ^0104^Do you wish to continue (/).................? [ ]"; + +/*****************************************************************************************************/ +/* Screen for EXT_DELETE */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Delete Extended DOS Partition ³menu_30 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */ +/* 09³ ## # # ####### #### ###% ³menu_14 # */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */ +/* 15³ ³ */ +/* 16³ Warning! Data in the deleted Extended DOS partition will be lost. ³menu_31 */ +/* 17³ Do you wish to continue (Y/N).................? [N] ³menu_31 */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_30 = + +"^0426^Delete Extended DOS Partition"; + +/*-------------------------------------------------------------*/ + char far *menu_31 = + +"^1604^Warning! Data in the deleted Extended DOS Partition will be lost.\ + ^0104^Do you wish to continue (/).................? [ ]"; + +/******************************************************************************************************/ +/* Screen for VOL_DELETE */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ Delete Logical DOS Drive(s) in the Extended DOS Partition ³menu_32 */ +/* 02³ ³ */ +/* 03³Drv Volume Label MBytes System Usage Drv Volume Label MBytes System Usage³menu_19/20 # */ +/* 04³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 05³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 06³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 07³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 08³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 09³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 10³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 11³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 12³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 13³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 14³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 15³## ############# #### ######## ###% ³ */ +/* 16³ ³ */ +/* 17³ Total Extended DOS Partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_21 */ +/* 18³ ³ */ +/* 19³ Warning! Data in a deleted Logical DOS Drive will be lost. ³menu_33 */ +/* 20³ What drive do you want to delete...........................? [ ] ³menu_33 */ +/* 21³ Enter Volume Label.............................? [ ] ³menu_41 */ +/* 22³ Are you sure (Y/N).............................? [N] ³menu_34 */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/******************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_32 = + +"^0112^Delete Logical DOS Drive(s) in the Extended DOS Partition"; + +/*-------------------------------------------------------------*/ + char far *menu_33 = + +"^1904^Warning! Data in a deleted Logical DOS Drive will be lost.\ + ^0104^What drive do you want to delete...............................? [ ]"; + +/*-------------------------------------------------------------*/ + char far *menu_34 = + +"^2204^Are you sure (/)..............................? [ ]"; + +/*-------------------------------------------------------------*/ + char far *menu_41 = + +"^2104^Enter Volume Label..............................? [ ]"; + +/******************************************************************************************************/ +/* Screen for DISPLAY_PARTITION_INFORMATION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ Display Partition Information ³menu_35 */ +/* 05³ ³ */ +/* 06³ Current fixed disk drive: # ³menu_5 # */ +/* 07³ ³ */ +/* 08³ Partition Status Type Size in Mbytes Percentage of Disk Used ³menu_14 # */ +/* 09³ ## # # ####### #### ###% ³menu_14 # */ +/* 10³ ## # # ####### #### ###% ³ */ +/* 11³ ## # # ####### #### ###% ³ */ +/* 12³ ## # # ####### #### ###% ³ */ +/* 13³ ³ */ +/* 14³ Total disk space is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_15 # */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ The Extended DOS partition contains Logical DOS Drives. ³menu_36 */ +/* 18³ Do you want to display the logical drive information (Y/N)......? [Y] ³menu_36 */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/******************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_35 = + +"^0426^Display Partition Information"; + +/*-------------------------------------------------------------*/ + char far *menu_36 = + +"^1704^The Extended DOS Partition contains Logical DOS Drives.\ + ^0104^Do you want to display the logical drive information (/)......?[ ]"; + +/*****************************************************************************************************/ +/* Screen for DISPLAY_VOLUME_INFORMATION */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ Display Logical DOS Drive Information ³menu_37 */ +/* 02³ ³ */ +/* 03³Drv Volume Label Mbytes System Usage Drv Volume Label Mbytes System Usage³menu_19/20 */ +/* 04³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 05³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 16³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 17³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 18³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 19³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 10³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 11³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 12³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 13³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 14³## ############# #### ######## ###% ## ############# #### ######## ###%³ */ +/* 15³## ############# #### ######## ###% ³ */ +/* 16³ ³ */ +/* 17³ Total Extended DOS partition size is #### Mbytes (1 Mbyte = 1048576 bytes) ³menu_17 */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ Press ESC to return to FDISK Options ³menu_11 */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_37 = + +"^0121^Display Logical DOS Drive Information"; + +/*****************************************************************************************************/ +/* Screen for SYSTEM_REBOOT */ +/* */ +/* ³00000000001111111111222222222233333333334444444444555555555566666666667777777777³ */ +/* ³01234567890123456789012345678901234567890123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³ ³ */ +/* 01³ ³ */ +/* 02³ ³ */ +/* 03³ ³ */ +/* 04³ ³ */ +/* 05³ ³ */ +/* 06³ ³ */ +/* 07³ ³ */ +/* 08³ ³ */ +/* 09³ ³ */ +/* 10³ ³ */ +/* 11³ ³ */ +/* 12³ ³ */ +/* 13³ System will now restart ³menu_38 */ +/* 14³ ³ */ +/* 15³ Insert DOS diskette in drive A: ³menu_38 */ +/* 16³ Press any key when ready . . . ³menu_38 */ +/* 17³ ³ */ +/* 18³ ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³ ³ */ +/* 22³ ³ */ +/* 23³ ³ */ +/* 24³ ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/*****************************************************************************************************/ + +/*-------------------------------------------------------------*/ + char far *menu_38 = + +"^1304^System will now restart\ + ^0204^Insert DOS Startup diskette in drive A:\ + ^0104^Press any key when ready . . ."; + + +/* */ +/* */ +/* The following character strings are required to display the */ +/* status messages indicating successful operation. These messages */ +/* have the form: status_xx */ +/* */ +/* Note: In order to overlay any previous message on the screen, these */ +/* messages are all 2 lines long. The second line may only be */ +/* a blank line. If 2 lines are needed for translation, use the */ +/* second line for text. Exceptions are those msgs on line 0, */ +/* and status_3. */ +/* */ + +/*-------------------------------------------------------------*/ + char far *status_1 = + +"^2104^Primary DOS Partition deleted\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_2 = + +"^2104^Extended DOS Partition deleted\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_3 = + +"^0004^Drive deleted"; +/* NOTE - the ^rrcc^ must be the first thing in this string */ + +/*-------------------------------------------------------------*/ + char far *status_4 = + +"^2104^Partition made active\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_5 = + +"^2104^Primary DOS Partition created\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_6 = + +"^2104^Extended DOS Partition created\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_7 = + +"^2204^Logical DOS Drive created, drive letters changed or added"; + +/*-------------------------------------------------------------*/ + char far *status_8 = + +"^2104^No partitions defined\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_9 = + +"^1004^No logical drives defined\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *status_10 = + +"^1804^Drive letters have been changed or deleted"; + +/*-------------------------------------------------------------*/ + char far *status_11 = + +"^0004^Drive redirected"; +/* NOTE - the ^rrcc^ must be the first thing in this string */ + +/*-------------------------------------------------------------*/ + char far *status_12 = + +"^2104^Primary DOS Partition created, drive letters changed or added\ + ^0100^"; + +/*-------------------------------------------------------------*/ + +/* */ +/* */ +/* The following character strings are required to display the */ +/* error messages. These have form: error_xx */ +/* */ +/* Note: In order to overlay any previous message on the screen, these */ +/* messages are all 2 lines long. The second line may only be */ +/* a blank line. If 2 lines are needed for translation, use the */ +/* second line for text. Exceptions are those msgs on line 0. */ +/* and those messages that start on line 23 */ +/* */ + + +/*-------------------------------------------------------------*/ + char far *error_1 = + +"^0004^No fixed disks present.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_2 = + +"^2204^Error reading fixed disk.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_3 = + +"^2204^Error writing fixed disk.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_4 = + +"^0004^Incorrect DOS version."; + +/*-------------------------------------------------------------*/ + char far *error_5 = + +"^0004^Cannot FDISK with network loaded."; + +/*-------------------------------------------------------------*/ + char far *error_6 = + +"^2204^No Primary DOS Partition to delete.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_7 = + +"^2204^No Extended DOS Partition to delete.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_8 = + +"^2204^Primary DOS Partition already exists.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_9 = + +"^2204^Extended DOS Partition already exists.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_10 = + +"^2204^No space to create a DOS partition.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_12 = + +"^2204^Requested logical drive size exceeds the maximum available space.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_13 = + +"^2204^Requested partition size exceeds the maximum available space.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_14 = + +"^2204^No partitions to delete.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_15 = + +"^2204^The only startable partition on Drive 1 is already set active.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_16 = + +"^2204^No partitions to make active.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_17 = + +"^2204^Partition selected () is not startable, active partition not changed."; + +/*-------------------------------------------------------------*/ + char far *error_19 = + +"^2204^Cannot create Extended DOS Partition without\ + ^0104^Primary DOS Partition on disk 1."; + +/*-------------------------------------------------------------*/ + char far *error_20 = + +"^2204^All available space in the Extended DOS Partition\ + ^0104^is assigned to logical drives."; + +/*-------------------------------------------------------------*/ + char far *error_21 = + +"^2204^Cannot delete Extended DOS Partition while logical drives exist."; + +/*-------------------------------------------------------------*/ + char far *error_22 = + +"^2204^All logical drives deleted in the Extended DOS Partition."; + +/*-------------------------------------------------------------*/ + char far *error_23 = + +"^2204^\ + ^0104^ is not a choice. Please enter ."; + +/*-------------------------------------------------------------*/ + char far *error_24 = + +"^2204^Warning! The partition set active is not startable."; + +/*-------------------------------------------------------------*/ + char far *error_25 = + +"^2204^ Only non-startable partitions exist.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_26 = + +"^2204^Only partitions on Drive 1 can be made active."; + +/*-------------------------------------------------------------*/ + char far *error_27 = + +"^2204^Maximum number of Logical DOS Drives installed."; + +/*-------------------------------------------------------------*/ + char far *error_28 = + +"^2204^Cannot create a zero size partition.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_29 = + +"^2204^Drive already deleted.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + char far *error_30 = + +"^2204^Unable to access Drive ."; + +/*-------------------------------------------------------------*/ + char far *error_31 = + +"^2304^Invalid entry, please enter ."; + +/*-------------------------------------------------------------*/ + char far *error_32 = + +"^2204^Cannot delete Primary DOS Partition on drive 1 \ + ^0104^when an Extended DOS Partition exists."; + +/*-------------------------------------------------------------*/ + char far *error_33 = + +"^2200^\ + ^0104^Invalid entry, please press Enter."; + +/*-------------------------------------------------------------*/ + char far *error_34 = + +"^2204^Volume label does not match."; + +/*-------------------------------------------------------------*/ + char far *error_35 = + +"^2204^Cannot create Logical DOS Drive without\ + ^0104^an Extended DOS Partition on the current drive."; + +/*-------------------------------------------------------------*/ + char far *error_36 = + +"^2204^No Logical DOS Drive(s) to delete.\ + ^0100^"; + +/*-------------------------------------------------------------*/ + + +/* */ +/* */ +/* The following message is only included as an aide to debug message */ +/* strings during translations. The FDISK message formatter will attempt*/ +/* to the best of its ability to catch invalid message strings and */ +/* print the error. This message should NEVER appear for a user, so it */ +/* is not neccessary to translate this message */ +/* */ +/* */ + + +/*-------------------------------------------------------------*/ + char far *debug_msg = + +"^2200^Message string error . See header of FDISKC.MSG for error definition"; + +/*-------------------------------------------------------------*/ + char far *internal_error = + +"^2204^Internal error"; + +/* */ +/* The following are not translatable. They are the partition names */ +/* */ + + char *DOS_part = "PRI DOS"; + char *XENIX_part = " XENIX "; + char *EXTENDED_part = "EXT DOS"; + char *BAD_BLOCK_part= " Table "; + char *PCIX_part = " PC/IX "; + char *NON_DOS_part = "Non-DOS"; + + 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 @@ +/* FDISK MESSAGE FILE */ + +/************************************************************************/ +/* Please log all modifications to this file: */ +/*----------------------------------------------------------------------*/ +/* Date: 04/04/86 */ +/* Changed by: Mark T */ +/* Message changed: menu_1 - menu_38 */ +/* Reason: Creation of file */ +/*----------------------------------------------------------------------*/ +/* Date: 05/04/87 */ +/* Changed by: Dennis M */ +/* Message changed: menu_1 - menu_44 */ +/* Reason: DOS 3.3 */ +/*----------------------------------------------------------------------*/ +/* Date: */ +/* Changed by: */ +/* Message changed: */ +/* Reason: */ +/*----------------------------------------------------------------------*/ +/************************************************************************/ + +#define ACTIVE_PART 'A' /* Character to indicate active status */ +#define DRIVE_INDICATOR ':' /* Character displayed to indicate drive letter */ + +/*-------------------------------------------------------------*/ + extern char far *menu_1; /* AN000 */ + extern char far *menu_2; /* AN000 */ + extern char far *menu_3 ; /* AN000 */ + extern char far *menu_4 ; /* AN000 */ + extern char far *menu_5 ; /* AN000 */ + extern char far *menu_6 ; /* AN000 */ + extern char far *menu_7 ; /* AN000 */ + extern char far *menu_8 ; /* AN000 */ + extern char far *menu_9 ; /* AN000 */ + extern char far *menu_10 ; /* AN000 */ + extern char far *menu_11 ; /* AN000 */ + extern char far *menu_12 ; /* AN000 */ + extern char far *menu_13 ; /* AN000 */ + extern char far *menu_14 ; /* AN000 */ + extern char far *menu_15 ; /* AN000 */ + extern char far *menu_16 ; /* AN000 */ + extern char far *menu_39 ; /* AN000 */ + extern char far *menu_17 ; /* AN000 */ + extern char far *menu_42 ; /* AN000 */ + extern char far *menu_18 ; /* AN000 */ + extern char far *menu_19 ; /* AN000 */ + extern char far *menu_43 ; /* AN000 */ + extern char far *menu_20 ; /* AN000 */ + extern char far *menu_44 ; /* AN000 */ + extern char far *menu_21 ; /* AN000 */ + extern char far *menu_22 ; /* AN000 */ + extern char far *menu_40 ; /* AN000 */ + extern char far *menu_23 ; /* AN000 */ + extern char far *menu_24 ; /* AN000 */ + extern char far *menu_25 ; /* AN000 */ + extern char far *menu_26 ; /* AN000 */ + extern char far *menu_27 ; /* AN000 */ + extern char far *menu_28 ; /* AN000 */ + extern char far *menu_29 ; /* AN000 */ + extern char far *menu_30 ; /* AN000 */ + extern char far *menu_31 ; /* AN000 */ + extern char far *menu_32 ; /* AN000 */ + extern char far *menu_33 ; /* AN000 */ + extern char far *menu_34 ; /* AN000 */ + extern char far *menu_41 ; /* AN000 */ + extern char far *menu_35 ; /* AN000 */ + extern char far *menu_36 ; /* AN000 */ + extern char far *menu_37 ; /* AN000 */ + extern char far *menu_38 ; /* AN000 */ + extern char far *menu_45 ; /* AN000 */ + extern char far *menu_46 ; /* AN000 */ +/*-------------------------------------------------------------*/ + extern char far *status_1 ; /* AN000 */ + extern char far *status_2 ; /* AN000 */ + extern char far *status_3 ; /* AN000 */ + extern char far *status_4 ; /* AN000 */ + extern char far *status_5 ; /* AN000 */ + extern char far *status_6 ; /* AN000 */ + extern char far *status_7 ; /* AN000 */ + extern char far *status_8 ; /* AN000 */ + extern char far *status_9 ; /* AN000 */ + extern char far *status_10 ; /* AN000 */ + extern char far *status_11 ; /* AN000 */ + extern char far *status_12 ; /* AN000 */ +/*-------------------------------------------------------------*/ + extern char far *error_1 ; /* AN000 */ + extern char far *error_2 ; /* AN000 */ + extern char far *error_3 ; /* AN000 */ + extern char far *error_4 ; /* AN000 */ + extern char far *error_5 ; /* AN000 */ + extern char far *error_6 ; /* AN000 */ + extern char far *error_7 ; /* AN000 */ + extern char far *error_8 ; /* AN000 */ + extern char far *error_9 ; /* AN000 */ + extern char far *error_10 ; /* AN000 */ + extern char far *error_12 ; /* AN000 */ + extern char far *error_13 ; /* AN000 */ + extern char far *error_14 ; /* AN000 */ + extern char far *error_15 ; /* AN000 */ + extern char far *error_16 ; /* AN000 */ + extern char far *error_17 ; /* AN000 */ + extern char far *error_19 ; /* AN000 */ + extern char far *error_20 ; /* AN000 */ + extern char far *error_21 ; /* AN000 */ + extern char far *error_22 ; /* AN000 */ + extern char far *error_23 ; /* AN000 */ + extern char far *error_24 ; /* AN000 */ + extern char far *error_25 ; /* AN000 */ + extern char far *error_26 ; /* AN000 */ + extern char far *error_27 ; /* AN000 */ + extern char far *error_28 ; /* AN000 */ + extern char far *error_29 ; /* AN000 */ + extern char far *error_30 ; /* AN000 */ + extern char far *error_31 ; /* AN000 */ + extern char far *error_32 ; /* AN000 */ + extern char far *error_33 ; /* AN000 */ + extern char far *error_34 ; /* AN000 */ + extern char far *error_35 ; /* AN000 */ + extern char far *error_36 ; /* AN000 */ +/*-------------------------------------------------------------*/ + extern char far *debug_msg ; /* AN000 */ + extern char far *internal_error ; /* AN000 */ +/*-------------------------------------------------------------*/ + extern char *DOS_part ; /* AN000 */ + extern char *XENIX_part ; /* AN000 */ + extern char *EXTENDED_part ; /* AN000 */ + extern char *BAD_BLOCK_part ; /* AN000 */ + extern char *PCIX_part ; /* AN000 */ + extern char *NON_DOS_part ; /* AN000 */ + 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 @@ + +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "parse.h" /* AN000 */ +#include "string.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "msgret.h" /* AN000 */ + + +/* */ +/******************************************************************************/ +/*Routine name: PARSE_COMMAND_LINE */ +/******************************************************************************/ +/* */ +/*Description: Sets up flags, preloads messages, and parses the command */ +/* line for switchs. */ +/* */ +/*Called Procedures: */ +/* */ +/*Change History: Created 5/30/87 DRM */ +/* */ +/*Input: None */ +/* */ +/*Output: None */ +/* */ +/******************************************************************************/ + + +char parse_command_line(argc,argv) /* AN000 */ + +char *argv[]; /* array of pointer arguments AN000 */ +int argc; + +BEGIN /* AN000 */ + + + char cmd_line[128]; /* AN000 */ + char finished; /* AN000 */ + int i; /* AN000 */ + char parse_good; /* AN000 */ + char far *cmdline; + + parse_init(); /* AN000 */ + + /* Initialize parse_flag to true and don't change unless error */ + parse_good = TRUE; /* AN000 */ + + regs.h.ah = (unsigned char) 0x62; + intdosx(®s, ®s, &segregs); + + FP_OFF(cmdline) = 0x81; + FP_SEG(cmdline) = regs.x.bx; + + i = 0; + while ( *cmdline != (char) '\x0d' ) cmd_line[i++] = *cmdline++; + cmd_line[i++] = (char) '\x0d'; + cmd_line[i++] = (char) '\0'; + + regs.x.si = (unsigned)cmd_line; /* AN000 make DS:SI point to source */ + regs.x.cx = u(0); /* AN000 operand ordinal (whatever that means) */ + regs.x.dx = u(0); /* AN000 operand ordinal (whatever that means) */ + regs.x.di = (unsigned)&p_p; /* AN000 address of parm list */ + Parse_Ptr = (unsigned)cmd_line; /* AN010 */ + regs.x.si = (unsigned)cmd_line; /* AN010 */ + + finished = FALSE; + while ( !finished ) /* AN000 */ + BEGIN /* AN000 */ + + Parse_Ptr = regs.x.si; /* AN010 point to next parm */ + parse(®s,®s); /* AN000 Call DOS PARSE service routines*/ + + if (regs.x.ax == u(NOERROR)) /* AN000 If there was an error*/ + BEGIN + if (regs.x.dx == (unsigned)&p_buff) /* AN000 */ + check_disk_validity(); /* AN000 It's a drive letter */ + + if (regs.x.dx == (unsigned)&sp_buff) /* AN000 */ + process_switch(); /* AN000 It's a switch*/ + END + else + BEGIN + if (regs.x.ax == u(0xffff)) + finished = TRUE; /* AN000 Then we are done*/ + else + BEGIN + Parse_msg(regs.x.ax,STDERR,Parse_err_class); /* AN010 */ + parse_good = FALSE; + finished = TRUE; /* AN000 Then we are done*/ + END + END + END /* End WHILE */ /* AN000 */ + + return(parse_good); /* AN000 Return to caller*/ + +END /* end parser */ /* AN000 */ + + +/* */ +/******************************************************************************/ +/*Routine name: INIT_PARSE */ +/******************************************************************************/ +/* */ +/*Description: Sets up ALL VALUES AND STRUCTS FOR PARSER. */ +/* */ +/*Called Procedures: */ +/* */ +/*Change History: Created 6/15/87 DRM */ +/* */ +/*Input: None */ +/* */ +/*Output: None */ +/* */ +/******************************************************************************/ + + +void parse_init() /* AN000 */ + +BEGIN /* AN000 */ + + + primary_flag = FALSE; /* AN000 */ + extended_flag = FALSE; /* AN000 */ + logical_flag = FALSE; /* AN000 */ + disk_flag = FALSE; /* AN000 */ + quiet_flag = FALSE; /* AN000 */ + + p_p.p_parmsx_ptr = (unsigned)&p_px; /* AN000 Address of extended parm list */ + p_p.p_num_extra = uc(1); /* AN000 */ + p_p.p_len_extra_delim = uc(1); /* AN000 */ + p_p.p_extra_delim = c(SEMICOLON); /* AN000 */ + + p_px.p_minp = uc(0); /* AN000 1 required positional */ + p_px.p_maxp = uc(1); /* AN000 1 maximum positionals */ + p_px.p_con1_ptr = (unsigned)&p_con; /* AN000 pointer to next control blk */ + p_px.p_maxs = uc(2); /* AN000 number of switches */ + p_px.p_swi1_ptr = (unsigned)&p_swi1; /* AN000 pointer to next control blk */ + p_px.p_swi2_ptr = (unsigned)&p_swi2; /* AN000 pointer to next control blk */ + p_px.p_maxk = uc(NOVAL); /* AN000 no keywords */ + + p_con.p_match_flag = u(0x8001); /* AN000 DRIVE NUMBER 1 OR 2 optional */ + p_con.p_function_flag = u(0x0000); /* AN000 DO NOTHING FOR FUNCTION FLAG */ + p_con.p_buff1_ptr = (unsigned)&p_buff; /* AN000 */ + p_con.p_val1_ptr = (unsigned)&p_val; /* AN000 */ + p_con.p_nid = uc(0); /* AN000 */ + + p_swi1.sp_match_flag = u(0x8000); /* AN000 Optional (switch) */ + p_swi1.sp_function_flag = u(0x0000); /* AN000 DO NOTHING FOR FUNCTION FLAG */ + p_swi1.sp_buff1_ptr = (unsigned)&sp_buff; /* AN000 */ + p_swi1.sp_val1_ptr = (unsigned)&sp_val; /* AN000 */ + p_swi1.sp_nid = uc(3); /* AN000 3 switches allowed */ + strcpy((char *) p_swi1.sp_switch1,PRI); /* AN000 /a switch */ + strcpy((char *) p_swi1.sp_switch2,EXT); /* AN000 /a switch */ + strcpy((char *) p_swi1.sp_switch3,LOG); /* AN000 /a switch */ + + p_swi2.sp_match_flag = u(0x0001); /* AN000 Optional (switch) */ + p_swi2.sp_function_flag = u(0x0000); /* AN000 DO NOTHING FOR FUNCTION FLAG */ + p_swi2.sp_buff1_ptr = (unsigned)&sp_buff; /* AN000 */ + p_swi2.sp_val1_ptr = (unsigned)NOVAL; /* AN000 */ + p_swi2.sp_nid = uc(1); /* AN000 3 switches allowed */ + strcpy((char *) p_swi2.sp_switch4,QUIET); /* AN000 /a switch */ + + p_val.p_values = uc(1); /* AN000 - Number of values items returned */ + p_val.p_range = uc(1); /* AN000 - Number of ranges */ + p_val.p_range_one = uc(1); /* AN000 - range number one */ + p_val.p_low_range = ul(1); /* AN000 - low value for range */ + p_val.p_high_range = ul(2); /* AN000 - high value for range */ + + sp_val.p_values = uc(1); /* AN000 - Number of values items returned */ + sp_val.p_range = uc(1); /* AN000 - Number of ranges */ + sp_val.p_range_one = uc(1); /* AN000 - range number one */ + sp_val.p_low_range = ul(1); /* AN000 - low value for range */ + sp_val.p_high_range = ul(4000); /* AN000 - high value for range */ + + return; /* AN000 */ + +END + /* AN000 */ +/* */ +/******************************************************************************/ +/*Routine name: CHECK_DISK_VALIDITY */ +/******************************************************************************/ +/* */ +/*Description: Checks the return buffer from parse for the positional */ +/* value to be equal to 0 or 1. */ +/* */ +/*Called Procedures: */ +/* */ +/*Change History: Created 6/18/87 DRM */ +/* */ +/*Input: None */ +/* */ +/*Output: None */ +/* */ +/******************************************************************************/ + + +void check_disk_validity() /* AN000 */ + +BEGIN /* AN000 */ + + disk_flag = (FLAG)TRUE; /* AN000 */ + cur_disk_buff = ((char)p_buff.p_value - 1); /* AN000 */ + return; /* AN000 */ +END /* AN000 */ + +/* */ +/******************************************************************************/ +/*Routine name: PROCESS_SWITCH */ +/******************************************************************************/ +/* */ +/*Description: This function looks at the return buffer of the parse and */ +/* determins the switch, places value in buffer, and sets */ +/* flag for specific switch. */ +/* */ +/*Called Procedures: */ +/* */ +/*Change History: Created 6/18/87 DRM */ +/* */ +/*Input: None */ +/* */ +/*Output: None */ +/* */ +/******************************************************************************/ + + +void process_switch() /* AN000 */ + +BEGIN /* AN000 */ + + + BEGIN /* AN000 */ + if (sp_buff.p_synonym == (unsigned)p_swi1.sp_switch1) /* AN000 */ + BEGIN /* AN000 */ + primary_flag = (FLAG)TRUE; /* AN000 */ + primary_buff = (unsigned)sp_buff.p_value; /* AN000 */ + END /* AN000 */ + + if (sp_buff.p_synonym == (unsigned)p_swi1.sp_switch2) /* AN000 */ + BEGIN /* AN000 */ + extended_flag = (FLAG)TRUE; /* AN000 */ + extended_buff = (unsigned)sp_buff.p_value; /* AN000 */ + END /* AN000 */ + + if (sp_buff.p_synonym == (unsigned)p_swi1.sp_switch3) /* AN000 */ + BEGIN /* AN000 */ + logical_flag = (FLAG)TRUE; /* AN000 */ + logical_buff = (unsigned)sp_buff.p_value; /* AN000 */ + END /* AN000 */ + + if (sp_buff.p_synonym == (unsigned)p_swi2.sp_switch4) /* AN000 */ + BEGIN /* AN000 */ + quiet_flag = (FLAG)TRUE; /* AN000 */ + END /* AN000 */ + END /* AN000 */ + return; /* AN000 Return to caller*/ +END /* end parser */ /* AN000 */ + +/************************************************************************/ /* ;an000; */ +/* Parse_Message - This routine will print only those */ +/* messages that require 1 replaceable */ +/* parm. */ +/* */ +/* Inputs : Msg_Num - number of applicable message */ +/* Handle - display type */ +/* Message_Type - type of message to display */ +/* Replace_Parm - pointer to parm to replace */ +/* */ +/* Outputs : message */ +/* */ +/* Date : 03/28/88 */ +/* Version : DOS 4.00 */ +/************************************************************************/ + +void Parse_msg(Msg_Num,Handle,Message_Type) /* AN010 */ + /* AN010 */ +int Msg_Num; /* AN010 */ +int Handle; /* AN010 */ +unsigned char Message_Type; /* AN010 */ + +BEGIN /* AN010 */ +char far *Cmd_Ptr; /* AN010 */ + + + BEGIN /* AN010 */ + segread(&segregs); /* AN010 */ + FP_SEG(Cmd_Ptr) = segregs.ds; /* AN010 */ + FP_OFF(Cmd_Ptr) = regs.x.si; /* AN010 */ + *Cmd_Ptr = '\0'; /* AN010 */ + + FP_SEG(sublistp[0].value) = segregs.ds; /* AN010 */ + FP_OFF(sublistp[0].value) = Parse_Ptr; /* AN010 */ + sublistp[0].size = Sublist_Length; /* AN010 */ + sublistp[0].reserved = Reserved; /* AN010 */ + sublistp[0].id = 0; /* AN010 */ + sublistp[0].flags = Char_Field_ASCIIZ+Left_Align; /* AN010 */ + sublistp[0].max_width = 80; /* AN010 */ + sublistp[0].min_width = 01; /* AN010 */ + sublistp[0].pad_char = Blank; /* AN010 */ + + regs.x.ax = Msg_Num; /* AN010 */ + regs.x.bx = Handle; /* AN010 */ + regs.x.cx = SubCnt1; /* AN010 */ + regs.h.dl = No_Input; /* AN010 */ + regs.h.dh = Message_Type; /* AN010 */ + regs.x.si = (unsigned int)&sublistp[0]; /* AN010 */ + sysdispmsg(®s,®s); /* AN010 */ + END /* AN010 */ + return; /* AN010 */ +END /* AN010 */ + 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 @@ + +#include "fdisk.h" +#include "dos.h" + +/* */ +/* */ +/****************************************************************************/ +/* Declare Global variables */ +/****************************************************************************/ +/* */ + + + +char cur_disk; +char good_disk[2]; +unsigned char number_of_drives; +char reboot_flag; +char errorlevel; +char max_partition_size; +char sort[24]; +char no_fatal_error; +char valid_input; +unsigned char video_mode; +unsigned char display_page; +unsigned char video_attribute; /* AN006 */ + + +unsigned total_disk[2]; +unsigned total_mbytes[2]; /* AN000 */ +unsigned char max_sector[2]; +unsigned max_head[2]; /* AC004 */ +unsigned required_cyls[2]; + +unsigned input_row; +unsigned input_col; +char insert[800]; /* AC000 */ +char *pinsert = insert; + +extern unsigned char master_boot_record[2][512]; +unsigned char boot_record[512]; + +char next_letter; /* AN000 */ +char primary_flag; /* AC000 */ +char extended_flag; /* AC000 */ +char logical_flag; /* AC000 */ +char disk_flag; /* AC000 */ +char quiet_flag; /* AC000 */ +unsigned primary_buff; /* AC000 */ +unsigned extended_buff; /* AC000 */ +unsigned logical_buff; /* AC000 */ +char cur_disk_buff; /* AC000 */ +unsigned long NOVAL = (unsigned long) 0; /* AC000 */ +FLAG PercentFlag; /* AC000 */ + +FLAG mono_flag; /* AC006 */ + +char Yes; /* AC012 */ +char No; /* AC012 */ + +unsigned Parse_Ptr; /* AN010 */ +/* */ +/* */ +/****************************************************************************/ +/* Define Global structures */ +/****************************************************************************/ +/* */ + +struct entry part_table[2][4]; +struct entry ext_table[2][24]; +struct freespace free_space[24]; +struct KeyData *input_data; +struct dx_buffer_ioctl dx_buff; /* AN000 */ +struct diskaccess disk_access; /* AN002 */ +struct SREGS segregs; +struct sublistx sublistp[1]; /* AN010 */ + +/* */ +/****************************************************************************/ +/* Define UNIONS */ +/****************************************************************************/ +/* */ + +union REGS regs; + 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 @@ + +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "ctype.h" /* AN000 */ +#include "string.h" /* AN000 */ +#include "stdio.h" +#include "fdiskmsg.h" /* AN000 */ +#include "doscall.h" /* AN000 */ + +/* */ +char get_num_input(input_default,max_num,row,col) + +char max_num; +unsigned row; +unsigned col; +char input_default; + +BEGIN + + char input; + char default_used; + char input_value; + + /* print default entry if there is one */ + if (input_default != c(NUL)) /* AC000 */ + + BEGIN + default_used = TRUE; + /* position the cursor */ + VIOSETCURPOS(row,col,u(0)); /* AC000 */ + + /* Display the default character */ + putch(((int)(input_default+'0'))); + END + + /* Assume bad input */ + valid_input = FALSE; + + /* Loop until we get good stuff */ + while (valid_input == FALSE) + BEGIN + + /* position the cursor */ + VIOSETCURPOS(row,col,u(0)); /* AC000 */ + + /* Flush the keyboard buffer and get the next pressed key */ + input = get_char_input(); + + /* Do world trade get country information */ + input = dos_upper(input); /* AN000 */ + + /* Go handle different inputs */ + switch(input) + BEGIN + case ESC: + BEGIN + valid_input = TRUE; + break; + END + + case CR: + BEGIN + /* Set the input to the default if there is one there */ + if (default_used) + BEGIN + if (input_default != c(NUL)) + BEGIN + input_value = input_default+'0'; + END + else + BEGIN + /* Make the enter look like a blank for error message */ + input_value = c(' '); /* AC000 */ + END + END + /* See if it is digit and less or equal to max */ + if ( (isdigit(input_value)) && + (input_value <= (max_num+'0')) && + (input_value != c('0')) ) + BEGIN + valid_input = TRUE; + input = input_value; + END + else + BEGIN + if (isdigit(input_value)) + BEGIN + /* Setup error message */ + insert[0] = input_value; + insert[1] = c('1'); /* AC000 */ + insert[2] = c('-'); /* AC000 */ + insert[3] = max_num+'0'; + display(error_23); + END + else + BEGIN + insert[0] = c('1'); /* AC000 */ + insert[1] = c('-'); /* AC000 */ + insert[2] = max_num+'0'; + display(error_31); + END + END + break; + END + + default: + BEGIN + putch(((int)(input))); + default_used = FALSE; + input_value = input; + break; + END + END + END + return(input); +END + + + +/* */ + +char get_yn_input(input_default,row,col) + +unsigned row; +unsigned col; +char input_default; + +BEGIN + + char input; + char default_used; + char input_value; + + /* print default entry if there is one */ + if (input_default != c(NUL)) /* AC000 */ + + BEGIN + default_used = TRUE; + /* position the cursor */ + VIOSETCURPOS(row,col,u(0)); /* AC000 */ + + /* Display the default character */ + putch(((int)(input_default))); + END + + /* Assume bad input */ + valid_input = FALSE; + + /* Loop until we get good stuff */ + while (valid_input == FALSE) + BEGIN + + /* position the cursor */ + VIOSETCURPOS(row,col,u(0)); /* AC000 */ + + /* Flush the keyboard buffer and get the next pressed key */ + input = get_char_input(); + input = dos_upper(input); + + /* Go handle different inputs */ + switch(input) + BEGIN + case ESC: + BEGIN + valid_input = TRUE; + break; + END + + case CR: + BEGIN + /* Set the input to the default if there is one there */ + if (default_used) + BEGIN + if (input_default != c(NUL)) /* AC000 */ + BEGIN + input_value = input_default; + END + else + BEGIN + internal_program_error(); + END + END + /* See if YES or NO */ + + /* Do world trade get country information */ + input = check_yn_input(input_value); /* AN000 */ + + if ((input == c(1)) || (input == c(0))) /* AC000 */ + BEGIN + valid_input = TRUE; + END + else + BEGIN + /* Setup error message */ + insert[0] = c(Yes); /* AC000 AC011 */ + insert[1] = c('-'); /* AC000 */ + insert[2] = c(No); /* AC000 AC011 */ + display(error_31); + END + break; + END + + default: + BEGIN + putch(((int)(input))); + default_used = FALSE; + input_value = input; + break; + END + END + END + return(input); +END + + +/* */ +char wait_for_ESC() + +BEGIN + char input; + + while (input != c(ESC)) /* AC000 */ + BEGIN + /* position the cursor at the end of the ESC prompt */ + VIOSETCURPOS(u(24),u(39),u(0)); /* AC000 */ + + /* Get input */ + input = get_char_input(); + + END + return(c(ESC)); /* AC000 */ +END + + + + +XFLOAT get_large_num_input(input_default,max_num,max_percent,input_message,prompt_location,error_message) + +unsigned input_default; /* AC000 */ +unsigned max_num; +unsigned max_percent; +char far *input_message; +char far *error_message; +unsigned prompt_location; + +BEGIN + +char input; +XFLOAT large_input; /* AC000 */ +char default_used; +unsigned long very_big_input; + + /* Assume bad input */ + valid_input = FALSE; + + /* Assume no input, and use default */ + default_used = TRUE; + + /* Initialize the input value */ + large_input = u(0); /* AC000 */ + + /* Loop until we get good stuff */ + while (valid_input == FALSE) + + BEGIN + /* position the cursor */ + VIOSETCURPOS(input_row,input_col,u(0)); /* AC000 */ + + /* Flush the keyboard buffer and get the next pressed key */ + + input = get_char_input(); + + /* Go handle different inputs */ + switch(input) + BEGIN + case ESC: + valid_input = TRUE; + large_input = ((unsigned)(ESC_FLAG)); + break; + + case CR: + BEGIN + if (PercentFlag) + BEGIN + /* Set the input to the default if there is one there and nothing else entered */ + if ((input_default != u(NUL)) && (default_used)) /* AC000 */ + large_input = input_default; + /* See if input is less or equal to max_value */ + if (large_input <= max_percent) + BEGIN + if (large_input != u(0)) + valid_input = TRUE; + else + display(error_28); + END + else + display(error_message); + END + else + BEGIN + /* Set the input to the default if there is one there and nothing else entered */ + if ((input_default != u(NUL)) && (default_used)) /* AC000 */ + large_input = input_default; + /* See if input is less or equal to max_value */ + if (large_input <= max_num) + BEGIN + if (large_input != u(0)) + valid_input = TRUE; + else + display(error_28); + END + else + display(error_message); + END + break; + END + + case BACKSPACE: + if (PercentFlag) + PercentFlag = (FLAG)FALSE; /* AN000 */ + else + large_input = large_input / 10; + + /* Indicate that we are not using the default */ + default_used = FALSE; + sprintf(&insert[prompt_location],"%4.0d",large_input); /* AN000 */ + display(input_message); + break; + + case PERCENT: /* AN000 */ + + if (PercentFlag == (FLAG)FALSE) + BEGIN /* AN000 */ + PercentFlag = (FLAG)TRUE; /* AN000 */ + /* Round down if > 999.9 */ + if (large_input > u(999)) /* AN000 */ + large_input = (large_input%1000); /* AN000 */ + sprintf(&insert[prompt_location],"%3.0d%%",large_input); /* AN000 */ + /* Indicate that we are not using the default */ + default_used = FALSE; /* AN000 */ + display(input_message); /* AN000 */ + END /* AN000 */ + else + display(error_33); /* AN000 */ + + break; /* AN000 */ + + + default: + BEGIN + + /* Make sure it is numerical input */ + + if ( (isdigit(input)) && ((!PercentFlag) || (default_used)) ) /* AN000 */ + BEGIN + /* Add this digit in */ + very_big_input= (((unsigned long)(large_input)) * 10) + ((unsigned long)input - '0'); /* AC000 */ + + /* Round down if > 9999.9 */ + large_input = ((unsigned)(very_big_input%10000)); + + /* Put it in the message */ + number_in_msg((XFLOAT)large_input,prompt_location); /* AN000 */ + display(input_message); + + /* Indicate that we are not using the default */ + default_used = FALSE; + PercentFlag = (FLAG)FALSE; /* AN000 */ + END + else + BEGIN + if (!PercentFlag) /* AN000 */ + BEGIN /* AN000 */ + /* Setup error message */ + insert[0] = c('0'); /* AC000 */ + insert[1] = c('-'); /* AC000 */ + insert[2] = c('9'); /* AC000 */ + display(error_31); + END /* AN000 */ + else /* AN000 */ + BEGIN /* AN000 */ + display(error_33); /* AN000 */ + END /* AN000 */ + END + END + END + END + + return(large_input); +END + + +/* */ +char get_alpha_input(low_letter,high_letter,row,col,error_low_letter,error_high_letter) + +unsigned row; +unsigned col; +char low_letter; +char high_letter; +char error_low_letter; +char error_high_letter; + +BEGIN + + char input; + char default_used; + char input_value; + + + /* Assume bad input */ + valid_input = FALSE; + + /* Init input_value to something non-alpha */ + input_value = c(0); /* AC000 */ + + /* Loop until we get good stuff */ + while (valid_input == FALSE) + BEGIN + + /* position the cursor */ + VIOSETCURPOS(row,col,u(0)); /* AC000 */ + + /* Flush the keyboard buffer and get the next pressed key */ + input = get_char_input(); + input = dos_upper(input); + + /* Go handle different inputs */ + switch(input) + BEGIN + case ESC: + BEGIN + valid_input = TRUE; + break; + END + + case CR: + BEGIN + /* See if it is digit and between given letters*/ + /* Do world trade get country information */ + input = dos_upper(input_value); /* AN000 */ + if ((isalpha(input)) && + (input >= low_letter) && + (input <= high_letter) && + (isalpha(input_value))) + BEGIN + valid_input = TRUE; + END + else + BEGIN + if (isalpha(input_value)) + BEGIN + /* Setup error message */ + insert[0] = input; + insert[1] = error_low_letter; + insert[2] = c('-'); /* AC000 */ + insert[3] = error_high_letter; + display(error_23); + END + else + BEGIN + insert[0] = error_low_letter; + insert[1] = c('-'); /* AC000 */ + insert[2] = error_high_letter; + display(error_31); + END + END + break; + END + + default: + BEGIN + putch(((int)(input))); + default_used = FALSE; + input_value = input; + break; + END + END + END + return(input); +END + + +/* */ +char get_char_input() + +BEGIN + regs.h.ah = uc(0x0C); /* AC000 */ + regs.h.al = uc(0x08); /* AC000 */ + intdos(®s,®s); + if (regs.h.al == uc(0)) /* AC000 */ + BEGIN + DOSBEEP(u(900),u(400)); /* AC000 */ + END + return(((char)(regs.h.al))); + +END + + + +/* */ /* AN000 */ + /* AN000 */ +void get_string_input(StartRow,StartCol,string_ptr) /* AN000 */ + /* AN000 */ +unsigned StartRow; /* AN000 */ +unsigned StartCol; /* AN000 */ +char far *string_ptr; /* AN000 */ + /* AN000 */ +BEGIN /* AN000 */ + +#define MAX_STRING_INPUT_LENGTH 11 + /* AN000 */ +unsigned char input; /* AN000 */ +char input_value; /* AN000 */ +char far *WorkingPtr; /* AN000 */ +char far *DeletePtr; /* AN000 */ +char Done; /* AN000 */ +unsigned Row; /* AN000 */ +unsigned Col; /* AN000 */ +int i; /* AN000 */ + /* AN000 */ + /* AN000 */ + WorkingPtr = string_ptr; /* AN000 */ + + Row = StartRow; /* AN000 */ + Col = StartCol; /* AN000 */ + VIOSETCURPOS(Row,Col,u(0)); /* AN000 */ + + while(*WorkingPtr != c(NUL)) /* AN000 */ + BEGIN /* AN000 */ + putch((int)(*WorkingPtr++)); /* AN000 */ + Col++; /* AN000 */ + VIOSETCURPOS(Row,Col,u(0)); /* AN000 */ + END /* AN000 */ + + regs.h.ah = uc(12); /* AN000 */ + regs.h.al = uc(8); /* AN000 */ + intdos(®s,®s); /* AN000 */ + input = regs.h.al; /* AN000 */ + + /* Loop until we get good stuff */ /* AN000 */ + Done = FALSE; /* AN000 */ + while (!Done) /* AN000 */ + BEGIN /* AN000 */ + + /* Go handle different inputs */ + + if (input < 32) /* AN000 */ + BEGIN /* AN000 */ + switch(input) /* AN000 */ + BEGIN /* AN000 */ + case ESC: /* AN000 */ + Done=TRUE; /* AN000 */ + *string_ptr++ = c(ESC); /* AN000 */ + *string_ptr++ = c('\0'); /* AN000 */ + break; /* AN000 */ + + case CR: /* AN000 */ + Done=TRUE; /* AN000 */ + break; /* AN000 */ + + case 8: /* backspace */ /* AN000 */ + if (Col > StartCol) /* AN000 */ + BEGIN /* AN000 */ + WorkingPtr--; /* AN000 */ + Col--; /* AN000 */ + VIOSETCURPOS(Row,Col,u(0)); /* AN000 */ + putch(' '); /* AN000 */ + VIOSETCURPOS(Row,Col,u(0)); /* AN000 */ + DeletePtr = WorkingPtr; /* AN000 */ + while ( *(DeletePtr+1) != c('\0') ) /* AN000 */ + BEGIN /* AN000 */ + *DeletePtr = *(DeletePtr+1); /* AN000 */ + putch(*DeletePtr); /* AN000 */ + DeletePtr++; /* AN000 */ + END /* AN000 */ + *DeletePtr = c('\0'); /* AN000 */ + putch(' '); /* AN000 */ + VIOSETCURPOS(Row,Col,u(0)); /* AN000 */ + END /* AN000 */ + else DOSBEEP(u(900),u(400)); /* AN000 */ + break; /* AN000 */ + + case 0: /* AN000 */ + regs.h.ah = uc(0x08); /* AN000 */ + intdos(®s,®s); /* AN000 */ + input = regs.h.al; /* AN000 */ + switch(input) /* AN000 */ + BEGIN /* AN000 */ + case 71: /* HOME */ /* AN000 */ + WorkingPtr = string_ptr; /* AN000 */ + Row = StartRow; /* AN000 */ + Col = StartCol; /* AN000 */ + VIOSETCURPOS(Row,Col,u(0)); /* AN000 */ + break; /* AN000 */ + + case 79: /* END */ /* AN000 */ + while (*WorkingPtr != c('\0') ) /* AN000 */ + BEGIN /* AN000 */ + WorkingPtr++; /* AN000 */ + Col++; /* AN000 */ + VIOSETCURPOS(Row,Col,u(0)); /* AN000 */ + END /* AN000 */ + break; /* AN000 */ + + + case 75: /* Cursor Left */ /* AN000 */ + if (Col > StartCol) /* AN000 */ + BEGIN /* AN000 */ + WorkingPtr--; /* AN000 */ + Col--; /* AN000 */ + VIOSETCURPOS(Row,Col,u(0)); /* AN000 */ + END /* AN000 */ + else DOSBEEP(u(900),u(400)); /* AN000 */ + break; /* AN000 */ + + + case 77: /* Cursor Right */ /* AN000 */ + if ( *WorkingPtr != c('\0') ) /* AN000 */ + BEGIN /* AN000 */ + WorkingPtr++; /* AN000 */ + Col++; /* AN000 */ + VIOSETCURPOS(Row,Col,u(0)); /* AN000 */ + END /* AN000 */ + else DOSBEEP(u(900),u(400)); /* AN000 */ + break; /* AN000 */ + + + default: /* AN000 */ + DOSBEEP(u(900),u(400)); /* AN000 */ + break; /* AN000 */ + + END /* AN000 */ + break; /* AN000 */ + + default: /* AN000 */ + DOSBEEP(u(900),u(400)); /* AN000 */ + break; /* AN000 */ + END /* AN000 */ + + END /* AN000 */ + else /* input is >= 32 */ /* AN000 */ + BEGIN /* AN000 */ + input = dos_upper(input); /* AN000 */ + if ( (strchr(".\"/\\[]:|<>+=;,",input) == NULL) && + (Col < StartCol + MAX_STRING_INPUT_LENGTH) ) /* AN000 */ + BEGIN /* AN000 */ + putch(((int)(input))); /* AN000 */ + *WorkingPtr = input; /* AN000 */ + *(WorkingPtr+1) = c('\0'); /* AN000 */ + if (Col < (StartCol + MAX_STRING_INPUT_LENGTH - 1) ) /* AN000 */ + BEGIN /* AN000 */ + Col++; /* AN000 */ + WorkingPtr++; /* AN000 */ + END /* AN000 */ + VIOSETCURPOS(Row,Col,u(0)); /* AN000 */ + END /* AN000 */ + else DOSBEEP(u(900),u(400)); /* AN000 */ + END /* AN000 */ + + if (!Done) /* AN000 */ + BEGIN /* AN000 */ + /* Get a character */ /* AN000 */ + regs.h.ah = uc(0x08); /* AN000 */ + intdos(®s,®s); /* AN000 */ + input = regs.h.al; /* AN000 */ + END /* AN000 */ + END /* AN000 */ + + return; /* AN000 */ +END /* AN000 */ + 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 @@ +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "fdiskmsg.h" /* AN000 */ + +#include "string.h" +#include "stdio.h" +#include "stdlib.h" + +/* int printf(char *, ...); */ + +/* */ +char get_disk_info() + +BEGIN + +unsigned char i; + + /* Initialize values */ + number_of_drives = uc(0); /* AC000 */ + for (i=uc(0); i < uc(2); i++) /* AC000 */ + BEGIN + total_disk[i] = u(0); /* AC000 */ + total_mbytes[i] = f(0); /* AC000 */ + max_sector[i] = uc(0); /* AC000 */ + max_head[0] = u(0); /* AC004 */ + END + + /* See how many drives there are */ + if (get_drive_parameters(uc(0x80))) /* AC000 */ + + BEGIN + /* Get the drive parameters for all drives */ + for (i = uc(0); i < number_of_drives;i++) /* AC000 */ + + BEGIN + if (get_drive_parameters(uc(0x80)+i)) /* AC000 */ + + BEGIN + /* Save drive parameters */ + max_sector[i] = ((unsigned char)(regs.h.cl & 0x3F)); + max_head[i] = ((unsigned)(regs.h.dh +1)); /* AC004 */ +#if IBMCOPYRIGHT + total_disk[i] = ((((unsigned)(regs.h.cl & 0xC0 )) & 0x00C0) << 2)+ ((unsigned)regs.h.ch) +1; +#else + total_disk[i] = ((((unsigned)(regs.h.cl & 0xc0)) << 2) | regs.h.ch) + 1; +#endif + total_mbytes[i] = cylinders_to_mbytes(total_disk[i],i); /* AN004 */ + END + else + BEGIN + good_disk[i] = FALSE; + return(FALSE); + END + END + return(TRUE); + END + else + /* No drives present */ + BEGIN + no_fatal_error = FALSE; + return(FALSE); + END +END + + + +/* */ +char write_boot_record(cylinder,which_disk) + +unsigned cylinder; +unsigned char which_disk; + +BEGIN + +char i; +char j; +char far *buffer_pointer = boot_record; + + /* Setup read, always on a cylinder boundary */ + regs.h.ah = uc(WRITE_DISK); /* AC000 */ + regs.h.al = uc(1); /* AC000 */ + regs.h.dh = uc(0); /* AC000 */ + regs.h.cl = uc(0x01); /* AC000 */ + + /* Specify the disk */ + regs.h.dl = which_disk + 0x80; + + /* Need to scramble CX so that sectors and cyl's are in INT 13 format */ + + if (cylinder > u(255)) /* AC000 */ + BEGIN + regs.h.cl = regs.h.cl | ((unsigned char)((cylinder /256) << 6)); + END + regs.h.ch = (unsigned char)(cylinder & 0xFF); + + /* Point at the place to read the boot record */ + regs.x.bx = FP_OFF(buffer_pointer); + segregs.es = FP_SEG(buffer_pointer); + + /* write the boot record */ + DiskIo(®s,®s,&segregs); /* AC000 */ + + /* Check for error reading it */ + if ((regs.x.cflag & 1) != u(1)) /* AC000 */ + BEGIN + return(TRUE); + END + else + BEGIN + /* Tell user there was an error */ + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + display(error_2); + no_fatal_error = FALSE; + return(FALSE); + END +END + +/* */ +unsigned verify_tracks(pointer,type) + +char pointer; +char type; + +BEGIN +unsigned i; +unsigned location; +unsigned sectors_per_fat; +unsigned cur_cyl; +unsigned verify_cyl; +unsigned num_tracks; +unsigned long total_sectors; +char golden_tracks; +char retry; +unsigned char cur_head; /* AC004 */ + +char far *buffer_pointer = boot_record; +char head; + + + + for (i=u(0); i< u(BYTES_PER_SECTOR);i++) /* AC000 */ + BEGIN + /* Put something other then 0's so that unformatted FAT looks full */ + + boot_record[i] = uc(0xF6); /* AC000 */ + END + + /* Get the start cylinder for the sweep */ + cur_cyl = free_space[pointer].start; + + /* Also keep track of what it is */ + verify_cyl = cur_cyl; + + /* Initialize the start head -assume 0*/ + cur_head = uc(0); /* AC004 */ + if ((type == c(PRIMARY)) && (cur_cyl == u(0))) /* AC000 */ + BEGIN + + /* It's head 1 - NOTE: This is convience for PC-DOS because it is */ + /* always this way - This may have to be beefed up for IFS */ + cur_head = uc(1); /* AC004 */ + END + + /* Now go figure out the number of golden sectors needed. Use the */ + /* allocation equation in the fixed disk section of DOS Tech Ref. */ + /* */ + /* TS = Free cyl's * sector/track * track/cyl */ + /* RS = 1 */ + /* D = 512 */ + /* BPD = 32 */ + /* BPS = BYTES_PER_SECTOR */ + /* CF = 2 */ + /* SPF = Solve */ + /* SPC = 4 or 8 */ + /* BPC = 1.5 or 2 */ + /* */ + /* Golden Sectors = RS + 2(SPF) + BPD(D) + (DOSFILES) */ + /* ÄÄÄÄÄÄ if bootable */ + /* BPS */ + + total_sectors = ((unsigned long)free_space[pointer].space) * max_head[cur_disk] * max_sector[cur_disk]; + + /* Chop off one track if it starts on head 1 */ + if (cur_head == uc(1)) /* AC004 */ + BEGIN + total_sectors = total_sectors - max_sector[cur_disk]; + END + + /* See if 12 or 16 bit fat */ + if (total_sectors > (unsigned long)FAT16_SIZE) + BEGIN + /* 16 bit */ + sectors_per_fat = ((unsigned)((total_sectors -33)/(2 + ((BYTES_PER_SECTOR *4)/2)))); + END + else + BEGIN + /* 12 bit */ + sectors_per_fat = ((unsigned)((total_sectors -33)/(2 + ((BYTES_PER_SECTOR *8)/1.5)))); + END + + /* Round up one just to handle any rounding errors */ + sectors_per_fat++; + + /* Now see how many tracks */ + num_tracks = (sectors_per_fat*2) + 33; + + /* If primary and drive 0, add in enough for system files */ + if ((type == c(PRIMARY)) && (cur_disk == c(0))) /* AC000 */ + BEGIN + num_tracks = num_tracks + SYSTEM_FILE_SECTORS; + END + + #if IBMCOPYRIGHT + /* Now convert to tracks */ + num_tracks = num_tracks/max_sector[cur_disk]; + + /* Handle upward rounding */ + if (num_tracks%max_sector[cur_disk] != u(0)) /* AC000 */ + BEGIN + num_tracks++; + END + #else + /* Handle upward rounding */ /* The problem with the IBM code is */ + if (num_tracks%max_sector[cur_disk] != u(0)) /* that if num_tracks is < max_sector[cur_disk] */ + BEGIN /* the num_tracks becomes 0 due to the integer */ + num_tracks = num_tracks + max_sector[cur_disk]; /* division and num_tracks will not be inc'd . */ + END /* This section of code overcomes that. */ + + /* Now convert to tracks */ + num_tracks = num_tracks/max_sector[cur_disk]; + #endif + + + golden_tracks = FALSE; + while (!golden_tracks) + BEGIN + for (i = u(0);i < num_tracks; i++) /* AC000 */ + BEGIN + retry = c(0); /* AC000 */ + do + BEGIN + retry++; + /* Specify the operation */ + regs.h.ah = uc(WRITE_DISK); /* AC000 */ + + /* Specify number of sectors */ + regs.h.al = ((unsigned char)max_sector[cur_disk]); + + /* Specify the start sectors */ + regs.h.cl = uc(1); /* AC000 */ + + /* Need to scramble CX so that sectors and cyl's are in INT 13 format */ + if (cur_cyl > u(255)) /* AC000 */ + BEGIN + regs.h.cl = regs.h.cl | ((unsigned char)((cur_cyl/256) << 6)); + END + regs.h.ch = ((unsigned char)cur_cyl) & 0xFF; + + /* Specify the disk */ + regs.h.dl = ((unsigned char)cur_disk) + 0x80; + + /* Specify the head */ + regs.h.dh = cur_head; /* AC004 */ + + /* Point at the place to write */ + regs.x.bx = FP_OFF(buffer_pointer); + segregs.es = FP_SEG(buffer_pointer); + + /* write the track */ + DiskIo(®s,®s,&segregs); /* AC000 */ + + END + while (((regs.x.cflag & 1) == u(1)) && (retry != c(5))); /* AC000 */ + + /* See if we had a good read */ + if ((regs.x.cflag & 1) != u(1)) /* AC000 */ + BEGIN + golden_tracks = TRUE; + /* Get the next head */ + cur_head++; + if (cur_head == (uc(max_head[cur_disk] -1))) /* AC004 */ + BEGIN + /* Up to the next cylinder */ + cur_head = uc(0); /* AC004 */ + cur_cyl++; + + /* Check to see if we've reached the end of the free_space*/ + if (cur_cyl > free_space[pointer].end) + BEGIN + /* It is, so return with the cyl offset equal to the freespace */ + return(free_space[pointer].space); + END + END + END + else + BEGIN + /* Get out of the for loop, with a false flag */ + golden_tracks = FALSE; + + /* Bump up to the next cylinder boundary */ + cur_cyl++; + cur_head = uc(0); /* AC004 */ + + /* Save the new verify start point */ + verify_cyl = cur_cyl; + + break; + END + END /* for num_tracks */ + END /* while !golden_tracks */ + + /* All done, return the offset from original cyl to the new one */ + return(verify_cyl - free_space[pointer].start); +END + + +/* */ +char get_drive_parameters(drive) + +unsigned char drive; + +BEGIN + /* See how many drives there are */ + regs.h.ah = uc(DISK_INFO); /* AC000 */ + regs.h.dl = drive; + DiskIo(®s,®s,&segregs); /* AC000 */ + + /* See if any drives exist */ + if ((regs.h.dl == uc(0)) || ((regs.x.cflag & 1) == u(1))) /* AC000 */ + BEGIN + display(error_1); + return(FALSE); + END + else + BEGIN + /* Save the number of drives */ + number_of_drives = regs.h.dl; + return(TRUE); + END +END + +/* */ +char read_boot_record(cylinder,which_disk,which_head,which_sector) /* AC000 */ + +unsigned cylinder; +unsigned char which_disk; +unsigned char which_head; /* AN000 */ +unsigned char which_sector; /* AN000 */ + +BEGIN + +char far *buffer_pointer = boot_record; + + /* Setup read, always on a cylinder boundary */ + regs.h.ah = uc(READ_DISK); /* AC000 */ + regs.h.al = uc(1); /* AC000 */ + regs.h.dh = which_head; /* AC000 */ + regs.h.cl = which_sector; /* AC000 */ + + /* Specify the disk */ + regs.h.dl = which_disk + 0x80; + + /* Need to scramble CX so that sectors and cyl's are in INT 13 format */ + + if (cylinder > u(255)) /* AC000 */ + BEGIN + regs.h.cl = regs.h.cl | ((char)((cylinder /256) << 6)); + END + regs.h.ch = (unsigned char)(cylinder & 0xFF); + + /* Point at the place to write the boot record */ + regs.x.bx = FP_OFF(buffer_pointer); + segregs.es = FP_SEG(buffer_pointer); + + /* read in the boot record */ + DiskIo(®s,®s,&segregs); /* AC000 */ + /* Check for error reading it */ + if ((regs.x.cflag & 1) != u(1)) /* AC000 */ + BEGIN + return(TRUE); + END + else + BEGIN + /* Tell user there was an error */ + good_disk[which_disk] = FALSE; + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + return(FALSE); + END +END + +/* */ +void DiskIo(InRegs,OutRegs,SegRegs) +union REGS *InRegs; +union REGS *OutRegs; +struct SREGS *SegRegs; + +BEGIN + + char *WritePtr; + +#ifdef DEBUG + + switch(InRegs->h.ah) + { + case 0: + case 1: + case 2: + case 4: + case 8: + case 15: + case 16: + int86x((int)DISK,InRegs,OutRegs,SegRegs); /* AC000 */ + break; + + default: + WritePtr = getenv("WRITE"); + if (strcmpi(WritePtr,"ON") != 0) + BEGIN + printf("\nDisallowing Disk I/O Request\n"); + printf("AX:%04X BX:%04X CX:%04X DX:%04X ES:%04X\n", + InRegs->x.ax,InRegs->x.bx,InRegs->x.cx,InRegs->x.dx,SegRegs->es); + + OutRegs->h.ah = (unsigned char) 0; + OutRegs->x.cflag = (unsigned) 0; + END + else int86x((int)DISK,InRegs,OutRegs,SegRegs); + + break; + + } + +#else + + int86x((int)DISK,InRegs,OutRegs,SegRegs); /* AC000 */ + +#endif + + return; + +END + 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 @@ + +/* */ + +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SOURCE FILE NAME: FDISK */ +/* */ +/* DESCRIPTIVE NAME: FIXED DISK PARTITIONING UTILITY */ +/* */ +/* FUNCTION: */ +/* Allows creation and deletion of DOS related partitions */ +/* on fixed disk devices 80-81h (int 13h BIOS defined, */ +/* DOS). Also allows display of all partitions, and will */ +/* allow a partition to be marked active (bootable). The */ +/* user will be prompted for action thru a full screen */ +/* interface. The user can also create, delete and display */ +/* logical DOS drives within a EXTENDED DOS Partition. If a*/ +/* regular DOS partition is created, the beginning of the */ +/* partition will be scanned to insure a contiguous area of*/ +/* good sectors on the disk large enough to satisfy the */ +/* DOS system requirements. If a bad spot is found, the */ +/* start of the partition will be moved out until a good */ +/* area is located */ +/* */ +/* NOTES: The program will work by setting up a logical image */ +/* of all relevant disk information at initilization */ +/* time. All operations will be performed on this */ +/* logical image, thus reducing disk accesses to only */ +/* those required to initially set up the logical image,*/ +/* and to write the changed information at the end. The */ +/* user will be informed if there is a problem writing */ +/* the logical image back to the disk. */ +/* */ +/* FDISK will interface with the partition table in the */ +/* master boot record as defined in the PC-DOS technical*/ +/* reference manual. It will also create and manage the */ +/* EXTENDED DOS partition architecture as defined in the*/ +/* PC-DOS 3.30 functional spec (CP/DOS spec dcr pending)*/ +/* */ +/* ENTRY POINTS: MAIN */ +/* LINKAGE: [d:] [path] FDISK */ +/* */ +/* EXTERNAL REFERENCES: */ +/* Fixed Disk Master Boot Record */ +/* EXTENDED Partition Volume Boot Records */ +/* Note: Both of the above are physical data structures on */ +/* the surface of the disk */ +/* */ +/* P.S. - To whoever winds up maintaining this, I will */ +/* apoligize in advance. I had just learned 'C' when */ +/* writing this, so out of ignorance of the finer points*/ +/* of the langauge I did a lot of things by brute force.*/ +/* Hope this doesn't mess you up too much - MT 5/20/86 */ +/******************** END OF SPECIFICATIONS ********************/ + +#include /* AN000 */ +#include /* AN000 */ +#include /* AN000 */ +#include /* AN000 */ +#include /* AN000 */ +#include /* AN000 */ +#include /* AN000 */ +#include /* AN000 */ +#include /* AN000 */ +#include /* AN000 */ +#include /* AN001 */ +#include /* AN000 */ + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: MAIN */ +/* */ +/* DESCRIPTIVE NAME: Main control routine */ +/* */ +/* FUNCTION: Main will handle call routines to handle the */ +/* setup of the video for the full screen interface, */ +/* get physical data on the drive characteristics, */ +/* initilize all data fields with the current status */ +/* of the disk partitioning information. Before the */ +/* program is terminated, the video is reset to the */ +/* mode it was in previous to the routine entry. It */ +/* will also handle the case of an improper setup */ +/* */ +/* NOTES: FDISK requires at least 1 hardfile to operate */ +/* */ +/* ENTRY POINTS: main(); */ +/* LINKAGE: */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: Return Code = 0 */ +/* */ +/* EXIT-ERROR: Return Code = 1 */ +/* */ +/* EFFECTS: Sets up status variables, sets up video for full */ +/* screen interface, and then restores the video mode */ +/* before exiting program */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* init_video_information */ +/* get_disk_information */ +/* check_valid_environment */ +/* do_main_menu */ +/* init_partition_tables */ +/* reset_video_information */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* DosExit */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + + +/* */ +/**************************************************************************/ +/* */ +/* UTILITY NAME: FDISK.com */ +/* SOURCE FILE NAME: FDISK.c */ +/* STATUS: FDISK utility, DOS 3.3 */ +/* CHANGE HISTORY: UPDATED 5-29-87 DOS4.0 DRM */ +/* SYNTAX (Command line) */ +/* */ +/* [d:][path]FDISK */ +/* */ +/* or */ +/* */ +/* [d:][path]FDISK d [/PRI:m | /EXT:n | /LOG:o | /Q ...] */ +/* */ +/* d: Drive to load FDISK utility from */ +/* */ +/* path path to the directory on specified drive to */ +/* load FDISK from */ +/* */ +/* d Drive (1 or 2) that FDISK should operate on */ +/* */ +/* /PRI:m Size of Primary DOS partition to create in K */ +/* */ +/* /EXT:n Size of Extended DOS partition to create in K */ +/* */ +/* /LOG:o Size of Logical drive to create in K in the */ +/* extended partition */ +/* */ +/* /Q This suppresses the reboot screen and returns */ +/* FDISK to DOS even if partitons have changed. */ +/* */ +/* UTILITY FUNCTION: */ +/* Allows you to create, set up, display, and delete the */ +/* DOS partitions on a fixed disk. */ +/* */ +/**************************************************************************/ +/* */ +void main(argc,argv) /* AC000 */ + +int argc; /* AN000 */ +char *argv[]; /* AN000 */ + +BEGIN + + char temp; /* AN000 */ + unsigned input; + + /* DISABLE CNTL-BREAK HERE */ + /* Gets defines from signal.h */ + signal( (int) SIGINT, SIG_IGN ); /* AN000 */ + + no_fatal_error = TRUE; /* AN000 */ + + /* Preload messages and return */ + if ( preload_messages() && + get_yes_no_values() ) /* AN000 AC012 */ + BEGIN /* AN000 */ + + /* Parse the command line for syntax and switches */ + if(parse_command_line(argc,argv)) /* AN000 */ + + BEGIN /* AN000 */ + /* check to see if switches were set */ + if ((primary_flag == FALSE) && + (extended_flag == FALSE) && + (logical_flag == FALSE) && + (disk_flag == FALSE)) /* AN000 */ + + BEGIN /* AN000 */ + reboot_flag = FALSE; + /* See if running evironment is ok (Got hardfile, no network */ + if (check_valid_environment()) + BEGIN /* AN000 */ + /* Get and save screen mode information */ + init_video_information(); + clear_screen(u(0),u(0),u(24),u(79)); /* AC006 */ + + /* Get disk size information */ + good_disk[0] = TRUE; + good_disk[1] = TRUE; + + if (get_disk_info()) + BEGIN + /* build memory model of partitions */ + init_partition_tables(); + + /* Go do main screen */ + do_main_menu(); + write_info_to_disk(); + END + + if (reboot_flag) + BEGIN /* AN000 */ + reboot_system(); + DOSEXIT((unsigned) 0,(unsigned) 0); /* AC000 */ + END /* AN000 */ + + /* Nearly done, go reset screen mode */ + if (no_fatal_error) + BEGIN + reset_video_information(); + END /* AN000 */ + /* this is end of check valid environment */ + END /* AN000 */ + /* This is end for no switches set */ + END /* AN000 */ + + else /* AN000 */ + + BEGIN /* AN000 */ + if ( ((primary_flag == FALSE) && + (extended_flag == FALSE) && + (logical_flag == FALSE)) || + (disk_flag == FALSE) ) /* AN000 */ + display_msg((int)8,(int)DosStdEr,(int)nosubcnt,(int)nosubptr,c(noinput),c(Utility_Msg_Class)); /*;AN000; AC014 AC015 */ + + else + BEGIN + reboot_flag = FALSE; /* AN000 */ + /* Get disk size information */ /* AN000 */ + good_disk[0] = TRUE; /* AN000 */ + good_disk[1] = TRUE; /* AN000 */ + if (get_disk_info()) /* AN000 */ + BEGIN + if (number_of_drives < (cur_disk_buff+1)) + display_msg((int)8,(int)DosStdEr,(int)nosubcnt,(int)nosubptr,c(noinput),c(Utility_Msg_Class)); /*;AN000; AC014 AC015*/ + else + BEGIN /* AN000 */ + /* build memory model of partitions */ + init_partition_tables(); /* AN000 */ + + /* set cur_disk to current disk */ + cur_disk = cur_disk_buff; /* AN000 */ + + /* If /PRI: was specified, create primary partition */ + /* check to see if a primary partition already exists */ + if ( (primary_flag == TRUE) && /* AN000 */ + ( (!find_partition_type(uc(DOS12))) && + (!find_partition_type(uc(DOS16))) && + (!find_partition_type(uc(DOSNEW))) ) ) /* AC000 */ + BEGIN + temp = find_part_free_space((char) PRIMARY); /* AN000 */ + if (primary_buff >= free_space[temp].mbytes_unused) /* AN000 */ + input = free_space[temp].space; /* AN000 */ + else /* AN000 */ + input = (unsigned)mbytes_to_cylinders(primary_buff, + cur_disk_buff); /* AN004 */ + make_partition(input,temp,uc(ACTIVE),(char)PRIMARY); /* AN000 */ + END + + /* If /EXT: was specified, create extended partition */ + /* Check and see if there is a primary partition before you create an extended */ + if ( (extended_flag == TRUE) && /* AN000 */ + ( (cur_disk == c(1)) || + (find_partition_type(uc(DOS12))) || + (find_partition_type(uc(DOS16))) || + (find_partition_type(uc(DOSNEW))) ) ) /* AC000 */ + BEGIN + /* Make sure there isn't an extended already there */ + if (!find_partition_type(uc(EXTENDED))) /* AC000 */ + BEGIN + temp = find_part_free_space((char) EXTENDED); /* AN000 */ + if (extended_buff >= free_space[temp].mbytes_unused) /* AN000 */ + input = free_space[temp].space; /* AN000 */ + else /* AN000 */ + input = (unsigned)mbytes_to_cylinders(extended_buff, + cur_disk_buff); /* AN004 */ + make_partition(input,temp,(unsigned char) NUL,(char) EXTENDED); /* AN000 */ + END + END + + /* If /LOG: was specified, create logical partition */ + if ( (logical_flag == TRUE) && + (find_partition_type(uc(EXTENDED))) ) /* AN000 */ + BEGIN /* AN000 */ + temp = find_ext_free_space(); /* AN000 */ + if (logical_buff >= free_space[temp].mbytes_unused) /* AN000 */ + input = free_space[temp].space; /* AN000 */ + else /* AN000 */ + input = (unsigned)mbytes_to_cylinders(logical_buff, + cur_disk_buff); /* AN004 */ + make_volume(input,temp); /* AN000 */ + END + + /* This is end of switch execution */ + write_info_to_disk(); /* AN000 */ + END /* AN000 */ + /* This is the end of compare cur_disk_buff for valid drive */ + END + /* This is the end of just disk_flag set */ + END + /* This is end of if switch is present */ + END + /* This is end of Parse command line */ + END /* AN000 */ + /* This end of Preload_messages function */ + END /* AN000 */ + cur_disk = c(0); /* AN001 */ + if ( (quiet_flag == TRUE) && + (!find_partition_type(uc(DOS12))) && + (!find_partition_type(uc(DOS16))) && + (!find_partition_type(uc(DOSNEW))) ) /* AN001 */ + exit(ERR_LEVEL_1); /* AN001 */ + else + BEGIN /* AN005 */ + if ((quiet_flag == TRUE) && /* AN005 */ + (primary_flag == FALSE) && /* AN008 */ + (extended_flag == FALSE) && /* AN008 */ + (logical_flag == FALSE)) /* AN008 */ + exit(ERR_LEVEL_2); /* AN005 */ + else /* AN005 */ + exit(ERR_LEVEL_0); /* AN001 */ + END /* AN005 */ +END + + 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 @@ + +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "fdiskmsg.h" /* AN000 */ + +/* */ +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: DO_MAIN_MENU */ +/* */ +/* DESCRIPTIVE NAME: Main menu display and input routine */ +/* */ +/* FUNCTION: */ +/* Displays the main FDISK menu, accepts and validates */ +/* input from menu and passes control to requested function */ +/* */ +/* NOTES: The following screen is managed by this routine: */ +/* */ +/* ³0000000000111111111122222222223333333333³ */ +/* ³0123456789012345678901234567890123456789³ */ +/* ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ */ +/* 00³IBM Personal Computer ³ */ +/* 01³Fixed Disk Setup Program Version 3.30 ³ */ +/* 02³(C)Copyright IBM Corp. 1983,1987 ³ */ +/* 03³ ³ */ +/* 04³FDISK Options ³ */ +/* 05³ ³ */ +/* 06³Current Fixed Disk Drive: # ³ */ +/* 07³ ³ */ +/* 08³Choose one of the following: ³ */ +/* 09³ ³ */ +/* 10³ 1. Create DOS partition ³ */ +/* 11³ 2. Change Active Partition ³ */ +/* 12³ 3. Delete DOS Partition ³ */ +/* 13³ 4. Display Partition Data ³ */ +/* 14³ 5. Select Next Fixed Disk Drive ³ */ +/* 15³ ³ */ +/* 16³ ³ */ +/* 17³ ³ */ +/* 18³Enter choice: [#] ³ */ +/* 19³ ³ */ +/* 20³ ³ */ +/* 21³WARNING! No partitions marked active ³ */ +/* 22³ ³ */ +/* 23³Press ESC to return to DOS ³ */ +/* ÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ */ +/* */ +/* ENTRY POINTS: do_main_menu */ +/* LINKAGE: do_main_menu(); */ +/* NEAR CALL */ +/* */ +/* INPUT: None */ +/* */ +/* EXIT-NORMAL: ERROR=FALSE */ +/* */ +/* EXIT-ERROR: ERROR=TRUE */ +/* GOTO internal_program_error if case statement */ +/* failure when branching to requested function */ +/* */ +/* EFFECTS: No data directly modified by this routine, but */ +/* child routines will modify data. */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* clear_screen */ +/* display */ +/* get_num_input */ +/* create_partition */ +/* change_active_partition */ +/* delete_partition */ +/* display_partition_information */ +/* find_active_partition */ +/* change_drive */ +/* internal_program_error */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/******************** END OF SPECIFICATIONS ********************/ + +/* */ +void do_main_menu() + +BEGIN + +char input; +char max_input; +unsigned temp; +unsigned i; + + + input = c(NUL); /* AC000 */ + PercentFlag = (FLAG)FALSE; /* AN000 */ + /* Intialize cur_disk indicator. It is 0 based for array usage */ + /* See if first disk readable */ + cur_disk = c(0); /* AC000 */ + if (!good_disk[0]) + BEGIN + cur_disk++; + END + + /* See if we have a valid combo of disk */ + if ((good_disk[0]) || ((good_disk[1]) && (number_of_drives == uc(2)))) /* AC000 */ + BEGIN + clear_screen(u(0),u(0),u(24),u(79)); /* AC000 */ + /* Display the copyright */ + display(menu_1); + + /* See if we couldn't access drive 1 */ + if (!good_disk[0]) + BEGIN + insert[0] = c('1'); /* AC000 */ + display(error_30); + END + + /* Display the menu every time this routine is returned to until ESC */ + input = c(NUL); /* AC000 */ + while (input !=c(ESC)) /* AC000 */ + BEGIN + /* Put up most of the menu */ + display(menu_2); + display(menu_3); + display(menu_7); + + /* Put correct disk in current disk message */ + insert[0]=cur_disk+1+'0'; + display(menu_5); + + /* Display warning prompt if no active partitions */ + /* check to see if there is an avail partition */ + temp = u(0); /* AC000 */ + for (i = u(0); i < u(4);i++) /* AC000 */ + BEGIN + + /* See if any non - zero system id bytes */ + temp = temp | part_table[cur_disk][i].sys_id ; + END + /* Any entry that isn't zero means */ + if (temp != u(0)) /* AC000 */ + BEGIN + /* If there isn't an active partition and this is disk 1, then yell) */ + if ((!find_active_partition()) && (cur_disk == c(0))) /* AC000 */ + display(menu_6); + END + + /* Get the menu input */ + + /* See if more than one fixed disk */ + if (number_of_drives == uc(2)) /* AC000 */ + BEGIN + display(menu_4); + max_input = c(5); /* AC000 */ + END + else /* only 4 options */ + max_input = c(4); /* AC000 */ + /* Setup default and go get input */ + input = get_num_input(c(1),max_input,input_row,input_col); /* AC000 */ + switch(input) + BEGIN + case '1': create_partition(); + break; + + case '2': change_active_partition(); + break; + + case '3': delete_partition(); + break; + + case '4': display_partition_information(); + break; + + case '5': BEGIN + if (number_of_drives == uc(1)) /* AC000 */ + internal_program_error(); + else + BEGIN + /* Swap the number */ + if (cur_disk == c(0)) /* AC000 */ + BEGIN + if (good_disk[1]) + BEGIN + cur_disk++; + END + else + BEGIN + /* Disk has error reading */ + insert[0] = c('2'); /* AC000 */ + display(error_30); + END + END + else + BEGIN + + if (cur_disk == c(1)) /* AC000 */ + BEGIN + if (good_disk[0]) + BEGIN + cur_disk--; + END + else + BEGIN + /* Disk has error reading */ + insert[0] = c('1'); /* AC000 */ + display(error_30); + END + END + else + internal_program_error; + END + END + break; + END + + case ESC: break; /* ESC case */ + + default: internal_program_error(); + END + END + END + else + BEGIN + /* Can't read either drive, so quit */ + no_fatal_error = c(FALSE); /* AC000 */ + display(error_2); + END + return; +END + + \ 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 @@ +#************************** makefile for cmd\... *************************** + +msg =..\..\messages +dos =..\..\dos +inc =..\..\inc +hinc =..\..\h + +# +####################### dependencies begin here. ######################### +# + +map =..\..\mapper +here =..\cmd\fdisk + +all: fdisk.exe + + +# Handle the FDISK 'C' source compilations first + +fdiskm.c : $(msg)\$(COUNTRY).msg fdisk.msg + menubld fdisk.msg $(msg)\$(COUNTRY).MSG + +fdisk5.cl1 : fdisk5.skl $(msg)\$(COUNTRY).msg + +fdisk.ctl : fdisk.skl $(msg)\$(COUNTRY).msg + +main.obj : main.c \ + fdisk.h subtype.h extern.h fdiskmsg.h msgret.h doscall.h + +fdisk.obj : fdisk.c \ + fdisk.h subtype.h extern.h fdiskmsg.h doscall.h msgret.h + +mainmenu.obj : mainmenu.c fdisk.h subtype.h extern.h fdiskmsg.h + +display.obj : display.c \ + fdisk.h subtype.h extern.h fdiskmsg.h doscall.h + +d_menus.obj : d_menus.c fdisk.h subtype.h extern.h fdiskmsg.h + +c_menus.obj : c_menus.c fdisk.h subtype.h extern.h fdiskmsg.h + +input.obj : input.c fdisk.h subtype.h extern.h fdiskmsg.h doscall.h + +tdisplay.obj : tdisplay.c fdisk.h subtype.h extern.h fdiskmsg.h + +vdisplay.obj : vdisplay.c fdisk.h subtype.h extern.h fdiskmsg.h + +space.obj : space.c fdisk.h subtype.h extern.h + +partinfo.obj : partinfo.c fdisk.h subtype.h extern.h + +makepart.obj : makepart.c fdisk.h subtype.h extern.h + +video.obj : video.c fdisk.h extern.h subtype.h fdiskmsg.h doscall.h + +int13.obj : int13.c fdisk.h subtype.h extern.h fdiskmsg.h + +diskout.obj : diskout.c fdisk.h subtype.h extern.h + +fdparse.obj : fdparse.c fdisk.h subtype.h extern.h parse.h msgret.h + +convert.obj : convert.c fdisk.h subtype.h extern.h + +global.obj : global.c fdisk.h makefile + +fdiskm.obj : fdiskm.c + +messages.obj : messages.c msgret.h extern.h subtype.h fdisk.h + + +# Handle the FDISK MASM source + + +fdboot.obj : fdboot.asm fdisk5.cl1 + +fdboot.inc: fdboot.obj + link fdboot; + exe2bin fdboot + del fdboot.exe + dbof fdboot.bin fdboot.inc 600 200 + +_parse.obj : _parse.asm $(inc)\psdata.inc $(inc)\parse.asm \ + makefile + +_msgret.obj : _msgret.asm $(inc)\psdata.inc \ + fdisk.ctl fdisk.cla fdisk.clb fdisk.cl1 fdisk.cl2 \ + makefile + +bootrec.obj : bootrec.asm fdboot.inc \ + makefile + +reboot.obj : reboot.asm \ + makefile + +$(map)\mapper.lib: + cd $(map) + nmake + cd $(here) + +# Do the link of FDISK + +fdisk.exe : fdisk.obj reboot.obj bootrec.obj fdboot.obj \ + display.obj input.obj tdisplay.obj vdisplay.obj \ + space.obj partinfo.obj video.obj makepart.obj \ + int13.obj diskout.obj messages.obj fdparse.obj \ + convert.obj global.obj fdiskm.obj main.obj \ + c_menus.obj d_menus.obj mainmenu.obj _msgret.obj \ + $(map)\mapper.lib makefile fdisk.lnk fdisk.ctl _parse.obj \ + $(inc)\comsubs.lib + cd $(inc) + nmake + cd $(here) + link @fdisk.lnk + 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 @@ + +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "string.h" /* AN000 */ + +/* */ + +void make_partition(size,free_pointer,bootable,type) + +unsigned size; +char free_pointer; +unsigned char bootable; +char type; + +BEGIN + +char table_pointer; +unsigned i; +unsigned char temp; +unsigned long total_sectors; + + /* Find a free spot to put it in */ + table_pointer = find_free_partition(); + + if (table_pointer != ((char)(NOT_FOUND))) + BEGIN + /* found a free partition, now lets go fill it up */ + + /* Do we need to make it active? */ + if (bootable == ((unsigned char)(ACTIVE))) + BEGIN + + /* Go clear out a previously active one */ + for (i=u(0); i +#include +#include +#include +#include + + +void main() + +BEGIN + +unsigned i; + + /* Main Menu */ + clear_screen(0,0,24,79); + display(menu_1); + display(menu_2); + display(menu_3); + display(menu_4); + insert[0] = 'C'; + display(menu_5); + display(menu_6); + display(menu_7); + + wait_for_ESC(); + + + /* Type of DOS partition for create */ + clear_screen(0,0,24,39); + display(menu_3); + insert[0] = 'C'; + display(menu_5); + display(menu_7); + display(menu_8); + display(menu_9); + display(menu_10); + display(menu_11); + wait_for_ESC(); + + /* Shortcut screen C:*/ + clear_screen(0,0,24,39); + display(menu_12); + insert[0] = 'C'; + display(menu_5); + display(menu_11); + display(menu_12); + display(menu_13); + wait_for_ESC(); + + /* Shortcut screen D:*/ + clear_screen(0,0,24,39); + display(menu_12); + insert[0] = 'C'; + display(menu_5); + display(menu_11); + display(menu_12); + display(menu_41); + wait_for_ESC(); + + +/* Create primary DOS partition screen */ + display(menu_12); + insert[0] = 'C'; + display(menu_5); + for (i=0;i < 92;i++) + BEGIN + insert[i] = 'x'; + END + display(menu_14); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_15); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_16); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_39); + display(menu_11); + wait_for_ESC(); + +/* Create Extended Partition */ + clear_screen(0,0,24,39); + display(menu_17); + insert[0] = 'C'; + display(menu_5); + for (i=0;i < 92;i++) + BEGIN + insert[i] = 'x'; + END + display(menu_14); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_15); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_16); + display(menu_39); + display(menu_11); + wait_for_ESC(); + + +/* Create logical drive screen */ + clear_screen(0,0,24,39); + display(menu_18); + for (i=0;i < 168;i++) + BEGIN + insert[i]= 'x'; + END + display(menu_19); + for (i=0;i < 168;i++) + BEGIN + insert[i]= 'x'; + END + display(menu_20); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_21); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_22); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_40); + display(menu_11); + wait_for_ESC(); + + +/* Change active partition screen */ + clear_screen(0,0,24,39); + display(menu_23); + insert[0] = 'C'; + display(menu_5); + for (i=0;i < 92;i++) + BEGIN + insert[i] = 'x'; + END + display(menu_14); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_15); + display(menu_24); + display(menu_11); + wait_for_ESC(); + + +/* Delete Partition Screen */ + clear_screen(0,0,24,39); + display(menu_25); + insert[0] = 'C'; + display(menu_5); + display(menu_3); + display(menu_26); + display(menu_27); + display(menu_7); + display(menu_11); + wait_for_ESC(); + +/* Delete Primary Screen */ + clear_screen(0,0,24,39); + display(menu_28); + insert[0] = 'C'; + display(menu_5); + for (i=0;i < 92;i++) + BEGIN + insert[i] = 'x'; + END + display(menu_14); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_15); + display(menu_29); + display(menu_11); + wait_for_ESC(); + + +/* Delete Extended Screen */ + clear_screen(0,0,24,39); + display(menu_30); + insert[0] = 'C'; + display(menu_5); + for (i=0;i<92;i++) + BEGIN + insert[i] = 'x'; + END + display(menu_14); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_15); + display(menu_31); + display(menu_11); + wait_for_ESC(); + + +/* Delete Logical Drives */ + clear_screen(0,0,24,39); + display(menu_32); + display(menu_18); + for (i=0;i<168;i++) + BEGIN + insert[i]='x'; + END + display(menu_19); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_21); + display(menu_33); + display(menu_11); + wait_for_ESC(); + +/* Display Partition Information */ + clear_screen(0,0,24,39); + display(menu_35); + insert[0] = 'C'; + display(menu_5); + for (i=0;i<92;i++) + BEGIN + insert[i] = 'x'; + END + display(menu_14); + insert[0] = 'x'; + insert[1] = 'x'; + insert[2] = 'x'; + insert[3] = 'x'; + display(menu_15); + display(menu_36); + display(menu_11); + wait_for_ESC(); + +/* Display Logical Drive Info */ + clear_screen(0,0,24,39); + display(menu_37); + for (i=0;i<168;i++) + BEGIN + insert[i]='x'; + END + display(menu_19); + for (i=0;i<168;i++) + BEGIN + insert[i]='x'; + END + display(menu_20); + display(menu_11); + wait_for_ESC(); + +/* Reboot Screen */ + clear_screen(0,0,24,39); + display(menu_38); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(status_1); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(status_2); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(status_3); + wait_for_ESC(); + + clear_screen(0,0,24,39); + insert[0] = 'x'; + display(status_4); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(status_5); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(status_6); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(status_7); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(status_8); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(status_9); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(status_10); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_1); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_2); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_3); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_4); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_5); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_6); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_7); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_8); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_9); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_10); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_12); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_13); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_14); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_15); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_16); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_17); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_19); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_20); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_21); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_22); + wait_for_ESC(); + + clear_screen(0,0,24,39); + insert[0]='x'; + insert[1]='y'; + insert[2]='-'; + insert[3]='z'; + display(error_23); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_24); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_25); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_26); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_27); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_28); + wait_for_ESC(); + + clear_screen(0,0,24,39); + insert[0]='X'; + insert[1]=':'; + display(error_29); + wait_for_ESC(); + + clear_screen(0,0,24,39); + insert[0]='X'; + display(error_30); + wait_for_ESC(); + + clear_screen(0,0,24,39); + insert[0]='x'; + insert[1]='-'; + insert[2]='y'; + display(error_31); + wait_for_ESC(); + + clear_screen(0,0,24,39); + display(error_32); + wait_for_ESC(); + + clear_screen(0,0,24,39); + DOSEXIT(0,0); + +END + + +/******************* START OF SPECIFICATIONS *******************/ +/* */ +/* SUBROUTINE NAME: DISPLAY */ +/* */ +/* DESCRIPTIVE NAME: Display full screen interface messages */ +/* */ +/* FUNCTION: Displays messages and handles control characters */ +/* */ +/* NOTES: */ +/* FDISK MESSAGES */ +/* Portions of the screen that are handled in the msg are */ +/* indicated on the listing of the screen with the message */ +/* name given. If the text message is defined in another */ +/* screen, then the name is followed by a "#" character */ +/* */ +/* NOTE TO TRANSLATORS The characters inside the <> and the [] */ +/* are control characters and should not be translated. The */ +/* Control characters are defined as follows: */ +/* */ +/* - Highlight the following text */ +/* - Regular text */ +/* - Blink the following text */ +/* - Turn blinking off */ +/* - Print YES character, as set by define */ +/* - Print NO character, as set by define */ +/* - Sound the beep */ +/* - Save cursor position for later use */ +/* - Insert character from insert[] string. This string */ +/* must be set up prior to displaying the message. The */ +/* first will insert Insert[0], the second */ +/* insert[1], etc....This will move the cursor one */ +/* postition. The insert[] string will be initialized */ +/* */ +/* Multiple control characters can be between the <>. */ +/* */ +/* The %####%indicates Row and column for the text and has the */ +/* format of [rrcc] where the numbers are decimal and zero */ +/* based (first row/col is 00. The numbers are in decimal, */ +/* and must be 2 characters, which means rows/cols 0-9 should */ +/* be listed as 00-09. For example, the 5th row, 3rd column */ +/* on the screen would be listed as %0402%. */ +/* */ +/* The column number is always the column desired. The row */ +/* number is an offset from the previous row. For example, if */ +/* the text just printed is on row 6, and the next text should */ +/* be printed 2 rows down in column 0, then the control strin */ +/* would be %0201%. The first row specified in the message is */ +/* assumed to be based off of row 0, it would actually specify */ +/* the actual row for the start of the msg to be printed. */ +/* */ +/* ENTRY POINTS: display(*message_name); */ +/* LINKAGE: Near call */ +/* */ +/* INPUT: char *message_name */ +/* */ +/* EXIT-NORMAL: */ +/* */ +/* EXIT-ERROR: */ +/* */ +/* EFFECTS: */ +/* input_row changed if control character in message */ +/* input_col changed if control character in message */ +/* */ +/* INTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/* EXTERNAL REFERENCES: */ +/* ROUTINES: */ +/* */ +/* viowrtcharstratt(); */ +/******************** END OF SPECIFICATIONS ********************/ +void display(s) + +char far *s; + +BEGIN + unsigned row; + unsigned col; + char attribute; + char far *attribute_ptr = &attribute; + unsigned insert_count; + + + /* Initialize row and col, and index into array */ + row = 0; + col = 0; + insert_count = 0; + /* check for a request to display a null string */ + if (*s == '\0') + BEGIN + /* Message string error */ + insert[0] = '1'; + display(debug_msg); + END + else + BEGIN + /* There is data there, lets go handle it */ + + attribute = 0x00; + /* Go until end of string */ + while (*s != '\0') + BEGIN + + /* Check for any imbedded control strings */ + switch (*s) + BEGIN + /* Check for control characters */ + case '<': + BEGIN + s++; + while ( (*s != '>') && (*s != '\0') ) + BEGIN + switch (*s++) + BEGIN + case 'H': attribute = (attribute & 0x80) | 0x0F; + break; + + + case 'R': attribute = (attribute & 0x80) | 0x07; + break; + + case 'B': attribute |= 0x80; + break; + + case 'O': attribute &= 0x7F; + break; + + case 'W': DOSBEEP(900,400); + break; + + case 'I': + BEGIN + /* display next element in the array */ + if (attribute == 0x00) + attribute = 0x07; + VIOWRTCHARSTRATT(pinsert+insert_count++,1,row,col++,attribute_ptr,0); + break; + END + + + case 'Y': + BEGIN + /* display YES character in next location */ + *--s = YES; + if (attribute == 0x00) + attribute = 0x07; + VIOWRTCHARSTRATT(s++,1,row,col++,attribute_ptr,0); + break; + END + + case 'N': + BEGIN + /* display NO character in next location */ + *--s = NO; + if (attribute == 0x00) + attribute = 0x07; + VIOWRTCHARSTRATT(s++,1,row,col++,attribute_ptr,0); + break; + END + + + case 'S': + BEGIN + input_row = row; + input_col = col; + break; + END + + case 'C': + BEGIN + /* Clear from current position to end of line */ + clear_screen(row,col,row,39); + break; + END + + case '\0': + BEGIN + /* Message string error - string ended in the middle of control string*/ + insert[0] = '7'; + display(debug_msg); + break; + END + + default: + BEGIN + /* Message string error - no valid control char found */ + insert[0] = '6'; + display(debug_msg); + break; + END + END /* Switch */ + END /* While */ + /* Get the pointer past the '>' */ + s++; + break; + END /* control characters */ + + /* Check for row,col */ + case '%': + BEGIN + s++; + /* determine the row to put the message on */ + if ( !isdigit(*s) ) + BEGIN + /* Message string error */ + insert[0] = '2'; + display(debug_msg); + END + else + BEGIN + row = row+((unsigned)(((*s++ - '0')*10))); + if ( !isdigit(*s) ) + BEGIN + /* Message string error */ + insert[0] = '2'; + display(debug_msg); + END + else + BEGIN + row = row+((unsigned)(*s++ - '0')); + /* determine the col to put the message on */ + if ( !isdigit(*s) ) + BEGIN + /* Message string error */ + insert[0] = '3'; + display(debug_msg); + END + else + BEGIN + col = ((unsigned)(*s++ - '0')); + if ( !isdigit(*s) ) + BEGIN + /* Message string error */ + insert[0] = '3'; + display(debug_msg); + END + else + BEGIN + col = ((unsigned)((col* 10) + (*s++ - '0'))); + if (*s++ != '%') + BEGIN + /* Message string error */ + insert[0] = '4'; + display(debug_msg); + END /* 2nd sq bracket */ + END /* 2nd digit col */ + END /* 1st digit col */ + END /* 2nd digit row */ + END /* 1st digit row */ + break; + END + /* Handle anything else */ + + + default: + BEGIN + /* See if attribute set to anything */ + if (attribute == 0x00) + attribute = 0x07; + VIOWRTCHARSTRATT(s++,1,row,col++,attribute_ptr,0); + break; + END + END + END /* End of string check */ + END /* No characters in string check */ + return; + +END + +void number_in_msg(number,start) + +unsigned number; +unsigned start; + +BEGIN + +unsigned i; + + /* init the four spots to zero's */ + for (i = 0; i < 4;i++) + BEGIN + insert[start+i] = ' '; + END + /* Divide the space down and get it into decimal */ + if (number > 999) + BEGIN + insert[start] = ((char)(number/1000))+'0'; + insert[start+1] = '0'; + insert[start+2] = '0'; + insert[start+3] = '0'; + number = number%1000; + END + if (number > 99) + BEGIN + insert[start+1] = ((char)(number/100))+'0'; + insert[start+2] = '0'; + insert[start+3] = '0'; + number = number%100; + END + if (number > 9) + BEGIN + insert[start+2] = ((char)(number/10))+'0'; + insert[start+3] = '0'; + number = number%10; + END + insert[start+3] = ((char)(number +'0')); + return; +END + + + +void clear_screen(TopRow,LeftCol,BotRow,RightCol) + +unsigned TopRow; +unsigned LeftCol; +unsigned BotRow; +unsigned RightCol; + +BEGIN + +char attribute; +char *attribute_ptr = &attribute; + + attribute = 0x07; + VIOSCROLLUP(TopRow,LeftCol,BotRow,RightCol,0,attribute_ptr,0); + return; +END + + + +char wait_for_ESC() + +BEGIN + char input; + + while (input != ESC) + BEGIN + /* position the cursor at the end of the ESC prompt */ + VIOSETCURPOS(24,39,0); + + /* Get input */ + KBDFLUSHBUFFER(0); + /*KBDCHARIN(input_data,0,0);*/ + /*input = input_data->char_code;*/ + input = ((char)(getch())); + END + return(ESC); +END + + \ 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 @@ + +/* */ +/****************************************************************************/ +/* Define statements */ +/****************************************************************************/ +/* */ + +#define BEGIN { +#define END } +#define ESC 0x1B +#define NUL 0x00 +#define NOT_FOUND 0xFF +#define DELETED 0xFF +#define INVALID 0xFF +#define FALSE (1==0) +#define TRUE !FALSE +#define CR 0x0D + +/* */ +/****************************************************************************/ +/* Declare Global variables */ +/****************************************************************************/ +/* */ + + + + +unsigned input_row; +unsigned input_col; +char insert[200]; +char *pinsert = insert; + + +/* */ +/****************************************************************************/ +/* Subroutine Definitions */ +/****************************************************************************/ +/* */ + +void clear_screen(unsigned,unsigned,unsigned,unsigned); +void display(char far *); +char wait_for_ESC(void); + + \ 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 @@ + + title Reboot Support for FDISK + +IF1 + %OUT ASSEMBLING: Reboot + %OUT +ENDIF + +ROMDATA segment at 040h + org 072h +BootType dw ? +ROMDATA ends + +ROMBIOS segment at 0ffffh + org 0 +POR label far +ROMBIOS ends + +_text segment byte public 'code' + assume cs:_TEXT + assume ds:nothing + assume es:nothing + assume ss:nothing + + public _reboot +_reboot proc near + + mov ax,ROMDATA + mov ds,ax + assume ds:ROMDATA + + mov BootType,1234h + + cli + cld + jmp POR + +_reboot endp + +_text ends + + end + \ 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 @@ + +#include "dos.h" +#include "fdisk.h" +#include "extern.h" +#include "subtype.h" + +/* */ +char find_part_free_space(type) + +char type; + +BEGIN + + +char i; +char partition_count; +char last_found_partition; +unsigned temp; +char freespace_count; +char any_partition; +unsigned temp_size; + + /* Sort the partition table */ + sort_part_table(c(4)); /* AC000 */ + + + /* Intialize free space to zero */ + for (i = c(0); i < c(5); i++) /* AC000 */ + BEGIN + free_space[i].space = u(0); /* AC000 */ + free_space[i].start = u(0); /* AC000 */ + free_space[i].end = u(0); /* AC000 */ + free_space[i].mbytes_unused = f(0); /* AC000 */ /* AN000 */ + free_space[i].percent_unused = u(0); /* AC000 */ /* AN000 */ + END + + /* Find space between start of disk and first partition */ + partition_count = c(0); /* AC000 */ + + any_partition = FALSE; + for (i = c(0); i < c(4); i++) /* AC000 */ + BEGIN + if (part_table[cur_disk][sort[i]].sys_id != uc(0)) /* AC000 */ + BEGIN + /* Found a partition, get the space */ + + free_space[0].start = u(0); /* AC000 */ + + /* This is a special case - the extended partition can not start */ + /* on cylinder 0 due too its archetecture. Protect against that here */ + if (type == c(EXTENDED)) /* AC000 */ + BEGIN + free_space[0].start = u(1); /* AC000 */ + END + + /* free space ends before start of next valid partition */ + if (part_table[cur_disk][sort[i]].start_cyl > u(0)) /* AC000 */ + BEGIN + free_space[0].end = part_table[cur_disk][sort[i]].start_cyl-1; + END + + free_space[0].space = part_table[cur_disk][sort[i]].start_cyl; + free_space[0].mbytes_unused = + cylinders_to_mbytes(free_space[0].space,cur_disk); /* AN004 */ + free_space[0].percent_unused = (unsigned)cylinders_to_percent(free_space[0].space,total_disk[cur_disk]); /* AN000 */ + + partition_count = i; + last_found_partition = sort[i]; + any_partition = TRUE; + break; + END + END + /* See if any partitions were there */ + if (any_partition) + BEGIN + /* Look for space between the rest of the partitions */ + freespace_count = c(1); /* AC000 */ + for (i = partition_count+1; i < c(4); i++) /* AC000 */ + BEGIN + if (part_table[cur_disk][sort[i]].sys_id != uc(0)) /* AC000 */ + BEGIN + + /* Check to see if more than one partition on a cylinder (i.e. XENIX bad block) */ + /* If so, leave the space at zero */ + + if (part_table[cur_disk][sort[i]].start_cyl != part_table[cur_disk][last_found_partition].end_cyl) + + BEGIN + /* No, things are normal */ + /* Get space between the end of the last one and the start of the next one */ + free_space[freespace_count].space = part_table[cur_disk][sort[i]].start_cyl + - (part_table[cur_disk][last_found_partition].end_cyl+1); + + temp_size = (part_table[cur_disk][sort[i]].start_cyl - + part_table[cur_disk][last_found_partition].end_cyl); + + if (temp_size != u(0) ) /* AC000 */ + BEGIN + free_space[freespace_count].space = temp_size - u(1); /* AC000 */ + END + END + + free_space[freespace_count].start = part_table[cur_disk][last_found_partition].end_cyl+1; + free_space[freespace_count].end = part_table[cur_disk][sort[i]].start_cyl -1; + free_space[freespace_count].mbytes_unused = + cylinders_to_mbytes(free_space[freespace_count].space,cur_disk); /* AN004 */ + free_space[freespace_count].percent_unused = (unsigned) + cylinders_to_percent(free_space[freespace_count].space,total_disk[cur_disk]); /* AN000 */ + + + + /* update the last found partition */ + last_found_partition = sort[i]; + freespace_count++; + END + END + /* Find the space between the last partition and the end of the disk */ + free_space[freespace_count].space = (total_disk[cur_disk] + - part_table[cur_disk][last_found_partition].end_cyl)-1; + free_space[freespace_count].start = part_table[cur_disk][last_found_partition].end_cyl+1; + free_space[freespace_count].end = total_disk[cur_disk]-1; + free_space[freespace_count].mbytes_unused = + cylinders_to_mbytes(free_space[freespace_count].space,cur_disk); /* AN004 */ + free_space[freespace_count].percent_unused = + cylinders_to_percent(free_space[freespace_count].space,total_disk[cur_disk]); /* AN000 */ + END + else + BEGIN + /* No partitions found, show entire space as free */ + free_space[0].start = u(0); /* AC000 */ + + /* This is a special case - the extended partition can not start */ + /* on cylinder 0 due too its architecture. Protect against that here */ + if (type == c(EXTENDED)) /* AC000 */ + BEGIN + free_space[0].start = u(1); /* AC000 */ + END + free_space[0].end = total_disk[cur_disk]-1; + free_space[0].space = (free_space[0].end - free_space[0].start)+1; + free_space[0].mbytes_unused = + cylinders_to_mbytes(free_space[0].space,cur_disk); /* AN004 */ + free_space[0].percent_unused = + cylinders_to_percent(free_space[0].space,total_disk[cur_disk]); /* AN000 */ + END + + + + /* Find largest free space, and verify the golden tracks while we are at it */ + do + BEGIN + temp = u(0); /* AC000 */ + + /* Zip thru the table */ + for (i = c(0); i < c(5); i++) /* AC000 */ + BEGIN + /* Is this one bigger ? */ + if (free_space[i].space > temp) + BEGIN + temp = free_space[i].space; + last_found_partition = i; + + END + END + + /* If there is any free space, go verify it */ + temp = u(0); + if (free_space[last_found_partition].space != u(0)) /* AC000 */ + BEGIN + + /* Go verify the tracks */ + temp = verify_tracks(last_found_partition,c(PRIMARY)); /* AC000 */ + END + /* Move up to next golden track */ + free_space[last_found_partition].start = free_space[last_found_partition].start+temp; + free_space[last_found_partition].space = free_space[last_found_partition].space-temp; + free_space[last_found_partition].mbytes_unused = + cylinders_to_mbytes(free_space[last_found_partition].space,cur_disk); /* AN004 */ + free_space[last_found_partition].percent_unused = (unsigned) + cylinders_to_percent(free_space[last_found_partition].space,total_disk[cur_disk]); /* AN000 */ + END + + /* Repeat the loop if the start was moved due to bad tracks */ + /* Unless we're past the end of the free space */ + while ((temp != u(0)) && (free_space[last_found_partition].space != u(0))); /* AC000 */ + + /* Return with the pointer to the largest free space */ + return(last_found_partition); +END + + + +/* */ +void sort_part_table(size) + +char size; + +BEGIN + +char changed; +char temp; +char i; + + /* Init the sorting parameters */ + + for (i=c(0); i < size; i++) /* AC000 */ + BEGIN + sort[i] = i; + END + + /* Do a bubble sort */ + changed = TRUE; + + /* Sort until we don't do a swap */ + while (changed) + + BEGIN + changed = FALSE; + for (i=c(1); i < size; i++) /* AC000 */ + BEGIN + + /* Does the partition entry start before the previous one, or */ + /* is it empty (0 ENTRY). If empty, it automatically gets shoved */ + /* to the front, if the previous entry isn't also empty */ + + if ((part_table[cur_disk][sort[i]].end_cyl < part_table[cur_disk][sort[i-1]].end_cyl) + || ((part_table[cur_disk][sort[i]].num_sec == ul(0)) + && (part_table[cur_disk][sort[i-1]].num_sec != ul(0)))) /* AC000 */ + + BEGIN + /* Swap the order indicators */ + temp = sort[i-1]; + sort[i-1] = sort[i]; + sort[i] = temp; + + /* printf("\nI-1 =%d\n",part_table[cur_disk][sort[i-1]].start_cyl);*/ + /* printf("I =%d\n",part_table[cur_disk][sort[i]].start_cyl);*/ + /* printf("Sort[i-1] = %d\n",sort[i-1]);*/ + /* printf("Sort[i] = %d\n",sort[i]); */ + /* wait_for_ESC(); */ + + + /* indicate we did a swap */ + changed = TRUE; + END + END + END + return; +END + + + + +/* */ +char find_ext_free_space() + + +BEGIN + + +char i; +char partition_count; +char last_found_partition; +unsigned temp; +char freespace_count; +char any_partition; +char ext_location; + + /* Sort the partition table */ + sort_ext_table(c(23)); /* AC000 */ + + + /* Initialize free space to zero */ + for (i = c(0); i < c(24); i++) /* AC000 */ + BEGIN + free_space[i].space = u(0); /* AC000 */ + free_space[i].start = u(0); + free_space[i].end = u(0); /* AC000 */ + free_space[i].mbytes_unused = f(0); /* AN000 */ + free_space[i].percent_unused = u(0); /* AN000 */ + END + + /* Find space between start of Extended partition and first volume */ + ext_location = find_partition_location(uc(EXTENDED)); /* AC000 */ + + partition_count = c(0); /* AC000 */ + + any_partition = FALSE; + for (i = c(0); i < c(23); i++) /* AC000 */ + BEGIN + if (ext_table[cur_disk][sort[i]].sys_id != uc(0)) /* AC000 */ + BEGIN + /* Found a partition, get the space */ + free_space[0].space = ext_table[cur_disk][sort[i]].start_cyl - part_table[cur_disk][ext_location].start_cyl; + free_space[0].start = part_table[cur_disk][ext_location].start_cyl; + free_space[0].end = ext_table[cur_disk][sort[i]].start_cyl-1; + free_space[0].mbytes_unused = + cylinders_to_mbytes(free_space[0].space,cur_disk); /* AN004 */ + free_space[0].percent_unused = (unsigned)cylinders_to_percent(free_space[0].space,total_disk[cur_disk]); /* AN000 */ + + partition_count = i; + last_found_partition = sort[i]; + any_partition = TRUE; + break; + END + END + /* See if any partitions were there */ + if (any_partition) + BEGIN + /* Look for space between the rest of the partitions */ + freespace_count = c(1); /* AC000 */ + for (i = partition_count+1; i < c(23); i++) /* AC000 */ + BEGIN + if (ext_table[cur_disk][sort[i]].sys_id != uc(0)) /* AC000 */ + BEGIN + + /* Get space between the end of the last one and the start of the next one */ + temp = ext_table[cur_disk][sort[i]].start_cyl - (ext_table[cur_disk][last_found_partition].end_cyl+1); + free_space[freespace_count].space = temp; + free_space[freespace_count].start = ext_table[cur_disk][last_found_partition].end_cyl+1; + free_space[freespace_count].end = ext_table[cur_disk][sort[i]].start_cyl -1; + free_space[freespace_count].mbytes_unused = + cylinders_to_mbytes(free_space[freespace_count].space,cur_disk); /* AN004 */ + free_space[freespace_count].percent_unused = (unsigned) + cylinders_to_percent(free_space[freespace_count].space,total_disk[cur_disk]); /* AN000 */ + + + /* update the last found partition */ + last_found_partition = sort[i]; + freespace_count++; + END + END + /* Find the space between the last partition and the end of the extended partition */ + temp = part_table[cur_disk][ext_location].end_cyl - ext_table[cur_disk][last_found_partition].end_cyl; + free_space[freespace_count].space = temp; + free_space[freespace_count].start = ext_table[cur_disk][last_found_partition].end_cyl+1; + free_space[freespace_count].end = part_table[cur_disk][ext_location].end_cyl; + free_space[freespace_count].mbytes_unused = + cylinders_to_mbytes(free_space[freespace_count].space,cur_disk); /* AN004 */ + free_space[freespace_count].percent_unused = (unsigned) + cylinders_to_percent(free_space[freespace_count].space,total_disk[cur_disk]); /* AN000 */ + + END + else + BEGIN + /* No partitions found, show entire space as free */ + free_space[0].space = (part_table[cur_disk][ext_location].end_cyl - part_table[cur_disk][ext_location].start_cyl) + 1; + free_space[0].start = part_table[cur_disk][ext_location].start_cyl; + free_space[0].end = part_table[cur_disk][ext_location].end_cyl; + free_space[0].mbytes_unused = + cylinders_to_mbytes(free_space[0].space,cur_disk); /* AN004 */ + free_space[0].percent_unused = (unsigned)cylinders_to_percent(free_space[0].space,total_disk[cur_disk]); /* AN000 */ + END + + /* Find largest free space */ + temp = u(0); /* AC000 */ + + + /* Find largest free space, and verify the golden tracks while we are at it */ + do + BEGIN + temp = u(0); /* AC000 */ + + /* Zip thru the table */ + for (i = c(0); i < c(24); i++) /* AC000 */ + BEGIN + /* Is this one bigger ? */ + if (free_space[i].space > temp) + BEGIN + temp = free_space[i].space; + last_found_partition = i; + END + END + /* If there is any free space, go verify it */ + temp = u(0); + if (free_space[last_found_partition].space != u(0)) /* AC000 */ + BEGIN + + /* Go verify the tracks */ + temp = verify_tracks(last_found_partition,c(EXTENDED)); /* AC000 */ + END + /* Move up to next golden track */ + free_space[last_found_partition].start = free_space[last_found_partition].start+temp; + free_space[last_found_partition].space = free_space[last_found_partition].space-temp; + free_space[last_found_partition].mbytes_unused = + cylinders_to_mbytes(free_space[last_found_partition].space,cur_disk); /* AN004 */ + free_space[last_found_partition].percent_unused = + cylinders_to_percent(free_space[last_found_partition].space,total_disk[cur_disk]); /* AN000 */ + END + /* Repeat the loop if the start was moved due to bad tracks */ + /* Unless we're past the end of the free space */ + while ((temp !=u(0)) && (free_space[last_found_partition].space!= u(0))); /* AC000 */ + + /* Return with the pointer to the largest free space */ + return(last_found_partition); +END + + +/* */ +void sort_ext_table(size) + +char size; + +BEGIN + +char changed; +char temp; +char i; + + /* Init the sorting parameters */ + + for (i=c(0); i < size; i++) /* AC000 */ + BEGIN + sort[i] = i; + END + + /* Do a bubble sort */ + changed = TRUE; + + /* Sort until we don't do a swap */ + while (changed) + + BEGIN + changed = FALSE; + for (i=c(1); i < size; i++) /* AC000 */ + BEGIN + + if (ext_table[cur_disk][sort[i]].start_cyl < ext_table[cur_disk][sort[i-1]].start_cyl) + BEGIN + + temp = sort[i-1]; + sort[i-1] = sort[i]; + sort[i] = temp; + /* indicate we did a swap */ + changed = TRUE; + END + END + END + return; +END 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 @@ +/*************************************************************/ +/* DISPLAY.C ROUTINES */ +/*************************************************************/ +void display(char far *); +void number_in_msg(XFLOAT,unsigned); +void percent_in_msg(unsigned,unsigned); /* AN000 */ +void string_in_msg(char far *,unsigned); /* AN000 */ +void volume_in_msg(char far *,unsigned); /* AN000 */ + +/*************************************************************/ +/* VIDEO.C ROUTINES */ +/*************************************************************/ +void clear_screen(unsigned,unsigned,unsigned,unsigned); +void init_video_information(void); +void reset_video_information(void); +void get_video_attribute(void); /* AN006 */ + + +/*************************************************************/ +/* DISKOUT.C ROUTINES */ +/*************************************************************/ +void write_info_to_disk(void); +char write_master_boot_to_disk(unsigned char); +char write_ext_boot_to_disk(char,unsigned char); + + +/*************************************************************/ +/* PARTINFO.C ROUTINES */ +/*************************************************************/ +char find_free_partition(void); +char find_partition_type(unsigned char); +XFLOAT get_partition_size(unsigned char); +char find_active_partition(void); +char find_partition_location(unsigned char); +char find_free_ext(void); +char find_logical_drive(void); +char get_num_logical_dos_drives(void); +char find_ext_drive(char); +char find_previous_drive(char); + +/*************************************************************/ +/* MAKEPART.C ROUTINES */ +/*************************************************************/ +void make_partition(unsigned,char,unsigned char,char); +char make_volume(unsigned,char); + +/*************************************************************/ +/* INPUT.C ROUTINES */ +/*************************************************************/ +char get_num_input(char,char,unsigned,unsigned); +char get_yn_input(char,unsigned,unsigned); +char wait_for_ESC(void); +unsigned get_large_num_input(unsigned,unsigned,unsigned,char far *,unsigned,char far *); +char get_alpha_input(char,char,unsigned,unsigned,char,char); +char get_char_input(void); +void get_string_input(unsigned,unsigned,char far *); + + +/*************************************************************/ +/* SPACE.C ROUTINES */ +/*************************************************************/ +char find_part_free_space(char); +void sort_part_table(char); +char find_ext_free_space(void); +void sort_ext_table(char); + + +/*************************************************************/ +/* INT13.C ROUTINES */ +/*************************************************************/ +char get_disk_info(void); +char read_boot_record(unsigned,unsigned char,unsigned char,unsigned char); /* AC000 */ +char write_boot_record(unsigned,unsigned char); +unsigned verify_tracks(char,char); +char get_drive_parameters(unsigned char); +void DiskIo(union REGS *,union REGS *, struct SREGS *); + +/*************************************************************/ +/* VDISPLAY.C ROUTINES */ +/*************************************************************/ +char volume_display(void); + +/*************************************************************/ +/* TDISPLAY.C ROUTINES */ +/*************************************************************/ +char table_display(void); +char table_drive_letter(void); + +/*************************************************************/ +/* FDISK.C ROUTINES */ +/*************************************************************/ +void main(int,char * []); +void load_logical_drive(char,unsigned char); +void init_partition_tables(void); +char check_valid_environment(void); +void reboot_system(void); +void display_volume_information(void); +void display_partition_information(void); +void volume_delete(void); +void ext_delete(void); +void delete_partition(void); +void dos_delete(void); +void change_active_partition(void); +void volume_create(void); +void ext_create_partition(void); +void input_dos_create(void); +void dos_create_partition(void); +void create_partition(void); +void do_main_menu(void); +void internal_program_error(void); +void reboot(void); + +/*************************************************************/ +/* CONVERT ROUTINES */ +/*************************************************************/ +void get_volume_string(char,char *); /* AN000 */ +unsigned mbytes_to_cylinders(XFLOAT,char); /* AN004 */ +XFLOAT percent_to_cylinders(unsigned,XFLOAT); /* AN000 */ +XFLOAT cylinders_to_mbytes(unsigned,char); /* AN004 */ +unsigned cylinders_to_percent(unsigned,unsigned); /* AN000 */ +char dos_upper(char); /* AN000 */ +char check_yn_input(char); /* AN000 */ +FLAG get_fs_and_vol(char); /* AN000 */ +FLAG check_format(char); /* AN002 */ + +/*************************************************************/ +/* PARSE ROUTINES */ +/*************************************************************/ +char parse_command_line(int,char * []); /* AN000 */ +void parse_init(void); /* AN000 */ +void check_disk_validity(void); /* AN000 */ +void process_switch(void); /* AN000 */ +void parse(union REGS *, union REGS *); /* AN000 */ +void Parse_msg(int,int,unsigned char); /* AN010 */ + + +/*************************************************************/ +/* MESSAGES ROUTINES */ +/*************************************************************/ +char preload_messages(void); /* AN000 */ +void display_msg(int,int,int,int *,char,char); /* AN000 AC014 */ +void sysloadmsg(union REGS *, union REGS *); /* AN000 */ +void sysdispmsg(union REGS *, union REGS *); /* AN000 */ +void sysgetmsg(union REGS *, struct SREGS *, union REGS *); /* AN012 */ +char get_yes_no_values(void); /* AN012 */ + + +/*************************************************************/ +/* C ROUTINES */ +/*************************************************************/ + +int getch(void); +void putch(int); + +int int86x(int, union REGS *, union REGS *, struct SREGS *); +int int86(int, union REGS *, union REGS *); +int intdos(union REGS *, union REGS *); + 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 @@ + +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "fdiskmsg.h" /* AN000 */ +#include "stdio.h" +#include "string.h" +#include "memory.h" + +/* */ +char table_display() + +BEGIN + + +unsigned i; +unsigned x; +unsigned io; +char *ThisPartitionType; +char ThisPartitionLetter[3]; +FLAG partition_found; +char partition_num; + + /* initialize all the inserts to blanks */ + memset(insert,c(' '),4*21); + io = u(0); + + /* Sort the partitions */ + sort_part_table(c(4)); /* AC000 */ + + /* loop thru the partitions, only print stuff if it is there */ + partition_found = FALSE; + partition_num = c(0); /* AC000 */ + + for (i=u(0); i < u(4); i++) /* AC000 */ + BEGIN + + if (part_table[cur_disk][sort[i]].sys_id != uc(0)) /* AC000 */ + BEGIN + + partition_found = TRUE; + + strcpy(ThisPartitionLetter," "); + switch(part_table[cur_disk][sort[i]].sys_id) + BEGIN + case DOSNEW: /* AN000 */ + case DOS16: + case DOS12: + ThisPartitionType = DOS_part; + part_table[cur_disk][sort[i]].drive_letter = table_drive_letter(); /* AN000 */ + sprintf(ThisPartitionLetter,"%c%c", + part_table[cur_disk][sort[i]].drive_letter, + ( part_table[cur_disk][sort[i]].drive_letter == c(' ') ) ? ' ' : ':'); + break; + case EXTENDED: + ThisPartitionType = EXTENDED_part; + break; + case BAD_BLOCK: + ThisPartitionType = BAD_BLOCK_part; + break; + case XENIX1: + ThisPartitionType = XENIX_part; + break; + case XENIX2: + ThisPartitionType = XENIX_part; + break; + case PCIX: + ThisPartitionType = PCIX_part; + break; + default: + ThisPartitionType = NON_DOS_part; + break; + END + + io += sprintf(&insert[io],"%-2.2s%c%c%-7.7s%4.0d%3.0d%%", + ThisPartitionLetter, + partition_num+'1', + (part_table[cur_disk][sort[i]].boot_ind == uc(0x80)) ? 'A' : ' ', + ThisPartitionType, + part_table[cur_disk][sort[i]].mbytes_used, + part_table[cur_disk][sort[i]].percent_used); + + partition_num++; + + END + + END + + /* Do a clearscreen to erase previous data */ + clear_screen(u(8),u(0),u(12),u(79)); /* AC000 */ + + if (partition_found) display(menu_14); + else display(status_8); + + /* Return true if partitions exist, false otherwise */ + if (partition_found) return(TRUE); + + return(FALSE); + +END + +/* */ +char table_drive_letter() + +BEGIN +char drive_letter; + + /* Put in drive letter in display */ + if (cur_disk == c(0)) /* AC000 */ + BEGIN + /* There is a primary partition on 80h, so drive C: */ + drive_letter = c('C'); /* AC000 */ + END + else + BEGIN + /* We are on drive 81h, so assume D: */ + drive_letter = c('D'); /* AC000 */ + + /* See if primary exists on 80h drive */ + /* First, set cur_drive to 0 */ + cur_disk = c(0); /* AC000 */ + + /* Check for primary on drive 80h */ + if (!(find_partition_type(uc(DOS12)) || find_partition_type(uc(DOS16)) || find_partition_type(uc(DOSNEW)))) /* AC000 */ + BEGIN + drive_letter = c('C'); /* AC000 */ + END + /* restore cur_disk to normal */ + cur_disk = c(1); /* AC000 */ + END + return(drive_letter); +END + \ 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 @@ +test() + +BEGIN + +int i; +int x; + + for (i=0;i<24;i++) + BEGIN + for (x=0;x <2; x++) + BEGIN + ext_part_entry[i][x].boot_ind = 0; + ext_part_entry[i][x].start_head = 0; + ext_part_entry[i][x].start_sector = 0; + ext_part_entry[i][x].start_cyl = 0; + ext_part_entry[i][x].sys_id = 0; + ext_part_entry[i][x].end_head = 0; + ext_part_entry[i][x].end_sector = 0; + ext_part_entry[i][x].end_cyl = 0; + ext_part_entry[i][x].rel_sec = 0; + ext_part_entry[i][x].num_sec = 0; + END + END + return; +END + \ 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 @@ + +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "subtype.h" /* AN000 */ +#include "fdiskmsg.h" /* AN000 */ +#include "string.h" +#include "stdio.h" +#include "memory.h" + +/* */ +char volume_display() + +BEGIN + +unsigned i; +unsigned x; +char drive_found; +char drive_letter; +char drive_num; +char temp; +char first_display; +char second_display; +char third_display; +char fourth_display; +unsigned insert_offset; + + first_display = FALSE; + second_display = FALSE; + third_display = FALSE; + fourth_display = FALSE; + + /* See what the starting drive letter is */ + drive_letter = c(SEA); /* AC000 */ + + /* See if primary on drive 1 */ + temp = cur_disk; + cur_disk = c(0); /* AC000 */ + if ( (find_partition_type(uc(DOS12))) || + (find_partition_type(uc(DOS16))) || + (find_partition_type(uc(DOSNEW)))) /* AC000 */ + BEGIN + /* There is a Primary partition on drive 1, so increment for first logical drive */ + drive_letter++; + END + cur_disk = temp; + + /* See if there is a second drive */ + if (number_of_drives == uc(2)) /* AC000 */ + BEGIN + + /* Go see if DOS partition on drive 2 */ + temp = cur_disk; + cur_disk = c(1); /* AC000 */ + if ( (find_partition_type(uc(DOS12))) || + (find_partition_type(uc(DOS16))) || + (find_partition_type(uc(DOSNEW)))) /*AC000*/ + BEGIN + + /* There is a Primary partition on drive 2, so increment for first logical drive */ + drive_letter++; + END + /* Are we on drive 2? If so, we got to find all the drives on drive 1 */ + if (temp == c(1)) /* AC000 */ + BEGIN + /* Next, we need to see what is on drive 1 */ + for (i=u(0); i < u(23); i++) /* AC000 */ + BEGIN + /* See if there is a logical drive we understand in PC-DOS land */ + if ( (ext_table[0][i].sys_id == uc(DOS12)) || + (ext_table[0][i].sys_id == uc(DOS16)) || + (ext_table[0][i].sys_id == uc(DOSNEW)) ) /* AC000 */ + BEGIN + /* Found one, so kick up the first available drive letter */ + drive_letter++; + END + END + END + + /* Reset the cur_drive to where it was */ + cur_disk = temp; + END + + + + + /* loop thru the partitions, only print stuff if it is there */ + + /* Get the drives in order by location on disk */ + sort_ext_table(c(23)); /* AC000 */ + + /* initialize all the inserts to blanks */ + memset(insert,c(' '),(24*29)); + + drive_num = c(0); /* AC000 */ + drive_found = FALSE; + first_display = TRUE; + insert_offset = 0; + + for (i=u(0); i < u(23); i++) /* AC000 */ + BEGIN + + /* See if entry exists */ + if ( (ext_table[cur_disk][sort[i]].sys_id == uc(DOS12)) || + (ext_table[cur_disk][sort[i]].sys_id == uc(DOS16)) || + (ext_table[cur_disk][sort[i]].sys_id == uc(DOSNEW)) ) /* AC000 */ + BEGIN + + /* We found one, now get the info */ + drive_found = TRUE; + + /* Get the drive letter - make sure it is Z: or less*/ + /* Put it in the message, and set it up for next time */ + if (drive_letter > c('Z')) + ext_table[cur_disk][sort[i]].drive_letter = c(' '); + else ext_table[cur_disk][sort[i]].drive_letter = drive_letter; + + insert_offset += sprintf(&insert[insert_offset],"%c%c%-11.11s%4.0d%-8.8s%3.0d%%", + ext_table[cur_disk][sort[i]].drive_letter, + ( ext_table[cur_disk][sort[i]].drive_letter == c(' ') ) ? ' ' : ':', + ext_table[cur_disk][sort[i]].vol_label, + ext_table[cur_disk][sort[i]].mbytes_used, + ext_table[cur_disk][sort[i]].system, + ext_table[cur_disk][sort[i]].percent_used ); + + + drive_letter++; + drive_num++; + + END + END + + /* Display the column of drives */ + if (drive_found) + BEGIN + + clear_screen(u(2),u(0),u(15),u(79)); /* AC000 */ + + if ( drive_num > 0 ) + BEGIN + pinsert = &insert[0]; + display(menu_19); + END + + if ( drive_num > 6 ) + BEGIN + pinsert = &insert[6*29]; + display(menu_43); + END + + if ( drive_num > 12 ) + BEGIN + pinsert = &insert[12*29]; + display(menu_20); + END + + if ( drive_num > 18 ) + BEGIN + pinsert = &insert[18*29]; + display(menu_44); + END + pinsert = &insert[0]; + END + else + BEGIN + /* Didn't find any */ + if (first_display) + BEGIN + /* Wipe out display and put up message */ + clear_screen(u(2),u(0),u(15),u(79)); /* AC000 */ + display(status_9); + END + END + /* Return the highest drive letter found */ + drive_letter--; + return(drive_letter); + +END + + \ 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 @@ + +#include "dos.h" /* AN000 */ +#include "fdisk.h" /* AN000 */ +#include "extern.h" /* AN000 */ +#include "doscall.h" /* AN000 */ +#include "fdiskmsg.h" /* AN000 */ +#include "subtype.h" + +/* */ + +void clear_screen(TopRow,LeftCol,BotRow,RightCol) + +unsigned TopRow; +unsigned LeftCol; +unsigned BotRow; +unsigned RightCol; + +BEGIN + +char attribute; +char *attribute_ptr = &attribute; + + if (mono_flag == TRUE) /* AN006 */ + attribute = GRAY_ON_BLACK; /* AN006 */ + else /* AN006 */ + attribute = WHITE_ON_BLUE; /* AC000 */ + VIOSCROLLUP(TopRow,LeftCol,BotRow,RightCol,u(0),attribute_ptr,u(0)); /* AC000 */ + return; +END + + + + + +/* */ +/* */ +/****************************************************************************/ +/* Initializes the screen and stores the lower right hand corner */ +/* of the screen in the global variable LowerRightHandCorner. This */ +/* is which is used for screen clears. If the screen is in grahpics mode, */ +/* it is changed to BW 40x25. This procedure is only called once at program*/ +/* start. Also saves the current screen */ +/****************************************************************************/ +/* */ + + +void init_video_information() + +BEGIN + mono_flag = FALSE; /* AN006 */ + + /* Get the current video state */ + regs.h.ah = uc(CURRENT_VIDEO_STATE); /* AC000 */ + int86((int)VIDEO,®s,®s); /* AC000 */ + + /* Save the mode and display page */ + video_mode = regs.h.al; + display_page = regs.h.bh; + + get_video_attribute(); /* AN006 */ + + BEGIN + /* assume color mode */ + regs.h.al = uc(Color80_25); /* AC000 */ + + /* See if we are in MONOCHROME mode */ + if ((video_mode == uc(MONO80_25)) || (video_mode == uc(MONO80_25A))) /* AC000 AC006 */ + BEGIN + + /* Nope,set to BW80x25*/ + regs.h.al = uc(BW80_25); /* AC000 */ + mono_flag = TRUE; /* AN006 */ + END + + /* go set the new mode */ + regs.h.ah = uc(SET_MODE); /* AC000 */ + int86((int)VIDEO,®s,®s); /* AC000 */ + END + + /* Set the display page */ + regs.h.ah = uc(SET_ACTIVE_DISPLAY_PAGE); /* AC000 */ + regs.h.al = uc(0); /* AC000 */ + int86((int)VIDEO,®s,®s); /* AC000 */ + + return; +END + +/* */ +/* */ +/* Resets the video mode to the original value */ +/* */ + +void reset_video_information() + +BEGIN + +char *attribute_ptr = &video_attribute; /* AN006 */ + + /* Clear display with colors that were present when FDISK was invoked */ + VIOSCROLLUP(u(0),u(0),u(24),u(79),u(0),attribute_ptr,u(0)); /* AN006 */ + + /* Reset the video mode */ + regs.h.ah = SET_MODE; + regs.h.al = video_mode; + int86((int)VIDEO,®s,®s); /* AC000 */ + + /* Set the page */ + regs.h.ah = SET_PAGE; + regs.h.al = display_page; + int86((int)VIDEO,®s,®s); /* AC000 */ + return; + +END + +/******************************************************************************/ +/*Routine name: GET_VIDEO_ATTRIBUTE */ +/******************************************************************************/ +/* */ +/*Description: This routine will invoke interrupt 10 function 08h to */ +/* get the current attributes at the cursor postition in order */ +/* to restore the correct colors when returning out of FDISK. */ +/* */ +/*Called Procedures: none */ +/* */ +/* */ +/*Change History: Created 3/11/88 DRM */ +/* */ +/*Input: None */ +/* */ +/*Output: None */ +/* */ +/******************************************************************************/ + +void get_video_attribute() /* AN006 */ + +BEGIN /* AN006 */ + + /* Get current attributes */ + regs.h.ah = CURRENT_VIDEO_ATTRIBUTE; /* AN006 */ + regs.h.bh = display_page; /* AN006 */ + int86((int)VIDEO,®s,®s); /* AN006 */ + video_attribute = regs.h.ah; /* AN006 */ + return; /* AN006 */ + +END /* AN006 */ + 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 @@ +page 60,132 +name _msgret +title C to Message Retriever +;------------------------------------------------------------------- +; +; MODULE: _msgret +; +; PURPOSE: Supplies an interface between C programs and +; the DOS 3.3 message retriever +; +; CALLING FORMAT: +; msgret(&inregs,&outregs); +; +; DATE: 5-21-87 +; +;------------------------------------------------------------------- + + INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AC010; + + MSG_UTILNAME ;IDENTIFY THE COMPONENT ;AC010; + +;------------------------------------------------------------------- +;------------------------------------------------------------------- + + +_TEXT SEGMENT BYTE PUBLIC 'CODE' ;AC010; +_TEXT ENDS ;AC010; +_DATA SEGMENT WORD PUBLIC 'DATA' ;AC010; +_DATA ENDS ;AC010; +CONST SEGMENT WORD PUBLIC 'CONST' ;AC010; +CONST ENDS ;AC010; +_BSS SEGMENT WORD PUBLIC 'BSS' ;AC010; +_BSS ENDS ;AC010; + +DGROUP GROUP CONST, _BSS, _DATA ;AC010; + ASSUME CS: DGROUP, DS: DGROUP, SS: DGROUP, ES: NOTHING ;AC010; + + public data_sysloadmsg ;AC010; + public data_sysdispmsg ;AC010; + public data_sysgetmsg ;AC010; + +_DATA SEGMENT ;AC010; + + MSG_SERVICES ;AC010; + MSG_SERVICES ;AC010; + MSG_SERVICES ;AC010; + MSG_SERVICES ;AC010; ;AC010; + + +data_sysloadmsg proc far + + push bp ; save user's base pointer ;AC010; + mov bp,sp ; set bp to current sp ;AC010; + push di ; save some registers ;AC010; + push si ;AC010; + +; copy C inregs into proper registers + + mov di,[bp+4+4] ; fix di (arg 0) ;AC010; + +;------------------------------------------------------------------- + + mov ax,[di+0ah] ; load di ;AC010; + push ax ; the di value from inregs is now on stack ;AC010; + + mov ax,[di+00] ; get inregs.x.ax ;AC010; + mov bx,[di+02] ; get inregs.x.bx ;AC010; + mov cx,[di+04] ; get inregs.x.cx ;AC010; + mov dx,[di+06] ; get inregs.x.dx ;AC010; + mov si,[di+08] ; get inregs.x.si ;AC010; + pop di ; get inregs.x.di from stack ;AC010; + + push bp ; save base pointer ;AC010; + +;------------------------------------------------------------------- + + call sysloadmsg ; call the message retriever ;AC010; + +;------------------------------------------------------------------- + + pop bp ; restore base pointer ;AC010; + push di ; the di value from call is now on stack ;AC010; + mov di,[bp+6+4] ; fix di (arg 1) ;AC010; + + mov [di+00],ax ; load outregs.x.ax ;AC010; + mov [di+02],bx ; load outregs.x.bx ;AC010; + mov [di+04],cx ; load outregs.x.cx ;AC010; + mov [di+06],dx ; load outregs.x.dx ;AC010; + mov [di+08],si ; load outregs.x.si ;AC010; + + lahf ; get flags into ax ;AC010; + mov al,ah ; move into low byte ;AC010; + mov [di+0ch],ax ; load outregs.x.cflag ;AC010; + + pop ax ; get di from stack ;AC010; + mov [di+0ah],ax ; load outregs.x.di ;AC010; + +;------------------------------------------------------------------- + + pop si ; restore registers ;AC010; + pop di ;AC010; + mov sp,bp ; restore sp ;AC010; + pop bp ; restore user's bp ;AC010; + ret + +data_sysloadmsg endp ;AC010; + + +data_sysdispmsg proc far ;AC010; + + push bp ; save user's base pointer ;AC010; + mov bp,sp ; set bp to current sp ;AC010; + push di ; save some registers ;AC010; + push si ;AC010; + +; copy C inregs into proper registers + + mov di,[bp+4+4] ; fix di (arg 0) ;AC010; + +;------------------------------------------------------------------- + + mov ax,[di+0ah] ; load di ;AC010; + push ax ; the di value from inregs is now on stack ;AC010; + + mov ax,[di+00] ; get inregs.x.ax ;AC010; + mov bx,[di+02] ; get inregs.x.bx ;AC010; + mov cx,[di+04] ; get inregs.x.cx ;AC010; + mov dx,[di+06] ; get inregs.x.dx ;AC010; + mov si,[di+08] ; get inregs.x.si ;AC010; + pop di ; get inregs.x.di from stack ;AC010; + + push bp ; save base pointer ;AC010; + +;------------------------------------------------------------------- + + call sysdispmsg ;AC010; + +;------------------------------------------------------------------- + + pop bp ; restore base pointer ;AC010; + push di ; the di value from call is now on stack ;AC010; + mov di,[bp+6+4] ; fix di (arg 1) ;AC010; + + mov [di+00],ax ; load outregs.x.ax ;AC010; + mov [di+02],bx ; load outregs.x.bx ;AC010; + mov [di+04],cx ; load outregs.x.cx ;AC010; + mov [di+06],dx ; load outregs.x.dx ;AC010; + mov [di+08],si ; load outregs.x.si ;AC010; + + lahf ; get flags into ax ;AC010; + mov al,ah ; move into low byte ;AC010; + mov [di+0ch],ax ; load outregs.x.cflag ;AC010; + + pop ax ; get di from stack ;AC010; + mov [di+0ah],ax ; load outregs.x.di ;AC010; + +;------------------------------------------------------------------- + + pop si ; restore registers ;AC010; + pop di ;AC010; + mov sp,bp ; restore sp ;AC010; + pop bp ; restore user's bp ;AC010; + ret ;AC010; + +data_sysdispmsg endp ;AC010; + + +data_sysgetmsg proc far ;AC010; + + push bp ; save user's base pointer ;AC010; + mov bp,sp ; set bp to current sp ;AC010; + push di ; save some registers ;AC010; + push si ;AC010; + +; copy C inregs into proper registers + + mov di,[bp+4+4] ; fix di (arg 0) ;AC010; + +;------------------------------------------------------------------- + + mov ax,[di+0ah] ; load di ;AC010; + push ax ; the di value from inregs is now on stack ;AC010; + + mov ax,[di+00] ; get inregs.x.ax ;AC010; + mov bx,[di+02] ; get inregs.x.bx ;AC010; + mov cx,[di+04] ; get inregs.x.cx ;AC010; + mov dx,[di+06] ; get inregs.x.dx ;AC010; + mov si,[di+08] ; get inregs.x.si ;AC010; + pop di ; get inregs.x.di from stack ;AC010; + + push bp ; save base pointer ;AC010; + +;------------------------------------------------------------------- + + call sysgetmsg ; call the message retriever ;AC010; + +;------------------------------------------------------------------- + + pop bp ; restore base pointer ;AC010; + push di ; the di value from call is now on stack ;AC010; + mov di,[bp+6+4] ; fix di (arg 1) ;AC010; + + push ax ; save ax ;AC010; + mov [di+00],es ; load segregs.es ;AC010; + mov [di+06],ds ; load outregs.ds ;AC010; + pop ax ; restore ax ;AC010; + + pop di ; restore di ;AC010; + push di ; save it ;AC010; + mov di,[bp+8+4] ; fix di (arg 2) ;AC010; + mov [di+00],ax ; load outregs.x.ax ;AC010; + mov [di+02],bx ; load outregs.x.bx ;AC010; + mov [di+04],cx ; load outregs.x.cx ;AC010; + mov [di+06],dx ; load outregs.x.dx ;AC010; + mov [di+08],si ; load outregs.x.si ;AC010; + + lahf ; get flags into ax ;AC010; + mov al,ah ; move into low byte ;AC010; + mov [di+0ch],ax ; load outregs.x.cflag ;AC010; + + pop ax ; get di from stack ;AC010; + mov [di+0ah],ax ; load outregs.x.di ;AC010; + +;------------------------------------------------------------------- + + pop si ; restore registers ;AC010; + pop di ;AC010; + mov sp,bp ; restore sp ;AC010; + pop bp ; restore user's bp ;AC010; + ret ;AC010; + +data_sysgetmsg endp ;AC010; + + +_DATA ends ; end code segment ;AC010; + +_TEXT SEGMENT ;AC010; + + assume cs:_TEXT ;AC010; + + public _sysdispmsg ;AC010; + public _sysloadmsg ;AC010; + public _sysgetmsg ;AC010; + +_sysdispmsg proc near ;AC010; + call data_sysdispmsg ;AC010; + ret ;AC010; +_sysdispmsg endp ;AC010; + +_sysloadmsg proc near ;AC010; + call data_sysloadmsg ;AC010; + ret ;AC010; +_sysloadmsg endp ;AC010; + +_sysgetmsg proc near ;AC010; + call data_sysgetmsg ;AC010; + ret ;AC010; +_sysgetmsg endp ;AC010; + +_TEXT ENDS ;AC010; + end ;AC010; + + \ 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 @@ +page 60,132 +name _parse +title C to PARSER interface +;------------------------------------------------------------------- +; +; MODULE: _parse +; +; PURPOSE: Supplies an interface between C programs and +; the DOS 3.3 parser +; +; CALLING FORMAT: +; parse(&inregs,&outregs); +; +; DATE: 5-21-87 +; +;------------------------------------------------------------------- + +; extrn sysparse:far + + public _parse + +;------------------------------------------------------------------- +FarSW equ 0 ; make sysparse be a NEAR proc +TimeSW equ 0 ; Check time format +FileSW equ 0 ; Check file specification +CAPSW equ 0 ; Perform CAPS if specified +CmpxSW equ 0 ; Check complex list +NumSW equ 1 ; Check numeric value +KeySW equ 0 ; Support keywords +SwSW equ 1 ; Support switches +Val1SW equ 1 ; Support value definition 1 +Val2SW equ 1 ; Support value definition 2 +Val3SW equ 0 ; Support value definition 3 +DrvSW equ 0 ; Support drive only format +QusSW equ 0 ; Support quoted string format +;------------------------------------------------------------------- + + + + +_TEXT SEGMENT BYTE PUBLIC 'CODE' +_TEXT ENDS +_DATA SEGMENT WORD PUBLIC 'DATA' +_DATA ENDS +CONST SEGMENT WORD PUBLIC 'CONST' +CONST ENDS +_BSS SEGMENT WORD PUBLIC 'BSS' +_BSS ENDS + + +DGROUP GROUP CONST, _BSS, _DATA + + +_DATA segment word public 'DATA' + + assume cs:DGROUP + assume ss:dgroup + + public SysParse + +;------------------------------------------------------------------- +.xlist +include parse.asm ; include the parser +.list +;------------------------------------------------------------------- + + public CallParser +CallParser proc far + + push ds + PUSH ES + + push cs + pop ds + assume ds:DGROUP + + push cs + pop es + assume es:DGROUP + + nop + + call SysParse + + POP ES + pop ds + + ret + +CallParser endp + + + +_DATA ends + +_TEXT segment byte public 'CODE' + + ASSUME CS:_TEXT + ASSUME DS:DGROUP + ASSUME ES:NOTHING + ASSUME SS:DGROUP + +_parse proc near + + push bp ; save user's base pointer + mov bp,sp ; set bp to current sp + push di ; save some registers + push si + +; copy C inregs into proper registers + + mov di,[bp+4] ; fix di (arg 0) + +;------------------------------------------------------------------- + + mov ax,[di+0ah] ; load di + push ax ; the di value from inregs is now on stack + + mov ax,[di+00] ; get inregs.x.ax + mov bx,[di+02] ; get inregs.x.bx + mov cx,[di+04] ; get inregs.x.cx + mov dx,[di+06] ; get inregs.x.dx + mov si,[di+08] ; get inregs.x.si + pop di ; get inregs.x.di from stack + + push bp ; save base pointer + +;------------------------------------------------------------------- +;------------------------------------------------------------------- + + call CallParser ; call the parser + +;------------------------------------------------------------------- +;------------------------------------------------------------------- + + pop bp ; restore base pointer + push di ; the di value from call is now on stack + mov di,[bp+6] ; fix di (arg 1) + + mov [di+00],ax ; load outregs.x.ax + mov [di+02],bx ; load outregs.x.bx + mov [di+04],cx ; load outregs.x.cx + mov [di+06],dx ; load outregs.x.dx + mov [di+08],si ; load outregs.x.si + + xor ax,ax ; clear ax + lahf ; get flags into ax + mov [di+0ch],ax ; load outregs.x.cflag + + pop ax ; get di from stack + mov [di+0ah],ax ; load outregs.x.di + +;------------------------------------------------------------------- + + pop si ; restore registers + pop di + mov sp,bp ; restore sp + pop bp ; restore user's bp + ret + +_parse endp + +_TEXT ends ; end code segment + end + -- cgit v1.2.3