Commit Graph

46 Commits

Author SHA1 Message Date
Elliot Nunn
72f4af9523 Dump pre-built object files 2018-05-31 19:55:03 +08:00
Elliot Nunn
77023fea0f Add Unix shell script to wrap EasyBuild 2018-05-21 15:29:31 +08:00
Elliot Nunn
6d103981d8 Add a Unix shell script to set file types
Because the previous README instructions did not specify *.sh files as
exempt from line-ending filtering, I have added SetFileTypes.sh as one-
liner.
2018-02-10 19:38:27 +08:00
Elliot Nunn
bbe9f79aaf Automate re-Rezzing in EasyBuild script
The DeRezzed files in Misc (*.rsrc and GoNativeResources) will be Rezzed
from their own data forks when EasyBuild notices that they have an empty
resource fork.
2018-02-10 18:30:10 +08:00
Elliot Nunn
3cb1a8d163 Add README 2018-02-10 18:30:06 +08:00
Elliot Nunn
224fdc9897 Add EasyBuild script 2018-02-03 15:03:59 +08:00
Elliot Nunn
a292aebdaa Add .gitignore 2018-02-03 11:47:09 +08:00
Elliot Nunn
a855f682c6 Fix bug where RomLink handles weren't locked
Pointers to relocatable blocks were being kept and re-used! Now HLock is
correctly used to keep the blocks in place. This is Memory Manager 101.
2018-02-03 11:40:54 +08:00
Elliot Nunn
6788160911 Neaten up terrible DrawBeepScreen disassembly 2018-02-03 09:05:59 +08:00
Elliot Nunn
a71d9d38d8 Identify most DisplayMgr entry points
This was done to identify why (or indeed whether) the DisplayMgr was
crashing the mini.
2018-01-22 10:40:44 +08:00
Elliot Nunn
b6a6ff6192 Identify two Expansion Bus Manager entry points
Based on boot 3 reversal.
2018-01-14 11:56:25 +08:00
Elliot Nunn
c6a027b810 Reverse the two new functions in StartInit.a 2018-01-08 20:09:24 +08:00
Elliot Nunn
bbb73bc9b7 Use placeholder files to create BuildResults/
Running the Make/CreateBuildResultsFolders script after a clone, or
after clobbering BuildResults/, was a pain. Now a clean build can be
guaranteed with:

rm -rf BuildResults
git checkout BuildResults
2017-12-26 09:53:21 +08:00
Elliot Nunn
723f584a4f Annotate ExpandMemRec field offsets 2017-12-26 09:53:21 +08:00
Elliot Nunn
0c319592a9 Build Slot Mgr from source
(Slot Mgr is for compatibility only on PCI Macs.)
2017-12-26 09:53:21 +08:00
Elliot Nunn
c087445dd0 Correct names of NK Event Group wrapper code
The names of the NanoKernel MP calls made by this 68k ROM library were
found by inspecting the PowerPC MPLibrary, which makes these and many
other MP calls. The document "Adding Multitasking Capability to
Applications Using Multiprocessing Services" gave some background
information. It also helped to determine the function signatures of the
MP calls and of these ROM wrappers.
2017-12-26 09:53:20 +08:00
Elliot Nunn
9c4547cfdb Reverse the Universal Info table
This was tricky. The table seems to be vestigial, anyway.
2017-12-26 09:53:20 +08:00
Elliot Nunn
4204a9c355 Build MMU.lib from sources
The sources needed no changes (how embarrassing), except to remove an
unnecessary dependence on a nonexistent SoundPrivate.a. Lastly.lib had
an incorrect position for SIDESOUNDBUFFER, which has been fixed.
2017-12-26 09:53:20 +08:00
Elliot Nunn
0e4a082eb4 Remove branch islands
The unlinker's new ISLANDGUESS HIDE' option removes autogenerated BSR.L
from the binary dumps and makes tweaks that will cause them to be
regenerated by the linker. MPW's linker seems to have the correct branch
island placement policy, because round-tripping is preserved. When
building from edited sources, there is a remote possibility that the
arrangement of branch islands inside a dumped file will be changed,
disrupting references within that file.
2017-12-26 09:53:20 +08:00
Elliot Nunn
5a0785d5d8 Correctly reverse Standard and Interface libs
Previously these were lumped in with Lastly. Now they are unlinked and
correctly labelled, and Lastly contains only a small amount of PowerPC-
specific code.
2017-12-26 09:53:19 +08:00
Elliot Nunn
d4a7b16d8d Declare between-file branches
The unlink tool now REFGUESSes branches between object files, with some
manual guidance. If you patch the ROM enough to change its function
offsets, it should still work fine.

