Re: Wild PID's

From: Andy Valencia <vandys_at_nospam.org>
Date: Tue May 25 1999 - 22:49:46 PDT

[Eric_Jacobs@fc.mcps.k12.md.us (Eric Jacobs) writes:]

>PID's only have to be unique, so it was just a curiousity rather than an
>actual problem. If a message loop wants to be notified of a timer event,
>it would have to create a thread, true; but I was under the impression
>that tfork'ing (and even forking) under VSTa was pretty efficient?
>(maybe not 3000 times in a row, though. :)

Actually, given the speed of a floppy, it's probably not too bad!

>Speaking about the floppy driver, I had to make a couple of changes
>to make it work on a boot disk. After getting it to link as a boot
>server,
>the floppy driver would crash trying to allocate the bounce buffer on
>certain systems. The error was EBUSY, which I assume was generated
>by mach_page_wire(), noticing that the original page had already been
>attached to some physical memory.

First question is whether your system has more than 16 megs of RAM? ISA DMA
can only address the first 16 megs, so you have to start using bounce
buffers.

>I'm probably not explaining this
>right, and I didn't really understand what I was doing, but on a whim
>I changed the malloc() in fd to a direct mmap() for anonymous memory,
>and lo and behold, it started working. I'm still not sure what happened
>though. Does malloc always commit to physical memory? It doesn't
>seem like it should.

No, malloc() generally gives you virtual memory, with the physical memory
behind it faulted in on demand. But that memory can be allocated anywhere
in the full physical range--which can result in buffers in high memory which
the floppy DMA can't touch.

For quite a long time we had a patch to cap memory at 15 megs or so. I
fixed up the bounce buffer stuff (with, apparently, some bugs left :->)
because I got tired of seeing most of my 64 megs in my SMP box sitting idle.
This is probably what will also prod me to finally cook up x86 SMP support!
If you can figure out what's going wrong I'll be happy to try and fix it.

Andy
Received on Tue May 25 21:45:20 1999

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2005 - 15:12:56 PDT