qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC][PATCH 000/111] QEMU m68k core additions


From: Natalia Portillo
Subject: Re: [Qemu-devel] [RFC][PATCH 000/111] QEMU m68k core additions
Date: Sun, 21 Aug 2011 01:23:25 +0100

El 21/08/2011, a las 00:42, Rob Landley escribió:

> On 08/20/2011 06:17 PM, Natalia Portillo wrote:
>>> or ancient macintosh support
>> 
>> Most of the hardware (but a few required ones like SWIM) is already
>> in QEMU, you need to glue everything, make Toolbox be VERY happy
>> about its environment, make Mac OS boot so it can second-boot Linux
>> (the direct-booter is so buggy it may introduce phantom bugs on the
>> emulation) and implement the MMU.
> 
> I haven't got a copy of ancient MacOS.
> 
> Why is the direct booter buggy?  I'm happy to track down and isolate
> phantom bugs, either in the kernel or in qemu.  (One nice thing about
> emulators is you can get deterministic regression tests reasonably
> easily. :)
> 
> How do I _use_ the direct booter, anyway?  I built mac_defconfig in 3.0
> but it only gave me a vmlinux, which faulted on the instruction at
> address 0.  I tried m68k-objdump -O binary vmlinux vmlinux.bin but that
> wouldnt' bot at all (qemu -kernel refused to load it).
> 
>>> that Linux could boot on?  (I.E. I'm interested in Linux system 
>>> emulation of non-coldfire m68k.  So far that means "use aranym".)
>> 
>> Linux requires the MMU and an almost complete hardware emulation. 
>> Standard m68k emulations (UAE, Aranym and specially BasiliskII) try
>> to patch the OS to work.
> 
> That's kinda sad.  Is there a web page anywhere that elaborates on this?

It is a known thing that Linux requires MMU, it appears on the installation 
guide of all m68k distros.
On how and how much they patch the OS, check their sources.

>> Indeed BasiliskII is anything but a real macintosh emulator, as it
>> patches heavily the Toolbox and Mac OS (that's why Linux and A/UX
>> will never work on it)
> 
> I believe toolbox is the ancient mac bios, correct?  Does Linux need/use
> it at all?

Yes and no to both.
Mac OS is a really complex operating system where everything is divided in 
little pieces that can be loaded individually and independently (the Grand 
Unified Model, the reason why resource forks exist).
Toolbox is the most important part, the one that resides inside the ROM chip, 
provides the specific model drivers (and in the II models, loads the video 
driver from the NuBus card), and loads the rest of the system from the System 
file inside MacOS.

It does not expect a boot loader, it's the OS itself, indeed in an specific 
model the whole OS is contained in ROM.

There is a table for OS functions that can be made to point to ROM (implemented 
on Toolbox) or in RAM (System file, bug or functionality updates).

BasiliskII patches that table inserting their own functions (for example, the 
floppy driver is "enhanced" to provide access to the host disk images, instead 
of calling to the SWIM chip that will manage the floppy drive in a real 
macintosh).

The Linux bootloader is nothing more than a Mac OS application that loads the 
Linux kernel and gives it access to the full RAM, where it can (and as you see 
in the compatibility list, does not so well) access to the whole Macintosh 
hardware bypassing both Toolbox and System.

Not long ago some people discovered a way to substitute the System file (RAM 
portion of the OS) so the Toolbox loads directly a Linux kernel. This is buggy 
for a lot of reasons (that was never the intended way, in-ROM drivers may be 
too buggy, so on).

Apple UNIX (A/UX) on the other way provides a full System file (corresponding 
to Mac OS 7) and then loads its kernel, retaining the original table in memory 
for Mac OS applications compatibility and the GUI (yeah, while it's a UNIX and 
contains X11, native applications can be made that while being A/UX ones, use, 
calls and depend, on the Toolbox and System functions :D)

So unless an emulation is complete enough to make the Toolbox happily load a 
System file, it cannot be called a Macintosh emulator.
It will be merely a custom-hardware-emulator capable of running Mac OS 
(BasiliskII) or Linux-m68k (nothing implemented right now).

Saying this of pure memory, BasiliskII patches (and so, does not emulate them 
really) the following devices: floppy (calls host disk images, not a floppy 
emulated device, whatever if the image is an hdd, floppy, or cd, it appears as 
a floppy to the OS), SCSI (there is no scsi emulated at all, the driver is 
patched to call to host ASPI devices), framebuffer (any combination is 
available independently of the Toolbox's expected one), NuBus (not present or 
patched at all), sound (not DAC at all), network (again, no network card at 
all), graphics accelerators (none emulated, requires NuBus), filesystem code 
(to make the host folder appear in desktop).

Btw, vMac is more loyal to real hardware emulation.

And the hardware, and the whole Toolbox and System are heavily documented up to 
II machines in the Inside Macintosh Volumes.

> Rob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]