Author Topic: QEMU question  (Read 18152 times)

0 Members and 1 Guest are viewing this topic.

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
QEMU question
« on: April 03, 2005, 04:26:18 pm »
Anyone have a linux box they can download qemu and try executing some of the phatbox software using their arm user mode emulator?

I'd be curious if you can get things to run under there.  I'd try the current release and one of the old BMW ones thats not signed and see if you can get the code to exectue.

Offline para

  • Senior Member
  • Veteran.
  • *****
  • Posts: 181
Re: QEMU question
« Reply #1 on: April 03, 2005, 06:21:02 pm »
I posted something similar:
http://forum.phathack.com/cgi-bin/yabb/YaBB.cgi?board=dmshack;action=display;num=1111072896

So if one doesn't work, try another emu...

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: QEMU question
« Reply #2 on: April 03, 2005, 06:28:35 pm »
Update

busybox from the ramdisk image will run under qemu BUT I cant execute any of the files located on /dos mount point.

I think theres a missing / hidden file of ld-linux.so.2 located in /dos/lib

I dont know where it uncompresses from but its GOT to be there for these to work and if I can get my hands on it I can start emulating the other phatbox files.

Offline balle

  • A few posts under my belt.
  • *
  • Posts: 18
  • Wannabe...
Re: QEMU question
« Reply #3 on: April 03, 2005, 06:30:15 pm »
Quote
Anyone have a linux box they can download qemu and try executing some of the phatbox software using their arm user mode emulator?

Have tried to play with this, and can run the applications (hdparm, 51d, phat, phatd and such), but I have not been able to establish a complete phat-environment where I boot from the kernel. Booting a x86-kernel looks like it works and to me it looks like the -kernel parameter is ignored when you run qemu-arm.

Maybe I am missing some parts, I have only done a 'apt-get install qemu' in a Debian system.

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: QEMU question
« Reply #4 on: April 03, 2005, 06:35:41 pm »
balle,

can you get any options or output from the 51d or phatd?  or the progpld ?  I want to see how they work.

thanks in advance.

I downloaded qemu and run qemu-arm ./phatd and it fails to run.

are you doing anything else?

Offline balle

  • A few posts under my belt.
  • *
  • Posts: 18
  • Wannabe...
Re: QEMU question
« Reply #5 on: April 03, 2005, 06:47:32 pm »
Quote
balle, can you get any options or output from the 51d or phatd?  or the progpld ?  I want to see how they work.


Code: [Select]

peregrin:/usr/local/Phat/PHTSYS# qemu-arm ./hdparm -V
hdparm v3.9
peregrin:/usr/local/Phat/PHTSYS#


The next is with /dos not mounted
Code: [Select]
peregrin:/usr/local/Phat/PHTSYS# qemu-arm ./phatd
74.52:phatd:main      : Corrupted /dos/pkeys2.e
qemu: uncaught target signal 2 (Interrupt) - exiting
peregrin:/usr/local/Phat/PHTSYS#


And with /dos mounted
Code: [Select]

peregrin:/dos# qemu-arm ./phatd
bind: Invalid argument
peregrin:/dos#


If I strace(1) the last command I see that the error is
bind(5, {sa_family=AF_FILE, path="/tmp/phatsock"}, 112) = -1 EINVAL.
Don't remember much about socket-programming, but maybe descriptor 5 already is used in my system or something?

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: QEMU question
« Reply #6 on: April 03, 2005, 06:50:49 pm »
could you run the progpld command for me as well?

What did you do to get your qemu environment working?  just compile it or install the rpms?  were there any other libraries you got ahold of?
« Last Edit: April 03, 2005, 06:52:02 pm by judb »

Offline balle

  • A few posts under my belt.
  • *
  • Posts: 18
  • Wannabe...
Re: QEMU question
« Reply #7 on: April 03, 2005, 06:54:36 pm »
Quote
What did you do to get your qemu environment working?  just compile it or install the rpms?  were there any other libraries you got ahold of?


Running Debian. Just did a 'apt-get install qemu' and voila..

But it did download a couple of dependencys also;

Depends: libc6 (>= 2.3.2.ds1-4), libsdl1.2debian (>> 1.2.7-0), zlib1g (>= 1:1.2.1), vgabios, bochsbios, sharutils

