QEMU and a config generator

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
User avatar
SistemaRayoXP
Tinkerer
Posts: 82
Joined: Fri Oct 13, 2017 4:34 pm
Location: Mexico
Contact:

QEMU and a config generator

Post by SistemaRayoXP »

Following to this conversation:
MacPlussed wrote:Soon I will do something like this, I am trying to do the QEMU Code Generator program now! :)
SistemaRayoXP wrote: (?)

Oh man, I'm so excited about this! I'd love to see your program in action :)
MacPlussed wrote: Yes, thank you :) , but I do not think it would be so easy to do them. :oops:
adespoton wrote:With QEMU, the command line IS the config file :) Unfortunately, command line on Windows is different than everywhere else (that uses bash). You can get around this on Windows 10 and use bash anyway, but then you'll have to custom compile QEMU for the Win10 Linux environment....
What does exactly QEMU in Bash and what does mean that the command line is the config file? And why is it different in Windows?
Hill radio station first attempt: Failure. Retrying...
User avatar
adespoton
Forum All-Star
Posts: 4277
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: QEMU and a config generator

Post by adespoton »

Here's how I run one of my QEMU instances:

Code: Select all

#!/bin/sh
osver='Mac OS 9.2.2'
mypath=`dirname "$0"`
rootpath=`dirname "$mypath"`
respath="$rootpath/Resources"
cd "$respath"
#
DEVNUM=`hdiutil attach -nomount "$osver.sparsebundle" | perl -ne'if ($_ =~ /^\/dev\/disk([0-9]+)\s+Apple_partition_scheme/) { print($1); exit(0) }'`
#
"./$osver" \
  -bios "openbios-ppc-screamer" \
  -boot c \
  -drive file="/dev/disk$DEVNUM",format=raw,media=disk	 \
  -M mac99 \
  -m 256 \
  -cpu G3 \
  -netdev user,id=vlan0 \
  -device sungem,netdev=vlan0 \
  -prom-env 'auto-boot?=true' \
  -g 1280x720x32 \
  -name "- $osver" & EMUPID=$!\
  -prom-env "vga-ndrv?=true"
#  -usb -device usb-audio \

 osascript \
 -e "on run(argv)" \
 -e 'tell application "System Events" to set frontmost of process (argv as string) to true' \
 -e "end" \
 -- "$osver"

wait $EMUPID
hdiutil detach "disk$DEVNUM"
It is a script file that runs in the bash shell. Since Windows by default uses the windows command line and .bat files instead of .sh files, the syntax and capabilities will be slightly different. You could probably wrap it all up in powershell too, for that matter.

A lot of what was in the script above would make no sense on Windows. However, you could probably make a script file that would run on Linux, OS X and Windows by being very careful in how you crafted it.
User avatar
MacPlussed
Inquisitive Elf
Posts: 25
Joined: Wed Apr 11, 2018 2:42 pm

Re: QEMU and a config generator

Post by MacPlussed »

The QEMU Code Generator is ready for now, but the Setup file needs to be created. QEMU Code Generator has been tested and 100% working. :idea:

QEMU does not have a Config file and is not required :wink: . My program's QEMU codes can be saved with Batch file. :smile:
Post Reply