ts-7000
[Top] [All Lists]

[ts-7000] Re: some questions on TS7300...

To:
Subject: [ts-7000] Re: some questions on TS7300...
From: "PeterElliot" <>
Date: Thu, 28 Jun 2007 11:09:57 -0000
Hi Developer07,

Here's the code snippets from my code:

FILE *fp;

// Check for file on SDcard #2 to see if card is mounted...
// and mount if not present.

if ((fp=fopen("./pje/mnt/mounted", "r"))==NULL) {
  printf("..sdcard1: Mounting Data Drive\n");
  system("mount -t ext2 /dev/sdcard1/disc0/part1 ./pje/mnt");
} else {
  printf("..sdcard1: Already mounted...\n");
  fclose(fp);
}

// Check for file on Thumbdrive to see if it is mounted...
// and mount if not present.

if ((fp=fopen("./pje/thumbdrive/mounted", "r"))==NULL) {
  printf("..thumbdrive: Mounting Thumbdrive\n"); 
  system("mount -t vfat /dev/scsi/host0/bus0/target0/lun0/part1 
pje/thumbdrive");
  sleep(2); // Wait a while...
} else {
  printf("..thumbdrive: Already mounted...\n");
  fclose(fp);
}

// Unmount Thumbdrive

if ((fp=fopen("./pje/thumbdrive/mounted", "r"))) {
 fclose(fp);
 printf("..thumbdrive: Unmounting Thumbdrive\n");
 system("umount ./pje/thumbdrive");
}

// Unmount SD Card
if ((fp=fopen("./pje/mnt/mounted", "r"))) {
 fclose(fp);
 printf("..sdcard1: Unmounting Data Drive\n");
 system("umount ./pje/mnt");
} else {
 printf("..sdcard1: Already unmounted...\n");
}

The code in both cases currently looks for a file called 'mounted' in 
the root directory of both devices, and mounts the cards if it can't 
see it...

I'm not sure which header include files are needed, start with the 
standard ones and if you have issues I'll post those I've used (most 
of which aren't needed).

With regard to the startup scripts I'm looking to do a (simple) Wiki 
page on this topic - more as a memory jogger for myself. From the 
full boot I mount the second partion of the sdcard and then look 
around...

mount -t ext2 /dev/sdcard0/disc0/part2 /mnt/bootdrive

The main file I've changed is startfpga in the 'bin' directory. This 
has a list of the modules loaded on startup, to which I added the 
bat3 and fat/vfat modules, and I use the file to call my program at 
startup - If you'd like to see it I can post my version.

Hope this helps,

PJE


--- In  "developer07" <> wrote:
>
> 
> Hi,
> 
> If you can post the code or email to me, it will be really helpful 
to 
> me. 
> No such thing to laugh at your code. I even dont have idea how to 
do!
> By the way, how to modify the startup scrip ?
> 
> Thanks a million
> developer07




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU