Skip to content

Commit ed25b09

Browse files
Initial Commit
1 parent a253eae commit ed25b09

2 files changed

Lines changed: 356 additions & 21 deletions

File tree

Installing Darwin.txt

Lines changed: 351 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,351 @@
1+
Darwin 8.0.1 (corresponding to Mac OS X 10.4) seems to be the latest available full installer image, at least, until the PureDarwin project produces a new one.
2+
3+
List of available ISO images
4+
5+
More recent versions of packages are available in source form:
6+
7+
Open Source website (links by OS release)
8+
9+
Full list of packages (some aren't linked under any OS release)
10+
11+
Installing
12+
13+
Download and extract installation CD image:
14+
15+
Darwin 8.0.1 (was under �Darwin 8.0.1 Installer CD� on old website)
16+
17+
MD5: dbd260dda994093a11c31afbe624aa34
18+
19+
SHA-256: a26f9f14795fe0687bd647d41b712464c9a61430736fae4aa0fdb89207e1a62a
20+
21+
$ gunzip darwinx86-801.iso.gz
22+
23+
Set up QEMU VM:
24+
25+
$ qemu-img create -f qcow2 darwin.qcow2 10G
26+
27+
Start VM:
28+
29+
$ qemu -net none -drive file=darwin.qcow2,cache=writeback -cdrom darwinx86-801.iso -boot d
30+
31+
Other useful qemu options: -m 512 and -enable-kqemu
32+
33+
Installation steps:
34+
35+
First boot:
36+
37+
Select disk
38+
39+
"2" (manual partitioning)
40+
41+
"y" (initialize MBR)
42+
43+
In fdisk:
44+
45+
> auto hfs
46+
47+
Ignore the warning
48+
49+
> update
50+
51+
> write
52+
53+
> quit
54+
55+
Enter partition name
56+
57+
"yes" (clean install)
58+
59+
"darwin" (volume name)
60+
61+
Continue (reboot)
62+
63+
Second boot (make sure to boot from CD again):
64+
65+
Select disk
66+
67+
"3" (existing partition)
68+
69+
Enter partition name
70+
71+
"hfs" (HFS+ filesystem)
72+
73+
"yes" (clean install)
74+
75+
"darwin" (volume name)
76+
77+
Wait for installation to complete...
78+
79+
Enter root password
80+
81+
"darwin" (hostname)
82+
83+
"3" (spawn shell)
84+
85+
# halt
86+
87+
Configure VM for normal startup:
88+
89+
Remove QEMU flags -cdrom darwinx86-801.iso -boot d
90+
91+
Basic configuration
92+
Enable VM networking
93+
94+
Change QEMU flags: -net none ? -net nic,model=rtl8139 -net user
95+
96+
SSH access
97+
98+
Change QEMU flags: -net user ? -net user,hostfwd=tcp:127.0.0.1:10022-:22 (pick any port instead of 10022)
99+
100+
Log in to VM, enable SSH:
101+
102+
# service ssh start
103+
104+
Connect to VM with
105+
106+
$ ssh -p 10022 root@localhost
107+
108+
Optionally add an alias to host ~/.ssh/config to simplify connecting:
109+
110+
Host darwin-vm
111+
HostName localhost
112+
Port 10022
113+
User root
114+
115+
Connect to VM with
116+
117+
ssh darwin-vm
118+
119+
Install public key to simplify logging in:
120+
121+
$ cat .ssh/id_rsa.pub | ssh darwin-vm 'mkdir .ssh; cat >>.ssh/authorized_keys'
122+
123+
Add -nographic to QEMU flags to disable console window, which is no longer required
124+
125+
Some familiar aliases
126+
127+
# echo "alias ll='ls -l'" >>/etc/bashrc
128+
129+
# echo "alias la='ls -lA'" >>/etc/bashrc
130+
131+
Timezone
132+
133+
# ln -sf /usr/share/zoneinfo/UTC /etc/localtime
134+
135+
Temporary filesystem
136+
137+
Using a temporary disk image to build software helps keep the main disk image file smaller.
138+
139+
$ qemu-img create -f qcow2 scratch.qcow2 10G
140+
141+
Add QEMU flag: -drive file=scratch.qcow2,cache=writeback and boot
142+
143+
Figure out which disk number corresponds to the scratch drive:
144+
145+
# mount
146+
147+
# ls /dev/rdisk*
148+
149+
It's the one that isn't mounted and doesn't have any partitions (sn-suffixed files)
150+
151+
It's usually, but not always, /dev/rdisk1
152+
153+
# newfs_hfs -v scratch /dev/rdisk1
154+
155+
# reboot
156+
157+
Available as /Volumes/scratch on next boot
158+
159+
Notes
160+
161+
The VM sometimes fails to boot with "panic(...): nfs_boot_init failed"; if this happens, restart it.
162+
163+
Updating the system
164+
Kernel (xnu)
165+
166+
It breaks support for FAT (and thus the QEMU virtual FAT drive)
167+
168+
Support for FAT is in the msdosfs package which requires Xcode to build
169+
170+
An alternative to the virtual FAT drive for transferring files is writing tar archives directly to an unpartitioned drive
171+
172+
SSH scp is another alternative
173+
174+
Requires:
175+
176+
corresponding cctools (e.g. initially installed version or cctools-590.42.1, but not cctools-667.3)
177+
178+
gcc 3.3 (revert if changed with gcc_select 3.3)
179+
180+
Source package: xnu-792.6.76.tar.gz (update to version listed under �Mac OS X 10.4.3�)
181+
182+
MD5: 854f44519778e8bde4283e275ed154e6
183+
184+
SHA-256: 35c5ed2f1399c770583a229a733d064dc302ae6327a7fcb40996e1f3c474f568
185+
186+
Building:
187+
188+
# cd /Volumes/scratch
189+
190+
# tar xzf xnu-792.6.76.tar.gz
191+
192+
# cd xnu-792.6.76
193+
194+
Patch to help build gcc_42-5577:
195+
196+
# sed -i.tmp 's/defined *(__i386__)/& || defined(__x86_64__)/' bsd/{machine,sys}/*.h
197+
198+
# make DSTROOT= install
199+
200+
Reboot. uname -r is now 8.7.0.
201+
202+
Standard library (Libc)
203+
204+
Requires updated xnu (xnu-792.6.761).
205+
206+
Source package: Libc-391.2.10.tar.gz (update to version listed under �Mac OS X 10.4.3�)
207+
208+
MD5: 7a1a08d1b68668fc41916d6cf39182a4
209+
210+
SHA-256: e90b78d310235544623f26c6f18e27b329b5bc778deab8e57332e8e90ab92f11
211+
212+
Building:
213+
214+
# cd /Volumes/scratch
215+
216+
# tar xzf Libc-391.2.10.tar.gz
217+
218+
# cd Libc-391.2.10
219+
220+
# sed -i.tmp s/NOTIFY_STATUS_OK/0/g gen/{asl.c,syslog.c}
221+
222+
Patch to help build gcc_42-5577:
223+
224+
# sed -i.tmp 's/defined *(__i386__)/& || defined(__x86_64__)/' include/machine/*.h
225+
226+
# make OBJROOT="$PWD"/obj install
227+
228+
Upgrading GCC
229+
dyld
230+
231+
This is optional.
232+
233+
Source package: dyld-46.16.tar.gz (under �Mac OS X 10.4.11.x86�)
234+
235+
MD5: a97d4d2a77b3e5f2ff9757007cae0596
236+
237+
SHA-256: cf753c3a2cef239b1334c56603b36d206f54d613daa078ce0f2d73c3e2a0dd82
238+
239+
Makefile: dyld.mk
240+
241+
Darwin doesn't include Xcode, which is required to build this package. This makefile provides alternative build instructions.
242+
243+
Building:
244+
245+
# cd /Volumes/scratch
246+
247+
# tar xzf dyld-46.16.tar.gz
248+
249+
# cd dyld-46.16
250+
251+
# sed -i.tmp '/case CPU_TYPE_X86_64:/,/break;/d;/__pthread_tsd_first/d' src/dyld.cpp
252+
253+
# ln -s libstdc++.a /usr/lib/gcc/i686-apple-darwin8/4.0.0/libstdc++-static.a
254+
255+
# bsdmake -f dyld.mk VERSION_DYLD=46 install
256+
257+
cctools
258+
259+
Choice of version:
260+
261+
cctools-667.3
262+
263+
Too new to build xnu.
264+
265+
Source package: cctools-667.3.tar.gz (under �Mac OS X 10.5.8�)
266+
267+
MD5: 518166e6ddbd0287bebee3d00fddee7d
268+
269+
SHA-256: 1ba43a3d3bcf138a196e714666927c706857226adccf2e69db4f08e940631c0d
270+
271+
cctools-590.42.1
272+
273+
Too old to build gcc.
274+
275+
Source package: cctools-590.42.1.tar.gz (update to version listed under �Mac OS X 10.4.3�)
276+
277+
MD5: 6d875c5483699fd0f1e150facae35256
278+
279+
SHA-256: 61c86c4dc556daafbabebd8162bfbce8214843b218fefbd15c6c1ba03d225a10
280+
281+
Building:
282+
283+
# cd /Volumes/scratch
284+
285+
# tar xzf cctools-667.3.tar.gz
286+
287+
# cd cctools-667.3
288+
289+
# sed -i.tmp '/install.*strip/{h;s/strip/seg_hack/gp;g;s/ -s / /;}' misc/Makefile
290+
291+
# sed -i.tmp s/ld_classic/ld/ ld/Makefile
292+
293+
# make install
294+
295+
The new assembler will often show the warning "indirect jmp without '*'" on code generated by the old GCC.
296+
297+
gcc
298+
299+
Choice of version:
300+
301+
gcc_42-5577
302+
303+
Latests gcc_42 package (newer packages are named gcc). GCC 4.2.1. Requires patched system include files, which can be done when upgrading xnu and Libc (see above).
304+
305+
Source package: gcc_42-5577.tar.gz (update to version listed under �Mac OS X 10.5.8�)
306+
307+
MD5: dab7ad45f76919f058a6f1cf3a0e91d8
308+
309+
SHA-256: fd6459ab701b41dc1297cdbc27f302c558d766505cfe8dd1d6ec0d257fef0e81
310+
311+
gcc_42-5531
312+
313+
Slightly older version. Doesn't require any changes to include files.
314+
315+
Source package: gcc_42-5531.tar.gz (under �Mac OS X 10.5.8�)
316+
317+
MD5: 959ecd224cea2477d57b1c3026fe05ee
318+
319+
SHA-256: 924862e2092fa11754ec9226a0de4772d831c40500231728055d00d1bb3a632e
320+
321+
Requires cctools-667.3 and optionally dyld
322+
323+
Building:
324+
325+
# cd /Volumes/scratch
326+
327+
# tar xzf gcc_42-5577.tar.gz
328+
329+
# cd gcc_42-5577
330+
331+
If dyld isn't upgraded, patch to revert debugging format from DWARF to stabs:
332+
333+
# sed -i.tmp 's/\(#define PREFERRED_DEBUGGING_TYPE \).*/\1DBX_DEBUG/' gcc/config/darwin.h
334+
335+
# sed -i.tmp '/darwin_macho_att_stub/s/Init.*//' gcc/config/darwin.opt
336+
337+
# sed -i.tmp '/x86_64/s/|| exit 1//' build_gcc
338+
339+
# ln -s true /usr/bin/dsymutil
340+
341+
# gnumake RC_ARCHS=i386 install
342+
343+
Don't try to set DSTROOT=/, it deletes everything.
344+
345+
# cp -pR dst/* /
346+
347+
# cp -pR obj/dst-i686-i686/usr/lib/libgcc_s* /usr/lib/gcc/i686-apple-darwin8/4.2.1/
348+
349+
GCC is now installed as gcc-4.2.
350+
351+
It can be made default with gcc_select 4.2.

0 commit comments

Comments
 (0)