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

Re: Kernel uses only half of Mac IIci memory with built-in video



Hi Brad,

On 15/03/21 10:13 am, Brad Boyer wrote:
On Mon, Mar 15, 2021 at 08:28:37AM +1300, Michael Schmitz wrote:
I'm pretty sure this has never worked. Though there ought to be a way to
make use of RAM in bank 0 for video as long as the kernel is loaded at
address 0 in that bank. Or if that's not possible, use the same trick as I
do on Atari - ioremap some of the bank 0 memory for use by video, and make
sure the video driver uses a dedicated low memory pool allocator for that
ioremapped RAM.
OK, I wasn't sure if it used to work. I own both a IIci and IIsi, but I
never got Linux up and running on either. I bought both of them just
about when I stopped having as much time to work on such things.

I believe one of the headaches is that the address is non-programmable
and requires the framebuffer not just to be in bank A, but to start at
address 0 which means we can't put the kernel at address 0. So we
instead put it at the beginning of bank B if RBV video is going to be
used. The RBV chip doesn't have a way to specify the buffer address
(the official Apple documentation is quite clear that RBV has no
control over the framebuffer location). The other chip that does that
part is also the main memory mapping logic for all onboard devices and
has a completely static mapping for this sort of thing as far as I know.
The documentation I've found never explicitly says the address 0 is
hard-coded, but it never says it can be changed either.
Only leaves the option of using a dedicated pool of ioremapped memory and a special allocator. That is, unless someone manages to rewrite the m68k MMU code to allow RAM chunks to be listed and mapped in any order. We now use a memory model that should allow that, but the code that maps virtual addresses to physical addresses and vice versa (without walking the page tables) isn't there yet. It's been a while since I looked though ...

A second headache is that we don't have real video drivers for anything
on Mac (other than valkyrie which is only found on one or two very late
m68k models and is a shared driver with some ppc models). The macfb
driver mostly just takes information passed in by Penguin and uses
that. It only has enough logic beyond that to change the color palettes
on some of the more common hardware.

On the Atari, is the rest of the low memory usable if the kernel isn't
there? I seem to recall it is only accessible by that special allocator
No, none of the RAM in the low memory chunk is mapped for use as normal memory.
in that case, not as generic memory. I'm not sure of anything else we
have on a Mac that would be able to use that sort of thing.

The only other use is for DMA buffers (floppy and SCSI controllers, probably also DMA for the sound chip). DMA on Macs is weird (though can probably address the entire memory, not just the low 24 address bits, so the problem never arose on MAC as far as I recall).

Cheers,

    Michael



	Brad Boyer
	flar@allandria.com



Reply to: