Skip to content
Permalink
Browse files

Added ROMDumper from original disk image to the Pacakages/ directory …

…for completeness.
  • Loading branch information...
Jake Bordens Jake Bordens
Jake Bordens authored and Jake Bordens committed Jan 28, 2017
1 parent 31fde52 commit c48d0efe07756216cd04a0a560acef5cc0124d49
@@ -0,0 +1,3 @@
Originally from http://www.kallisys.com/files/newton/Einstein/

Original source code and binary can be found in the Mac Classic IMG file: ROMDumper.img.bin
Binary file not shown.
@@ -0,0 +1,85 @@
ROM Dumper Read Me

Introduction
------------
ROM Dumper is a very simple utility to dump the Newton's ROM via TCP/IP.
I wrote it to provide an alternative way to dump the ROM and use it with
Einstein emulator (the original method implied using a low-level debugger
and worked over a serial link).

Principle
---------
ROM Dumper relies on the fact that the ROM is duplicated between 8 MB and
16 MB. This is not necessarily true (with EVT units) and is caused by
electronic properties of the ROM board. It therefore dumps the content of
the memory between 8 and 16 MB virtual.

ROM Dumper will dump the unpatched base ROM. You don't need to remove
the system patch to dump the ROM.

Please note that ROM Dumper isn't really a very good example of a TCP/IP
server or program. I really wrote it quickly, bypassing many good practices.
I just wanted it to work (and it seems to). You may need to restart your
Newton if something wrong occurs.

Usage
-----
Press ROM Dumper's start button. This will connect to the internet (if you
aren't connected yet) and it will listen on port 10080.
Then connect to port 10080 on a desktop computer and save the result to a
file. The easiest way to do it is to use the terminal with nc program utility.

Syntax is:

nc <newton's ip address> 10080 > <rom file>

For example, I was able to save my MP2x00 US ROM to a file called 717006 with:

nc 10.0.1.202 10080 > 717006

For your information, the MP2x00 US ROM's md5 sum is
70dc5f5f3102e44f15dc93f356b98add.

No graphical utility on the desktop side is provided because I'd better
spend my time on other tasks.

Compilation
-----------
To compiler ROMDumper native code, you need toolserver(1) and associated
scripts, as well as Newton C++ Tools. NCTBuildMain doesn't work here for
some reason I ignore, hence the presence of ROMDumper.exp.a.

The package was build with NTK.

License
-------
ROM Dumper is released under the BSD license.

Copyright (c) 2005, Paul Guyot.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above copyright
notice and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice and the following disclaimer in the
documentation and/or other materials provided with the
distribution.
* Neither the name of the author nor the names of its contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,4 @@
ROM Dumper Release Notes

