Professional Documents
Culture Documents
2.
3.
4.
5.
6.
and a checksum.
Michael Steil: Reconstructing the Leftovers on the Amiga Kickstart 1.0 Disk
Every directory entry occupies a complete sector, and deleting a file means
just removing the links to the directory entry sector, without touching the
data sectors or the directory entry sector at all. And whats best: For performance reasons, directory entries are clustered around the center of the
disk, i.e. sector 880, which, in our case, has not been overwritten by the
ROM image, so it should be easy to get some data out of this disk.
Extraction Program
The program to extract the data from the disk uses the following algorithm:
It iterates over all sectors from the end of the ROM image to the end of the
disk image and looks at the sector type. If it is a data block, it looks at the
parent, in the hope that it is an intact directory entry. If this is the case, it
walks back the list from parent to parent to get the full path and filename
of the file. If the directory entry has not survived, the file will get the index
of the directory entry as a name. As we now know the filename of the file
the sector belongs to and we can read the sequence number from the sector header, it is possible to write 488 bytes worth of data into the output
file.
Here is the source code of the program to extract the files: extract-adf.c
Results
The disk seemed to have contained C header files and assembly includes
earlier, and has then been overwritten with the current set of command line
tools of AmigaOS (the name of the disk cli26.1 reflects this), extended
with some custom development tools used by Commodore-Amiga.
Since the DOS part of the Amiga operating system is actually based on the
only very slightly modified Metacomco Tripos operating system, the command line tools as well as the development tools mentioned in the following sections are mostly the same as those found in Tripos; therefore the
terms Tripos and AmigaDOS may be used interchangeably.
CLI Programs
The c subdirectory contains the following command line tools that can
also be found on the Workbench 1.0 disk:
Assign
Echo
If
Prompt
Stack
Break
Ed
Info
Protect
Status
CD
Edit
Install
Quit
Type
Copy
EndCLI
Join
Rename
Wait
Date
Execute
Lab
Run
Why
Delete
FailAt
List
Search
Dir
Fault
MakeDir
Skip
NewCLI
Sort
DiskCopy Format
Michael Steil: Reconstructing the Leftovers on the Amiga Kickstart 1.0 Disk
Disk-Validator
Port-Handler
Ram-Handler
But these may very well be earlier versions. DiskCopy for example is significantly smaller than the Diskcopy that shipped with Workbench 1.0.
Development Tools
The following command line utilities can also be found in c. They do not
ship with WorkBench, but are part of a separtare tools disk for developers,
as described in the AmigaDOS Manual. Some also exist on pre-1.0 beta
versions of Workbench, although possibly in different versions.
Alink
DiskEd
Down-
Load
DumpObj
Michael Steil: Reconstructing the Leftovers on the Amiga Kickstart 1.0 Disk
PCC) is mentioned in a header file in the Native Development Kit for AmigaOS as printed in AMIGA ROM Kernel Reference Manual: Libraries and Devices, next to the suggested native compiler Lattice C and two other
compilers, implying that PCC could be used for Amiga development.
The AmigaDOS manual says that the tools available on the Sun Microsystem for cross development include the assembler, linker, and two C compilers. One compiler is explicitly mentioned: It is the Greenhills C compiler (metacc; the name suggests it was Metacomcos shipping C compiler
for Tripos); the other one is presumably PCC. According to this resume, the
first versions of the ROM were compiled using the Greenhills C compiler.
So Commodore-Amiga must have cross-developed AmigaOS on BSD with
the Greenhills C compiler.
New Executables
c/d
c/Read
c/ReadPref
accesses config/preferences
demos/ImageEdit
devs/narrator.device
libs/translator.library
libs/translator.library
The header of the libraries contain the respective versions. Note that the
newer version of narrator.device has the older timestamp. PDT implies
that AmigaOS has been written on the US West Coast - in the California office of Commodore. For comparison, Workbench 1.0 shipped with
narrator 1.6 (10 Sep 1985)
translator 1.3 (4 Sep 1985)
Michael Steil: Reconstructing the Leftovers on the Amiga Kickstart 1.0 Disk
Misc Files
config/preferences
s/startup-sequence
ReadPref
echo Use the DATE command to set date and time
wait 1 sec
date
t/ed-backupequence
Comment
935
amiga.lib
1077 crt0.obj
1074 clib/macros.h
1025 exec/alerts.h
1026 exec/execname.h
1045 graphics/clip.h
1050 graphics/clip.i
1051 graphics/collide.h
1052 graphics/copper.h
1053 graphics/display.h
1054 graphics/gels.h
Michael Steil: Reconstructing the Leftovers on the Amiga Kickstart 1.0 Disk
1055 graphics/gels.i
1056 graphics/gfx.h
Feb
85
Dale
added
Rectangle,BitMap
structures
1057 graphics/gfx.i
1048 graphics/gfxbase.h
1059 graphics/gfxbase.i
1060 graphics/gfxmacros.h
9-07-84
Dale
fixed
macros
to
use
new
RastPort
1061 graphics/graphint.h
1062 graphics/layers.h
1063 graphics/layers.i
1064 graphics/rastport.h
1065 graphics/rastport.i
1058 graphics/regions.h
1066 graphics/regions.i
1067 graphics/sprite.h
1068 graphics/sprite.i
1 0 2 7 graphics/text.i
1071
2-8-85
Dale
conversion
to
24
View-
>ViewPort
1073 graphics/view.i
1044 intuition/intuition.h 1-30-85 -=RJ=- created this file!
1047 intuition/intuition.i 6-13-85 =VoodooDrRj= added back the comments
1009 libraries/translator.h
1029 libraries/translator.i
1030 libraries/dos.h
1032 libraries/dos.i
1033 libraries/dosextens.h
1034 libraries/dosextens.i
1035 libraries/mathffp.h
Michael Steil: Reconstructing the Leftovers on the Amiga Kickstart 1.0 Disk
1036 resources/cia.i
1043 resources/ciabase.i
1041 resources/disk.i
1042 resources/disk.h
1038 resources/potgo.h
1031 resources/potgo.i
1039 resources/misc.i
1040 resources/misc.h
1070 diag/romdiag.i
Unlike the published NDK headers, these still contain the revision control
and author information. All files use UNIX line breaks (LF).
Some files contain the address of Commodore-Amiga, which was:
Commodore-Amiga Incorporated
983 University Ave. Building #D
Los Gatos, California, 95030
Michael Steil: Reconstructing the Leftovers on the Amiga Kickstart 1.0 Disk
devices/serial.i
devices/timer.h
devices/timer.i
devices/trackdisk.h
devices/trackdisk.i
hardware/blit.i
hardware/intbits.h
Avail
ObjDump
SetPref
Conclusion
The following conclusions can be drawn from this exercise:
1.
The reduncandy in the Amiga Old Filesystem makes this filesystem perfect
for reconstructing deleted and even partially overwritten data.
2.
3.
The disk was used to move developer tools and header files between machines.
4.
Version 1.0 of the OS has been developed in the California office of Commodore - the original Amiga office.
Open Questions
1.
2.
How does the version numbering (26.1 etc.) work? How is it related to
source control?
3.
Does the 1.0 NDK still exist somewhere? It should have shipped with Lattice
C, at least. It would be very interesting to compare these headers and includes with the 1.0 NDK ones; for real differences, and for changes in the
comments.
4.
What are the differences between these headers and the 1.0 headers? Any
last minute changes?
Links
http://gega.homelinux.net/AmigaDevDocs/
Michael Steil: Reconstructing the Leftovers on the Amiga Kickstart 1.0 Disk
/*
* extract-adf.c
* (C)2008 Michael Steil, http://www.pagetable.com/
* Do whatever you want with it, but please give credit.
*/
#include <libc.h>
#include <sys/_endian.h>
#define SECTORS 1760
#define FIRST_SECTOR 513 /* for kick10.adf */
#define
#define
#define
T_HEADER 2
T_DATA 8
T_LIST 16
type;
header_key;
seq_num;
data_size;
next_data;
chksum;
struct fileheader {
struct blkhdr hdr;
uint8_t misc[288];
uint32_t unused1;
uint16_t uid;
uint16_t gid;
uint32_t protect;
uint32_t byte_size;
uint8_t comm_len;
uint8_t comment[79];
uint8_t unused2[12];
uint32_t days;
uint32_t mins;
uint32_t ticks;
uint8_t name_len;
char filename[30];
uint8_t unused3;
uint32_t unused4;
uint32_t real_entry;
uint32_t next_link;
uint32_t unused5[5];
uint32_t hash_chain;
uint32_t parent;
uint32_t extension;
uint32_t sec_type;
};
struct dataheader {
struct blkhdr hdr;
uint8_t data[488];
};
union sector {
struct blkhdr hdr;
struct fileheader fh;
struct dataheader dh;
};
#define DATABYTES (sizeof(union sector)-sizeof(struct blkhdr))
union sector sector[SECTORS];
void printfilename(int i) {
if (ntohl(sector[i].hdr.type) != T_HEADER)
return;
if (sector[i].fh.parent) {
printfilename(ntohl(sector[i].fh.parent));
}
printf("/%s", sector[i].fh.filename);
}
int main() {
FILE *f;
int i, j;
uint32_t type, header_key;
char filename[31];
f = fopen("kick10.adf", "r");
int r = fread(sector, sizeof(union sector), SECTORS, f);
printf("sectors: %d\n", r);
fclose(f);
Michael Steil: Reconstructing the Leftovers on the Amiga Kickstart 1.0 Disk
//
}
printf("%x: byte_size %d\n", i, ntohl(sector[i].fh.byte_size));
break;
case T_DATA:
header_key = ntohl(sector[i].hdr.header_key);
if (header_key<SECTORS && ntohl(sector[header_key].hdr.type) == T_HEADER) {
printf("%x: filename \"%s\"\n", i, sector[header_key].fh.filename);
printf("%x: byte_size %d\n", i, ntohl(sector[header_key].fh.byte_size));
strncpy(filename, sector[header_key].fh.filename, sizeof(filename));
} else {
snprintf(filename, sizeof(filename), "%04d.txt", header_key);
}
printf("XXX \"%s\" %03d: ", filename, ntohl(sector[i].hdr.seq_num));
printf("XXX \"");
printfilename(header_key);
printf("\" %03d: ", ntohl(sector[i].hdr.seq_num));
for (j=0; j<16; j++) {
uint8_t c = sector[i].dh.data[j];
if ((c>=32 && c<128)||c==9) {
printf("%c", c);
} else {
printf("<0x%02x>", c);
}
}
printf("\n");
f = fopen(filename, "r+"); /* try to open existing file */
if (!f)
f = fopen(filename, "w"); /* doesn't exist, so create */
fseek(f, (ntohl(sector[i].hdr.seq_num)-1)*DATABYTES, SEEK_SET);
printf("seek to %ld\n", (ntohl(sector[i].hdr.seq_num)-1)*DATABYTES);
fwrite(sector[i].dh.data, ntohl(sector[i].hdr.data_size), 1, f);
fclose(f);
}
printf("\n");
return 0;
10