qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] some help
@ 2004-06-16 14:42 Ludovic Gele
  2004-06-16 19:13 ` [Qemu-devel] Can't see network under qemu 0.5.5 Leonard T. Erwine
  2004-06-16 20:26 ` [Qemu-devel] Useful Q&A Benjamin Brown
  0 siblings, 2 replies; 22+ messages in thread
From: Ludovic Gele @ 2004-06-16 14:42 UTC (permalink / raw)
  To: qemu-devel

Hi,

I am trying to use the network emulation with qemu 5.4 under debian sarge with a
kernel 2.6.5-1-386, but I don't succeed. When I try to install an another debian
with the netinst cd, the debian's installer won't detect the network card. I use
the /etc/qemu-ifup script, and qemu don't give error about tun0.

Thanks

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] Can't see network under qemu 0.5.5
  2004-06-16 14:42 [Qemu-devel] some help Ludovic Gele
@ 2004-06-16 19:13 ` Leonard T. Erwine
  2004-06-17  8:22   ` Ludovic Gele
  2004-06-16 20:26 ` [Qemu-devel] Useful Q&A Benjamin Brown
  1 sibling, 1 reply; 22+ messages in thread
From: Leonard T. Erwine @ 2004-06-16 19:13 UTC (permalink / raw)
  To: Qemu Mailing List

I have this problem with using qemu 0.5.5 under windows 98.

I can ping the interface's own IP but can't see beyond that.

I have screen captures of my settings and other relevant system data at
http://www.lennyerwine.com/qemu-net.

If anyone can help me with this problem, I will be GLAD to transform the
aforementioned web page into a help document. If I can get past this, I
plan on doing this for Win2K, Linux as well.

On Wed, 2004-06-16 at 10:42, Ludovic Gele wrote:
> Hi,
> 
> I am trying to use the network emulation with qemu 5.4 under debian sarge with a
> kernel 2.6.5-1-386, but I don't succeed. When I try to install an another debian
> with the netinst cd, the debian's installer won't detect the network card. I use
> the /etc/qemu-ifup script, and qemu don't give error about tun0.
> 
> Thanks
> 
> 
> 
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] Useful Q&A
  2004-06-16 14:42 [Qemu-devel] some help Ludovic Gele
  2004-06-16 19:13 ` [Qemu-devel] Can't see network under qemu 0.5.5 Leonard T. Erwine
@ 2004-06-16 20:26 ` Benjamin Brown
  2004-06-16 20:35   ` Bartosz Fabianowski
  2004-06-16 21:02   ` Fabrice Bellard
  1 sibling, 2 replies; 22+ messages in thread
From: Benjamin Brown @ 2004-06-16 20:26 UTC (permalink / raw)
  To: qemu-devel

Hi all,

List of questions open to all - please answer any you can!

Where can I find a *Full* listing of all of the command line parameters 
for QEMU (i.e. includes "-cirrus")?
Will support for newer graphics cards be included any time soon?
Why doesn't (guest) Windows 98 (FE) recognise the emulated sound card  
as new hardware on my host  Mandrake 10.0 machine when I specifiy 
"-enable-audio" - it doesn't think there is one at all?
Any thoughts on binary builds for i586 and higher instead of default 
i386, are any processor specific optimizations likely to be made in future?

Benjamin

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Useful Q&A
  2004-06-16 20:26 ` [Qemu-devel] Useful Q&A Benjamin Brown
@ 2004-06-16 20:35   ` Bartosz Fabianowski
  2004-06-17 10:42     ` Antony T Curtis
  2004-06-16 21:02   ` Fabrice Bellard
  1 sibling, 1 reply; 22+ messages in thread
From: Bartosz Fabianowski @ 2004-06-16 20:35 UTC (permalink / raw)
  To: qemu-devel

> Where can I find a *Full* listing of all of the command line parameters 
> for QEMU (i.e. includes "-cirrus")?

I posted this a few days ago. Go to QEMU's source directory and run:

egrep "^    QEMU_OPTION_" vl.c

> Why doesn't (guest) Windows 98 (FE) recognise the emulated sound card  
> as new hardware on my host  Mandrake 10.0 machine when I specifiy 
> "-enable-audio" - it doesn't think there is one at all?

If you're not using -pci, the sound card is not plug'n'play. Maybe the 
Windows hardware detection just fails to find it and you need to add it 
manually?

- Bartosz

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Useful Q&A
  2004-06-16 20:26 ` [Qemu-devel] Useful Q&A Benjamin Brown
  2004-06-16 20:35   ` Bartosz Fabianowski
@ 2004-06-16 21:02   ` Fabrice Bellard
  2004-06-16 21:16     ` malc
  2004-06-16 21:41     ` Benjamin Brown
  1 sibling, 2 replies; 22+ messages in thread
From: Fabrice Bellard @ 2004-06-16 21:02 UTC (permalink / raw)
  To: qemu-devel

Benjamin Brown wrote:
> Hi all,
> 
> List of questions open to all - please answer any you can!
> 
> Where can I find a *Full* listing of all of the command line parameters 
> for QEMU (i.e. includes "-cirrus")?

All options of QEMU releases are documented. As the CVS version is not 
an official release, it contains test options that may be suppressed or 
modified without notice (in particular -pci and -cirrusvga). You can use 
the source code of the CVS version to have more information.

> Will support for newer graphics cards be included any time soon?

No.

> Why doesn't (guest) Windows 98 (FE) recognise the emulated sound card  
> as new hardware on my host  Mandrake 10.0 machine when I specifiy 
> "-enable-audio" - it doesn't think there is one at all?

Did you try to relaunch the hardware probe in Windows ?

> Any thoughts on binary builds for i586 and higher instead of default 
> i386, are any processor specific optimizations likely to be made in future?

No, except for translate-copy mode to use MMX/SSE/SSE2.

Fabrice.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Useful Q&A
  2004-06-16 21:02   ` Fabrice Bellard
@ 2004-06-16 21:16     ` malc
  2004-06-16 21:41     ` Benjamin Brown
  1 sibling, 0 replies; 22+ messages in thread
From: malc @ 2004-06-16 21:16 UTC (permalink / raw)
  To: qemu-devel

On Wed, 16 Jun 2004, Fabrice Bellard wrote:

> Benjamin Brown wrote:
> > Hi all,
> >
> > List of questions open to all - please answer any you can!
> >
> > Where can I find a *Full* listing of all of the command line parameters
> > for QEMU (i.e. includes "-cirrus")?
>
> All options of QEMU releases are documented. As the CVS version is not
> an official release, it contains test options that may be suppressed or
> modified without notice (in particular -pci and -cirrusvga). You can use
> the source code of the CVS version to have more information.
>
> > Will support for newer graphics cards be included any time soon?
>
> No.
>
> > Why doesn't (guest) Windows 98 (FE) recognise the emulated sound card
> > as new hardware on my host  Mandrake 10.0 machine when I specifiy
> > "-enable-audio" - it doesn't think there is one at all?
>
> Did you try to relaunch the hardware probe in Windows ?

Windows 98 does not recognize emulated SB16, i have yet to isolate the
problem. Then again i have successfully used Win2K's WDM drivers on Win98.
Others(hetz) have been less lucky.

>
> > Any thoughts on binary builds for i586 and higher instead of default
> > i386, are any processor specific optimizations likely to be made in future?
>
> No, except for translate-copy mode to use MMX/SSE/SSE2.
>
> Fabrice.

-- 
mailto:malc@pulsesoft.com

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Useful Q&A
  2004-06-16 21:02   ` Fabrice Bellard
  2004-06-16 21:16     ` malc
@ 2004-06-16 21:41     ` Benjamin Brown
  2004-06-17  8:25       ` Johannes Schindelin
  2004-06-19 16:34       ` [Qemu-devel] Mounting a disk image under Linux Benjamin Brown
  1 sibling, 2 replies; 22+ messages in thread
From: Benjamin Brown @ 2004-06-16 21:41 UTC (permalink / raw)
  To: qemu-devel

Thanks for the info - few more questions tho:

Fabrice Bellard wrote:

>> Will support for newer graphics cards be included any time soon?
>
>
> No.

Is this sort of thing difficult (I've not written an emulator before)?

>
>> Why doesn't (guest) Windows 98 (FE) recognise the emulated sound 
>> card  as new hardware on my host  Mandrake 10.0 machine when I 
>> specifiy "-enable-audio" - it doesn't think there is one at all?
>
>
> Did you try to relaunch the hardware probe in Windows ?

Yes, I'll look into it again. It may well be something with my setup as 
I also recently did a CVS build and still have the problem.

>
>> Any thoughts on binary builds for i586 and higher instead of default 
>> i386, are any processor specific optimizations likely to be made in 
>> future?
>
>
> No, except for translate-copy mode to use MMX/SSE/SSE2.

To me the i386 support seems to be pointless - anybody who is seriously 
going to be running QEMU will be using a minimum of a i586 (K6-2, 
Pentium etc), granted QEMU it is not intended for just this processor 
platform - what is the justification for a 386 compatible version....? :)

Excellent software all round - wish I had the technical know how!

Benjamin

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Can't see network under qemu 0.5.5
  2004-06-16 19:13 ` [Qemu-devel] Can't see network under qemu 0.5.5 Leonard T. Erwine
@ 2004-06-17  8:22   ` Ludovic Gele
  2004-06-17 15:39     ` Marc Vertes
  2004-06-18 20:34     ` Leonard T. Erwine
  0 siblings, 2 replies; 22+ messages in thread
From: Ludovic Gele @ 2004-06-17  8:22 UTC (permalink / raw)
  To: qemu-devel

Selon "Leonard T. Erwine" <lerwine@teamlightning.com>:

> I have this problem with using qemu 0.5.5 under windows 98.
> 
> I can ping the interface's own IP but can't see beyond that.
> 
> I have screen captures of my settings and other relevant system data at
> http://www.lennyerwine.com/qemu-net.
> 
> If anyone can help me with this problem, I will be GLAD to transform the
> aforementioned web page into a help document. If I can get past this, I
> plan on doing this for Win2K, Linux as well.

Have you activate the ipforwarding on your host system? And the NAT?

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Useful Q&A
  2004-06-16 21:41     ` Benjamin Brown
@ 2004-06-17  8:25       ` Johannes Schindelin
  2004-06-19 17:35         ` Benjamin Brown
  2004-06-19 16:34       ` [Qemu-devel] Mounting a disk image under Linux Benjamin Brown
  1 sibling, 1 reply; 22+ messages in thread
From: Johannes Schindelin @ 2004-06-17  8:25 UTC (permalink / raw)
  To: qemu-devel

Hi,

On Wed, 16 Jun 2004, Benjamin Brown wrote:
> >> Will support for newer graphics cards be included any time soon?
> > No.
> Is this sort of thing difficult (I've not written an emulator before)?

Why on earth would you want to do that? It is an *emulated* graphics card.
So any card which works should be fine. There is no point of maintaining
two or more solutions to the same problem.

> To me the i386 support seems to be pointless - anybody who is seriously
> going to be running QEMU will be using a minimum of a i586 (K6-2,
> Pentium etc), granted QEMU it is not intended for just this processor
> platform - what is the justification for a 386 compatible version....? :)

Well, there is more to it than just focusing on the newest, fastest, best
processor there is.

First, why do you suppose at all, that the main use of QEMU is on INTEL
platform? There are quite a few 386 compatible processors, and while not
exactly being slow, they do not all support INTEL extensions.

Second, you need time to write the special support for all those
extensions. Don't underestimate the effort!

Third, any day of the week I would rather fix things that don't work yet
than fine tune some performance issues.

Fourth, I strongly doubt that supporting those extensions does have a high
impact on performance: They are too special. They are mainly for large
vector an matrix calculations, and last time I checked, a word processor
does not really use many of those.

> Excellent software all round - wish I had the technical know how!

Use the source, Luke!

This is good for two reasons: You will learn a lot, especially how
well-written code looks like. And you will be able to turn on debugging
options, to understand what exactly happens, and to contribute back what
you learnt as a means of saying "Thanks".

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Useful Q&A
  2004-06-16 20:35   ` Bartosz Fabianowski
@ 2004-06-17 10:42     ` Antony T Curtis
  0 siblings, 0 replies; 22+ messages in thread
From: Antony T Curtis @ 2004-06-17 10:42 UTC (permalink / raw)
  To: qemu-devel

On Wed, 2004-06-16 at 21:35, Bartosz Fabianowski wrote:
> > Where can I find a *Full* listing of all of the command line parameters 
> > for QEMU (i.e. includes "-cirrus")?
> 
> I posted this a few days ago. Go to QEMU's source directory and run:
> 
> egrep "^    QEMU_OPTION_" vl.c
> 
> > Why doesn't (guest) Windows 98 (FE) recognise the emulated sound card  
> > as new hardware on my host  Mandrake 10.0 machine when I specifiy 
> > "-enable-audio" - it doesn't think there is one at all?
> 
> If you're not using -pci, the sound card is not plug'n'play. Maybe the 
> Windows hardware detection just fails to find it and you need to add it 
> manually?

Using my PnP patch, it shouldn't be hard to make it "Plug and Play"
compatible...

-- 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Can't see network under qemu 0.5.5
  2004-06-17  8:22   ` Ludovic Gele
@ 2004-06-17 15:39     ` Marc Vertes
  2004-06-18 20:58       ` Leonard T. Erwine
  2004-06-18 20:34     ` Leonard T. Erwine
  1 sibling, 1 reply; 22+ messages in thread
From: Marc Vertes @ 2004-06-17 15:39 UTC (permalink / raw)
  To: qemu-devel

Here is the /etc/qemu-ifup I use to perform full network configuration:

-----------------------------------------------------
#!/bin/sh
#
# Inside the qemu VM, the following commands are required:
#
# ifconfig eth0 172.20.0.2
# route add default gw 172.20.0.1
#
intf=$1
eth0_ipaddr=$(ifconfig eth0 | awk '/inet addr:/ {print substr($2, 6)}')

sudo sh << EOT
/sbin/ifconfig $intf 172.20.0.1
/sbin/route add -host 172.20.0.2 $intf
/usr/sbin/iptables -t nat -F
/usr/sbin/iptables -t nat -A POSTROUTING -j SNAT -o eth0 --to $eth0_ipaddr
echo 1 > /proc/sys/net/ipv4/ip_forward
EOT
---------------------------------------------------

Marc

Ludovic Gele wrote:

>Selon "Leonard T. Erwine" <lerwine@teamlightning.com>:
>
>>I have this problem with using qemu 0.5.5 under windows 98.
>>
>>I can ping the interface's own IP but can't see beyond that.
>>
>>I have screen captures of my settings and other relevant system data at
>>http://www.lennyerwine.com/qemu-net.
>>
>>If anyone can help me with this problem, I will be GLAD to transform the
>>aforementioned web page into a help document. If I can get past this, I
>>plan on doing this for Win2K, Linux as well.
>>
>
>Have you activate the ipforwarding on your host system? And the NAT?
>
>
>
>_______________________________________________
>Qemu-devel mailing list
>Qemu-devel@nongnu.org
>http://lists.nongnu.org/mailman/listinfo/qemu-devel
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Can't see network under qemu 0.5.5
  2004-06-17  8:22   ` Ludovic Gele
  2004-06-17 15:39     ` Marc Vertes
@ 2004-06-18 20:34     ` Leonard T. Erwine
  1 sibling, 0 replies; 22+ messages in thread
From: Leonard T. Erwine @ 2004-06-18 20:34 UTC (permalink / raw)
  To: Qemu Mailing List

Yes I did enable IP forwarding. I did not set up any NAT. I did not
think this was necessary to just get a connection to the host system. I
was going to take care of IP forwarding and NAT once I positively
established a connection.

On Thu, 2004-06-17 at 04:22, Ludovic Gele wrote:
> Selon "Leonard T. Erwine" <lerwine@teamlightning.com>:
> 
> > I have this problem with using qemu 0.5.5 under windows 98.
> > 
> > I can ping the interface's own IP but can't see beyond that.
> > 
> > I have screen captures of my settings and other relevant system data at
> > http://www.lennyerwine.com/qemu-net.
> > 
> > If anyone can help me with this problem, I will be GLAD to transform the
> > aforementioned web page into a help document. If I can get past this, I
> > plan on doing this for Win2K, Linux as well.
> 
> Have you activate the ipforwarding on your host system? And the NAT?
> 
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Can't see network under qemu 0.5.5
  2004-06-17 15:39     ` Marc Vertes
@ 2004-06-18 20:58       ` Leonard T. Erwine
  0 siblings, 0 replies; 22+ messages in thread
From: Leonard T. Erwine @ 2004-06-18 20:58 UTC (permalink / raw)
  To: Qemu Mailing List

I tried this, but still to no avail. Nothing gets in and nothing gets
out of the qemu instance. Are you using Windows 98 for this?

On Thu, 2004-06-17 at 11:39, Marc Vertes wrote:
> Here is the /etc/qemu-ifup I use to perform full network configuration:
> 
> -----------------------------------------------------
> #!/bin/sh
> #
> # Inside the qemu VM, the following commands are required:
> #
> # ifconfig eth0 172.20.0.2
> # route add default gw 172.20.0.1
> #
> intf=$1
> eth0_ipaddr=$(ifconfig eth0 | awk '/inet addr:/ {print substr($2, 6)}')
> 
> sudo sh << EOT
> /sbin/ifconfig $intf 172.20.0.1
> /sbin/route add -host 172.20.0.2 $intf
> /usr/sbin/iptables -t nat -F
> /usr/sbin/iptables -t nat -A POSTROUTING -j SNAT -o eth0 --to $eth0_ipaddr
> echo 1 > /proc/sys/net/ipv4/ip_forward
> EOT
> ---------------------------------------------------
> 
> Marc
> 
> Ludovic Gele wrote:
> 
> >Selon "Leonard T. Erwine" <lerwine@teamlightning.com>:
> >
> >>I have this problem with using qemu 0.5.5 under windows 98.
> >>
> >>I can ping the interface's own IP but can't see beyond that.
> >>
> >>I have screen captures of my settings and other relevant system data at
> >>http://www.lennyerwine.com/qemu-net.
> >>
> >>If anyone can help me with this problem, I will be GLAD to transform the
> >>aforementioned web page into a help document. If I can get past this, I
> >>plan on doing this for Win2K, Linux as well.
> >>
> >
> >Have you activate the ipforwarding on your host system? And the NAT?
> >
> >
> >
> >_______________________________________________
> >Qemu-devel mailing list
> >Qemu-devel@nongnu.org
> >http://lists.nongnu.org/mailman/listinfo/qemu-devel
> >
> 
> 
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] Mounting a disk image under Linux
  2004-06-16 21:41     ` Benjamin Brown
  2004-06-17  8:25       ` Johannes Schindelin
@ 2004-06-19 16:34       ` Benjamin Brown
  2004-06-19 16:39         ` Grzegorz Kulewski
                           ` (2 more replies)
  1 sibling, 3 replies; 22+ messages in thread
From: Benjamin Brown @ 2004-06-19 16:34 UTC (permalink / raw)
  To: qemu-devel

I created a disk image under (host) Linux using dd and fdisked and
formatted using a (guest)Windows 98 boot disk under QEMU.
I then tried to mount this under linux to add files to it using:

mount -o loop /opt/qemu/tempImage /mnt/tempImage

This failed and asked me for the filesystem type so I specified:

mount -o loop -t vfat /opt/qemu/tempImage /mnt/tempImage

This also failed with the error:

mount: wrong fs type, bad option, bad superblock on /dev/loop1,
or too many mounted file systems
(could this be the IDE device where you in fact use
ide-scsi so that sr0 or sda or so is needed?)

Any ideas why this happens - this should just a straight fat formatted
disk image?

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Mounting a disk image under Linux
  2004-06-19 16:34       ` [Qemu-devel] Mounting a disk image under Linux Benjamin Brown
@ 2004-06-19 16:39         ` Grzegorz Kulewski
  2004-06-19 16:40         ` Gianni Tedesco
  2004-06-19 17:31         ` Jim C. Brown
  2 siblings, 0 replies; 22+ messages in thread
From: Grzegorz Kulewski @ 2004-06-19 16:39 UTC (permalink / raw)
  To: Benjamin Brown; +Cc: qemu-devel

Yuo should mount it with offset (because of partition table). The right 
offset was posted several times to this list but I do not remember it. 
When you will find it you should add -o offset=xxxxx to mount command.


Grzegorz Kulewski


On Sat, 19 Jun 2004, Benjamin Brown wrote:

> I created a disk image under (host) Linux using dd and fdisked and
> formatted using a (guest)Windows 98 boot disk under QEMU.
> I then tried to mount this under linux to add files to it using:
> 
> mount -o loop /opt/qemu/tempImage /mnt/tempImage
> 
> This failed and asked me for the filesystem type so I specified:
> 
> mount -o loop -t vfat /opt/qemu/tempImage /mnt/tempImage
> 
> This also failed with the error:
> 
> mount: wrong fs type, bad option, bad superblock on /dev/loop1,
> or too many mounted file systems
> (could this be the IDE device where you in fact use
> ide-scsi so that sr0 or sda or so is needed?)
> 
> Any ideas why this happens - this should just a straight fat formatted
> disk image?

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Mounting a disk image under Linux
  2004-06-19 16:34       ` [Qemu-devel] Mounting a disk image under Linux Benjamin Brown
  2004-06-19 16:39         ` Grzegorz Kulewski
@ 2004-06-19 16:40         ` Gianni Tedesco
  2004-06-19 17:16           ` Benjamin Brown
  2004-06-19 17:31         ` Jim C. Brown
  2 siblings, 1 reply; 22+ messages in thread
From: Gianni Tedesco @ 2004-06-19 16:40 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

On Sat, 2004-06-19 at 17:34 +0100, Benjamin Brown wrote:
> I created a disk image under (host) Linux using dd and fdisked and
> formatted using a (guest)Windows 98 boot disk under QEMU.
> I then tried to mount this under linux to add files to it using:
> 
> mount -o loop /opt/qemu/tempImage /mnt/tempImage
> 
> This failed and asked me for the filesystem type so I specified:
> 
> mount -o loop -t vfat /opt/qemu/tempImage /mnt/tempImage
> 
> This also failed with the error:
> 
> mount: wrong fs type, bad option, bad superblock on /dev/loop1,
> or too many mounted file systems
> (could this be the IDE device where you in fact use
> ide-scsi so that sr0 or sda or so is needed?)
> 
> Any ideas why this happens - this should just a straight fat formatted
> disk image?

*bzzzt* it's partitioned ;)

You need to do losetup manually and specify an offset (`expr 512 \* 63`
usually).

-- 
// Gianni Tedesco (gianni at scaramanga dot co dot uk)
lynx --source www.scaramanga.co.uk/scaramanga.asc | gpg --import
8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Mounting a disk image under Linux
  2004-06-19 16:40         ` Gianni Tedesco
@ 2004-06-19 17:16           ` Benjamin Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Benjamin Brown @ 2004-06-19 17:16 UTC (permalink / raw)
  To: qemu-devel

Thanks.

I did an sfdisk on the file and added -o loop,32256 to the mount command.
I know nothing of low level stuff so thats quite an achievement for me, 
I learn something new everyday ;)

Benjamin


Gianni Tedesco wrote:

>On Sat, 2004-06-19 at 17:34 +0100, Benjamin Brown wrote:
>  
>
>>I created a disk image under (host) Linux using dd and fdisked and
>>formatted using a (guest)Windows 98 boot disk under QEMU.
>>I then tried to mount this under linux to add files to it using:
>>
>>mount -o loop /opt/qemu/tempImage /mnt/tempImage
>>
>>This failed and asked me for the filesystem type so I specified:
>>
>>mount -o loop -t vfat /opt/qemu/tempImage /mnt/tempImage
>>
>>This also failed with the error:
>>
>>mount: wrong fs type, bad option, bad superblock on /dev/loop1,
>>or too many mounted file systems
>>(could this be the IDE device where you in fact use
>>ide-scsi so that sr0 or sda or so is needed?)
>>
>>Any ideas why this happens - this should just a straight fat formatted
>>disk image?
>>    
>>
>
>*bzzzt* it's partitioned ;)
>
>You need to do losetup manually and specify an offset (`expr 512 \* 63`
>usually).
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Qemu-devel mailing list
>Qemu-devel@nongnu.org
>http://lists.nongnu.org/mailman/listinfo/qemu-devel
>  
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Mounting a disk image under Linux
  2004-06-19 16:34       ` [Qemu-devel] Mounting a disk image under Linux Benjamin Brown
  2004-06-19 16:39         ` Grzegorz Kulewski
  2004-06-19 16:40         ` Gianni Tedesco
@ 2004-06-19 17:31         ` Jim C. Brown
  2004-06-19 20:00           ` Gianni Tedesco
  2 siblings, 1 reply; 22+ messages in thread
From: Jim C. Brown @ 2004-06-19 17:31 UTC (permalink / raw)
  To: qemu-devel

On Sat, Jun 19, 2004 at 05:34:35PM +0100, Benjamin Brown wrote:
> I created a disk image under (host) Linux using dd and fdisked and
> formatted using a (guest)Windows 98 boot disk under QEMU.
> I then tried to mount this under linux to add files to it using:
> 
> mount -o loop /opt/qemu/tempImage /mnt/tempImage
> 
> This failed and asked me for the filesystem type so I specified:
> 
> mount -o loop -t vfat /opt/qemu/tempImage /mnt/tempImage
> 
> This also failed with the error:
> 
> mount: wrong fs type, bad option, bad superblock on /dev/loop1,
> or too many mounted file systems
> (could this be the IDE device where you in fact use
> ide-scsi so that sr0 or sda or so is needed?)
> 
> Any ideas why this happens - this should just a straight fat formatted
> disk image?
> 
> 

No its not. There is a partition table in it.

The quick and dirty way is to use this mount command:

mount -oloop,offset=sector_size*partition_start -t vfat /opt/qemu/tempImage /mnt/tempImage

sector_size is usually 512 and parition_start is usually 63. You can run

