Re: [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall.

2007-11-20 Thread Tomoyoshi ASANO

Hello,

I tested big-endian binaries by sh4(eb)-linux-user 
with a small patch(attached) for building sh4eb-linux-user.
But I don't understand that this patch is needed or not.

sh4eb-linux-user is OK using static link binaries.

But I feel that sh4eb-linux-users has some problem(?)
using dynamic link binaries.

1) If host-os has /etc/ld.so.cache, sh4eb-linux-users is NG.

[EMAIL PROTECTED] ~] qemu-sh4eb -strace /usr/qemu-sh4eb/bin/busybox
28575 uname(0x4007f818) = 0
28575 brk(0,132617,1074264468,57,1074325300,4096) = 0x00487000
28575 access("/etc/ld.so.preload",04) = -1 errno=2 (No such file or 
directory)
28575 open("/etc/ld.so.cache",0,01) = 3
28575 fstat64(3,0x4007f234) = 0
28575 mmap(0,66277,1,2,3,0) = 0x42081000
28575 close(3) = 0
Unhandled trap: 0xa0
pc=0x400870d0 sr=0x8001 pr=0x40086e32 fpscr=0x0008
r0=0x0348 r1=0xb61a0ff4 r2=0x2a2c1010 r3=0x000c
r4=0x400a4000 r5=0x40092afc r6=0x000b r7=0x0002
r8=0x7411fff4 r9=0x000102e5 r10=0x1f017fff r11=0x17dd02d5
r12=0x400a4000 r13=0x3e02 r14=0x4007f2b0 r15=0x4007f2b0
r16=0x r17=0x r18=0x r19=0x
r20=0x r21=0x r22=0x r23=0x

But if no /etc/ld.so.cache in host-os, sh4eb-linux-users is OK.