1.0 16/01/05 [Paul Guyot]
Initial Release.
@@ -0,0 +1 @@
/* File: Consts.f Project: ROM Dumper Written by: Paul Guyot <pguyot@kallisys.net> Copyright: © 2005 by Paul Guyot. All rights reserved worldwide.*/DefConst('kROMBase, 0x00800000);DefConst('kROMSize, 0x00800000);DefConst('kPacketSize, 2048);
Binary file not shown.
@@ -0,0 +1 @@
// NIE 2.0 public platform file API definitions// Copyright 1997 Apple Computer, Inc.// All rights reserved.// by Jim Schramif not knownGlobalFunctions.InetGrabLinkVerboseor not globalFnHelpStrings.InetGrabLinkVerbose then begin knownGlobalFunctions.DNSCancelRequests := 2; knownGlobalFunctions.DNSGetAddressFromName := 3; knownGlobalFunctions.DNSGetMailAddressFromName := 3; knownGlobalFunctions.DNSGetMailServerNameFromDomainName := 3; knownGlobalFunctions.DNSGetNameFromAddress := 3; knownGlobalFunctions.InetAddNewLinkEntry := 1; knownGlobalFunctions.InetAddNewLinkEntryInternal := 1; knownGlobalFunctions.InetCancelCurrentRequest := 1; knownGlobalFunctions.InetCancelLink := 3; knownGlobalFunctions.InetDisconnectLink := 3; knownGlobalFunctions.InetDisplayStatus := 3; knownGlobalFunctions.InetGetAllLinksStatus := 0; knownGlobalFunctions.InetGetDefaultLinkID := 0; knownGlobalFunctions.InetGetLinkEntry := 1; knownGlobalFunctions.InetGetLinkStatus := 1; knownGlobalFunctions.InetGrabLink := 3; knownGlobalFunctions.InetOpenConnectionSlip := 3; knownGlobalFunctions.InetReleaseLink := 3; knownGlobalFunctions.InetSetDefaultLinkID := 1; knownGlobalFunctions.InetGetExceptionError := 1; knownGlobalFunctions.InetGetErrorString := 1; knownGlobalFunctions.InetBuildStatusFrame := 6; knownGlobalFunctions.InetObjectToString := 1; knownGlobalFunctions.RegInetLinkStatusChange := 3; knownGlobalFunctions.UnRegInetLinkStatusChange := 1; knownGlobalFunctions.InetIPAddressToString := 1; knownGlobalFunctions.InetIPStringToAddress := 1; knownGlobalFunctions.InetIsSameIPAddress := 2; knownGlobalFunctions.InetIsSameIPAddressStr := 2; knownGlobalFunctions.InetIsValidIPAddress := 1; knownGlobalFunctions.InetIsValidIPAddressStr := 1; knownGlobalFunctions.InetIsZeroIPAddress := 1; knownGlobalFunctions.InetGetIPAddress := 1; knownGlobalFunctions.InetGrabLinkVerbose := 3; knownGlobalFunctions.InetReleaseLinkVerbose := 3; globalFnHelpStrings.DNSCancelRequests := ['globalFn, "(clientFrame, clientSymbol)", 'Run]; globalFnHelpStrings.DNSGetAddressFromName := ['globalFn, "(name, clientFrame, clientSymbol)", 'Run]; globalFnHelpStrings.DNSGetMailAddressFromName := ['globalFn, "(name, clientFrame, clientSymbol)", 'Run]; globalFnHelpStrings.DNSGetMailServerNameFromDomainName := ['globalFn, "(name, clientFrame, clientSymbol)", 'Run]; globalFnHelpStrings.DNSGetNameFromAddress := ['globalFn, "(address, clientFrame, clientSymbol)", 'Run]; globalFnHelpStrings.InetAddNewLinkEntry := ['globalFn, "(newLinkInfo) linkID or nil", 'Run]; globalFnHelpStrings.InetAddNewLinkEntryInternal := ['globalFn, "(newLinkInfo) linkID or nil", 'Run]; globalFnHelpStrings.InetCancelCurrentRequest := ['globalFn, "(linkID)", 'Run]; globalFnHelpStrings.InetCancelLink := ['globalFn, "(linkID, clientFrame, clientSymbol)", 'Run]; globalFnHelpStrings.InetDisconnectLink := ['globalFn, "(linkID, clientFrame, clientSymbol)", 'Run]; globalFnHelpStrings.InetDisplayStatus := ['globalFn, "(linkID, statusView, statusFrame) statusView", 'Run]; globalFnHelpStrings.InetGetAllLinksStatus := ['globalFn, "() linksStatusFrame", 'Run]; globalFnHelpStrings.InetGetDefaultLinkID := ['globalFn, "() linkID", 'Run]; globalFnHelpStrings.InetGetLinkEntry := ['globalFn, "(linkID) linkEntry", 'Run]; globalFnHelpStrings.InetGetLinkStatus := ['globalFn, "(linkID) statusSymbol", 'Run]; globalFnHelpStrings.InetGrabLink := ['globalFn, "(linkID, clientFrame, clientSymbol)", 'Run]; globalFnHelpStrings.InetOpenConnectionSlip := ['globalFn, "(linkID, clientFrame, clientSymbol) view or nil", 'Run]; globalFnHelpStrings.InetReleaseLink := ['globalFn, "(linkID, clientFrame, clientSymbol)", 'Run]; globalFnHelpStrings.InetSetDefaultLinkID := ['globalFn, "(linkID) linkID or nil", 'Run]; globalFnHelpStrings.InetGetExceptionError := ['globalFn, "(exception) number", 'Run]; globalFnHelpStrings.InetGetErrorString := ['globalFn, "(error) string", 'Run]; globalFnHelpStrings.InetBuildStatusFrame := ['globalFn, "(linkID, infoStatus, infoError, infoText1, infoText2, infoText3) statusFrame", 'Run]; globalFnHelpStrings.InetObjectToString := ['globalFn, "(obj) string", 'Run]; globalFnHelpStrings.RegInetLinkStatusChange := ['globalFn, "(uniqueSymbol, clientFrame, clientSymbol) uniqueSymbol", 'Run]; globalFnHelpStrings.UnRegInetLinkStatusChange := ['globalFn, "(uniqueSymbol)", 'Run]; globalFnHelpStrings.InetIPAddressToString := ['globalFn, "(address) string", 'Run]; globalFnHelpStrings.InetIPStringToAddress := ['globalFn, "(addressStr) address", 'Run]; globalFnHelpStrings.InetIsSameIPAddress := ['globalFn, "(address1, address2) true or nil", 'Run]; globalFnHelpStrings.InetIsSameIPAddressStr := ['globalFn, "(addressStr1, addressStr2) true or nil", 'Run]; globalFnHelpStrings.InetIsValidIPAddress := ['globalFn, "(address) true or nil", 'Run]; globalFnHelpStrings.InetIsValidIPAddressStr := ['globalFn, "(addressStr) true or nil", 'Run]; globalFnHelpStrings.InetIsZeroIPAddress := ['globalFn, "(address) true or nil", 'Run]; globalFnHelpStrings.InetGetIPAddress := ['globalFn, "(whichAddress) address", 'Run]; globalFnHelpStrings.InetGrabLinkVerbose := ['globalFn, "(linkID, clientFrame, clientSymbol)", 'Run]; globalFnHelpStrings.InetReleaseLinkVerbose := ['globalFn, "(linkID, clientFrame, clientSymbol)", 'Run]; end;
Binary file not shown.
@@ -0,0 +1,181 @@
# ==============================
# Fichier: Makefile
# Projet: ROM Dumper
# Ecrit par: Paul Guyot (pguyot@kallisys.net)
#
# CrŽŽ le: 13/1/2005
# Tabulation: 4 espaces
#
# Copyright (c) 2005, Paul Guyot.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# * Neither the name of Kallisys nor the names of its contributors
# may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ===========
# $Id$
# ===========

# Makefile for GNU Make using toolserver(1) v1.0 or higher.
# You need to install the NCT examples provided with toolserver(1) to get
# this working.

# Once all this is installed, type make to build ROMDumper native code.
# (remark: this Makefile uses GNU Make-isms. On MacOS X, make is GNU Make).

# -------- Variables --------

# Commands & options:
Link = ARMLink
LinkOptionsCommon = -dupok -remove
LinkOptionsNoDebug = -bin
LinkOptionsDebug = -aif -bin -dsuppress -rel
LinkOptionsNTKC = -debug -aif -bin -dsuppress -rel
LinkOptionsPart =
Asm = ARM6Asm
AsmOptionsCommon =
AsmOptionsNoDebug =
AsmOptionsDebug = -g
CPlus = ARMCpp
CPlusOptionsDefines = -d hasPCMCIA -d forARM -d TARGET_OS_NEWTON -d NO_ERRNO_H ${MoreCDefines}
CPlusOptionsCommon = -facqy -zo -W -cfront ${CPlusOptionsDefines}
CPlusOptionsNoDebug =
CPlusOptionsDebug = -d forDebug
CPlusOptionsNTKC = -gf
AIFtoNTK = AIFtoNTK
NCTTools = /Users/paul/Applications/Programmation/MPW/MPW/NCT_Folder/Tools/
RIncludes = /Developer/Headers/FlatCarbon/

# Include paths:
AsmIncludes = -i "{DDK_Libraries-dir}"
CPlusIncludes = \
-i "{DDK_Includes-dir}" \
-i "{DDK_Includes-dir}Bootstrap:" \
-i "{DDK_Includes-dir}CLibrary:" \
-i "{DDK_Includes-dir}CommAPI:" \
-i "{DDK_Includes-dir}Communications:" \
-i "{DDK_Includes-dir}Frames:" \
-i "{DDK_Includes-dir}HAL:" \
-i "{DDK_Includes-dir}OS600:" \
-i "{DDK_Includes-dir}Packages:" \
-i "{DDK_Includes-dir}Power:" \
-i "{DDK_Includes-dir}Printing:" \
-i "{DDK_Includes-dir}QD:" \
-i "{DDK_Includes-dir}Toolbox:" \
-i "{DDK_Includes-dir}UtilityClasses:" \
-i "{DDK_Includes-dir}PCMCIA:" \
-i "{NCT_Includes}" \
-i "{NCT_Includes}Frames:" \
-i "{NCT_Includes}Utilities:" \
-i "{NCT_Includes}:NSandDDK:"

# Libraries I'm linking with:

LibrariesCommon = '"{NCT_Libraries}Newton Public APIs.o"'
LibrariesDebug =
LibrariesNTKC =
LibrariesPart =

# Binaries:

ObjectsNTKC = \
ROMDumper.o \
ROMDumper.exp.o

# -------- Rules --------

# --- Common rules ---

%.exp.a : %.exp
NCTBuildMain $< $@
%.impl.a : %.impl.h
ProtocolGen -ImplementationGlue $< -package ${CPlusOptionsDefines} ${CPlusIncludes} -stdout > $@
%.a : %.h
ProtocolGen -InterfaceGlue $< ${CPlusOptionsDefines} ${CPlusIncludes} -stdout > $@

# --- No Debug rules ---

%.o : %.c
${CPlus} $< ${CPlusOptionsCommon} ${CPlusOptionsNoDebug} ${CPlusIncludes} -o $(@F)
%.o : %.cp
${CPlus} $< ${CPlusOptionsCommon} ${CPlusOptionsNoDebug} ${CPlusIncludes} -o $(@F)
%.o : %.a
${Asm} $< ${AsmOptionsCommon} ${AsmOptionsNoDebug} ${AsmIncludes} -o $(@F)

# --- Debug rules ---

%.d.o : %.c
${CPlus} $< ${CPlusOptionsCommon} ${CPlusOptionsNoDebug} ${CPlusIncludes} -o $(@F)
%.d.o : %.cp
${CPlus} $< ${CPlusOptionsCommon} ${CPlusOptionsDebug} ${CPlusIncludes} -o $(@F)
%.d.o : %.a
${Asm} $< ${AsmOptionsCommon} ${AsmOptionsDebug} ${AsmIncludes} -o $(@F)

# --- all ---

all : ROMDumper.ntkc

# --- Specific rules ---
# I need specific rules for the NTKC entry points. They should be compiled with -gf to make AIFtoNTK happy.

ROMDumper.o : ROMDumper.cp
${CPlus} $(^F) ${CPlusOptionsCommon} ${CPlusOptionsNoDebug} ${CPlusOptionsNTKC} \
${CPlusIncludes} -o $(@F)

# ------ Package rules ------

# --- NoDebug rules ---
# --- Debug rules ---

# ------ NTKC modules ------

# --- NoDebug rules ---

%.ntkc : %.sym %.exp
${AIFtoNTK} ${LocalAIFtoNTKOptions} -via $(*F).exp $(^F) -o $(@F)
Rez ${NCTTools}NCTIcons.r -i ${RIncludes} -append -o $(@F)
SetFile -a C $(@F)

ROMDumper.sym : ${ObjectsNTKC}
${Link} ${LinkOptionsCommon} ${LinkOptionsNTKC} \
${LibrariesCommon} ${LibrariesNTKC} $(^F) -o $(@F)

# --- clean ---
clean :
rm -f Objects/*/*

## ======================================================================= ##
## 4.2 BSD UNIX #57: Sun Jun 1 23:02:07 EDT 1986 ##
## ##
## You swing at the Sun. You miss. The Sun swings. He hits you with a ##
## 575MB disk! You read the 575MB disk. It is written in an alien ##
## tongue and cannot be read by your tired Sun-2 eyes. You throw the ##
## 575MB disk at the Sun. You hit! The Sun must repair your eyes. The ##
## Sun reads a scroll. He hits your 130MB disk! He has defeated the ##
## 130MB disk! The Sun reads a scroll. He hits your Ethernet board! He ##
## has defeated your Ethernet board! You read a scroll of "postpone until ##
## Monday at 9 AM". Everything goes dark... ##
## -- /etc/motd, cbosgd ##
## ======================================================================= ##
@@ -0,0 +1 @@
// ==============================// Fichier: ROMDumper.cp// Projet: ROM Dumper// Ecrit par: Paul Guyot (pguyot@kallisys.net)// // CrŽŽ le: 13/1/2005// Tabulation: 4 espaces// // Copyright: © 2005 by Paul Guyot.// Tous droits rŽservŽs pour tous pays.// ===========// $Id$// ===========// NewtonOS#include <NSandDDKIncludes.h>#include <Unicode.h>#include <NewtonScript.h>#include <OSErrors.h>#include <UStringUtils.h>// ------------------------------------------------------------------------ //// * RefToULong( Ref inRef )// ------------------------------------------------------------------------ //// Cette transforme un objet NewtonScript en un entier.// Si c'est un entier, retourne la valeur.// Si c'est une cha”ne, elle est traduite.unsigned long RefToULong( Ref inRef ){ unsigned long theResult; while(1) { // If it is an Int, just cast it if (ISINT(inRef)) { theResult = RINT(inRef); break; } if (::IsString(inRef)) { UniChar* theUCString = ::GetCString(inRef); // La chaine de caractres. char theCString[32]; // EspŽrons que c'est assez. ::ConvertFromUnicode( (const Character*) theUCString, theCString ); while (1) // False loop^ { if (::sscanf( theCString, "#%i", &theResult ) == 1) { break; } if (::sscanf( theCString, "0d%i", &theResult ) == 1) { break; } if (::sscanf( theCString, "0x%X", &theResult ) == 1) { break; } if (::sscanf( theCString, "$%X", &theResult ) == 1) { break; } if (::sscanf( theCString, "%X", &theResult ) == 1) { break; }// ::ThrowMsg("Bad format for parameter. Format is #1234, 0d1234, 0x1234, $1234, 1234 (default is hexa)."); break; } break; }// ::ThrowMsg("Bad parameter's type try int or string"); ThrowBadTypeWithFrameData(kNSErrNotAnInteger, theResult); break; } return theResult;}// -------------------------------------------------------------------------- //// * Dump( RefArg, RefArg, RefArg )// -------------------------------------------------------------------------- //extern "C" RefDump( RefArg inRcvr, RefArg inBaseAddress, RefArg outBinary ){ ULong theAddress = RefToULong( inBaseAddress ); // Check the binary is a binary. if (!::IsBinary(outBinary)) { ThrowBadTypeWithFrameData(kNSErrNotABinaryObject, outBinary); } // Get the size of the binary. ULong theSize = Length(outBinary); WITH_LOCKED_BINARY(outBinary, outBinaryPtr) ULong* theBinaryCrsr = (ULong*) outBinaryPtr; ULong* theROMCrsr = (ULong*) theAddress; ULong* theEnd = (ULong*) (theAddress + theSize); while (theROMCrsr < theEnd) { *theBinaryCrsr++ = *theROMCrsr++; } END_WITH_LOCKED_BINARY(outBinary) return NILREF;}// ====================================================== //// "Yacc" owes much to a most stimulating collection oEOF //// ====================================================== //
@@ -0,0 +1 @@
ROMDumper; Module ROMDumperDump
@@ -0,0 +1,10 @@

AREA |@NCTBuiltMain|,REL,CODE,READONLY
;
; Dummy main to reference all the functions for the linker
ENTRY
__NCTMain_ROMDumper
; Module ROMDumper
IMPORT Dump
b Dump
END
Binary file not shown.

0 comments on commit c48d0ef

Please sign in to comment.
You can’t perform that action at this time.