forked from len0rd/rockbox
test code portable now
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5145 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
65bee608f6
commit
b2c2738f09
2 changed files with 8 additions and 7 deletions
|
@ -56,7 +56,7 @@ int ata_init(char* filename)
|
||||||
if (!filename)
|
if (!filename)
|
||||||
filename = "disk.img";
|
filename = "disk.img";
|
||||||
/* check disk size */
|
/* check disk size */
|
||||||
file=fopen(filename,"r+");
|
file=fopen(filename,"rb+");
|
||||||
if(!file) {
|
if(!file) {
|
||||||
fprintf(stderr, "read_disk() - Could not find \"%s\"\n",filename);
|
fprintf(stderr, "read_disk() - Could not find \"%s\"\n",filename);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/time.h>
|
|
||||||
#include "fat.h"
|
#include "fat.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "disk.h"
|
#include "disk.h"
|
||||||
|
@ -266,7 +265,7 @@ int dbg_wrtest(char* name)
|
||||||
void dbg_type(char* name)
|
void dbg_type(char* name)
|
||||||
{
|
{
|
||||||
const int size = SECTOR_SIZE*5;
|
const int size = SECTOR_SIZE*5;
|
||||||
unsigned char buf[size+1];
|
unsigned char buf[SECTOR_SIZE*5+1];
|
||||||
int fd,rc;
|
int fd,rc;
|
||||||
|
|
||||||
fd = open(name,O_RDONLY);
|
fd = open(name,O_RDONLY);
|
||||||
|
@ -658,10 +657,8 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int rc,i;
|
int rc,i;
|
||||||
struct partinfo* pinfo;
|
struct partinfo* pinfo;
|
||||||
struct timeval tv;
|
|
||||||
|
|
||||||
gettimeofday(&tv, NULL);
|
srand(clock());
|
||||||
srand(tv.tv_usec);
|
|
||||||
|
|
||||||
if(ata_init("disk.img")) {
|
if(ata_init("disk.img")) {
|
||||||
DEBUGF("*** Warning! The disk is uninitialized\n");
|
DEBUGF("*** Warning! The disk is uninitialized\n");
|
||||||
|
@ -674,7 +671,11 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( i=0; i<4; i++ ) {
|
for ( i=0; i<4; i++ ) {
|
||||||
if ( pinfo[i].type == PARTITION_TYPE_FAT32 ) {
|
if ( pinfo[i].type == PARTITION_TYPE_FAT32
|
||||||
|
#ifdef HAVE_FAT16SUPPORT
|
||||||
|
|| pinfo[i].type == PARTITION_TYPE_FAT16
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
DEBUGF("*** Mounting at block %ld\n",pinfo[i].start);
|
DEBUGF("*** Mounting at block %ld\n",pinfo[i].start);
|
||||||
rc = fat_mount(pinfo[i].start);
|
rc = fat_mount(pinfo[i].start);
|
||||||
if(rc) {
|
if(rc) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue