CDP Forum Forum Index CDP Forum
NOTE: The forum is being replaced by support.icd.no
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RTOS won't find my files...

 
Post new topic   Reply to topic    CDP Forum Forum Index -> RTOS-32 programming
View previous topic :: View next topic  
Author Message
Rune



Joined: 14 Mar 2007
Posts: 25
Location: Norway

PostPosted: Mon 25 Jun 11:07:43 2007    Post subject: RTOS won't find my files... Reply with quote

Exclamation Problem: RTOS does not find my files on some types of hardware.

Question Cause: For some reason RTOS does not see the correct drive.

Idea Solution: insert the following in CDPMain.cpp:

Code:
#include <direct.h>


...and after CDPTimer::Init():

Code:
  // Locate startup drive if we have a special setup:
  CDPMessage("Locating startup-drive, please wait...\n");
  // find correct drive (modify if special drive is needed)
  bool bOk = false;
  for(int i='A';i<'Z';i++)
  {
    if(_chdrive(i-'A'+1)!=-1)
    {
      FILE* pFile = fopen("Application.xml","r");
      if(pFile!=NULL)
      {
        fclose(pFile);
        CDPMessage("Found Application.xml on drive %c:\\\n",i);
        // found drive.
        bOk = true;
        break;
      }
      pFile = fopen("CDPSafe.xml","r");
      if(pFile!=NULL)
      {
        fclose(pFile);
        CDPMessage("Found CDPSafe.xml on drive %c:\\\n",i);
        // found drive.
        bOk = true;
        break;
      }
    }
  }
  if(!bOk)
  {
    printf("No valid startupdrive was found. Make sure that the device-list is correct.\n");
    OSAPISleep(5000);
  }
  // we now have the correct drive.

_________________
Best Regards,
Rune Espeseth
Industrial Control Design AS
Back to top
View user's profile Send private message Visit poster's website
Svein



Joined: 14 Mar 2007
Posts: 94
Location: Ålesund, Norway

PostPosted: Mon 9 Jul 9:59:25 2007    Post subject: RTOS won't find my files Reply with quote

Exclamation Problem
CDP fails to start, Configure() can't find any files.

Idea Solution
RTOS detects the drives specified in the RTFDeviceList in CDPMain.cpp.
The default devicelist looks like this:

Code:
static RTFDrvFLPYData FLPYDriveAData = {0};
static RTFDrvFLPYData FLPYDriveBData = {0};
static RTFDrvIDEData  IDEDriveCData  = {0};
static RTFDrvIDEData  IDEDriveDData  = {0};

RTFDevice RTFDeviceList[] = {
  { RTF_DEVICE_FLOPPY, 0, 0, &RTFDrvFloppy, &FLPYDriveAData },
  { RTF_DEVICE_FLOPPY, 1, 0, &RTFDrvFloppy, &FLPYDriveBData },
  { RTF_DEVICE_FDISK , 0, 0, &RTFDrvIDE,    &IDEDriveCData  }, // Primary MASTER
  { RTF_DEVICE_FDISK , 1, 0, &RTFDrvIDE,    &IDEDriveDData  }, // Primary SLAVE
  { 0 } // end of list specifier
};


You can see from above that, if you have a disk on the secondary IDE channel of your controller, this disk will not be detected. To make RTOS detect it, add the following lines before the RTFDevice...

Code:
static RTFDrvIDEData  IDEDriveEData  = {0};
static RTFDrvIDEData  IDEDriveFData  = {0};


... and add the following lines just before the {0} (end of list specifier):

Code:
  { RTF_DEVICE_FDISK , 2, 0, &RTFDrvIDE,    &IDEDriveEData  }, // Secondary MASTER
  { RTF_DEVICE_FDISK , 3, 0, &RTFDrvIDE,    &IDEDriveFData  }, // Secondary SLAVE


For more information on the RTOS32 device list, please check the RTOS-32 manual.
_________________
Svein Erling Linge, ICD
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    CDP Forum Forum Index -> RTOS-32 programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group