(One potential exception: if the linker needs to put a new "BSR.L"
island module *within* a pre-built object file, that module file's
internal references *may* be disrupted. This situation is fairly
unlikely, but with improved reversal it will be addressed.)
2017-12-26 09:53:19 +08:00
Elliot Nunn
8dbf307712 Build Data Access Mgr stub from source
Turns out, the source was just a stub for PACK 13
2017-12-26 09:53:19 +08:00
Elliot Nunn
8908c7662c Switch to new unlinker
"DeVectorize" was a hideous several-thousand-line Python script that
split 70% of the ROM into barely passable MPW object files. The new
unlinker, "unlink", produces much nicer files and enjoys a clean
separation of code from data. Using DumpObj, you can get a very readable
listing of a given object file (GoNativeROMLib.o has improved a great
deal). With a bit more work, unlink will be superior to FDisasm for all
68k Mac ROM reversal.
2017-12-26 09:53:18 +08:00
Elliot Nunn
76f84dd27e Make Vectorize more robust 2017-12-26 09:52:55 +08:00
Elliot Nunn
9c249dafab Reverse 68k Color QuickDraw
The ROM now round-trips with QuickDraw mostly built from source.
(~30% of the ROM is now built from source.)
2017-12-26 09:52:55 +08:00
Elliot Nunn
6764d35537 Reverse TextEdit 2017-12-26 09:52:54 +08:00
Elliot Nunn
8cc7afaf0d Reverse printing glue 2017-12-26 09:52:54 +08:00
Elliot Nunn
76713a2368 Identify Expansion Bus Manager entry points
The ExpansionBusDispatch trap (AAF3) is implemented in ROM using a
DispatchHelper table. Using a header from the embryonic Expansion Bus Mgr in
CubeE (rather suspect) and from the Universal Interfaces (solid), the names of
24 of the 47 dispatch selectors have been found. This commit updates the
dumped ExpansionBusMgr.lib with new symbol names.

All but two of the 47 dispatch selectors are Vectorized, so this commit also
updates VectorTable.a with selector numbers and, where possible, names. The
two non-Vectorized dispatch selectors (27 and 28) both point to the same 'nop'
function immediately before ExpansionBusDispatch.
2017-12-26 09:52:54 +08:00
Elliot Nunn
d42472fb9e Identify trap AA7F as _MPDispatch 2017-12-26 09:52:54 +08:00
Elliot Nunn
ba23f80fd4 Fix typos in suggested NK log code 2017-12-26 09:52:54 +08:00
Elliot Nunn
d6259012e0 Make the final ROM link depend on the actual linker
Now the linker (RomLayout) does not need to be built manually.
2017-12-26 09:52:53 +08:00
Elliot Nunn
634961dee4 Consider GoNativeResources worthy of a 'rsrc' type 2017-12-26 09:52:53 +08:00
Elliot Nunn
47d2507b23 Correct the hard-coded DeclData build date
The ROM now round-trips perfectly (cf. Mac OS ROM 9.6.1).
2017-12-26 09:52:53 +08:00
Elliot Nunn
bfdc32871e Add RomLayout, the ROM postlinker 2017-12-26 09:52:53 +08:00
Elliot Nunn
d697a7b029 Update list of resources in ROM 2017-12-26 09:52:53 +08:00
Elliot Nunn
56f7e5c784 Dump new resources in updated ROM 2017-12-26 09:52:53 +08:00
Elliot Nunn
4d4dd13e2b Update declarative ROM resources 2017-12-26 09:52:52 +08:00
Elliot Nunn
2951b5c1b4 Get InSANE (PACKs 4 and 5) building
Only had to add it to the reconstructed Toolbox.make
2017-12-26 09:52:52 +08:00
Elliot Nunn
26978a00fb Update SANE (PACK 7) and get it building
SANE is the Standard Apple Numeric Environment (a float library deprecated in
favour of the native PowerPC float unit). The only change to the PACK 7
resource was in the vicinity of a _StripAddress call. SANE also had to be
added to the reconstructed Toolbox.make file.
2017-12-26 09:52:52 +08:00
Elliot Nunn
0bd74145ca Update the EDisk (RAM Disk) driver 2017-12-26 09:52:52 +08:00
Elliot Nunn
3a7bff43c0 Add RomLink, a bytecode interpreter
The "RomLink" bytecode language can be used to link a tree of binary chunks
into a flat file. The bytecode specifying each binary chunk lives in a
Resource Manager resource. The RomLink's only purpose is to flatten
DeclData.rsrc into a "Slot 0" (motherboard) DeclData, so it seems like
overkill. Nonetheless, DeclData.rsrc is very complicated (and so are its
antecedents, DeclData.r and the include file RomLink).

This implementation is incomplete. It is just enough to build the vestigial
DeclROM that TNT and later machines retain for Open Transport.
2017-12-26 09:52:52 +08:00
Elliot Nunn
269a655a67 Add a script to convert line endings
Git works better with LFs but MPW mostly requires CRs.
ConvertLineEndings acts only on TEXT files, so run SuggestFileTypes
first. Then:

:Make:ConvertLineEndings > "{TempFolder}FixLines" ; "{TempFolder}FixLines"

ConvertLineEndings is both an MPW script and a C program. The script
builds the fast MPW C Tool, and suggests a command that will use the
Tool to fix all the line endings in the repository.
2017-12-26 09:52:36 +08:00
Elliot Nunn
666baba343 Add scripts to make a git-mangled repo buildable
CreateBuildResultsFolders is necessary because git does not track empty
directories (fair enough) despite the build system requiring their presence.

SuggestFileTypes is necessary because git does not track Finder metadata.

Both scripts are flexible in how they are run and robust -- important in a
newly cloned repo.
2017-12-26 09:52:26 +08:00
Elliot Nunn
1c43f478a3 Build updated MainCode image (matches Mac OS ROM 9.6.1+) 2017-12-26 09:52:25 +08:00
Elliot Nunn
283a0c5ba8 Reimplement the Vectorize tool 2017-12-26 09:52:24 +08:00
Elliot Nunn
4325cdcc78 Bring in CubeE sources
Resource forks are included only for .rsrc files. These are DeRezzed into their data fork. 'ckid' resources, from the Projector VCS, are not included.

The Tools directory, containing mostly junk, is also excluded.
2017-12-26 09:52:23 +08:00