Re: [Qemu-devel] [OpenBIOS] [PATCH] Add resolutions via the command-line

2016-09-20 Thread Alfonso Gamboa
Perhaps include a base set of resolutions that the actual mac99 machine
supported, implemented in OpenBIOS, and also adding the --video-resolutions
option so the user may add custom entries that would be read by the VGA
device if so desired.  I believe that is the best compromise vs. having a
huge list of resolutions hard coded in QEMU and presented to MacOS and OSX.


Re: [Qemu-devel] [PATCH] Add resolutions via the command-line

2016-09-19 Thread Alfonso Gamboa
t; > > > +
> > > > + #define PROPERTY_NAME "resolutions"
> > > > + #define NODE_PATH "Devices:device-tree:options"
> > > > +
> > > > + /* init the entry variable */
> > > > + err = RegistryEntryIDInit(entry_id);
> > > > + if (err != noErr) {
> > > > + lprintf("Error: Failed to init entry variable!
> > > > (%d)\n", err);
> > > > + return err;
> > > > + }
> > > > + is_done = false;
> > > > +
> > > > + /* Get the entry ID value */
> > > > + err = RegistryCStrEntryLookup(NULL /* start root */,
> > > > NODE_PATH,
> > > > entry_id);
> > > > + if (err != noErr) {
> > > > + lprintf("RegistryCStrEntryLookup() failure
> > > > (%d)\n",
> > > > err);
> > > > + return err;
> > > > + }
> > > > +
> > > > + /* Get the size of the property */
> > > > + err = RegistryPropertyGetSize(entry_id, PROPERTY_NAME,
> > > > &property_size);
> > > > + if (err != noErr) {
> > > > + lprintf("Error: Failed to get property size!
> > > > (%d)\n", err);
> > > > + return err;
> > > > + }
> > > > +
> > > > + /* allocate memory to the value variable */
> > > > + value = (void *) malloc(property_size);
> > > > +
> > > > + /* Get the value of the property */
> > > > + err = RegistryPropertyGet(entry_id, PROPERTY_NAME,
> > > > value,
> > > > &property_size);
> > > > + if (err != noErr) {
> > > > + lprintf("Error: Failed to find property value
> > > > %s!\n", PROPERTY_NAME);
> > > > + return err;
> > > > + }
> > > > +
> > > > + /* Limit the number of resolutions to 20 */
> > > > + #define sane_number_of_resolutions 20
> > > > + res_set_count = get_set_count(value);
> > > > + res_set_count = (res_set_count >
> > > > sane_number_of_resolutions
> > > > ?
> > > > sane_number_of_resolutions : res_set_count);
> > > > +
> > > > + /* Add each resolution set */
> > > > + for(index = 0; index < res_set_count; index++) {
> > > > + set_str = get_set(value, index);
> > > > + vModes[index].width = get_width(set_str);
> > > > + vModes[index].height = get_height(set_str);
> > > > + free(set_str);
> > > > + }
> > > > +
> > > > + free(value);
> > > > +}
> > > > +
> > > > +/* Returns the number of resolutions */
> > > > +static int get_number_of_resolutions()
> > > > +{
> > > > + int size_of_array, num_of_resolutions, index;
> > > > +
> > > > + num_of_resolutions = 0;
> > > > + size_of_array = sizeof(vModes) / sizeof(struct vMode);
> > > > +
> > > > + for(index = 0; index < size_of_array; index++)
> > > > + {
> > > > + /* Don't count any place holders */
> > > > + if (vModes[index].width != 0) {
> > > > + num_of_resolutions++;
> > > > + }
> > > > + }
> > > > +
> > > > + return num_of_resolutions;
> > > > +}
> > > >
> > > >   OSStatus QemuVga_Init(void)
> > > >   {
> > > >   UInt16 id, i;
> > > >   UInt32 mem, width, height, depth;
> > > > +
> > > > + add_user_resolutions();
> > > >
> > > >   lprintf("First MMIO read...\n");
> > > >   id = DispiReadW(VBE_DISPI_INDEX_ID);
> > > > @@ -183,7 +406,7 @@ OSStatus QemuVga_Init(void)
> > > >   i = 0;
> > > >   }
> > > >   GLOBAL.bootMode = i;
> > > > - GLOBAL.numModes = sizeof(vModes) / sizeof(struct vMode)
> > > > - 1;
> > > > + GLOBAL.numModes = get_number_of_resolutions();
> > > >
> > > >   QemuVga_SetMode(GLOBAL.bootMode, depth, 0);
> > > >
>
>


-- 
Alfonso Gamboa
Gran Turismo Enterprises, Inc.   |   Director, Global Operations
4660 La Jolla Village Drive- La Jolla, CA 92122  -  USA
www.gtxent.com  -=-  www.blue-foundation.org -=- profiles.gtxent.com/aag


Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-10 Thread Alfonso Gamboa
I removed OpenTransport and other extensions and control panels as well as
patched the System Suitcase on some of those iso's on the emaculation.com
forum. They are not stock images.  Perhaps we still need further work.   As
far as 9.0.4 booting,  I have never succeeded in booting that,  awesome!

Mark: do you have a link to the latest working openbios-ppc?

Regards,
Alfonso
On 07/09/2016 07:42 PM, G 3 wrote:
>> On 07/09/2016 02:43 AM, Mark Cave-Ayland wrote:
>>
>>> On 01/07/16 07:41, David Gibson wrote:
>>>
>>>
 From: Benjamin Herrenschmidt 

 The architecture specifies that any instruction that sets MSR:PR will
also
 set MSR:EE, IR and DR.

 Signed-off-by: Benjamin Herrenschmidt 
 Signed-off-by: C?dric Le Goater 
 Signed-off-by: David Gibson 
 ---
  target-ppc/helper_regs.h | 4 
  1 file changed, 4 insertions(+)

 diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h
 index 8fc0934..8fdfa5c 100644
 --- a/target-ppc/helper_regs.h
 +++ b/target-ppc/helper_regs.h
 @@ -136,6 +136,10 @@ static inline int hreg_store_msr(CPUPPCState
*env, target_ulong value,
  /* Change the exception prefix on PowerPC 601 */
  env->excp_prefix = ((value >> MSR_EP) & 1) * 0xFFF0;
  }
 +/* If PR=1 then EE, IR and DR must be 1 */
 +if ((value >> MSR_PR) & 1) {
 +value |= (1 << MSR_EE) | (1 << MSR_DR) | (1 << MSR_IR);
 +}
  #endif
  env->msr = value;
  hreg_compute_hflags(env);


>>>
>>> Unfortunately this patch causes a regression and breaks booting OS 9 and
>>> OS X under qemu-system-ppc.
>>>
>>
>> Ah This is curious.
>>
>>
>> I used :
>>
>> qemu-system-ppc -M g3beige -cdrom darwinppc-602.cdr -boot d
>> qemu-system-ppc -M mac99 -cdrom darwinppc-602.cdr -boot d
>> qemu-system-ppc64 -M g3beige -cdrom darwinppc-602.cdr -boot d
>>
>> which "work" as they reach the installation prompt :
>>
>> The following devices are available for installation.
>>
>> This one hangs :
>>
>> qemu-system-ppc64 -M mac99 -cdrom darwinppc-602.cdr -boot d
>>
>> But that is expected for a 970 cpu.
>>
>> The login prompt is reached with a full Darwin disk image.
>>
>> So I must be missing a scenario :/
>>
>> Thanks,
>>
>> C.
>
>
> I suggest you use a more up-to-date version of Darwin for PowerPC 64-bit
support:
>
> https://opensource.apple.com/static/iso/darwinppc-801.cdr.gz

ok. Will do.


Mark,

For OS 9, do you plan to commit these openbios patches soon ?


https://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg02824.html

as we just gave them a good test. Or may be, include them under
a github branch to make them easier to find.


Also, I found out that some OS 9 isos are not supported by qemu.
These are ok :


http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=0ef8922b24a51d2a9d546300aea69c64&start=250

But the one under :

http://c-obrien.org/qemu-os9/testing/

does not boot. It loops on some CUDA commands and then hangs.
I did not dig further. Is that a known issue ?

Thanks,

C.


Re: [Qemu-devel] [OpenBIOS] [Qemu-ppc] CUDA has problems with Mac OS 10.4

2015-11-24 Thread Alfonso Gamboa
On Tue, Nov 24, 2015 at 12:06 AM, Mark Cave-Ayland <
mark.cave-ayl...@ilande.co.uk> wrote:

> On 24/11/15 05:23, Alfonso Gamboa wrote:
>
> > Here are some links I packaged for the emaculation forum, included is an
> > image with macsbug installed already.  I had success booting to desktop.
> >
> > Note:  it seems as time goes by, booting several times using the ISO
> > images corrupts them, resulting in failed boots with crashes at the boot
> > splash screen.  Crashes will continue until you replace them with fresh
> > ones from the zip files.  Reasons as to why are unknown at this time.
>
> Yeah I noticed when booting from a CDROM that my open windows are
> remembered across sessions(!). This makes me think that OS 9 thinks the
> HFS volume is a HD rather than a CDROM and so mounts it read/write on
> boot. How would I find this out in OS9?
>
> > Resedit, Stuffit, Toast, Disk Copy, utilities in an ISO to mount within
> > QEMU:
> > http://bebop.gtxent.com/qemu_os9_utilities.iso.zip
> >
> > MacOS 9.2.2 bootable image(extensions all removed):
> > http://bebop.gtxent.com/os922_uni.iso.zip
> >
> > MacOS 9.2.1 bootable image(extensions all removed):
> > http://bebop.gtxent.com/os92_test.iso.zip
> >
> > MacOS 9.2.1 bootable image with macsbug (extensions all removed):
> > http://bebop.gtxent.com/os92_test_macsbug.iso.zip
>
> These images are definitely helpful, however what would be really useful
> to know is exactly what the modules in question do:
>
> - Multiprocessing (maybe uses a currently unimplemented CPU instruction
> to facilitate faster multitasking?)
>
> - Open Transport ASLM Modules (no idea what these do)
>
> - Apple Audio Extension Module (is this just a standard sound driver or
> other? I did get a backtrace once suggesting that it was trying to
> access digital CDROM audio which is why it crashed. Then again if it
> thinks that the CDROM is a HD then that's not going to help too much
> here either).
>
>
> ATB,
>
> Mark.
>
>

This is a zip containing qemu-ppc, and a 2gb disk image file with macos
9.2.2 installed. The system folder was modified to allow it to boot from an
unlocked HFS volume. This image has lots of extensions and control panels
included and enabled.  Once you download qemu_easy.zip, extract it, and run
qemu_os9.command (this is just a batch file with arguments)

qemu will now load and boot from the disk image to OS9 desktop.  The disk
image included here is read/write enabled.  I have only tried this on
OS10.11, your success may vary.  MacsBug is included in the root directory,
but is not enabled.


http://bebop.gtxent.com/qemu_easy.zip

thanks,
Alfonso


Re: [Qemu-devel] [OpenBIOS] [Qemu-ppc] CUDA has problems with Mac OS 10.4

2015-11-24 Thread Alfonso Gamboa
On Tue, Nov 24, 2015 at 12:06 AM, Mark Cave-Ayland <
mark.cave-ayl...@ilande.co.uk> wrote:

> On 24/11/15 05:23, Alfonso Gamboa wrote:
>
> > Here are some links I packaged for the emaculation forum, included is an
> > image with macsbug installed already.  I had success booting to desktop.
> >
> > Note:  it seems as time goes by, booting several times using the ISO
> > images corrupts them, resulting in failed boots with crashes at the boot
> > splash screen.  Crashes will continue until you replace them with fresh
> > ones from the zip files.  Reasons as to why are unknown at this time.
>
> Yeah I noticed when booting from a CDROM that my open windows are
> remembered across sessions(!). This makes me think that OS 9 thinks the
> HFS volume is a HD rather than a CDROM and so mounts it read/write on
> boot. How would I find this out in OS9?
>
> > Resedit, Stuffit, Toast, Disk Copy, utilities in an ISO to mount within
> > QEMU:
> > http://bebop.gtxent.com/qemu_os9_utilities.iso.zip
> >
> > MacOS 9.2.2 bootable image(extensions all removed):
> > http://bebop.gtxent.com/os922_uni.iso.zip
> >
> > MacOS 9.2.1 bootable image(extensions all removed):
> > http://bebop.gtxent.com/os92_test.iso.zip
> >
> > MacOS 9.2.1 bootable image with macsbug (extensions all removed):
> > http://bebop.gtxent.com/os92_test_macsbug.iso.zip
>
> These images are definitely helpful, however what would be really useful
> to know is exactly what the modules in question do:
>
> - Multiprocessing (maybe uses a currently unimplemented CPU instruction
> to facilitate faster multitasking?)
>
> - Open Transport ASLM Modules (no idea what these do)
>
> - Apple Audio Extension Module (is this just a standard sound driver or
> other? I did get a backtrace once suggesting that it was trying to
> access digital CDROM audio which is why it crashed. Then again if it
> thinks that the CDROM is a HD then that's not going to help too much
> here either).
>
>
> ATB,
>
> Mark.
>
>
​The "Multiprocessing" folder contains a file named "Apple CPU Plugins" of
type cpup. Looking at the resource "cpups", it seems to contain code to
supplement the OS to support various newer CPUs and architectures.  The
resources in the file are named (and contain):

PowerSurge2PPlugin:
"hammerhead" (old clone computers based off multiple PPC 604I believe)

G3Plugin:
Powerbook1,1

Core99Plugin:
uni-north
keylargo
PowerMac2,1
PowerMac2,2
PowerMac3,4
PowerMac3,5
PowerMac4,1
PowerBook3,3
PowerBook3,4

The "Open Transport ASLM Modules" file seem to be a collection of shared
libraries, since many programs, once this file is removed from the
extensions folder, refuses to run, for example Apple System Profiler.
OTLib$NBPScnr, OTLib$SerIAB are some examples of shared libraries contained
within this file.  This is verified from the book "Sad Macs, Bombs, and
Other Disasters: And what to Do about Them By Ted Landau
​, see https://goo.gl/TVm9Tt"​

I will do more research.

Thanks,
Alfonso


Re: [Qemu-devel] [OpenBIOS] [Qemu-ppc] CUDA has problems with Mac OS 10.4

2015-11-24 Thread Alfonso Gamboa
On Tue, Nov 24, 2015 at 12:01 AM, Mark Cave-Ayland <
mark.cave-ayl...@ilande.co.uk> wrote:

> On 24/11/15 03:28, Programmingkid wrote:
>
> >> I've just done some testing here on my 9.2.2 ISO and I've found the
> >> following:
> >>
> >> - Removing "Apple Audio Extension" appears to prevent some kind of
> >> corruption which allows MacsBugs to give non-corrupt stack traces
> >>
> >> - The resulting stack trace points at "AINI 8042 05AE Startup ASLM PPC"
> >>
> >> - Further removing "Open Transport ASLM Modules" allows boot to proceed
> >> nearly all the way except for a hang just before the progress bar
> >> reaches the end
> >>
> >> - Finally removing "Multiprocessing" allows boot to proceed all the way
> >> to the desktop
> >>
> >> Alfonso/John can you confirm whether removing these 3 extensions works
> >> for your images too? If you are able to run the OS 9 installer all the
> >> way through and manually mount the hd images to remove them by hand
> >> before the next boot, do you end up with a bootable OS 9 HD image?
> >
> > Which version of Macsbug are you using? Do you have an 9.2.2 image file
> > available for download that has macsbug installed? I tried installing
> Macsbug
> > 6.6.3 into my iso file, but Mac OS 9 always stops booting right before
> the debugger
> > message is suppose to appear.
>
> One other thing I forgot to mention: if you install MacsBugs onto your
> ISO, you need to provide some mouse or keyboard input around the time
> when the happy mac icon appears (I normally capture the mouse and move
> it around a little), otherwise as you mention you see a freeze just
> before "Debugger Installed" appears.
>
> My guess is that MacsBugs is trying to work out whether to use ADB or
> USB for keyboard, so unless the OS 9 ADB driver gets any input then it
> can't decide and hangs on boot. Then again this could be another bug
> somewhere in the QEMU ADB emulation...
>
>
> ATB,
>
> Mark.
>
>
Mark,

You are correct about booting MacsBug and mouse or keyboard input during
happy mac icon!  Also, Programmingkid, you hit the nail on the head
regarding those extensions.  Removing those 4 extensions and
Multiprocessing Folder does indeed allow boot to desktop.

In my testing tonight, I was able to successfully patch the System file to
allow the System Folder from the installation cd to boot off the hard disk
image, before it was throwing an error after happy mac icon saying the
media had been copied and would not boot.  I achieved this by editing the
System file and removing the resource "xboo". This resource apparently
checks whether the boot volume is a locked HFS volume or not, and denies
boot accordingly.

I have included MacsBug 6.6.3 in the System Folder, and right before I get
to desktop, MacsBug opens with a "PowerPC Illegal Instruction at ",
but I am able to type ES (escape to shell) to successfully boot into the
desktop.

Next, when running either the 9.2.1 OR 9.2.2 installer, MacsBug throws,
"PowerPC unmapped memory exception at AAFE0700".  I am then able to escape
to shell and resume the Finder.  I have tried copying the installer to
another disk image, increase memory allocation, to no avail.  The same
error persists.

I was also unable to find a method to boot any installed System File.  I
attempted to use an existing 9.2.2 System Folder found on macintoshgarden,
which would crash QEMU completely.  Next, extracting the "Big System
Morsels" file from the 9.2.2 installation cd (which should be the System
file, just renamed and with a different creator code) and setting the
Creator and Type Codes, throwing it in the System Folder and rebooting,
results in an Illegal Instruction and or Bus Error during boot.

Seems we still have some work to do...

I'm uploading a disk image y'all can use to boot to OS9.2.2CDSYSTEM for
further testing, I will forward the link when its ready to download.

-Alfonso


Re: [Qemu-devel] [OpenBIOS] [Qemu-ppc] CUDA has problems with Mac OS 10.4

2015-11-23 Thread Alfonso Gamboa
On Mon, Nov 23, 2015 at 7:28 PM, Programmingkid 
 wrote:

>
> On Nov 23, 2015, at 4:00 PM, Mark Cave-Ayland wrote:
>
> > On 22/11/15 17:39, Programmingkid wrote:
> >
> > Hi Alfonso,
> >
> > Has there been any progress at all as to which extensions may be
> causing
> > the crashes?
> 
>  Remove these extensions from the Extensions folder and Mac OS 9 will
> boot to the desktop:
> 
>  Apple Audio Extension
>  Apple Enet
>  Multiprocessing folder
>  Open Transport aslm modules
>  Text Encoding Converter
> 
>  Note: I used Cormac's Mac OS 9.2.1 iso file to do my testing.
> >>>
> >>> Now this is definitely helpful. Just to confirm that the presence of
> any
> >>> *one* of these modules causes boot to fail?
> >>
> >> Yes. That is correct.
> >
> > I've just done some testing here on my 9.2.2 ISO and I've found the
> > following:
> >
> > - Removing "Apple Audio Extension" appears to prevent some kind of
> > corruption which allows MacsBugs to give non-corrupt stack traces
> >
> > - The resulting stack trace points at "AINI 8042 05AE Startup ASLM PPC"
> >
> > - Further removing "Open Transport ASLM Modules" allows boot to proceed
> > nearly all the way except for a hang just before the progress bar
> > reaches the end
> >
> > - Finally removing "Multiprocessing" allows boot to proceed all the way
> > to the desktop
> >
> > Alfonso/John can you confirm whether removing these 3 extensions works
> > for your images too? If you are able to run the OS 9 installer all the
> > way through and manually mount the hd images to remove them by hand
> > before the next boot, do you end up with a bootable OS 9 HD image?
>
> Which version of Macsbug are you using? Do you have an 9.2.2 image file
> available for download that has macsbug installed? I tried installing
> Macsbug
> 6.6.3 into my iso file, but Mac OS 9 always stops booting right before the
> debugger
> message is suppose to appear.


Here are some links I packaged for the emaculation forum, included is an
image with macsbug installed already.  I had success booting to desktop.

Note:  it seems as time goes by, booting several times using the ISO images
corrupts them, resulting in failed boots with crashes at the boot splash
screen.  Crashes will continue until you replace them with fresh ones from
the zip files.  Reasons as to why are unknown at this time.

Resedit, Stuffit, Toast, Disk Copy, utilities in an ISO to mount within
QEMU:
http://bebop.gtxent.com/qemu_os9_utilities.iso.zip

MacOS 9.2.2 bootable image(extensions all removed):
http://bebop.gtxent.com/os922_uni.iso.zip

MacOS 9.2.1 bootable image(extensions all removed):
http://bebop.gtxent.com/os92_test.iso.zip

MacOS 9.2.1 bootable image with macsbug (extensions all removed):
http://bebop.gtxent.com/os92_test_macsbug.iso.zip


Re: [Qemu-devel] [OpenBIOS] [Qemu-ppc] CUDA has problems with Mac OS 10.4

2015-11-20 Thread Alfonso Gamboa
booting into MacOS9 with qemu to the Desktop is now possible, see:

http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&start=250

Some issues,  remain,  certain extensions crash on boot.
On Nov 20, 2015 7:46 AM, "Programmingkid"  wrote:

>
> On Nov 20, 2015, at 8:39 AM, BALATON Zoltan wrote:
>
> > On Thu, 19 Nov 2015, Segher Boessenkool wrote:
> >> Some mac99/pmu99 hardware has an ADB keyboard, fwiw (tibook, for
> example).
> >> The do have built-in USB; that, and being newworld, are not directly
> >> related things.
> >
> > Maybe, but the PowerMac3,1 we are trying to emulate here does not have
> ADB AFAIK. Although qemu's mac99 is not a real machine now we should move
> to being closer to some existing hardware if we want OSes written for that
> hardware to run.
>
> I use to have the same belief until Mark set me straight. We are only
> making an emulator of a new world Mac, not a simulator of a PowerMac3,1.
> This means we might be able to get away with not exactly mirroring a real
> Mac. The fact that Mac OS 9 can boot up at all does give me hope we are on
> the right path.
> --
> OpenBIOS http://openbios.org/
> Mailinglist:  http://lists.openbios.org/mailman/listinfo
> Free your System - May the Forth be with you
>