DSL on OS X with qemu


Forum: DSL Embedded
Topic: DSL on OS X with qemu
started by: dwarf75

Posted by dwarf75 on Oct. 04 2005,11:44
Hi,
here is one for you guys. Bit of a new challenge so to say.
I'm very much enthused about the whole OS on a memory stick thing.
Here is what I would like to be able to do:

Use the same usb memory stick on linux (already implemented), windows (already implemented) and OS X (not implemented) via qemu.

However, as I am a Linux newbie, I have got no clue! I tried to get the os x binary to run on OS X by trying to pass the same variables as in the .sh and .bat files to qemu, but without any luck.

If you guys could get this to work, that would be excellent! It would mean you have a truly compatible DSL in your pocket!

Cheers
Dwarf75

Posted by dslMike on Oct. 25 2005,02:39
Dwarf75.

I am also a mac user and was successful in getting qemu working on a Sony USB MicroVault 256MB with DSL.  I already had QemuX 0.15 (v0.15-BETA1) using standard install on my mac (http://cordney.com/QemuX/).  Insert your DSL USB drive, open a terminal window, and enter the following:
- you may have to update the usb volume name, mine showed "Untitled"
- you should be able to copy & paste commands

#move to root of usb volume
cd /Volumes/Untitled/

#copy mac qemu executable to usb & rename to avoid name conflict
cp /Applications/Qemu/qemu qemu/qemu_mac

#mac QemuX executable expects to find keymaps in directory under -L option location
mkdir qemu/keymaps

#copy en-us keymap (QemuX executable won't run without it)
cp /Applications/Qemu/share/qemu/keymaps/* qemu/keymaps/

#copy the dsl-linux.sh while changing the qemu executable name
cat dsl-linux.sh | sed s/qemu/qemu_mac/2 >dsl-mac.sh

Now, you should be able to insert your usb key, opening a terminal window and entering:

cd /Volumes/Untitled/
./dsl-mac.sh &

This should start up the qemu environment and load dsl.  

WARNING.  On a Mac Mini 1.42 GHz P4 with 1GB mem DSL reports on bootup a PII 41MHz so it is not speedy.  It takes a full 3 minutes to bootup.  I guess QemuX has alot of work to emulating x86 on a PPC real processor.

Cheers,
dslMike.

Posted by dwarf75 on Oct. 25 2005,03:04
Excellent!
I'll try later today. Haven't got the memory stick with me.
Thanks ever so much for your help!

Mike

Posted by John on Oct. 25 2005,05:57
Any chance of getting a screenshot?
Posted by dwarf75 on Oct. 25 2005,13:38
Hi John and DLSMike,
All up and running.
Here is a picture of the whole thing running:

The Mac is a eMac G4 1.2 GHz and emulates as Intel P2 41 Mhz

Currently trying to make an applescript so I can run DSL from within the OS X GUI without typing in the command line.

Posted by dslMike on Oct. 25 2005,13:50
dwarf75.  

- Is your networking running?
- I just noticed that I cannot get to the Internet.  Dillo shows dns error.
- NE2000 qemu ethernet interface was detected (lsmod shows ne2K module is loaded)
- ifconfig shows only loopback and not eth0
- leads me to believe qemu environment is not providing firewall/dns
- we might need additional QemuX things that my instructions didn't move
- QemuX running same DSL version does get to Internet
- I tried an explicit "-user-net" qemu option in dsl-mac.sh but made no difference
- I will experiment a little further and report back.

dslMike

Posted by dslMike on Oct. 25 2005,22:19
All.

I just isolated the other QemuX file needed to get networking working (bios.bin), which seems to be dependent on the version of qemu being used.  Therefore, the installation script for OS X should be the following (assuming that QemuX is already installed on the mac and your usb volume is "Untitled"):

#move to root of usb volume
cd /Volumes/Untitled/

#make new directory for mac qemu executables
mkdir qemu_mac

#copy mac qemu required files
cp /Applications/Qemu/qemu qemu_mac/
cp /Applications/Qemu/share/qemu/bios.bin qemu_mac/
cp /Applications/Qemu/share/qemu/linux_boot.bin qemu_mac/
cp /Applications/Qemu/share/qemu/vgabios-cirrus.bin qemu_mac/

#QemuX executable expects to find keymaps in directory under -L option location
mkdir qemu_mac/keymaps

#copy keymap files from QemuX
cp /Applications/Qemu/share/qemu/keymaps/* qemu_mac/keymaps/

#copy the dsl-linux.sh while changing the qemu directory in two places
cat dsl-linux.sh | sed s#qemu/#qemu_mac/# | sed s#qemu/#qemu_mac/# >dsl-mac.sh

Now, you should be able to insert your usb key, opening a terminal window and enter:

cd /Volumes/Untitled/
./dsl-mac.sh &

dslMike.

Posted by dwarf75 on Oct. 25 2005,23:24
Hi dslMike,
thanks for your effort. As I am a newbe to Linux, I have got no clue and everything I do is by trial and error.
Three thinks I found/ managed to get done though:
1.)When I tried to copy the keymaps onto the USB stick, termaninal threw a hissy-fit and I just used the normal Finder window to do it.
2.) I'm not sure how the line below does what this does, but I think there is a little error in there:
Quote (dslMike @ Oct. 25 2005,18:19)
#copy the dsl-linux.sh while changing the qemu directory in two places
cat dsl-linux.sh | sed s#qemu/#qemu_mac/# | sed s#qemu/#qemu_mac/# >dsl-mac.sh

When I try to run the shell script, it tells me that there is no qemu file or directory in /qemu_mac.
Hence I had to edit the shell by hand and replace  qemu qith qemu_mac in the first line.
All running now.

3.)Wrote an applescript to run DSL on OS X. Only get to run it on Terminal not X11: (I renamed my memory stick "DSL")
Just put this in script editor:
Code Sample
tell application "Terminal"
do script "cd /Volumes/DSL; ./dsl-mac.sh &"
end tell

It worked fine last night, however for some reason it opens two terminal windows today. Minor hickup.

In addition:
1.)Any idea on how to resize the Dsl window?

2.) For some reason, your changes have another effect: When in the DSL window, the CPU does not run 100% all the tiem anymore, like it did before.

I've also added another screenshot:


and the apple script can be found here:
< DSLonOSX Applescript >

Cheers
Mike

P.S. John, let me know if you want a larger screenshot.

Posted by dslMike on Oct. 25 2005,23:47
dwarf75.

Quote
I'm not sure how the line below does what this does, but I think there is a little error in there:
Code Sample
cat dsl-linux.sh | sed s#qemu/#qemu_mac/# | sed s#qemu/#qemu_mac/# >dsl-mac.sh


This line copies the dsl-linux.sh line and runs it through a Stream EDitor twice.  Each time is substitutes the first occurance of qemu for qemu_mac on every line.  

Quote
1.)Any idea on how to resize the Dsl window?


In the DSL window right click to menu -> System -> XVesa which pops up a panel to select the screen size and colour depth you want.  Once you select, qemu automatically resizes the window.  Your changes will also be saved in your preferences during the backup during shutdown and should be restored on the next boot.

Quote
2.) For some reason, your changes have another effect: When in the DSL window, the CPU does not run 100% all the tiem anymore, like it did before.


I think you'll find if you leave DSL settle, its CPU will register very low (1-5%) while the mac will be working a bit harder (30-50%), but when you try to do something in DSL, both will tend to go high.  I personally find working on a 41MHz virtual PC a little trying.  Don't know if its worth the pain for the pleasure of portable computing environment.

Thanks for the applescript.  

dslMike.

Posted by roberts on Oct. 25 2005,23:54
Hey Guys,

This is great news. I know nuttin about Mac. Is your apple script generic enough to be included in our 5-way which would mean we would have a 6-way script? Or at least 6 ways packed together with instructions for anyone to download. Let me know, as I will update the download 5-way.tgz

Robert

Posted by dwarf75 on Oct. 25 2005,23:56
Thanks for that.
Same here, I don't really intend to use it a lot. Just as a emergency system, that is always in my backpack.

Also, many thanks to my mate Billy (although I doubt he'll ever come across this), who helped me to get DSl on the memory stick on the first place.

As I said before, I'm a complete newbie.

Cheers

Posted by dwarf75 on Oct. 26 2005,00:02
Quote (roberts @ Oct. 25 2005,19:54)
Is your apple script generic enough to be included in our 5-way which would mean we would have a 6-way script? Or at least 6 ways packed together with instructions for anyone to download.

I think we can create some instructions and stuff.

However, problem 1:
dslMike, can you change the cat command so it changes the qemu  to qemu_mac as i described before hand.

problem 2:
the script depends on what people call their memory stick, so i don't think we can make a 6-way script.


I have a go at some instuctions for download. can't promise it today though.

Mike

Posted by dwarf75 on Oct. 26 2005,04:12
Had a set-back!
All was good and well, until I went to y other Mac to see if the memory stick works. And it didn't!
This is the error message I got from qemu:

So, it can only run on a machine that has qemu already installed!

Any ideas how we can get around this? Do that mean qemu has to be recompiled?

In that case, does that mean that we need a uniform name for the memorystick? (I would suggest "DSL", so we know it doesn't has problems getting mounted as something else)

in addition, does naming the memory stick have an effect on the other systems (linux, windows)?

Posted by dslMike on Oct. 26 2005,14:02
dwarf75.

I was afraid of this.  The answer is that qemu needs to be recompiled to find its libraries on the USB key.  Unfortunately, I am not up to this task.

Regarding the naming of the USB drive.  I believe this could be done as part of the 5-way script since it formats the USB drive and could assign a vfat volume name at that time.

My script to copy the dsl-linux.sh is not longer needed if built into a new 6-way script.

Cheers,
dslMike.

Posted by dwarf75 on Oct. 27 2005,01:01
bugger. same here!
Not a clue about programming.

Any idea where we could go from here?

Does anyone have any other suggestions?

Cheers
Mike

Posted by dwarf75 on Jan. 21 2006,10:24
I had another look on the net.
I found this program here and it seems to work without qemu being installed on the hard disk.

< Q for OS X >


I tried and it works quite nicely.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.