2) If host-os has /lib/tls/*, sh4eb-linux-users is NG.

[EMAIL PROTECTED] ~] qemu-sh4eb -strace /usr/qemu-sh4eb/bin/busybox
28580 uname(0x4007f818) = 0
28580 brk(0,132617,1074264468,57,1074325300,4096) = 0x00487000
28580 access("/etc/ld.so.preload",04) = -1 errno=2 (No such file or 
directory)
28580 open("/etc/ld.so.cache",0,01) = -1 errno=2 (No such file or 
directory)
28580 open("/lib/tls/libm.so.6",0,012) = 3
28580 read(3,0x4007f308,512) = 512
28580 close(3) = 0
28580 writev(2,0x4007efb8,0xa)/usr/qemu-sh4eb/bin/busybox: error 
while loading shared libraries: /lib/tls/libm.so.6: ELF file data
encoding not big-endian
 = 125
28580 exit_group(127)

But if no /lib/tls in host-os, sh4eb-linux-users is OK.

please help if possible.

Thanks,
--

On Wed, 21 Nov 2007 10:43:49 +0900
Tomoyoshi ASANO <[EMAIL PROTECTED]> wrote:

> Hell,
> 
> This is very nice!
> 
> I tested using glibc-2.5
> It seems good.
> 
> Thank you
> 
> On Wed, 21 Nov 2007 09:24:41 +0900
> "Magnus Damm" <[EMAIL PROTECTED]> wrote:
> 
> > Hi there,
> > 
> > On Nov 20, 2007 11:48 PM,  <[EMAIL PROTECTED]> wrote:
> > > I found 6th arg for syscall is missing on SH4 linux-user emulation.
> > > This seems to be the cause of shared library mapping failure.
> > > I successfully run shared-lib'd binary, after applying following fix.
> > 
> > Hehe, I managed to create the exact same patch yesterday evening. So
> > this email is just to acknowledge this fix. Dynamically linked
> > binaries using uclibc-0.9.29 or glibc-2.3.6 both work well. Thank you.
> > 
> > / magnus
> > 
> 


qemu-snapshot-sh4eb.patch
Description: Binary data


[Qemu-devel] [PATCH] sparc32 iommu fix

2007-11-20 Thread Robert Reif

Set initial value of AFSR register properly.
Index: hw/iommu.c
===
RCS file: /sources/qemu/qemu/hw/iommu.c,v
retrieving revision 1.19
diff -p -u -r1.19 iommu.c
--- hw/iommu.c  17 Nov 2007 17:14:42 -  1.19
+++ hw/iommu.c  21 Nov 2007 04:30:28 -
@@ -311,6 +311,7 @@ static void iommu_reset(void *opaque)
 s->iostart = 0;
 s->regs[IOMMU_CTRL] = s->version;
 s->regs[IOMMU_ARBEN] = IOMMU_MID;
+s->regs[IOMMU_AFSR] = 0x0080;
 }
 
 void *iommu_init(target_phys_addr_t addr, uint32_t version)


[Qemu-devel] Re: [PATCH] 06_efault.5.timespec.patch

2007-11-20 Thread Thayne Harbaugh
This uses __get_user()/__put_user() for copy_{to,from}_user_timespec().
It checks and handles return values.
Index: qemu/linux-user/syscall.c
===
--- qemu.orig/linux-user/syscall.c	2007-11-20 13:21:38.0 -0700
+++ qemu/linux-user/syscall.c	2007-11-20 13:51:28.0 -0700
@@ -3026,28 +3026,36 @@
 }
 #endif
 
-static inline abi_long target_to_host_timespec(struct timespec *host_ts,
-   abi_ulong target_addr)
+static inline abi_long copy_from_user_timespec(struct timespec *host_ts,
+   abi_ulong target_ts_addr)
 {
 struct target_timespec *target_ts;
 
-if (!lock_user_struct(VERIFY_READ, target_ts, target_addr, 1))
+if (!lock_user_struct(VERIFY_READ, target_ts, target_ts_addr, 1))
 return -TARGET_EFAULT;
-host_ts->tv_sec = tswapl(target_ts->tv_sec);
-host_ts->tv_nsec = tswapl(target_ts->tv_nsec);
-unlock_user_struct(target_ts, target_addr, 0);
+
+__get_user(host_ts->tv_sec, &target_ts->tv_sec);
+__get_user(host_ts->tv_nsec, &target_ts->tv_nsec);
+
+unlock_user_struct(target_ts, target_ts_addr, 0);
+
+return 0;
 }
 
-static inline abi_long host_to_target_timespec(abi_ulong target_addr,
-   struct timespec *host_ts)
+static inline abi_long copy_to_user_timespec(abi_ulong target_ts_addr,
+ const struct timespec *host_ts)
 {
 struct target_timespec *target_ts;
 
-if (!lock_user_struct(VERIFY_WRITE, target_ts, target_addr, 0))
+if (!lock_user_struct(VERIFY_WRITE, target_ts, target_ts_addr, 0))
 return -TARGET_EFAULT;
-target_ts->tv_sec = tswapl(host_ts->tv_sec);
-target_ts->tv_nsec = tswapl(host_ts->tv_nsec);
-unlock_user_struct(target_ts, target_addr, 1);
+
+__put_user(host_ts->tv_sec, &target_ts->tv_sec);
+__put_user(host_ts->tv_nsec, &target_ts->tv_nsec);
+
+unlock_user_struct(target_ts, target_ts_addr, 1);
+
+return 0;
 }
 
 /* do_syscall() should always have a single exit point at the end so
@@ -3855,7 +3863,8 @@
 unlock_user(p, arg1, 0);
 if (arg3) {
 puts = &uts;
-target_to_host_timespec(puts, arg3);
+if (copy_from_user_timespec(puts, arg3))
+goto efault;
 } else {
 puts = NULL;
 }
@@ -4807,17 +4816,21 @@
 struct timespec ts;
 ret = get_errno(sched_rr_get_interval(arg1, &ts));
 if (!is_error(ret)) {
-host_to_target_timespec(arg2, &ts);
+if (copy_to_user_timespec(arg2, &ts))
+goto efault;
 }
 }
 break;
 case TARGET_NR_nanosleep:
 {
 struct timespec req, rem;
-target_to_host_timespec(&req, arg1);
+
+if (copy_from_user_timespec(&req, arg1))
+goto efault;
 ret = get_errno(nanosleep(&req, &rem));
-if (is_error(ret) && arg2) {
-host_to_target_timespec(arg2, &rem);
+if (!is_error(ret) && arg2) {
+if (copy_to_user_timespec(arg2, &rem))
+goto efault;
 }
 }
 break;
@@ -5491,7 +5504,8 @@
 struct timespec ts;
 ret = get_errno(clock_gettime(arg1, &ts));
 if (!is_error(ret)) {
-host_to_target_timespec(arg2, &ts);
+if (copy_to_user_timespec(arg2, &ts))
+goto efault;
 }
 break;
 }
@@ -5502,7 +5516,8 @@
 struct timespec ts;
 ret = get_errno(clock_getres(arg1, &ts));
 if (!is_error(ret)) {
-host_to_target_timespec(arg2, &ts);
+if (copy_to_user_timespec(arg2, &ts))
+goto efault;
 }
 break;
 }
@@ -5535,8 +5550,10 @@
 case TARGET_NR_utimensat:
 {
 struct timespec ts[2];
-target_to_host_timespec(ts, arg3);
-target_to_host_timespec(ts+1, arg3+sizeof(struct target_timespec));
+
+if (copy_from_user_timespec(ts, arg3)
+|| copy_from_user_timespec(ts+1, arg3+sizeof(struct target_timespec)))
+goto efault;
 if (!arg2)
 ret = get_errno(sys_utimensat(arg1, NULL, ts, arg4));
 else {


[Qemu-devel] Re: [PATCH] 06_efault.4.patch - timeval

2007-11-20 Thread Thayne Harbaugh
This is the EFAULT for copy_{to,from}_user_timeval().  This updates to
use __get_user()/__put_user(), check return values of
copy_{to,from}_user_timeval().
Index: qemu/linux-user/syscall.c
===
--- qemu.orig/linux-user/syscall.c	2007-11-20 12:52:33.0 -0700
+++ qemu/linux-user/syscall.c	2007-11-20 12:52:47.0 -0700
@@ -552,30 +552,34 @@
 return 0;
 }
 
-static inline abi_long target_to_host_timeval(struct timeval *tv,
-  abi_ulong target_addr)
+static inline abi_long copy_from_user_timeval(struct timeval *tv,
+  abi_ulong target_tv_addr)
 {
 struct target_timeval *target_tv;
 
-if (!lock_user_struct(VERIFY_READ, target_tv, target_addr, 1))
+if (!lock_user_struct(VERIFY_READ, target_tv, target_tv_addr, 1))
 return -TARGET_EFAULT;
-tv->tv_sec = tswapl(target_tv->tv_sec);
-tv->tv_usec = tswapl(target_tv->tv_usec);
-unlock_user_struct(target_tv, target_addr, 0);
+
+__get_user(tv->tv_sec, &target_tv->tv_sec);
+__get_user(tv->tv_usec, &target_tv->tv_usec);
+
+unlock_user_struct(target_tv, target_tv_addr, 0);
 
 return 0;
 }
 
-static inline abi_long host_to_target_timeval(abi_ulong target_addr,
-  const struct timeval *tv)
+static inline abi_long copy_to_user_timeval(abi_ulong target_tv_addr,
+const struct timeval *tv)
 {
 struct target_timeval *target_tv;
 
-if (!lock_user_struct(VERIFY_WRITE, target_tv, target_addr, 0))
+if (!lock_user_struct(VERIFY_WRITE, target_tv, target_tv_addr, 0))
 return -TARGET_EFAULT;
-target_tv->tv_sec = tswapl(tv->tv_sec);
-target_tv->tv_usec = tswapl(tv->tv_usec);
-unlock_user_struct(target_tv, target_addr, 1);
+
+__put_user(tv->tv_sec, &target_tv->tv_sec);
+__put_user(tv->tv_usec, &target_tv->tv_usec);
+
+unlock_user_struct(target_tv, target_tv_addr, 1);
 
 return 0;
 }
@@ -614,7 +618,8 @@
 }
 
 if (target_tv_addr) {
-target_to_host_timeval(&tv, target_tv_addr);
+if (copy_from_user_timeval(&tv, target_tv_addr))
+return -TARGET_EFAULT;
 tv_ptr = &tv;
 } else {
 tv_ptr = NULL;
@@ -630,8 +635,8 @@
 if (efd_addr && copy_to_user_fdset(efd_addr, &efds, n))
 return -TARGET_EFAULT;
 
-if (target_tv_addr)
-host_to_target_timeval(target_tv_addr, &tv);
+if (target_tv_addr && copy_to_user_timeval(target_tv_addr, &tv))
+return -TARGET_EFAULT;
 }
 
 return ret;
@@ -3392,9 +3397,10 @@
 {
 struct timeval *tvp, tv[2];
 if (arg2) {
-target_to_host_timeval(&tv[0], arg2);
-target_to_host_timeval(&tv[1],
-arg2 + sizeof (struct target_timeval));
+if (copy_from_user_timeval(&tv[0], arg2)
+|| copy_from_user_timeval(&tv[1],
+  arg2 + sizeof(struct target_timeval)))
+goto efault;
 tvp = tv;
 } else {
 tvp = NULL;
@@ -3934,14 +3940,16 @@
 struct timeval tv;
 ret = get_errno(gettimeofday(&tv, NULL));
 if (!is_error(ret)) {
-host_to_target_timeval(arg1, &tv);
+if (copy_to_user_timeval(arg1, &tv))
+goto efault;
 }
 }
 break;
 case TARGET_NR_settimeofday:
 {
 struct timeval tv;
-target_to_host_timeval(&tv, arg1);
+if (copy_from_user_timeval(&tv, arg1))
+goto efault;
 ret = get_errno(settimeofday(&tv, NULL));
 }
 break;
@@ -4316,19 +4324,20 @@
 
 if (arg2) {
 pvalue = &value;
-target_to_host_timeval(&pvalue->it_interval,
-   arg2);
-target_to_host_timeval(&pvalue->it_value,
-   arg2 + sizeof(struct target_timeval));
+if (copy_from_user_timeval(&pvalue->it_interval, arg2)
+|| copy_from_user_timeval(&pvalue->it_value,
+  arg2 + sizeof(struct target_timeval)))
+goto efault;
 } else {
 pvalue = NULL;
 }
 ret = get_errno(setitimer(arg1, pvalue, &ovalue));
 if (!is_error(ret) && arg3) {
-host_to_target_timeval(arg3,
-   &ovalue.it_interval);
-host_to_target_timeval(arg3 + sizeof(struct target_timeval),
-   &ovalue.it_value);
+if (copy_to_user_timeval(arg3,
+ &ovalue.it_interv

Re: [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall.

2007-11-20 Thread Tomoyoshi ASANO
Hell,

This is very nice!

I tested using glibc-2.5
It seems good.

Thank you

On Wed, 21 Nov 2007 09:24:41 +0900
"Magnus Damm" <[EMAIL PROTECTED]> wrote:

> Hi there,
> 
> On Nov 20, 2007 11:48 PM,  <[EMAIL PROTECTED]> wrote:
> > I found 6th arg for syscall is missing on SH4 linux-user emulation.
> > This seems to be the cause of shared library mapping failure.
> > I successfully run shared-lib'd binary, after applying following fix.
> 
> Hehe, I managed to create the exact same patch yesterday evening. So
> this email is just to acknowledge this fix. Dynamically linked
> binaries using uclibc-0.9.29 or glibc-2.3.6 both work well. Thank you.
> 
> / magnus
> 

-- あさの





Re: [Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall.

2007-11-20 Thread Magnus Damm
Hi there,

On Nov 20, 2007 11:48 PM,  <[EMAIL PROTECTED]> wrote:
> I found 6th arg for syscall is missing on SH4 linux-user emulation.
> This seems to be the cause of shared library mapping failure.
> I successfully run shared-lib'd binary, after applying following fix.

Hehe, I managed to create the exact same patch yesterday evening. So
this email is just to acknowledge this fix. Dynamically linked
binaries using uclibc-0.9.29 or glibc-2.3.6 both work well. Thank you.

/ magnus




[Qemu-devel] kqemu in x86_64: (host) exception 0x0d in monitor space

2007-11-20 Thread Mike Peters
Hi,

Is there any known fix for the issue reported previously here -
http://www.mail-archive.com/qemu-devel@nongnu.org/msg06241.html

I'm seeing the same issue trying to install ubuntu-7.10-server-amd64 on
ubuntu-7.10-desktop-amd64 (2.6.22-14-generic #1 SMP) using the
current Ubuntu distributed qemu-0.9.0-2ubuntu4 and kqemu 1.3.0-pre11

I'm running qemu with:
qemu-system-x86_64 -hda ubuntu-server.img
-cdrom ubuntu-7.10-server-amd64.iso -boot d -m 256

The install starts but aborts after the language select screen with:

RAX=2b9063757fe0 RBX=7fff47352fc0 RCX=
RDX=000a24fd61624b91 RSI= RDI=7fff47352fc0
RBP=7fff47352fb0 RSP=7fff47352f90 R8 = R9
= R10= R11=0200
R12= R13= R14=
R15= RIP=2b9063757ffe RFL=00010202 [---] CPL=3
II=0 A20=1 SMM=0 HLT=0 ES =    CS
=0033   00affb00 SS =002b 
 00cff300 DS =   
FS =   
GS =   
LDT=   8000
TR =0040 810001005000 206f 01008900
GDT= 8058 0080
IDT= 805de000 0fff
CR0=8005003b CR2=2b9063972be0 CR3=01094000 CR4=06e0
Unsupported return value: 0x

/var/log/messages shows:

Nov 20 23:21:46 rincewind kernel: [1419344.733628] kqemu: aborting:
Unexpected e xception 0x0d in monitor space
Nov 20 23:21:46 rincewind kernel: [1419344.733633] err=
CS:EIP=f180: f0001f77 SS:SP=:f00c6df0


Everything runs fine (if very slow) when I append the -no-kqemu
option to the startup.

Thanks
-- 
Mike
Web Site: http://www.ice2o.com
Photos: http://www.flickr.com/photos/mikedpeters/
Registered Linux User #247123

Q:  What's a WASP's idea of open-mindedness?
A:  Dating a Canadian.




Re: [Qemu-devel] Online image backup

2007-11-20 Thread Fabrice Bellard
Matteo Bertini wrote:
> Hello everyone,
> 
> is there any support for an online image backup? Or some direction to
> have it?
> 
> Imagine I have an emulated server. How can I make an online backup of
> the server state?
> 
> If I'm right in the actual design this is very hard.
> 
> Or there are some image internals update rules that permit a consistent
> copy possible?

It should not be difficult provided the VM is using the QEMU qcow2 image
format (doing a backup can be seen as a kind of snapshot).

Fabrice.




[Qemu-devel] Online image backup

2007-11-20 Thread Matteo Bertini
Hello everyone,

is there any support for an online image backup? Or some direction to
have it?

Imagine I have an emulated server. How can I make an online backup of
the server state?

If I'm right in the actual design this is very hard.

Or there are some image internals update rules that permit a consistent
copy possible?

Regards,
Matteo Bertini





Re: [Qemu-devel] qemu block-vvfat.c block.c console.c dyngen.c e...

2007-11-20 Thread Igor Kovalenko
On Nov 18, 2007 4:44 AM, Paul Brook <[EMAIL PROTECTED]> wrote:
> CVSROOT:/sources/qemu
> Module name:qemu
> Changes by: Paul Brook  07/11/18 01:44:38
>
> Modified files:
> .  : block-vvfat.c block.c console.c dyngen.c
>  elf_ops.h i386-dis.c loader.c monitor.c osdep.c
>  qemu-char.h translate-op.c usb-linux.c vl.c
>  vnc.c x_keymap.c
> audio  : audio.c
> hw : arm_sysctl.c arm_timer.c gt64xxx.c i8259.c
>  ide.c mc146818rtc.c mcf_fec.c mips_malta.c
>  ne2000.c nvram.h omap.c omap.h omap_lcdc.c
>  parallel.c pc.c pci.c pckbd.c piix_pci.c
>  pl061.c pl190.c pxa2xx_lcd.c pxa2xx_pcmcia.c
>  realview_gic.c rtl8139.c sd.c sh_serial.c
>  sh_timer.c smbus.c stellaris.c usb-ohci.c
>  wm8750.c
> target-i386: helper.c
>
> Log message:
> Add statics and missing #includes for prototypes.
>

Here is a patch to hw/rtl8139.c which makes it reuse eeprom
implementation available in eeprom93xx.

-- 
Kind regards,
Igor V. Kovalenko


qemu-rtl8139-use-eeprom93xx-impl.patch
Description: Binary data


[Qemu-devel] [PATCH] Fix warning from qemu-doc.texi and more

2007-11-20 Thread Stefan Weil
Hi,

"make info" gives a warning:

makeinfo /head/qemu-doc.texi -o qemu-doc.info
/head/qemu-doc.texi:949: warning: unlikely character , in @var.

As I noticed an inconsistent usage of @var in qemu-doc.texi, I did
not stop after fixing this warning but re-worked other parts, too.

My patch fixes

* Warning from makeinfo (see above)
* Usage of @var (I hope that I got all places...)
* Replace "and and" by just "and"
* Added a "." at the end of selected items (in item list where
  most other items had one, too)

Please apply the patch to CVS HEAD.

Regards
Stefan



Index: qemu-doc.texi
===
RCS file: /sources/qemu/qemu/qemu-doc.texi,v
retrieving revision 1.166
diff -u -r1.166 qemu-doc.texi
--- qemu-doc.texi	11 Nov 2007 17:56:38 -	1.166
+++ qemu-doc.texi	20 Nov 2007 21:38:08 -
@@ -199,7 +199,7 @@
 
 @example
 @c man begin SYNOPSIS
-usage: qemu [options] [disk_image]
+usage: qemu [options] [EMAIL PROTECTED]
 @c man end
 @end example
 
@@ -208,22 +208,22 @@
 
 General options:
 @table @option
[EMAIL PROTECTED] -M machine
-Select the emulated machine (@code{-M ?} for list)
[EMAIL PROTECTED] -M @var{machine}
+Select the emulated @var{machine} (@code{-M ?} for list)
 
[EMAIL PROTECTED] -fda file
[EMAIL PROTECTED] -fdb file
[EMAIL PROTECTED] -fda @var{file}
[EMAIL PROTECTED] -fdb @var{file}
 Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}). You can
 use the host floppy by using @file{/dev/fd0} as filename (@pxref{host_drives}).
 
[EMAIL PROTECTED] -hda file
[EMAIL PROTECTED] -hdb file
[EMAIL PROTECTED] -hdc file
[EMAIL PROTECTED] -hdd file
[EMAIL PROTECTED] -hda @var{file}
[EMAIL PROTECTED] -hdb @var{file}
[EMAIL PROTECTED] -hdc @var{file}
[EMAIL PROTECTED] -hdd @var{file}
 Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}).
 
[EMAIL PROTECTED] -cdrom file
-Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and and
[EMAIL PROTECTED] -cdrom @var{file}
+Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and
 @option{-cdrom} at the same time). You can use the host CD-ROM by
 using @file{/dev/cdrom} as filename (@pxref{host_drives}).
 
@@ -240,10 +240,10 @@
 Disable boot signature checking for floppy disks in Bochs BIOS. It may
 be needed to boot from old floppy disks.
 
[EMAIL PROTECTED] -m megs
-Set virtual RAM size to @var{megs} megabytes. Default is 128 MB.
[EMAIL PROTECTED] -m @var{megs}
+Set virtual RAM size to @var{megs} megabytes. Default is 128 MiB.
 
[EMAIL PROTECTED] -smp n
[EMAIL PROTECTED] -smp @var{n}
 Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255
 CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs
 to 4.
@@ -253,7 +253,7 @@
 Will show the audio subsystem help: list of drivers, tunable
 parameters.
 
[EMAIL PROTECTED] -soundhw card1,card2,... or -soundhw all
[EMAIL PROTECTED] -soundhw @var{card1}[,@var{card2},...] or -soundhw all
 
 Enable audio and selected sound hardware. Use ? to print all
 available sound hardware.
@@ -270,12 +270,12 @@
 time). This option is needed to have correct date in MS-DOS or
 Windows.
 
[EMAIL PROTECTED] -startdate date
[EMAIL PROTECTED] -startdate @var{date}
 Set the initial date of the real time clock. Valid format for
 @var{date} are: @code{now} or @code{2006-06-17T16:01:21} or
 @code{2006-06-17}. The default value is @code{now}.
 
[EMAIL PROTECTED] -pidfile file
[EMAIL PROTECTED] -pidfile @var{file}
 Store the QEMU process PID in @var{file}. It is useful if you launch QEMU
 from a script.
 
@@ -290,13 +290,14 @@
 Windows 2000 is installed, you no longer need this option (this option
 slows down the IDE transfers).
 
[EMAIL PROTECTED] -option-rom file
-Load the contents of file as an option ROM.  This option is useful to load
-things like EtherBoot.
-
[EMAIL PROTECTED] -name string
-Sets the name of the guest.  This name will be display in the SDL window
-caption.  The name will also be used for the VNC server.
[EMAIL PROTECTED] -option-rom @var{file}
+Load the contents of @var{file} as an option ROM.
+This option is useful to load things like EtherBoot.
+
[EMAIL PROTECTED] -name @var{name}
+Sets the @var{name} of the guest.
+This name will be display in the SDL window caption.
+The @var{name} will also be used for the VNC server.
 
 @end table
 
@@ -320,7 +321,7 @@
 @item -full-screen
 Start in full screen.
 
[EMAIL PROTECTED] -vnc display[,option[,option[,...]]]
[EMAIL PROTECTED] -vnc @var{display}[,@var{option}[,@var{option}[,...]]]
 
 Normally, QEMU uses SDL to display the VGA output.  With this option,
 you can have QEMU listen on VNC display @var{display} and redirect the VGA
@@ -332,18 +333,18 @@
 
 @table @code
 
[EMAIL PROTECTED] @var{interface:d}
[EMAIL PROTECTED] @var{interface}:@var{d}
 
 TCP connections will only be allowed from @var{interface} on display @var{d}.
 By convention the TCP port is [EMAIL PROTECTED] Optionally, @var{interface} can
 be omitted in which case the server will bind to

Re: [Qemu-devel] qemu fpu/softfloat-specialize.h fpu/softfloat.c...

2007-11-20 Thread Paul Brook
> > Log message:
> > Add strict checking mode for softfp code.
>
> This commit has broken sparc-softmmu,

Strange. My intention was for this commit to have absolutely no functional 
changes.

FWIW I verified that the debian-sparc installer image booted successfully. I 
guess this probably doesn't stress the FPU much though.

> This and a couple similar changes look suspicious:
>            && ( (sbits64) ( zSig + roundIncrement ) < 0 ) )
>     ) {
>      float_raise( float_flag_overflow | float_flag_inexact STATUS_VAR);
> -    return packFloat64( zSign, 0x7FF, 0 ) - ( roundIncrement == 0 );
> +    return packFloat64( zSign, 0x7FF, - ( roundIncrement == 0 )); }

I'm pretty sure this change is correct. ie. it has no effect on the result.

Paul




Re: [Qemu-devel] qemu fpu/softfloat-specialize.h fpu/softfloat.c...

2007-11-20 Thread Blue Swirl
On 11/18/07, Paul Brook <[EMAIL PROTECTED]> wrote:
> CVSROOT:/sources/qemu
> Module name:qemu
> Changes by: Paul Brook  07/11/18 14:33:24
>
> Modified files:
> fpu: softfloat-specialize.h softfloat.c softfloat.h
> target-arm/nwfpe: double_cpdo.c single_cpdo.c
> target-m68k: helper.c op.c
> target-mips: op_helper.c
>
> Log message:
> Add strict checking mode for softfp code.

This commit has broken sparc-softmmu, for example Aurora 1.0 normally prints:
Running anaconda - please wait...
Probing for video card:   Sun TCX (8bit)
Probing for monitor type: Unable to probe
Probing for mouse type:   Sun - Mouse

After this commit:
Running anaconda - please wait...
Traceback (innermost last):
  File "/usr/bin/anaconda", line 67, in ?
import dispatch
  File "/usr/lib/anaconda/dispatch.py", line 29, in ?
from bootloader import writeBootloader, bootloaderSetupChoices
  File "/usr/lib/anaconda/bootloader.py", line 21, in ?
import whrandom
  File "/usr/lib/python1.5/whrandom.py", line 140, in ?
_inst = whrandom()
  File "/usr/lib/python1.5/whrandom.py", line 46, in __init__
self.seed(x, y, z)
  File "/usr/lib/python1.5/whrandom.py", line 59, in seed
t = long(time.time() * 256)
IOError: [Errno 2] No such file or directory
install exited abnormally
sending termination signals...done
sending kill signals...done
disabling swap...
unmounting filesystems...
/mnt/runtime done
disabling /dev/loop0
/proc/openprom done
/proc done
/dev/pts done
/mnt/source done
ejecting /tmp/cdrom...
you may safely reboot your system


This and a couple similar changes look suspicious:
   && ( (sbits64) ( zSig + roundIncrement ) < 0 ) )
) {
 float_raise( float_flag_overflow | float_flag_inexact STATUS_VAR);
-return packFloat64( zSign, 0x7FF, 0 ) - ( roundIncrement == 0 );
+return packFloat64( zSign, 0x7FF, - ( roundIncrement == 0 ));
 }
 if ( zExp < 0 ) {
 isTiny =




[Qemu-devel] Re: [PATCH] 06_efault.3.patch - copy_from_user_fdset()

2007-11-20 Thread Thayne Harbaugh

On Tue, 2007-11-20 at 12:08 -0700, Thayne Harbaugh wrote:
> This updates target_to_host_fds() to match the copy_from_user() code.
> It drops some unused variables, checks and handles return values for
> copy_from_user_fdset() and corrects an error where the "n" value was
> incorrectly multiplied with abi_long instead of used as one greater than
> the number of descriptors (which are bits).

The previous patch missed a minor detail.  This is an update to make the
"fd_set *fds" parameter of copy_to_user_fdset() into "const fd_set
*fds".
Index: qemu/linux-user/syscall.c
===
--- qemu.orig/linux-user/syscall.c	2007-11-20 11:53:16.0 -0700
+++ qemu/linux-user/syscall.c	2007-11-20 12:52:33.0 -0700
@@ -443,50 +443,66 @@
 }
 }
 
-static inline fd_set *target_to_host_fds(fd_set *fds,
- abi_long *target_fds, int n)
+static inline abi_long copy_from_user_fdset(fd_set *fds,
+abi_ulong target_fds_addr,
+int n)
 {
-#if !defined(BSWAP_NEEDED) && !defined(WORDS_BIGENDIAN)
-return (fd_set *)target_fds;
-#else
-int i, b;
-if (target_fds) {
-FD_ZERO(fds);
-for(i = 0;i < n; i++) {
-b = (tswapl(target_fds[i / TARGET_ABI_BITS]) >>
- (i & (TARGET_ABI_BITS - 1))) & 1;
-if (b)
-FD_SET(i, fds);
+int i, nw, j, k;
+abi_ulong b, *target_fds;
+
+nw = (n + TARGET_ABI_BITS - 1) / TARGET_ABI_BITS;
+if (!(target_fds = lock_user(VERIFY_READ,
+ target_fds_addr,
+ sizeof(abi_ulong) * nw,
+ 1)))
+return -TARGET_EFAULT;
+
+FD_ZERO(fds);
+k = 0;
+for (i = 0; i < nw; i++) {
+/* grab the abi_ulong */
+__get_user(b, &target_fds[i]);
+for (j = 0; j < TARGET_ABI_BITS; j++) {
+/* check the bit inside the abi_ulong */
+if ((b >> j) & 1)
+FD_SET(k, fds);
+k++;
 }