fdisk -lu /opt/qemu/tempImage

to be sure. I'm working on a wrapper called lomount that does this for you.
Basicly you call it like this:

lomount -t vfat -diskimage /opt/qemu/tempImage -partition 1 /mnt/tempImage

It works great but has a bug if you try to mount a partition which doesnt
exist.

> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel

-- 
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Useful Q&A
  2004-06-17  8:25       ` Johannes Schindelin
@ 2004-06-19 17:35         ` Benjamin Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Benjamin Brown @ 2004-06-19 17:35 UTC (permalink / raw)
  To: qemu-devel

Johannes Schindelin wrote:

>Hi,
>
>On Wed, 16 Jun 2004, Benjamin Brown wrote:
>  
>
>>>>Will support for newer graphics cards be included any time soon?
>>>>        
>>>>
>>>No.
>>>      
>>>
>>Is this sort of thing difficult (I've not written an emulator before)?
>>    
>>
>
>Why on earth would you want to do that? It is an *emulated* graphics card.
>So any card which works should be fine. There is no point of maintaining
>two or more solutions to the same problem.
>
>  
>
Perhaps to give it the edge over commercial solutions? I notice somebody 
recently mentioned open 3dfx specs were available. Don't get me wrong 
I'm all for the project plan of get everything working, then tune 
performance but asking the developers to at least consider the pros and 
cons of adding the support in the later stages of qemu dev (i.e. qemu 
1.5-2?). I've some simple pros/cons here, pls add more.
pro:
entices ppl from commercial products
will allow greater compat with direct 3d games (and effects)
con:
requires time
pos. v difficult

>>To me the i386 support seems to be pointless - anybody who is seriously
>>going to be running QEMU will be using a minimum of a i586 (K6-2,
>>Pentium etc), granted QEMU it is not intended for just this processor
>>platform - what is the justification for a 386 compatible version....? :)
>>    
>>
>
>Well, there is more to it than just focusing on the newest, fastest, best
>processor there is.
>
>  
>
Please elaborate on this point? I was suggesting upping the bar to i586, 
hardly cutting edge :)

>First, why do you suppose at all, that the main use of QEMU is on INTEL
>platform? There are quite a few 386 compatible processors, and while not
>exactly being slow, they do not all support INTEL extensions.
>  
>
I didn't in my day to day use I use Sparcs and ARM machines. I was 
suggesting extra compile support for i586 - that is when the more 
important issues have been rectified (i.e. bugs)

>Second, you need time to write the special support for all those
>extensions. Don't underestimate the effort!
>  
>
I realise its a lot of work but consider it to be of benefit in the 
later stages of the project especially as the projects main competitors 
are x86 based and currently have the perforamnce edge.

>Third, any day of the week I would rather fix things that don't work yet
>than fine tune some performance issues.
>
>  
>
Agreed. Bugs always come first.

>Fourth, I strongly doubt that supporting those extensions does have a high
>impact on performance: They are too special. They are mainly for large
>vector an matrix calculations, and last time I checked, a word processor
>does not really use many of those.
>
>  
>
They would be useful in software directx, multimedia and game usage...! :)

>>Excellent software all round - wish I had the technical know how!
>>    
>>
>
>Use the source, Luke!
>
>  
>
I'm perusing it now when I need to see how certain things work, but as a 
beginner C programmer I'm fairly useless in this respect!

>to contribute back what
>you learnt as a means of saying "Thanks".
>
>  
>
I'm considering a writing launcher, and time permitting figuring out how 
to grab the qemu display and fitting it into the launcher window.

Benjamin

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Mounting a disk image under Linux
  2004-06-19 17:31         ` Jim C. Brown
@ 2004-06-19 20:00           ` Gianni Tedesco
  2004-06-19 23:48             ` Jim C. Brown
  0 siblings, 1 reply; 22+ messages in thread
From: Gianni Tedesco @ 2004-06-19 20:00 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

On Sat, 2004-06-19 at 13:31 -0400, Jim C. Brown wrote:
> lomount -t vfat -diskimage /opt/qemu/tempImage -partition 1 /mnt/tempImage
> 
> It works great but has a bug if you try to mount a partition which doesnt
> exist.

Sounds great. Perhaps it could be included with qemu, (at least in souce
dist!)?

Do you want to post it on the list to fix it? Or have you just not had
time?

-- 
// Gianni Tedesco (gianni at scaramanga dot co dot uk)
lynx --source www.scaramanga.co.uk/scaramanga.asc | gpg --import
8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] Mounting a disk image under Linux
  2004-06-19 20:00           ` Gianni Tedesco
@ 2004-06-19 23:48             ` Jim C. Brown
  2004-06-20  8:20               ` Mulyadi Santosa
  0 siblings, 1 reply; 22+ messages in thread
From: Jim C. Brown @ 2004-06-19 23:48 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]

On Sat, Jun 19, 2004 at 09:00:30PM +0100, Gianni Tedesco wrote:
> On Sat, 2004-06-19 at 13:31 -0400, Jim C. Brown wrote:
> > lomount -t vfat -diskimage /opt/qemu/tempImage -partition 1 /mnt/tempImage
> > 
> > It works great but has a bug if you try to mount a partition which doesnt
> > exist.
> 
> Sounds great. Perhaps it could be included with qemu, (at least in souce
> dist!)?

