From c72d29ef262684a01be393038b2d5372c5de35a6 Mon Sep 17 00:00:00 2001 From: doug Date: Sat, 16 Feb 2013 17:52:57 +0000 Subject: [PATCH] added cautionary verbiage to source code --- branches/dwg/Apps/crossdev/2DRIVE.C | 40 ++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/branches/dwg/Apps/crossdev/2DRIVE.C b/branches/dwg/Apps/crossdev/2DRIVE.C index c80e722d..3e7e8b91 100644 --- a/branches/dwg/Apps/crossdev/2DRIVE.C +++ b/branches/dwg/Apps/crossdev/2DRIVE.C @@ -4,6 +4,42 @@ it contains techniques which are not recommended because there are better API functions to do these operations. */ +/* + This code is in the crossdev folder because it is part of + my development environment, and I said I would make everything + available. + + The purpose of this code is to dynamically alter the BIOS + data associated with PPIDE (or PPISD) drives. The default + configuration is that mass storage devices get four drives. + + Each of the four drives can be remapped using the logical + unit utility MAP. + + The purpose of this code is to alter the runtime data so that + instead of the PPIDE having four drives for the primary IDE + device, it then has two for the primary and two for the secondary. + + The MAP command will properly display the status after this is + run, but you must keep in mind that having two sets of logical + units at the same time is twice as complicated to keep straight + in your mind, and you have to be more careful you know exactly + how the drives are mapped so you don't accidentally destroy your + data. + + This utility is unsupported, and not recommended for general use. + The reason this utility wasn't generally published is that it + is very difficult to give support about this remotely. + + If you are brave, and talented, and you can figure out what I did + with pointers in this program, then you get the prize, which is + to be able to copy from one CF chip to another in a dual adapter. + + It has only been tested on my PPIDE, and I don't know what will + happen if you try it. You could wipe out your CF chip, so make + sure you are backed up if you try this. +*/ + #include "cpmbios.h" #include "bioscall.h" @@ -51,18 +87,20 @@ main(argc,argv) iregbc = DRIVED; iregde = 0; bioscall(); + pDPH_D = ireghl; pDPB_D = pDPH_D->dpb; pDU_D = ireghl -1; *pDU_D = 0x41; printf("Current D: DevUnit is %02x\n",*pDU_D); + pCUR_D = ireghl + 18; *pCUR_D = 1; printf("Current D: Logical Unit is %d\n",* pCUR_D); + pNUM_D = ireghl + 20; *pNUM_D = 64/9; printf("Current D: Number of LU's is %d\n",* pNUM_D); } - \ No newline at end of file