source: buchla-68k/readme.txt@ 87361de

Last change on this file since 87361de was 87361de, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Prepend a header to midas.abs.

  • Property mode set to 100644
File size: 6.6 KB
Line 
1Buchla 700 Firmware
2-------------------
3
4This repository, buchla-68k.git, contains a port of the Buchla 700
5firmware source code to a modern GCC-based cross-compilation
6environment.
7
8The resulting executable code needs to be run on emulated Buchla 700
9hardware, such as the one in the companion repository, buchla-emu.git.
10
11The source code was originally released on Aaron Lanterman's Buchla
12700 Preservation Page:
13
14 http://lanterman.ece.gatech.edu/buchla700/
15
16Aaron seems to have received the source code directly from Lynx Crowe,
17the developer.
18
19The licensing conditions are a little vague; Lynx released the source
20code "for noncommercial personal and educational use" and "as-is with
21no guarantees of completeness or correctness."
22
23While our modifications are in the public domain, Lynx's request still
24applies to the underlying original code. Please respect that.
25
26Note that this is just the code that runs on the Buchla 700's Motorola
2768k CPU:
28
29 1. The BIOS and ROMP debug monitor.
30
31 2. The MIDAS VII GUI-driven editing and control software.
32
33In particular, there's no code for anything related to the actual
34sound generation.
35
36Building with a GCC cross-compiler
37----------------------------------
38
39*** Setting up the cross-toolchain
40
41To build the code, you need a cross-toolchain, i.e., GCC and binutils,
42for the m68k-none-elf target. Let us show you, how we built the one
43that we use, binutils 2.28 and GCC 6.3.0. It lives in /opt/cross-m68k.
44
45First, binutils:
46
47 tar jxvf binutils-2.28.tar.bz2
48 cd binutils-2.28
49
50 mkdir build
51 cd build
52
53 ../configure --prefix=/opt/cross-m68k --target=m68k-none-elf
54
55 make -j2
56 make install
57
58Second, GCC:
59
60 # Important! Otherwise, the GCC build won't find the binutils that
61 # we just made!
62
63 export PATH="/opt/cross-m68k/bin:${PATH}"
64
65 tar jxvf gcc-6.3.0.tar.bz2
66 cd gcc-6.3.0
67
68 mkdir build
69 cd build
70
71 ../configure --prefix=/opt/cross-m68k --target=m68k-none-elf \
72 --enable-languages=c --without-headers
73
74 # Don't build everything, because features like GCC's stack
75 # protector will otherwise cause trouble.
76
77 make -j2 all-gcc all-target-libgcc
78 make install-gcc install-target-libgcc
79
80Now, as we put /opt/cross-m68k/bin in our PATH, we should be able to
81run the cross-compiler as follows:
82
83 user@host:~$ m68k-none-elf-gcc --version
84 m68k-none-elf-gcc (GCC) 6.3.0
85 Copyright (C) 2016 Free Software Foundation, Inc.
86 This is free software; see the source for copying conditions. There is NO
87 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
88
89 user@host:~$
90
91*** Cross-compiling the source code
92
93Once you have the cross-toolchain in place, invoke
94
95 make bios.img
96
97from the top-level directory of this repository to build the BIOS and
98ROMP debug monitor.
99
100To build MIDAS VII, invoke
101
102 make midas.abs
103
104instead.
105
106Building with Alcyon C
107----------------------
108
109Lynx developed the Buchla 700 firmware on an 68k-based Atari system
110with the Alcyon C compiler, assembler, and linker from Atari's TOS
111Developer Kit.
112
113If you want to relive this experience, you can do so thanks to the
114Hatari emulator, which emulates a suitable Atari system. Here's the
115idea:
116
117 * The hatari/c subdirectory contains the Atari C compiler,
118 assembler, and linker. It is turned into a harddrive image for the
119 emulator's C: drive.
120
121 * The hatari/d subdirectory is shared with the emulator, i.e., it is
122 not turned into a harddrive image. It is the emulator's D:
123 drive.
124
125 Any changes to this directory from inside the emulator are
126 instantaneously visible outside the emulator, and vice versa. We
127 use this as a means of communication between these two worlds.
128
129 The subdirectories under hatari/d contain links to the original
130 source code files. In addition, the compiled results go to
131 hatari/d/out.
132
133 * We have a Python script (hatari/rem.py) that acts as a remote
134 control for the emulator. It issues the commands required to
135 compile or assemble the source code files.
136
137You PATH needs to be set, such that the shell can find the Hatari
138executable:
139
140 user@host:~$ hatari --version
141
142 Hatari v2.0.0 - the Atari ST, STE, TT and Falcon emulator.
143
144 Hatari is free software licensed under the GNU General Public License.
145
146 user@host:~$
147
148We use Hatari 2.0.0 with version 0.9.8 of the open-source TOS
149replacement EmuTOS.
150
151Now you need to run two things in parallel, the remote control Python
152script as well as the Hatari emulator. The Python script goes
153first. In one shell window, invoke
154
155 make rem
156
157from the top-level directory of the repository to start the
158script. The script then waits for the emulator to come up and connect
159to it. Now run Hatari. In another shell window, invoke
160
161 make emu
162
163from the top-level directory of the repository. This creates a
164harddrive image from hatari/c and starts the emulator with appropriate
165command line options.
166
167When the EmuTOS desktop comes up, open the C:\BIN folder and run
168SH.TTP without any parameters. This opens a Unix-like shell, the Okami
169Shell. This is the shell that the Python script expects to control.
170
171Now, back in the window with the Python script, press the enter
172key. This tells the Python script to start sending commands to the
173shell in the emulator.
174
175Compiling the C and assembly language files of the source code takes
176quite a while. Once the process is complete, the hatari/d/out
177directory contains the following files:
178
179 * C source code (.c) files get compiled into assembly language
180 source code (.s) files, and then assembled into object (.o) files.
181
182 We keep both, .s and .o files. This proved useful when porting the
183 original source code to the cross-toolchain, because we could
184 compare the compiler output of the cross-toolchain to the original
185 output of the Alcyon C toolchain.
186
187 This made us realize, for example, that Alcyon C uses 16-bit int
188 values, whereas GCC defaults to 32-bit int values.
189
190 * Assembly language source code (.s) files get assembled into object
191 (.o) files. We keep those, too.
192
193 * Some of the object files (.o) get archived into static library
194 (.a) files.
195
196 * bios.abs, which is the BIOS and ROMP debug monitor.
197
198 * midas.abs is notably absent. Its object (.o) files are all there,
199 but our Atari TOS Developer Kit is newer than Lynx's and it comes
200 with a different linker (aln), which is not entirely compatible
201 with the older linker that Lynx used (link68).
202
203 While it would be possible to get linking to work with aln, we
204 decided to focus our attention on the cross-toolchain instead.
205
206For your convenience, all the .s, .o, and .a files, as well as
207bios.abs can also be found in the alcyon subdirectory of this
208repository. Just in case you are interested in them, but would prefer
209not to go through the emulator exercise.
Note: See TracBrowser for help on using the repository browser.