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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [stdalone/] [mkpart/] [main.c] - Diff between revs 38 and 259

Show entire file | Details | Blame | View Log

Rev 38 Rev 259
Line 130... Line 130...
  }
  }
  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 162... Line 162...
  }
  }
  return TRUE;
  return TRUE;
}
}
 
 
 
 
Bool writeDisk(unsigned long sector,
Bool writeDisk(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 193... Line 193...
 
 
/**************************************************************/
/**************************************************************/
 
 
 
 
void main(void) {
void main(void) {
  unsigned long numSectors;
  unsigned int numSectors;
 
 
  /* init interrupts */
  /* init interrupts */
  initInterrupts();
  initInterrupts();
  /* check disk ready */
  /* check disk ready */
  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");
  }
  }
  /* copy boot block to write buffer */
  /* copy boot block to write buffer */

powered by: WebSVN 2.1.0

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