1 line
3.3 KiB
Plaintext
1 line
3.3 KiB
Plaintext
|
Unfortunately, do to problems with installing on the demo machines at MacHack, and my physical location in New York (I had to do some high-school exams on 6/21), Ephemerboot was not presented at the Hack Show. It didn't get voted on & wasn't eligible for awards - here on the CD is its initial introduction.
As part of a last-ditch effort to be allowed to present, I wrote this speech script (during the hack show, but in New York). This covers the more interesting bits of the project faster than the Read Me, and also covers some stuff the other file doesn't, so I suggest reading it first.
Special thanks to Miro Jurisic (author of the 1998 winning Hack) for his hurculean efforts trying to install Ephemerboot on about a million different Macs, and to get a presentation slot.
-----
Hello, I'm Dave Krauss, and I'm gonna tell you about the hack Ephemerboot.
Ephemerboot is a bootable RAM disk driver for NewWorld Macs. To boot a newworld mac from ram, a few difficulties must be overcome. Data must be retrieved from powered-off RAM chips; Virtual Memory must be mercilessly hacked; and unspeakable evils must be perpetrated in the Forth level of Open Firmware hell.
Machines since the iMac stop maintaining their dimms for a fraction of a second during reboot. During the missed refresh cycles, data fades away, a process called "bit rot".
But not everything is erased. Just as human memory can be ephemeral, so is the ram of a newworld mac at reboot. hence ephemerboot.
To eliminate bit rot, I implemented a data checksumming and recovery scheme. When the Mac powers up, it reads the checksums and uses them to correct the rotten bits, which luckily occur one at a time.
The checksum is also stored in ram, tho. So it's a good idea to checksum the checksum. Then I checksum that checksum again, and that one's small enough to be flashed to nonvolatile ram where it's safe.
So, the driver writes 3 checksums with every write.
Next is the problem of allocating memory in a way that it's safe even through a reboot. That has to be done in Open firmware. A bootloader script erases the Mac's automatically-generated description of its ram chips, and replaces it with a new one. Data is safe in chips the Mac OS doesn't know it has.
This also gets around basic limitations in the Mac OS, like the 1.5 gig limit. A 500 meg Ephboot disk should let a 2 gig machine use all of its memory.
But if the operating system doesn't know about the memory, how will the driver access it? Normally, the OS controls the gate between the pointers we know and the chips. There is no published Apple API that allows us to use physical ram. So I reverse-engineered an obscure Apple utility that lets you look at physical memory.
There are just two calls to the mini-api, which let you access any memory in the machine, including PowerPC interrupt vectors. This is powerful stuff - see the source code.
Finally, there's the problem of how to load the driver early enough to boot from it. Obviously an extension won't do. Ephemerboot installs code into your disk's patch partition, where it's executed really early. I don't have time to talk about patch partitions, but they're not very well documented either.
What I can tell you is that the source on the CD will include a little utility for you to write your own patch partitions. Maybe some of you can use it to keep the tradition of hacking 9 alive.
|