[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bdpart and qemu



On 3/12/10 8:38 AM, Simon Perreault wrote:
>
> I'm trying to mount a filesystem from inside qemu. I run qemu exactly as
> described on the wiki [1]:
>
> 	$ qemu -hda fat:/home/simon/qemu/hd ...
>

The 'fat' disk create a single image with an emulated fat file system. 
What heppens if you:

   # mount -t dosfs /dev/ide0 /c

in the RTEMS shell.

> In my code I do this:
>
> ==============
> static void *
> POSIX_Init(void *arg UNUSED)
> {
>          rtems_status_code        status;
>
>          if ((status = rtems_bdpart_register_from_disk("/dev/ide0"))
>              != RTEMS_SUCCESSFUL) {
>                  printf("cannot read partition table from /dev/ide0\n");
>                  exit(-1);
>          }
>

Check the shell code for an example of the mount call.

> ...
> #define CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
> #define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
> ...
> ==============
>
> And I see this when I execute:
>
> ==============
> Initialized console on port COM1 9600-8-N-1
>
> IDE0:master:QEMU HARDDISK, 516.0M (16/1152/56), max blk size:8192
> cannot read partition table from /dev/ide0

I do not think a partition table exists. If you make a file that you use 
as a file system then you can partition and format it.

> ==============
>
> I verified that the /dev/ide0 device exists.
>
> Any idea what might be going on? Does qemu create a partition table with
> these flags?
>

Be careful with the qemu fat disk. It has limitations. One is the number 
of files it shows. I cannot remember the limitation but the last time I 
used it I hit a limit.

Chris