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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [disk/] [tools/] [mkmboot/] [stage2/] [mboot.c] - Diff between revs 17 and 86

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 17 Rev 86
Line 251... Line 251...
    if ((ptr[part].type & 0x80000000) == 0) {
    if ((ptr[part].type & 0x80000000) == 0) {
      printf("partition %d is not bootable\n", part);
      printf("partition %d is not bootable\n", part);
      continue;
      continue;
    }
    }
    /* load boot sector of selected partition */
    /* load boot sector of selected partition */
    readDisk(ptr[part].start, (unsigned char *) 0xC0000000, 1);
    readDisk(ptr[part].start, (unsigned char *) 0xC0010000, 1);
    /* check for signature */
    /* check for signature */
    if ((*((unsigned char *) 0xC0000000 + SECTOR_SIZE - 2) != 0x55) ||
    if ((*((unsigned char *) 0xC0010000 + SECTOR_SIZE - 2) != 0x55) ||
        (*((unsigned char *) 0xC0000000 + SECTOR_SIZE - 1) != 0xAA)) {
        (*((unsigned char *) 0xC0010000 + SECTOR_SIZE - 1) != 0xAA)) {
      printf("boot sector of partition %d has no signature\n", part);
      printf("boot sector of partition %d has no signature\n", part);
      continue;
      continue;
    }
    }
    /* we have a valid boot sector, leave loop */
    /* we have a valid boot sector, leave loop */
    break;
    break;
  }
  }
  /* boot manager finished, now go executing loaded boot sector */
  /* boot manager finished, now go executing loaded boot sector */
  startSector = ptr[part].start;
  startSector = ptr[part].start;
  numSectors = ptr[part].size;
  numSectors = ptr[part].size;
  entryPoint = 0xC0000000;
  entryPoint = 0xC0010000;
  return 0;
  return 0;
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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