-return fds;
-} else {
-return NULL;
 }
-#endif
+
+unlock_user(target_fds, target_fds_addr, 0);
+
+return 0;
 }
 
-static inline void host_to_target_fds(abi_long *target_fds,
-  fd_set *fds, int n)
+static inline abi_long copy_to_user_fdset(abi_ulong target_fds_addr,
+  const fd_set *fds,
+  int n)
 {
-#if !defined(BSWAP_NEEDED) && !defined(WORDS_BIGENDIAN)
-/* nothing to do */
-#else
 int i, nw, j, k;
 abi_long v;
+abi_ulong *target_fds;
 
-if (target_fds) {
-nw = (n + TARGET_ABI_BITS - 1) / TARGET_ABI_BITS;
-k = 0;
-for(i = 0;i < nw; i++) {
-v = 0;
-for(j = 0; j < TARGET_ABI_BITS; j++) {
-v |= ((FD_ISSET(k, fds) != 0) << j);
-k++;
-}
-target_fds[i] = tswapl(v);
+nw = (n + TARGET_ABI_BITS - 1) / TARGET_ABI_BITS;
+if (!(target_fds = lock_user(VERIFY_WRITE,
+ target_fds_addr,
+ sizeof(abi_ulong) * nw,
+ 0)))
+return -TARGET_EFAULT;
+
+k = 0;
+for (i = 0; i < nw; i++) {
+v = 0;
+for (j = 0; j < TARGET_ABI_BITS; j++) {
+v |= ((FD_ISSET(k, fds) != 0) << j);
+k++;
 }
+__put_user(v, &target_fds[i]);
 }
-#endif
+
+unlock_user(target_fds, target_fds_addr, sizeof(abi_ulong) * nw);
+
+return 0;
 }
 
 #if defined(__alpha__)
@@ -567,74 +583,57 @@
 
 /* do_select() must return target values and target errnos. */
 static abi_long do_select(int n,
-  abi_ulong rfd_p, abi_ulong wfd_p,
-  abi_ulong efd_p, abi_ulong target_tv)
+  abi_ulong rfd_addr, abi_ulong wfd_addr,
+  abi_ulong efd_addr, abi_ulong target_tv_addr)
 {
 fd_set rfds, wfds, efds;
 fd_set *rfds_ptr, *wfds_ptr, *efds_ptr;
-abi_long *target_rfds, *target_wfds, *target_efds;
 struct timeval tv, *tv_ptr;
 abi_long ret;
-int ok;
 
-if (rfd_p) {
-target_rfds = lock_user(VERIFY_WRITE, rfd_p, sizeof(abi_long) * n, 1);
-if (!target_rfds) {
-ret = -TARGET_EFAULT;
-goto end;
-}
-rfds_ptr = target_to_host_fds(&rfds, target_rfds, n);
+if (rfd_addr) {
+if (copy_from_user_fdset(&rfds, rfd_addr, n))
+return -TARGET_EFAULT;
+rfds_ptr = &rfds;
 } else {
-target_rfds = NULL;
 rfds_ptr = NULL;
 }
-if (wfd_p) {
-target_wfds = lock_user(VERIFY_WRITE, wfd_p, sizeof(abi_long) * n, 1);
-if (!target_wfds) {
-ret = -TARGET_EFAULT;
-goto end;
-

[Qemu-devel] Re: [PATCH] 06_efault.3.patch - copy_from_user_fdset()

2007-11-20 Thread Thayne Harbaugh
This updates target_to_host_fds() to match the copy_from_user() code.
It drops some unused variables, checks and handles return values for
copy_from_user_fdset() and corrects an error where the "n" value was
incorrectly multiplied with abi_long instead of used as one greater than
the number of descriptors (which are bits).
Index: qemu/linux-user/syscall.c
===
--- qemu.orig/linux-user/syscall.c	2007-11-17 09:00:14.0 -0700
+++ qemu/linux-user/syscall.c	2007-11-17 09:09:08.0 -0700
@@ -443,50 +443,66 @@
 }
 }
 
-static inline fd_set *target_to_host_fds(fd_set *fds,
- abi_long *target_fds, int n)
+static inline abi_long copy_from_user_fdset(fd_set *fds,
+abi_ulong target_fds_addr,
+int n)
 {
-#if !defined(BSWAP_NEEDED) && !defined(WORDS_BIGENDIAN)
-return (fd_set *)target_fds;
-#else
-int i, b;
-if (target_fds) {
-FD_ZERO(fds);
-for(i = 0;i < n; i++) {
-b = (tswapl(target_fds[i / TARGET_ABI_BITS]) >>
- (i & (TARGET_ABI_BITS - 1))) & 1;
-if (b)
-FD_SET(i, fds);
+int i, nw, j, k;
+abi_ulong b, *target_fds;
+
+nw = (n + TARGET_ABI_BITS - 1) / TARGET_ABI_BITS;
+if (!(target_fds = lock_user(VERIFY_READ,
+ target_fds_addr,
+ sizeof(abi_ulong) * nw,
+ 1)))
+return -TARGET_EFAULT;
+
+FD_ZERO(fds);
+k = 0;
+for (i = 0; i < nw; i++) {
+/* grab the abi_ulong */
+__get_user(b, &target_fds[i]);
+for (j = 0; j < TARGET_ABI_BITS; j++) {
+/* check the bit inside the abi_ulong */
+if ((b >> j) & 1)
+FD_SET(k, fds);
+k++;
 }
-return fds;
-} else {
-return NULL;
 }
-#endif
+
+unlock_user(target_fds, target_fds_addr, 0);
+
+return 0;
 }
 
-static inline void host_to_target_fds(abi_long *target_fds,
-  fd_set *fds, int n)
+static inline abi_long copy_to_user_fdset(abi_ulong target_fds_addr,
+  fd_set *fds,
+  int n)
 {
-#if !defined(BSWAP_NEEDED) && !defined(WORDS_BIGENDIAN)
-/* nothing to do */
-#else
 int i, nw, j, k;
 abi_long v;
+abi_ulong *target_fds;
 
-if (target_fds) {
-nw = (n + TARGET_ABI_BITS - 1) / TARGET_ABI_BITS;
-k = 0;
-for(i = 0;i < nw; i++) {
-v = 0;
-for(j = 0; j < TARGET_ABI_BITS; j++) {
-v |= ((FD_ISSET(k, fds) != 0) << j);
-k++;
-}
-target_fds[i] = tswapl(v);
+nw = (n + TARGET_ABI_BITS - 1) / TARGET_ABI_BITS;
+if (!(target_fds = lock_user(VERIFY_WRITE,
+ target_fds_addr,
+ sizeof(abi_ulong) * nw,
+ 0)))
+return -TARGET_EFAULT;
+
+k = 0;
+for (i = 0; i < nw; i++) {
+v = 0;
+for (j = 0; j < TARGET_ABI_BITS; j++) {
+v |= ((FD_ISSET(k, fds) != 0) << j);
+k++;
 }
+__put_user(v, &target_fds[i]);
 }
-#endif
+
+unlock_user(target_fds, target_fds_addr, sizeof(abi_ulong) * nw);
+
+return 0;
 }
 
 #if defined(__alpha__)
@@ -567,74 +583,57 @@
 
 /* do_select() must return target values and target errnos. */
 static abi_long do_select(int n,
-  abi_ulong rfd_p, abi_ulong wfd_p,
-  abi_ulong efd_p, abi_ulong target_tv)
+  abi_ulong rfd_addr, abi_ulong wfd_addr,
+  abi_ulong efd_addr, abi_ulong target_tv_addr)
 {
 fd_set rfds, wfds, efds;
 fd_set *rfds_ptr, *wfds_ptr, *efds_ptr;
-abi_long *target_rfds, *target_wfds, *target_efds;
 struct timeval tv, *tv_ptr;
 abi_long ret;
-int ok;
 
-if (rfd_p) {
-target_rfds = lock_user(VERIFY_WRITE, rfd_p, sizeof(abi_long) * n, 1);
-if (!target_rfds) {
-ret = -TARGET_EFAULT;
-goto end;
-}
-rfds_ptr = target_to_host_fds(&rfds, target_rfds, n);
+if (rfd_addr) {
+if (copy_from_user_fdset(&rfds, rfd_addr, n))
+return -TARGET_EFAULT;
+rfds_ptr = &rfds;
 } else {
-target_rfds = NULL;
 rfds_ptr = NULL;
 }
-if (wfd_p) {
-target_wfds = lock_user(VERIFY_WRITE, wfd_p, sizeof(abi_long) * n, 1);
-if (!target_wfds) {
-ret = -TARGET_EFAULT;
-goto end;
-}
-wfds_ptr = target_to_host_fds(&wfds, target_wfds, n);
+if (wfd_addr) {
+if (copy_from_user_fdset(&wfds, wfd_addr, n))
+return -TARGET_EFAULT;
+wfds_ptr = &wfds;
 } else {
-

[Qemu-devel] [PATCH] additional EFAULT patches

2007-11-20 Thread Thayne Harbaugh
These are some additional EFAULT patches.  They improve the code
consistency, check return values of copy_{to,from}_user() operations and
provide minor fixes.





[Qemu-devel] kqemu on celeron 64-bit (fwd)

2007-11-20 Thread Ryan Jud Hughes
Hi.  I'm not sure this message made it to the list (I never saw it come 
back), so I'm re-sending it.  If it actually did make it before, I 
apologize.


Thanks.
--Ryan

-- Forwarded message --
Date: Sat, 17 Nov 2007 12:13:45 -0500 (EST)
From: Ryan Jud Hughes <[EMAIL PROTECTED]>
To: qemu-devel@nongnu.org
Subject: kqemu on celeron 64-bit

Hi.  I'm attempting to run qemu with kqemu on an intel celeron host, with a 
variety of guests, and getting no luck.


I've got a few different guests I'm trying:
1. Damn-Small Linux, a 32bit linux 2.4 kernel.
2. Puppy Linux, a 32bit linux 2.6 kernel.
3. Debian businesscard, a 64bit linux 2.6 kernel.

Lemme show you what versions of things I'm using:
QEMU PC emulator version 0.9.0, Copyright (c) 2003-2007 Fabrice Bellard
(I downloaded the source and compiled it)

kqemu, I got the source package from ubuntu gutsy:  1.3.0~pre11-6

Linux version 2.6.22-14-generic ([EMAIL PROTECTED]) (gcc version 4.1.3 20070929 
(prerelease) (Ubuntu 4.1.2-16ubuntu2)) #1 SMP Sun Oct 14 21:45:15 GMT 2007

cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model   : 22
model name  : Intel(R) Celeron(R) CPU  530  @ 1.73GHz
stepping: 1
cpu MHz : 1729.066
cache size  : 1024 KB
fpu : yes
fpu_exception   : yes
cpuid level : 10
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss tm syscall nx lm constant_tsc 
up pni monitor ds_cpl tm2 ssse3 cx16 xtpr lahf_lm

bogomips: 3463.63
clflush size: 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:




All of these things work if kqemu is not enabled.  Here's how they fail if I do 
try to use kqemu and qemu-system-x86_64:


1. Damn-Small Linux begins to start Xwindows, and then hangs with a black
   screen indefinitely.
2. Puppy Linux prints a kernel crash onto the SDL screen.  I can't figure
   out how to get it to run with a serial console, though.  Otherwise, I
   would've loved to have copy/pasted it here.  I included a screenshot of
   that one.
3. Debian businesscard actually crashed the whole emulator.  This is what
   it printed on my console after it crashed.

RAX= RBX=80451ca0 RCX=001c 
RDX=804c0ec0
RSI=001c RDI=80451ca0 RBP=0286 
RSP=804c0ee0
R8 =0011 R9 =804c0ec0 R10=804c0f30 
R11=81000729bce0
R12=8100070d23c0 R13= R14=0246 
R15=810007efc800

RIP=80287a84 RFL=00010206 [-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =   
CS =0010   00af9a00
SS =0018   00cf9300
DS =   
FS =   
GS = 80521000  
LDT=   8000
TR =0040 810001003000 206f 01008900
GDT= 80532000 0080
IDT= 804c7000 0fff
CR0=8005003b CR2=2ab0bfbd3880 CR3=072a7000 CR4=06e0
Unsupported return value: 0x


I don't know if the debugging info I've provided is the right stuff, so tell me 
if you need anything else.



Thanks.
--Ryan<>

[Qemu-devel] qemu/linux-user main.c

2007-11-20 Thread Thiemo Seufer
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Thiemo Seufer  07/11/20 15:22:45

Modified files:
linux-user : main.c 

Log message:
SH4 Fix missing 6th arg of syscall, by "takasi-y".

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/linux-user/main.c?cvsroot=qemu&r1=1.155&r2=1.156




[Qemu-devel] [PATCH] SH4 Fix missing 6th arg of syscall.

2007-11-20 Thread takasi-y
Hello,

I found 6th arg for syscall is missing on SH4 linux-user emulation.
This seems to be the cause of shared library mapping failure.
I successfully run shared-lib'd binary, after applying following fix.
/yoshii

diff -u -r1.155 main.c
--- a/linux-user/main.c 17 Nov 2007 01:37:43 -  1.155
+++ b/linux-user/main.c 20 Nov 2007 14:09:59 -
@@ -1613,7 +1613,7 @@
  env->gregs[6],
  env->gregs[7],
  env->gregs[0],
- 0);
+ env->gregs[1]);
 env->gregs[0] = ret;
 env->pc += 2;
 break;




[Qemu-devel] trying to run rtmach with -kernel-kqemu

2007-11-20 Thread Robert William Fuller
Hi,

I have rtmach running in qemu, but I am having trouble with
-kernel-kqemu.  rtmach seems to be using a system call/return mechanism
unexpected by -kernel-kqemu.  Please see the linked to jpeg.  I'm using
the CVS version of qemu from November 19.

http://img337.imageshack.us/my.php?image=rtmachst2.jpg

Regards,

Rob




[Qemu-devel] PATCH: add input buffer to mux chr

2007-11-20 Thread Tristan Gingold

Hi,

when the -nographic switch is set, the input can be blocked if the OS  
doesn't read bytes.  This can be
boring especially when the OS is frozen and you'd like to quit qemu  
or inspect registers.


I propose a solution for this issue: add input buffers to the mux  
chr.  Characters are accepted as long as

the buffer is not full, but escape to monitor is always allowed.

Tested for ppc-softmmu, compiled on all targets but cris.

Tristan.


qemu.diff
Description: Binary data


[Qemu-devel] qemu/hw omap.c omap.h

2007-11-20 Thread Andrzej Zaborowski
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Andrzej Zaborowski  07/11/20 11:15:27

Modified files:
hw : omap.c omap.h 

Log message:
OMAP LPGs (LED pulse generators).
OMAP MPUI bridge config register.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/omap.c?cvsroot=qemu&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/omap.h?cvsroot=qemu&r1=1.18&r2=1.19




Re: [Qemu-devel] [PATCH] allow setting static devfn values for pci devices from the command line

2007-11-20 Thread Izik Eidus

Jocelyn Mayer wrote:

On Mon, 2007-11-19 at 18:53 +0200, Izik Eidus wrote:
  

Izik Eidus wrote:


hi,
this patch make it possible to define from the command line a static 
devfn value for each pci

device.
it was wrote for addressing a problem that right now qemu devices get 
their devfn in random way

(almost random)
the problem with this is that with adding and removing devices some 
devfn values can be changed

for each device.
this make (at least) windows unable to understand what happned to your 
device and mark it

in yellow color. (and will want you to reinstall it)

in this patch i simply use the device name that was registred with the 
pci device registration

function.
in case you have few devices from the same type (same name), it will 
simply increase each by one
so in this case all you have to do is give long enough  offset for the 
devfns from each other.


thanks
  

ok here is a fix to two issues that i noticed:
1.in one place i declared static_devfns[MAX_PCI_DEVICS][64] and in other 
place: static_devfns[MAX_PCI_DEVICS][128]


2.in one place i did a calculation on a pointer line before i checked if 
it is vaild pointer...


anyway here it is again and fixed.



It seems that you cannot impose the PCI device numbers mapping, which is
likely to be architecture dependant. What you could however change is
the PCI bus & slot the device is inserted into, the same way you can
choose the PCI slot you put a PCI card into on a real machine. The
architecture could then determine what is the corresponding PCI device
number, given this PCI bus & slot numbers.

i will check this.

For other PCI devices, like PCI bridges or other internal devices, the
PCI slots / devfn are fixed by the architecture. You cannot change them
in any way, then it seems pointless to have an option that would change
the behavior for any of those devices.
The last problem I see is that it seems very ugly to hardcode the device
names the way you did in vl.c. This is even false in most cases, as most
of those devices are only available for a few machines and are not
tunable at all (for example macio or uninorth are only available in some
Apple Mac machines, not even all). 
  

so how will i inform the user with the devices name?