Sure. I have no problems with that.

> 
> Do you want to post it on the list to fix it? Or have you just not had
> time?

I wrote it in under an hour, right before I went to bed. I've attached the
source code here but be warned: its very ugly. Very little error checking.
Expects fdisk to work right (which in turns means it assumes fdisk is being
passed a valid image with a valid parition table).

When I have some free time I'll try to clean it up. Right now it's full
of ugly hacks. (It was originally meant to be a shell script not a C program,
only my shell programming skills did not extend so far.)

> 
> -- 
> // Gianni Tedesco (gianni at scaramanga dot co dot uk)
> lynx --source www.scaramanga.co.uk/scaramanga.asc | gpg --import
> 8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D



> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel


-- 
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

[-- Attachment #2: lomount.c --]
[-- Type: text/plain, Size: 2703 bytes --]

#include <stdio.h>
#include <stdlib.h>

#define BUF 4096
#define TEMPFILE "/tmp/temp.minix"

int partnum(char * diskimage, FILE * temp, int * pnum)
{
	int num=0, c, i;
	char buf[BUF], buf2[BUF];
	strncpy(buf, diskimage, BUF);
	strncat(buf, "%d", BUF-strlen(buf));
	fscanf(temp, buf, pnum); /* skip start of line */
#ifdef DEBUG
	printf("pnum = %d\n", *pnum);
#endif
	c = fgetc(temp);
	while (c == ' ' || c == '*' || c == '@')
	{
		c = fgetc(temp);
#ifdef DEBUG
		printf("c = %d ", c);
#endif
	}
	/*ungetc(c, temp);
	fscanf(temp, "%d", &num);*/
#ifdef DEBUG
	printf("c = %d\n", c);
#endif
	buf2[0] = c;
	c = fgetc(temp);
	i = 1;
	while (c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9')
	{
		buf2[i] = c;
		c = fgetc(temp);
		i++;
	}
	buf2[i] = '\0';
	num = atoi(buf2);
#ifdef DEBUG
	printf("buf2 = %s num = %d\n", buf2, num);
#endif
	fgets(buf, BUF, temp); /* skip rest of line */
	return num;
}

int main(int argc, char ** argv)
{
	FILE * temp;
	char buf[BUF], argv2[BUF], diskimage[BUF];
	int partition = 1, sec1, sec2, num = 0, pnum = 0, len = BUF, i, f = 0;
	for (i = 1; i < argc; i ++)
	{
		if (strncmp(argv[i], "-diskimage", BUF)==0)
		{
			strncpy(diskimage, argv[i+1], BUF);
			i++; f = 1;
		}
		else if (strncmp(argv[i], "-partition", BUF)==0)
		{
			partition = atoi(argv[i+1]);
			i++;
			if (partition < 1) partition = 1;
		}
		else
		{
			strncat(argv2, argv[i], len);
			strncat(argv2, " ", len-1);
			len -= strlen(argv[i]);
			len--;
		}
	}
	if (!f)
	{
		printf("You must specify -diskimage and -partition\n");
		printf("ex. lomount -t fs-type -diskimage hda.img -partition 1 /mnt\n");
		return 0;
	}
	snprintf(buf, BUF, "fdisk -lu %s > %s 2>&1", diskimage, TEMPFILE);
	system(buf);
	temp = fopen(TEMPFILE, "r");
	fgets(buf, BUF, temp); /* skip first line */
#ifdef DEBUG
	printf("spare line: %s\n", buf);
#endif
	fgets(buf, BUF, temp); /* skip second line */
#ifdef DEBUG
	printf("spare line: %s\n", buf);
#endif
	fgets(buf, BUF, temp); /* skip third line */
#ifdef DEBUG
	printf("spare line: %s\n", buf);
#endif
	fgets(buf, BUF, temp); /* skip fourth line */
#ifdef DEBUG
	printf("spare line: %s\n", buf);
#endif
	fscanf(temp, "Units = sectors of %d * %d bytes\n", &sec1, &sec2);
#ifdef DEBUG
	printf("sec1: %d sec2: %d\n", sec1, sec2);
#endif
	fgets(buf, BUF, temp); /* skip sixth line */
#ifdef DEBUG
	printf("spare line: %s\n", buf);
#endif
	while (pnum != partition)
	{
		num = partnum(diskimage, temp, &pnum);
	}
	fclose(temp);
	pnum = sec1 * sec2 * num;
#ifdef DEBUG
	printf("offset = %d\n", pnum);
#endif
	snprintf(buf, BUF, "echo mount -oloop,offset=%d %s %s", pnum, diskimage, argv2);
	return system(buf);
}

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Re: [Qemu-devel] Mounting a disk image under Linux
  2004-06-19 23:48             ` Jim C. Brown
@ 2004-06-20  8:20               ` Mulyadi Santosa
  0 siblings, 0 replies; 22+ messages in thread
From: Mulyadi Santosa @ 2004-06-20  8:20 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

Hello all

I take Jim's program and add some checking of fdisk output. Basically, it just 
skip the output :

"You must set cylinders.
You can do this from the extra functions menu"

I got this message when  run fdisk -lu, so I skip them until I get following 
lines:
"Disk /mnt/qemu/myimage: 0 MB, 0 bytes"

And the rest of the program is pretty similar

regards

Mulyadi



[-- Attachment #2: lomount.c --]
[-- Type: text/x-csrc, Size: 2787 bytes --]

#include <stdio.h>
#include <stdlib.h>
#include <strings.h>

#define BUF 4096
#define TEMPFILE "/tmp/temp.minix"

int partnum(char * diskimage, FILE * temp, int * pnum)
{
	int num=0, c, i;
	char buf[BUF], buf2[BUF];
	strncpy(buf, diskimage, BUF);
	strncat(buf, "%d", BUF-strlen(buf));
	fscanf(temp, buf, pnum); /* skip start of line */
#ifdef DEBUG
	printf("pnum = %d\n", *pnum);
#endif
	c = fgetc(temp);
	while (c == ' ' || c == '*' || c == '@')
	{
		c = fgetc(temp);
#ifdef DEBUG
		printf("c = %d ", c);
#endif
	}
	/*ungetc(c, temp);
	fscanf(temp, "%d", &num);*/
#ifdef DEBUG
	printf("c = %d\n", c);
#endif
	buf2[0] = c;
	c = fgetc(temp);
	i = 1;
	while (c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9')
	{
		buf2[i] = c;
		c = fgetc(temp);
		i++;
	}
	buf2[i] = '\0';
	num = atoi(buf2);
#ifdef DEBUG
	printf("buf2 = %s num = %d\n", buf2, num);
#endif
	fgets(buf, BUF, temp); /* skip rest of line */
	return num;
}

int main(int argc, char ** argv)
{
	FILE * temp;
	char buf[BUF], argv2[BUF], diskimage[BUF];
	int partition = 1, sec1, sec2, num = 0, pnum = 0, len = BUF, i, f = 0;
	int total_sec;
	int pressed_key=0;
	for (i = 1; i < argc; i ++)
	{
		if (strncmp(argv[i], "-diskimage", BUF)==0)
		{
			strncpy(diskimage, argv[i+1], BUF);
			i++; f = 1;
		}
		else if (strncmp(argv[i], "-partition", BUF)==0)
		{
			partition = atoi(argv[i+1]);
			i++;
			if (partition < 1) partition = 1;
		}
		else
		{
			strncat(argv2, argv[i], len);
			strncat(argv2, " ", len-1);
			len -= strlen(argv[i]);
			len--;
		}
	}
	if (!f)
	{
		printf("You must specify -diskimage and -partition\n");
		printf("ex. lomount -t fs-type -diskimage hda.img -partition 1 /mnt\n");
		return 0;
	}
	snprintf(buf, BUF, "/sbin/fdisk -lu %s > %s 2>&1", diskimage, TEMPFILE);
	system(buf);
	temp = fopen(TEMPFILE, "r");

	do
	{
	    fgets(buf, BUF, temp); /* skip until we get "Disk" */
		
	} while (strncasecmp(buf, "Disk", 4)!=0);
	fgets(buf, BUF, temp); //skip once more
	fscanf(temp, "Units = sectors of %d * %d = %d bytes\n", &sec1, &sec2, &total_sec);
#ifdef DEBUG
	printf("sec1: %d sec2: %d\n", sec1, sec2);
#endif
	fgets(buf, BUF, temp); /* skip sixth line */
#ifdef DEBUG
	printf("spare line: %s\n", buf);
#endif
	while (pnum != partition)
	{
		num = partnum(diskimage, temp, &pnum);
	}
	fclose(temp);
	pnum = sec1 * sec2 * num;
#ifdef DEBUG
	printf("offset = %d\n", pnum);
#endif
	snprintf(buf, BUF, "mount -oloop,offset=%d %s %s", pnum, diskimage, argv2);
		
	printf("Do you want to execute mount command? [Y/n] ");
	pressed_key=getchar();
	
	/* if user press Enter (that means YES), or 'y' or 'Y'
	then execute the  command
	 */
	if ( (pressed_key==10) || (pressed_key==89) || (pressed_key==121) )
	{
	    system(buf);
	}
	return 0;
}

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2004-06-21 16:21 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-16 14:42 [Qemu-devel] some help Ludovic Gele
2004-06-16 19:13 ` [Qemu-devel] Can't see network under qemu 0.5.5 Leonard T. Erwine
2004-06-17  8:22   ` Ludovic Gele
2004-06-17 15:39     ` Marc Vertes
2004-06-18 20:58       ` Leonard T. Erwine
2004-06-18 20:34     ` Leonard T. Erwine
2004-06-16 20:26 ` [Qemu-devel] Useful Q&A Benjamin Brown
2004-06-16 20:35   ` Bartosz Fabianowski
2004-06-17 10:42     ` Antony T Curtis
2004-06-16 21:02   ` Fabrice Bellard
2004-06-16 21:16     ` malc
2004-06-16 21:41     ` Benjamin Brown
2004-06-17  8:25       ` Johannes Schindelin
2004-06-19 17:35         ` Benjamin Brown
2004-06-19 16:34       ` [Qemu-devel] Mounting a disk image under Linux Benjamin Brown
2004-06-19 16:39         ` Grzegorz Kulewski
2004-06-19 16:40         ` Gianni Tedesco
2004-06-19 17:16           ` Benjamin Brown
2004-06-19 17:31         ` Jim C. Brown
2004-06-19 20:00           ` Gianni Tedesco
2004-06-19 23:48             ` Jim C. Brown
2004-06-20  8:20               ` Mulyadi Santosa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).