But I don't know if these are really needed.

Offline balle

  • A few posts under my belt.
  • *
  • Posts: 18
  • Wannabe...
Re: QEMU question
« Reply #8 on: April 03, 2005, 06:55:44 pm »
Quote
could you run the progpld command for me as well?


Code: [Select]

peregrin:/dos# qemu-arm ./progpld
usage: ./progpld filename.dat
peregrin:/dos# qemu-arm ./progpld prog.bif
progpld prog.bif
programming prog.bif
*................................................................................................5498 bytes
ok
peregrin:/dos#


Will try to debug this and see where it actually did put those bytes..

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: QEMU question
« Reply #9 on: April 03, 2005, 06:59:09 pm »
hope that didnt just reprogeam something on your motherboard :)

try renaming the .sig file for prog.bif and see if that file still executes.

Offline balle

  • A few posts under my belt.
  • *
  • Posts: 18
  • Wannabe...
Re: QEMU question
« Reply #10 on: April 03, 2005, 07:09:04 pm »
Quote
hope that didnt just reprogeam something on your motherboard :)

try renaming the .sig file for prog.bif and see if that file still executes.


Same results with or without sigfiles for prog.bif.

Nope, I don't think I have reprogrammed anything here, but the though hit me the first time I ran this, as I do run all this as root as I though that it was required (it isn't).

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: QEMU question
« Reply #11 on: April 03, 2005, 07:15:30 pm »
I have poured over the ramdisk and nothing in it seems to require any sig files... so the kernel or the boot loader have to be mounting the PHATSYS partition and scanning for these as if you modify rc.sh (which is called by inittab via /etc/init.d/rcS)

Who's got the kernel source?  I need a copy of it please.

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: QEMU question
« Reply #12 on: April 03, 2005, 07:16:29 pm »
Quote

Same results with or without sigfiles for prog.bif.

Nope, I don't think I have reprogrammed anything here, but the though hit me the first time I ran this, as I do run all this as root as I though that it was required (it isn't).



Interesting... if we can decode the format of this file I think we have the image for at least one of the CPLD chips and could load our own.

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: QEMU question
« Reply #13 on: April 03, 2005, 07:18:06 pm »
hey belle,

do you have the file /usr/gnemul/qemu-arm ?

Offline balle

  • A few posts under my belt.
  • *
  • Posts: 18
  • Wannabe...
Re: QEMU question
« Reply #14 on: April 03, 2005, 07:21:37 pm »
Quote
hey belle,

do you have the file /usr/gnemul/qemu-arm ?


Nope, I see that qemu is trying to open this when I use strace, but I don't have this file here.

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: QEMU question
« Reply #15 on: April 03, 2005, 07:43:13 pm »
I hate redhat!!

I cant get half this crap to compile due to their using really old modified versions of stuff like python and glibc ... bah!


Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: QEMU question
« Reply #16 on: April 03, 2005, 07:58:48 pm »
can you see what the swgrli does?

Offline balle

  • A few posts under my belt.
  • *
  • Posts: 18
  • Wannabe...
Re: QEMU question
« Reply #17 on: April 03, 2005, 08:04:52 pm »
Quote
can you see what the swgrli does?


Code: [Select]

peregrin/dos>qemu-arm ./swgrli
Cannot open /dev/led, will print light status
Toggle light
peregrin/dos>qemu-arm ./swgrli 1
Cannot open /dev/led, will print light status
Light on
Light off
Light on
Light off
Light on
qemu: uncaught target signal 2 (Interrupt) - exiting
peregrin/dos>


If you 'strings the file you'll see in the end that there is a bit of morsecodes, so I would guess that this is the controller for the leds, and also for the keglady (or whatever her name was).

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: QEMU question
« Reply #18 on: April 03, 2005, 08:10:21 pm »
Yeah I just found that and im ht eprocess of running it through a decoder for morse code. :)

Any other exectueables on the box if you could dump out the command output that would be quite helpful!

Thanks!

Offline judb

  • Administrator
  • Veteran.
  • *****
  • Posts: 1329
  • ph4t l3wtz
Re: QEMU question
« Reply #19 on: April 03, 2005, 08:18:44 pm »