OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [stdalone/] [dmpmbr/] [main.c] - Diff between revs 196 and 259

Show entire file | Details | Blame | View Log

Rev 196 Rev 259
Line 96... Line 96...
  }
  }
  return FALSE;
  return FALSE;
}
}
 
 
 
 
unsigned long getDiskSize(void) {
unsigned int getDiskSize(void) {
  return *DISK_CAP;
  return *DISK_CAP;
}
}
 
 
 
 
Bool readDisk(unsigned long sector,
Bool readDisk(unsigned int sector,
              unsigned int count,
              unsigned int count,
              unsigned int *addr) {
              unsigned int *addr) {
  unsigned int n;
  unsigned int n;
  unsigned int *p;
  unsigned int *p;
  unsigned int i;
  unsigned int i;
Line 132... Line 132...
 
 
/**************************************************************/
/**************************************************************/
 
 
 
 
void main(void) {
void main(void) {
  unsigned long numSectors;
  unsigned int numSectors;
  unsigned int buffer[SECTOR_SIZE / sizeof(unsigned int)];
  unsigned int buffer[SECTOR_SIZE / sizeof(unsigned int)];
  int i, j;
  int i, j;
  unsigned char *p, *q;
  unsigned char *p, *q;
  unsigned char c;
  unsigned char c;
 
 
Line 146... Line 146...
  if (!checkDiskReady()) {
  if (!checkDiskReady()) {
    error("disk not ready");
    error("disk not ready");
  }
  }
  /* determine disk size */
  /* determine disk size */
  numSectors = getDiskSize();
  numSectors = getDiskSize();
  printf("Disk has %lu (0x%lX) sectors.\n",
  printf("Disk has %u (0x%X) sectors.\n",
         numSectors, numSectors);
         numSectors, numSectors);
  if (numSectors < 32) {
  if (numSectors < 32) {
    error("disk is too small");
    error("disk is too small");
  }
  }
  /* read master boot record */
  /* read master boot record */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.