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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [orpmon/] [cmds/] [hdbug.c] - Diff between revs 920 and 1020

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

Rev 920 Rev 1020
Line 47... Line 47...
*/
*/
void module_hdbug_init (void)
void module_hdbug_init (void)
{
{
  hdbug_num_commands = 0;
  hdbug_num_commands = 0;
 
 
  register_command ("mount", "<device> [<mode>]", "Opens ata device <device> and mounts the DOS filesystem on it.", hdbug_mount_cmd);
  register_command ("hdbug", "<device> [<mode>]", "Opens ata device <device> & mounts DOS filesystem", hdbug_mount_cmd);
  register_hdbug_command ("umount", "", "Unmounts the DOS filesystem and Closes the device.", hdbug_umount_cmd);
  register_hdbug_command ("umount", "", "Unmounts DOS filesystem & Closes device", hdbug_umount_cmd);
 
 
  register_hdbug_command ("dir", "", "dos 'dir' command.", hdbug_dir_cmd);
  register_hdbug_command ("dir", "", "dos 'dir' command.", hdbug_dir_cmd);
  register_hdbug_command ("cd", "", "dos 'cd' command.", hdbug_cd_cmd);
  register_hdbug_command ("cd", "", "dos 'cd' command.", hdbug_cd_cmd);
  register_hdbug_command ("help", "", "Display this help message", hdbug_help);
  register_hdbug_command ("help", "", "Display this help message", hdbug_help);
  register_hdbug_command ("exit", "", "Exit hdbug and return to ORPmon (same as umount)", hdbug_umount_cmd);
  register_hdbug_command ("exit", "", "Exit hdbug and return to ORPmon", hdbug_umount_cmd);
}
}
 
 
 
 
/*
/*
 The next code is graceously taken from the "common.c" file
 The next code is graceously taken from the "common.c" file
Line 226... Line 226...
        break;
        break;
    }
    }
  }
  }
  else
  else
  {
  {
 
    printf( "directory startsector: 0x%08lX\n", dos_params->ssector );
 
    printf( "cluster startsector  : 0x%08lX\n", dos_params->csector );
 
    printf( "cluster startentry   : 0x%08lX\n", dos_params->sentry );
 
 
    /* device is opened, filesystem is mounted, start command prompt  */
    /* device is opened, filesystem is mounted, start command prompt  */
    while ( !hdbug_mon_command() );
    while ( !hdbug_mon_command() );
  }
  }
 
 
  return 0;
  return 0;
Line 307... Line 311...
int hdbug_dir_print(struct dos_dir_entry *entry)
int hdbug_dir_print(struct dos_dir_entry *entry)
{
{
  unsigned long  ltmp;
  unsigned long  ltmp;
  unsigned short stmp;
  unsigned short stmp;
 
 
 
  char txt[9];
 
 
  switch (entry->name[0]) {
  switch (entry->name[0]) {
    case 0x00:
    case 0x00:
      /* empty entry */
      /* empty entry */
      break;
      break;
 
 
    case 0xe5:
    case 0xe5:
      /* deleted/removed entry */
      /* deleted/removed entry */
      break;
      break;
 
 
    default:
    default:
 
      /* check if entry is a label                                    */
 
      if (entry->attribute & ATT_LAB)
 
      {
 
        printf( "LABEL: " );
 
        memcpy(txt, entry->name, 8);
 
        txt[8] = '\0';
 
        printf( "%s", txt);
 
        memcpy(txt, entry->ext, 3);
 
        txt[3] = '\0';
 
        printf( "%s\n", txt);
 
      }
 
      else
 
      {
      /* display date & time                                          */
      /* display date & time                                          */
      stmp = entry->date;
      stmp = entry->date;
      swap(&stmp, sizeof(short) );
      swap(&stmp, sizeof(short) );
      printf( "%02d-%02d-%4d  ",stmp & 0x1f, (stmp >> 5) & 0xf, ((stmp >> 9) & 0xffff) +1980);
      printf( "%02d-%02d-%4d  ",stmp & 0x1f, (stmp >> 5) & 0xf, ((stmp >> 9) & 0xffff) +1980);
 
 
Line 347... Line 366...
      }
      }
 
 
      printf("\n");
      printf("\n");
      break;
      break;
  }
  }
 
  }
 
 
  return 0;
  return 0;
}
}
 
 
 
 

powered by: WebSVN 2.1.0

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