* [Qemu-devel] Run program without kernel. Possible? (part 2) @ 2006-07-18 18:16 Luis Pureza 2006-07-18 18:27 ` Johannes Schindelin 2006-07-18 19:52 ` Marco Matthies 0 siblings, 2 replies; 5+ messages in thread From: Luis Pureza @ 2006-07-18 18:16 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 345 bytes --] Hi, First, let me apologise if this isn't the right place for asking this. Yesterday I posted this thread ( http://qemu.dad-answers.com/viewtopic.php?t=1804) on the general help forum, but it seems I got no answer. This is kinda urgent and I'd really appreciate any help. Again, sorry for being a stubborn Thanks, Luís Pureza [-- Attachment #2: Type: text/html, Size: 430 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Run program without kernel. Possible? (part 2) 2006-07-18 18:16 [Qemu-devel] Run program without kernel. Possible? (part 2) Luis Pureza @ 2006-07-18 18:27 ` Johannes Schindelin 2006-07-19 12:23 ` Luis Pureza 2006-07-18 19:52 ` Marco Matthies 1 sibling, 1 reply; 5+ messages in thread From: Johannes Schindelin @ 2006-07-18 18:27 UTC (permalink / raw) To: qemu-devel Hi, Yes. To a certain extent: If you run x86 linux, and you want to execute a program for PPC linux, you can use the usermode emulation (-user). Unfortunately, this is only possible if you run Linux _and_ the program is for Linux (on another CPU). If you want to do this for Darwin, you might be lucky with the usermode emulation of darwine (which is not yet merged with mainstream QEmu, unfortunately). Maybe you want to ask in a more precise fashion what you want to achieve? Ciao, Dscho ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Run program without kernel. Possible? (part 2) 2006-07-18 18:27 ` Johannes Schindelin @ 2006-07-19 12:23 ` Luis Pureza 2006-07-19 13:20 ` Blue Swirl 0 siblings, 1 reply; 5+ messages in thread From: Luis Pureza @ 2006-07-19 12:23 UTC (permalink / raw) To: qemu-devel [-- Attachment #1.1: Type: text/plain, Size: 3098 bytes --] Hi, I think you got it right. I compiled a small test program on linux/x86 using a cross compiler that generates sparc binaries. Then I tried to emulate it (still on linux/x86) using $ qemu-sparc -d in_asm program and it starts emulating but then fails: Unhandled trap: 0x2 pc: 40002bac npc: 40002bb0 General Registers: %g0: 00000000 %g1: 40002bac %g2: 00000000 %g3: 00000000 %g4: 40002800 %g5: 00000000 %g6: 00000000 %g7: 00000000 Current Register Window: %o0: 00000000 %o1: 00000000 %o2: 00000000 %o3: 00000000 %o4: 00000000 %o5: 00000000 %o6: b7dbb2a0 %o7: 40002b00 %l0: 00000000 %l1: 00000000 %l2: 00000000 %l3: 00000000 %l4: 00000000 %l5: 00000000 %l6: 00000000 %l7: 00000000 %i0: 00000000 %i1: 00000000 %i2: 00000000 %i3: 00000000 %i4: 00000000 %i5: 00000000 %i6: 00000000 %i7: 00000000 Floating Point Registers: <All 0> psr: 0x04000000 -> ---- --- wim: 0x00000001 fsr: 0x00000000 According to the SPARC manual that is an illegal instruction trap. The log contains: ########################################################## start end size prot 40000000-40004000 00004000 rwx b7d76000-b7df6000 00080000 rw- b7df6000-b7df7000 00001000 --- start_brk 0x40003adc end_code 0x400038c4 start_code 0x40000000 end_data 0x400038c4 start_stack 0xb7df52e0 brk 0x40003adc entry 0x40000000 -------------- IN: 0x40000000: mov %g0, %g4 0x40000004: sethi %hi(0x40002800), %g4 0x40000008: jmp %g4 + 0x2f8 ! 0x40002af8 0x4000000c: nop -------------- IN: 0x40002af8: sethi %hi(0x40002800), %g1 0x40002afc: or %g1, 0x3ac, %g1 ! 0x40002bac 0x40002b00: call %g1 0x40002b04: nop -------------- IN: 0x40002bac: rd %psr, %l3 ########################################################## This last instruction seems to be completely legal, so I don't really know what's happening... The source for the program is in attachment. Thanks for your help. Luís Pureza P.S.: By the way, every time I tried qemu-i386 using examples from the official documentation, it failed with this error: cannot set up thread-local storage: set_thread_area failed when setting up thread-local storage Seems to be something related to my glibc. My problem? On 7/18/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote: > > Hi, > > Yes. To a certain extent: If you run x86 linux, and you want to execute a > program for PPC linux, you can use the usermode emulation (-user). > > Unfortunately, this is only possible if you run Linux _and_ the program is > for Linux (on another CPU). > > If you want to do this for Darwin, you might be lucky with the usermode > emulation of darwine (which is not yet merged with mainstream QEmu, > unfortunately). > > Maybe you want to ask in a more precise fashion what you want to achieve? > > Ciao, > Dscho > > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel > [-- Attachment #1.2: Type: text/html, Size: 3697 bytes --] [-- Attachment #2: teste3.c --] [-- Type: text/x-csrc, Size: 50 bytes --] int main(void) { int i; i = 3 + 4; return 0; } ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Run program without kernel. Possible? (part 2) 2006-07-19 12:23 ` Luis Pureza @ 2006-07-19 13:20 ` Blue Swirl 0 siblings, 0 replies; 5+ messages in thread From: Blue Swirl @ 2006-07-19 13:20 UTC (permalink / raw) To: pureza; +Cc: qemu-devel >IN: >0x40002bac: rd %psr, %l3 >########################################################## >This last instruction seems to be completely legal, so I don't really >know what's happening... User mode emulator does not allow supervisor mode instructions at all. Try the system emulator (qemu-system-sparc) instead, or compile your program so that the startup code doesn't use any supervisor instructions. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Run program without kernel. Possible? (part 2) 2006-07-18 18:16 [Qemu-devel] Run program without kernel. Possible? (part 2) Luis Pureza 2006-07-18 18:27 ` Johannes Schindelin @ 2006-07-18 19:52 ` Marco Matthies 1 sibling, 0 replies; 5+ messages in thread From: Marco Matthies @ 2006-07-18 19:52 UTC (permalink / raw) To: qemu-devel [sorry for posting this back to the list, but i'm too lazy to register for the forum] Luis Pureza wrote: > Is it possible to run some program with qemu without a kernel attached? > > I'm involved in a project to create an emulator for the leon2 processor (which is sparc-like). In order to estimate the kind of performance gains we can achieve using dynamic transalation, I'd like to run some small benchmarks without the overhead of the operative system. If i understand you correctly, you want to try qemu-user. Beware that when benchmarking, qemu-user should probably be faster than qemu-system, as it doesn't have to emulate the os and hardware. Marco ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-07-19 13:21 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-07-18 18:16 [Qemu-devel] Run program without kernel. Possible? (part 2) Luis Pureza 2006-07-18 18:27 ` Johannes Schindelin 2006-07-19 12:23 ` Luis Pureza 2006-07-19 13:20 ` Blue Swirl 2006-07-18 19:52 ` Marco Matthies
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).