Mr Thomas, one more question please... [Initializing Partition Table (?)]

Thomas Doerfler Thomas.Doerfler at imd-systems.de
Tue Jul 27 14:03:34 UTC 2004


Hello Joe,

it would be great if you would also implement an 
ext2/ext3 linux FS support for RTEMS, but until now 
only various FAT formats are supported. 

Using a floppy instead would be a good idea, but 
currently RTEMS is not shipped with floppy drivers.

wkr,
Thomas.


> Hi Mr Thomas, and thanks once more again,
> 
> So, I have a mandrake linux box using a 80GB had disk
> which was limited to 40Gb due to mother noard
> restrictions. I only have the madrake linux installed
> in that computer, a mendocino celeron at 400MHz.
> 
> Does the hardisk must be FAT formated???
> The hard disk I have is formated using linux
> filesystem. I installed mandrake with the express
> option and it created the linux needed partitions...
> 
> 
> So when I try to mount it using fileio sample I get a
> return value diferent from zero and the last error is
> 25 - file or directory doens exists... :-(
> 
> I dont have any FAT formated hard disk... :-( 
> 
> Can I use a floppy instead? I am starting the rtems
> program using a grub diskette which was formated using
> fat system...  Can I use it to be mounted?
> 
> How do I refere to the floppy when mounting and
> initializing using the fileio samples? /dev/fd0?
> 
> Many thanks, once more again...
> I ama  student and I am trying to make some research
> in the rtems but I need to create a file to store some
> values for later use...
> 
> Joe
> 
> 
> 
> 
> 
> 
> 
> --- Thomas Doerfler <Thomas.Doerfler at imd-systems.de>
> wrote:
> 
> > Hello,
> > 
> > yes, I think the IDE and ATA driver should 
> > initialize on your system. So in the "fileio" menu, 
> > you should call "fileio_part_table_initialize" (menu
> > 
> > letter 'p') and then "fileio_fsmount" (menu letter 
> > 'f'). Then your first harddisk partition with FAT 
> > filesystem should be mounted to /mnt/hda.
> > 
> > What messages do you get, when you call 
> > "fileio_mount"? What kind of harddisk do you use and
> > 
> > how is it partitioned?
> > 
> > wkr,
> > Thomas.
> > 
> > 
> > > Hello Mr Thomas and thank you for your help,
> > > 
> > > I have the following instruction in my rtems
> > program
> > > and I realize that the RTEMS_BSP_HAS_IDE_DRIVER is
> > > defined!
> > > 
> > > rtems_driver_address_table Device_drivers[] =
> > > {
> > >  	CONSOLE_DRIVER_TABLE_ENTRY
> > >  	,CLOCK_DRIVER_TABLE_ENTRY
> > > #ifdef RTEMS_BSP_HAS_IDE_DRIVER
> > >  	,IDE_CONTROLLER_DRIVER_TABLE_ENTRY
> > >  	/* important: ATA driver must be after ide
> > drivers
> > >  */
> > > 	,ATA_DRIVER_TABLE_ENTRY 
> > > #endif
> > > };
> > > 
> > > But I cant see the hda anyway... :-(
> > > That instruction is enough to load and initialize
> > the
> > > hardisk driver?
> > > 
> > > So, please, could you give a quick look at the
> > > scaletton of my program... I cant solve this
> > problem
> > > alone... Did you saw anything suspicious? Do I
> > have to
> > > include any special parameter when I configure and
> > > build the rtems to access hard drive? 
> > > 
> > > 
> > > Thank you Mr Thomas...
> > > 
> > > Joe
> > > 
> > > 
> > > PS: My program is in one file only called hello.c
> > and
> > > i want to use POSIX api as much as possible...
> > >
> >
> ==================================================================
> > > 
> > > #define CONFIGURE_INIT
> > > 
> > > #include <bsp.h> /* for device driver prototypes
> > */
> > > #include <libchip/ata.h> /* for ata driver
> > prototype
> > > */
> > > #include <libchip/ide_ctrl.h> /* for general ide
> > > driver prototype */
> > > 
> > > #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
> > > #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
> > > #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
> > > #define CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
> > > 
> > > #ifdef CONFIGURE_INIT
> > > rtems_driver_address_table Device_drivers[] =
> > > 	{
> > > 	CONSOLE_DRIVER_TABLE_ENTRY
> > > 	,CLOCK_DRIVER_TABLE_ENTRY
> > > #ifdef RTEMS_BSP_HAS_IDE_DRIVER
> > > 	,IDE_CONTROLLER_DRIVER_TABLE_ENTRY
> > > 	/* important: ATA driver must be after ide
> > drivers */
> > > 	,ATA_DRIVER_TABLE_ENTRY
> > > #endif
> > > 	};
> > > 
> > > #include <rtems/bdbuf.h>
> > > rtems_bdbuf_config rtems_bdbuf_configuration[] = {
> > >   {512,128,NULL}
> > > };
> > > int rtems_bdbuf_configuration_size =(
> > > sizeof(rtems_bdbuf_configuration)
> > > 				     /sizeof(rtems_bdbuf_configuration[0]));
> > > #endif
> > > 
> > > #include <unistd.h>
> > > #include <rtems/error.h>
> > > #include <dosfs.h>
> > > #include <ctype.h>
> > > #include <rtems/ide_part_table.h>
> > > #include <rtems/libcsupport.h>
> > > #include "fsmount.h"
> > > 
> > > #include <rtems.h>
> > > #include <stdlib.h>
> > > #include <stdio.h>
> > > #include <string.h>
> > > #include <errno.h>
> > > #include <semaphore.h>
> > > #include <pthread.h>
> > > #include <fcntl.h>
> > > #include <time.h>
> > > #include <rtems/posix/timer.h>
> > > 
> > > #define print_time(_s1, _tb, _s2) \
> > >   do { \
> > >     printf( "%s%02d:%02d:%02d   %02d/%02d/%04d%s",
> > \
> > >        _s1, (_tb)->hour, (_tb)->minute,
> > (_tb)->second,
> > > \
> > >        (_tb)->month, (_tb)->day, (_tb)->year, _s2
> > ); \
> > >     fflush(stdout); \
> > >   } while ( 0 )
> > > 
> > > /*
> > >  *  Macro to print an task name that is composed
> > of
> > > ASCII characters.
> > >  *
> > >  */
> > > 
> > > #define put_name( _name, _crlf ) \
> > >   do { \
> > >     rtems_unsigned32 c0, c1, c2, c3; \
> > >     \
> > >     c0 = ((_name) >> 24) & 0xff; \
> > >     c1 = ((_name) >> 16) & 0xff; \
> > >     c2 = ((_name) >> 8) & 0xff; \
> > >     c3 = (_name) & 0xff; \
> > >     putchar( (char)c0 ); \
> > >     if ( c1 ) putchar( (char)c1 ); \
> > >     if ( c2 ) putchar( (char)c2 ); \
> > >     if ( c3 ) putchar( (char)c3 ); \
> > >     if ( (_crlf) ) \
> > >       putchar( '\n' ); \
> > >   } while (0)
> > > 
> > > /*
> > >  *  static inline routine to make obtaining ticks
> > per
> > > second easier.
> > >  */
> > > 
> > > static inline rtems_unsigned32
> > get_ticks_per_second(
> > > void )
> > > {
> > >   rtems_interval ticks_per_second;
> > >   (void) rtems_clock_get(
> > > RTEMS_CLOCK_GET_TICKS_PER_SECOND,
> > &ticks_per_second );
> > >  return ticks_per_second;
> > > }
> > > 
> > > 
> > > /*
> > >  *  This allows us to view the "Test_task"
> > > instantiations as a set
> > >  *  of numbered tasks by eliminating the number of
> > > application
> > >  *  tasks created.
> > >  *
> > >  *  In reality, this is too complex for the
> > purposes
> > > of this
> > >  *  example.  It would have been easier to pass a
> > task
> > > argument. :)
> > >  *  But it shows how rtems_id's can sometimes be
> > used.
> > >  */
> > > 
> > > #define task_number( tid ) \
> > >   ( rtems_get_index( tid ) - \
> > >     
> > >
> >
> rtems_configuration_get_rtems_api_configuration()->number_of_initialization_tasks
> > > )
> > > 
> > > /* end of include file */
> > > 
> > > 
> > > /*
> > 
> === message truncated ===
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail

--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_keys.htm




More information about the users mailing list