WWDC2004 Session 105
Transcript
Kind: captions
Language: en
afternoon my name is kevin van vechten
I'm a open source software engineer
with Apple I'll be talking today about
the core of Mac OS 10 which is known as
Darwin it's a BFD layer an old eunuch
style it's open source and today I'll be
talking a bit about where you can find
the sources how you can download them
and build them on your own system to
make your own customization so first I'd
like to talk a little bit about what's
new at Apple last year since WWDC we've
announced the a psl version to license
the majority of the code that Apple
develops is released under the apple
public source license known as the acs l
which was all written OSI approved
license in a courtship or open source
initiative now it's also a free
corefoundation free software license so
it's not GPL compatible but it is
recognized as a free software licensed
by the FSF also we've unified the Apple
IDs with our a psl registration so the
same Apple ID that you use at your mac
com account for itunes music store for
apple developer connection can now be
used to agree to the license to download
these sources and also we had our darwin
701 release which corresponded to mac OS
10.3 panther so at Apple we have several
open source projects we dot and we have
Darwin streaming server rendezvous
header dock the list goes on some really
great technology that we have available
you should check out on our open source
site and the slides that you should
check it out at is develop calm / Darwin
the one listed up top I don't really
like to strongly recommend subscribing
to some of the mailing lists at apple
com these are lists where members of the
community who are interested in open
source can discuss various issues
they're having and there are also a lot
of engineers at Apple who participate on
these lists who gives responses to bug
reports or general technical questions
additionally I'd like to point out open
darwin org open darwin org is a mirror
of the sources available at Apple and
also hosts various other open source
projects that are related to Mac os10
such as Darwin ports there's also close
collaboration with the think project
both of which the URLs are listed here
and those two projects bring a large
number of third-party open source
applications to Mac OS 10 so what you'll
learn in this session is what's in
Darwin and where you can get it how to
build most of the projects that are in
Darwin they they tend to follow a common
format and we'll go over the best
practices for building these sources and
also how you can use these projects on a
Mac os10 system and I'll specifically
i'll be talking about what things are
generally safe to replace on mac OS 10
with your own custom iver customized
versions and what things you should
probably avoid replacing even though
they're open source and finally I'll go
over a brief outline of how you can make
a bootable CD that has Darwin on it
which might be useful you know for an
open source project might also be useful
to come up with some sort of UNIX
recovery CD for your own development
purposes so Darwin is the open-source
core of Mac OS 10 at the lowest level
it's the colonel on top of that is iokit
libraries and families iokit drivers and
finally it's the BFC commands and
libraries anything that you have access
to from terminal bought app or X term
and darwin can be very helpful to you as
a developer it's a place to look for
reference sample code so for example a
lot of the new work you've been hearing
about in the past couple days has had to
do with the new kernel programming
interfaces and finer grained locking in
the colonel you can check out the
sources to see either the ms-dos FS or
webdav FS has an
sample of these new locks in use in
Tiger and those sources are on the
website you can also use these sources
to debug your projects you know perhaps
it'd be helpful if you added 2k print
into the kernel at a certain step
because the driver you're riding is
having issues it really lets bug from
the inside and see both sides of the
picture when you're debugging your your
programs you can customize your system
you know perhaps there's a feature that
Apple doesn't provide but there's a
patch against parole or against Python
or any other open source component it's
possible for you to download the sources
apply the patch and then get that
feature on Mac OS 10 and of course there
are also a lot of research opportunities
whether you're interested in machine
virtualization or or whatever you know
there's the ability to to tinker with
the the underpinnings of the operating
system and try new things out so i'll go
over brief history of darwin darwin was
first released as a bunch of images of
the sources of portions of mac OS 10
server 1.0 and that was over five years
ago since then we've had to darwin
release that corresponds with each major
mac OS 10 release you can notice about
halfway down the list there was a break
in the numbering from darwin one series
to darwin five six and seven we have the
darwin versions match the major number
in the build number of Mac OS 10 so
there's some consistency now you can see
you know Mac OS 10.1 had a build number
that's started with a five and darwin
5.1 was released answer had a build
number that started with the 7 and
that's also darwin seven so you can
generally match things up using the
builds number and the darwin number so
you can get darwin from the open source
web site the the main link for you know
a lot of text on Darwin is
developer.apple.com / Darwin which I
mentioned earlier but the actual sources
live on the WWE open-source apple com
server they're also mirrored at darwin
source open darwin org we organized the
sources by Mac os10 relief so for each
least there's a page that has a list of
all the open source projects there's the
name of the project the license that
it's covered under whether it's the
Apple public source license or another
license and then there's also a tar
archive that you can download of those
sources so there's also a neat trick for
getting all the sources if you if you
want to grab them all at once you can go
to the open darwin site and they offer
anonymous rsync access on the darwin
source files so this is an example
command up here where it's grabbing all
of the sources that correspond to Mac
os10 point three point four you could
you could change the version number two
different Burton and grab them grab
those sources instead and the details
are available on the open darwin site so
now i'm going to talk about building the
projects that are in darwin at Apple we
have a proprietary build system the 10
build system and it's fairly heavy
weight and deals with a lot of issues
related to to building Mac OS 10 and a
lot of the projects that are in Darwin
are customized to be built with this
build system unfortunately it's not
practical to have this available outside
of Apple and so what we'll be talking
about is some of the expectations that
these projects might have but the 10
build system provides and how you can
set you up your environment to build
projects in the same manner so before
you start it's important to realize that
there are a lot of variables involved in
building software there's the compiler
tool version you have we have GCC 295
GCC 31 33 and now 35 with tiger so it's
important to build sources with the the
correct set of compiler tools generally
speaking the version of the compiler
that was used to build a given Mac os10
relief is the same GCC compiler that was
shift on that 10 release so for anything
in the Panther series of software
updates you'll want to use the GCC
compiler that came on the developer
tools accompanying maco
10.3 it's also important to realize that
the environment variables in your shell
have a large impact on how things get
built there are variables like the sea
flags or ldflags which pass extra
arguments to the compiler or as linker
so if you don't want them to be set to
be sure to unset you know any
unnecessary variables before building
because it can change the results of the
build it's also equally important to set
the correct environment variables that
the project's might be expecting and
I'll talk about those in a minute the
libraries and headers that you have
installed on your system are also
important you know that's what the
projects are going to link against and
so it's always important to keep in mind
what versions you have installed on your
system and when you're building these
projects there they will use those
versions so if you are anticipating
deploying the project to a different
machine you probably want to build on
something like 10 dot 3 base and they
would have the most compatibility over
all the extra software updates if you
build on something later like 10 33 or
1030 for it might pick up some changes
that may or may not be backward
compatible so it's generally speaking
easier to be forward compatible than
backward compatible the another issue is
for example the the file systems with
10.2 i believe it was Deb random was
introduced well if you're if you're
targeting a piece of software prior to
tend to Deb random is going to be there
and there's there's not much you can do
about it likewise if you're building
software for ten two and you're on ten
one dev randoms not going to be there so
if you have an auto cons configure
script that's automatically detecting
what features are available it's not
going to know that your system your
you're targeting should there shouldn't
have Deb random it's the system you're
on differs so again it's just really
important to be building on the same
style of system as you want to
ultimately use the project on
so the overall requirements for building
software generally more RAM is better
and more disqus better obviously you can
you can build sources with less than
these requirements but generally
speaking having about 300 megabytes of
RAM will will keep you from swapping a
lot as you're doing large builds and if
you if you intend to build a lot of
projects that are in Darwin you know I
recommend at least two gigabytes of
space to work with a lot of the
intermediate files during building can
take up a lot of space and it's always
unfortunate to see a very long compiled
I because you ran out of space on Mac OS
10 while you're building is important to
have the developer tools installed
obviously you'll need those two to have
the compiler on the system but it's also
important to have the BFC f ck and the
x11 f ck installed i think i skipped an
item the BFC package on the on the cds i
believe it's defaulted to install these
days but in the past it may have been an
optional install so make sure you have
all of your your b SD command line tools
because a lot of the sources require
those to build properly so another
important issue is many of the sources
may rely on a case sensitive file system
for example the CVS project uses
lowercase CVS to denote it be the
executable and a lot of the sources but
it also is checked into CVS and so there
are uppercase CVS directories on the
file system because of this is
recommended to do all your building on a
case sensitive file system whether
that's ufs or h fsx and i find that disk
images work particularly well for doing
this on mac OS 10 on darwin
unfortunately disk images aren't
available so it will be necessary to use
a separate partition shown here is an
example command HDI util which will
create a 4 gigabyte HFS x
volume so that has all the the speed and
journaling advantages of h of s but it's
also case sensitive by default cause you
to build something like the CBS project
next I'll talk about the show
environment many of the the make files
that are used by these sources expect
certain environment variables to be set
apple's build system sets for very
critical environment variables and these
are the source route the object route
the symbol route and the destination
route the source route is simply the
absolute path to where the sources are
that you are building the object route
is a path to what should start out as an
empty directory and that is where all
the intermediate dotto files and other
other miscellaneous intermediate files
will be stored during build and will
just delete that directory after a build
succeeded the symbol route is where
debugging versions of any executables
libraries or drivers who builds will be
placed and those versions have all the
symbols and then symbols get stripped
out and finally the destination route is
the final packaged bits it's possible to
take a destination root package it up
you with you know a tar archive or
something of that nature and then open
and then install it on the system that
that you want to run the software on
it's important to create all these
directories before you begin building
since some of the make files won't
create them and then the building might
fail because the directory is missing
it's also important to avoid spaces in
the past names leading up for these
directly do you have spaces and if
there's a bug in a make file and it
decides it wants to wipe out the object
route well you might have some
unfortunate consequences so so really be
careful and and don't use spaces in
these path names finally it's important
to change each of these two route wheel
ownership that way you get the proper
inheritance of the route wheel user ID
and group ID in the destination route if
you
many of the projects only change
explicitly the the ownership of files
that it expects to be different and so
it relies on this default while you're
building so when building projects many
of the projects have a makefile and if
there's a make file you should default
to using a new make to project as that's
what Apple does if there is a PV
projects code file then you'll need to
use xcode build which is a command-line
tool that can build the d project it's
important to always build this route
inside indicated some make files will
change the ownership or the permissions
of the file and the only way to change
ownership at least in that would before
there are ACL is if you have root
privileges so so always be root when you
invoke the new make or when you invoke
Xcode build and there are two main
targets for each of these projects
there's an install headers phase I mean
install headers phase and spells only
the header files so if you have a big
library or an i/o kit family and you're
missing the headers on your system you
don't need to build the entire library
to get the headers it's possible to
shortcut just do the install headers
that will give you the headers you need
for that library and then you can move
on to the next project that you want to
build that requires those headers on the
other hand if you use all target it will
build the ire binary or library etc and
that is a you know the complete package
man pages headers and binaries baffle
here's the basic environment for the CC
tools project now in Mac OS 10 3.4 CC
tools is version 4 95.8 and we'd find
that just by going to the darwin tar
archive so now we can create directories
as as each of these variables point to
and the sources to CC tools 495 h be in
that path that's that's specified
or more environment variables that you
should set there's a project name which
is CC tools there's the project's
version designed 58 there's the build
which is simply the number of attempts
you've made to build this particular
course this is our first attempt so it's
spilled version the architectures or
what architectures you're planning to
build for for Mac os10 that's obviously
PowerPC Darwin actually supports both
386 architecture at the architecture so
you might add in that if you want to the
operating system flag for environment
variables Mac OS the release should be
whatever you're building for so since
this is cici tools from 34 you'll want
to specify a release Panther for past
belief you know 10.0 sweta 10.1 with
Puma 10.2 was Jaguar 10.3 panther a 10.4
will figure again the mac OS deployment
target will affect how header files are
interpreted it should be set to be the
version number of the of what you're
targeting it shouldn't include a soft
state version I believe it should
include the major version so 10.1 to
10.3 here 10.4 for Darwin as I mentioned
there are a couple of variations you may
want to include the i386 architecture
while building you may want to include
extra cflags for example Darwin does not
have the c preprocessor so we're
specifying dash no TPP pre-comp so the
CPP precompiler doesn't doesn't get run
and also the relief is not panther or
tiger but the release is simply darwin
when building Darwin sources so actually
build CC tools we set the environment
variables could also pass all the
sensors as additional arguments the make
command when we're building the sources
it's also very useful to redirect all
the output to a log file these projects
have a lot about put while they're
building and if something goes wrong
your scroll back and not cover it if
it's in a file you can go back and see
where things actually started to go
wrong so in this example here doing sue
dash S which makes everything run its
route again that's very important for
building the sources we're doing a make
install of CC tools PowerPC architecture
I show the source route and the
additional variables you went over
omitted for for brevity the bottom
left-hand corner I'm redirecting entered
error to standard out so both standards
or and standard out will get captured in
the same and then I'm storing it in a in
a log file that you can see there so I'm
going to do a little demo now of going
over the step building CC tools that
we've just discussed
so here i have the command for HDI you
tale will create i guess for speed we
probably don't need a full two gigabytes
so we'll create a disk image quick and
this is where we'll be doing our
building this is an H fsx disk image so
it has case sensitivity
so I've chosen a name of build root for
this example and I'll change into the
bill dude volume now I've already
downloaded the CC tool which is so what
I'm going to do is extract them into
this directory all the courses we
publish on the site already have factory
name of the project named ash project
version so that's already set up you can
just extract it to wherever you want to
build the sources and you're ready to go
so I already have a little script here
that's up the appropriate environment
variables for source root object root
symbol root and desk root it creates the
directories to make sure they before the
building games and zip to the wheel for
each of those and all the environment
variables that were discussed and then
to the directory where the sources are
we make install to build the whole thing
and again variables that we had set in
the environment we also want to pass as
additional argument to make
so now we are running his route and all
do X which basically tells the bash
shell to echo each man said it's running
so we can see step by step as we run to
the
it's ilang CC tools and work on this for
a little while now go to this now so now
it's the time to about dependencies and
back to the build it will fit and there
will be an error that streams dot H was
not present basically what happens is
there's a lot of an aren't shipped on
Mac os10 because they're they're not
needed for day-to-day use but they are
available for the open source web site
so right now not easy to determine where
the streams dot H file may have come
from we're working on some that can help
track that type of information down for
searching through the Darwin saw you can
that there in lib street so the next
step would be to go to the open site
news project and we want to reprocess
for slipstream necessarily need to make
the whole black spray we really just
need that streams dot H file so it will
be sufficient to just do a make stall
headers in this particular project we
have that we can take the builds result
which has we'll call it a route that
contains of the built salts of the lid
streams installers and we can copy that
to the base system on Mac os10 a sudo
command is very useful for copying one
directory to another so you can just
ditto from the directory that contains
the live streams headers to slash and
that'll copy everything to the correct
place if you run a dis route it will
offices or what's the permissions always
make backups obviously if you're going
to be copying this over your based
system some can't wrong at times either
if you don't have a build of something
you're expected you did or versions
don't match up so to have good backups
if these build
on Darwin sydow is not available but but
either the ganute are the packs command
can be used to copy copy the sources to
the roots so I have a couple example
usages of both ditto and those packs
shown here we're going to go back to the
demo to resolve that streams dot H
problem that we discussed so we can see
here that stream state was not found and
we have an install error i also have
already downloaded slipstreams fraud so
i will extract is now and
I have script set up to compile we're
doing the same steps setting the source
route the object through the symbol
route destination route we're creating
the directories in case they don't hope
we're changing the ownership to route
wheel we export the project name in a
different building not only do we export
them in the environment but also pass
them to the make file so in this case
that have make install its make install
headers we just cut the header
so installing the headers is absolutely
very fast and just need to copy a few
files into the destination rude and if
we look at the directories we have here
if I find all those that are in the lib
streams we can see live streams and then
use local include string.h and streams
extra dot H so this is what you might
expect be into the base system to set up
missing dependent on stream CH and we'll
use the ditto command to copy live
stream route to sit and that it still
again we can take farther proper is a
lot of times when we do build the
objects root has failed things may not
tricking Exley that's one of my best
practices that I didn't follow it was
built it up the idea to clear out the
object root and the symbol route
thing from there with everything from
there and dry again this time hopefully
it'll it'll get a little further because
add a file full of all it on the system
by dependency back to the slides so
again be careful always tax if your
change on your base them it's also
important not to overwrite the core
foundation and work core foundation is
an example of something that doesn't
quite match up between Darwin and maca
with a lot of extra functionality and
Mac os10 that's not present on Darwin so
if you were to replace it on your Mac
os10 system things would fail to work in
general the BFD commands and the BFC
libraries are safe to replace so those
those you don't need to worry about too
much but xnu it's also generally safe to
replace but since it is fictional any
mistake will leave something on buddhist
always have a bitten or CD or something
you can boot again to reach your backup
of the film I Iloka divers and families
have those the same set of concerns
basically it's the base of the system
that decides the system will boot you
real back up a run in kick things
happened to these files
if you have an extra partition that has
a full system on it of course when
you're booting you can use the option
key to select which partition you want
to boot if something goes wrong on your
building partition use the option key to
go back to pack of partition boot from
that and then correct any problems I may
have had generally for troubleshooting
and I remember it's important to build
this route things won't fail out but the
difference to change owners might fail
silently and so the build results you
get won't be exactly what you were
expecting as we saw a lot of times it's
necessary to clear out the optimal route
and even the deaf after each attempt to
build the software their intermediate
results in there sometimes the make
files aren't as robust as they could be
and they may further because tricked by
a file that's in there so clearing those
out you do a fresh stock and it usually
makes things exceed if there's a header
file missing you can use the install for
phase 2 shortcut a build and of course
if you have specific questions hesitate
to ask a mailing list the Darwin
development listal com is a good general
starting point for Darwin questions and
there are more specific lists for
Colonel technologies or a series of
Darwin and also at Darwin daughter
Packers at a point org list where people
who are involved the Darwin source code
discuss this next I'll talk a little bit
more advanced top building in a changed
route a change is when you use the chain
troop BSE command there's a good man
page available on it that describes a
little bit about what does and what
essentially this does is it changes root
directory flap to be a different sub
directory on your disk and the advantage
of doing this is it's men ssible to
install heifers and install libraries
compiler whatever need in a different
environment than your host system so if
something goes wrong in there it's less
likely to affect the purchase that
you're booting
and it's also possible two or more easy
targeting it and that's different than
what you're running off for example if
your thing on tends to be three or ten
34 because that's what's newest you want
running but want things to work on and
three and building up the change route
with the 10 3 stuff will solve the
problem of picking up library headers
might have X isn't at that time because
you're in a contained environment a
couple things to note though it does
change ipcc so it's still it's still
important that you the same major
version and although it's easy to do a
change route to build you know tenth
resources that's on a system that's
actually 10 three four things inside the
change route will communicate with the
various demons on the system like look
up d so if there's been any protocol
change the change route doesn't doesn't
reflect that and either might fail to
work or get unexpected results so here i
have an example script again you have to
be root or to the root of the filesystem
and when you change through to the
filesystem some things will be missing
like dev FS and a lot of a lot of poor
needs that to compile so here i have an
example of creating the directory in the
route that we're going to change into
mounting the dev FS filesystem on that
dev directory mounting the file
descriptor file system on top of that
dev directory as well so that could see
things like flash dev / null dev random
the various file descriptors that are
accessible from the shell and it's
important to mount these file systems
outside of the change route if you mount
them inside of the change route and it
might not be possible to unmount these
file systems until you restart however
if you if you mount them before changing
into the root then it's possible to
unmount them again silly so we change
the route once this done and that will
drop us into the default shell inside
that root directory
not to talk a bit about the Darwin build
tools the darn build tools are scripts
that I've developed recently that help
to automate some of these tasks I've
just just discussed so as you might
imagine it'd be fairly yes if you had to
type in all the text each time to set
all the environment variables and pass
all the same arguments to make and these
scripts automate some of those processes
the darn build tools are our two main
components there's the darwin cross
reference tool which is called darwin
xref and what this can do is download a
property list from the open darwin side
or outside news property lists will be
hopefully a bull soon there's an example
one that that'll be that is available
already with the tools for 10 3 4 and
these property lists allow you to look
up what the particular source work is
for any project that's in Darwin that
corresponds to say Mac OS 10 point three
point four for example you can also list
what projects that depends on so in
order to build CC tools we saw that we
need to first have the headers of live
streams and that information is
reflected in the Darwin xref tool and
it's possible to ask that tool for a
list of those types of dependencies and
then another function that the darwin
xref tool has is the ability to cross
reference which files are installed on
disk with which projects they came from
so for example if we see that students
that H is missing we can run a little
weight on the Darwin xref tool and it
will report back that lid streams is the
project that that came from and again
over time this information will be
available for the darwin projects the
darwin build script is a script that
actually sets up the environment it uses
the darwin xref tool accessibly to get
the correct source versions it sets up
the environment for building it also
does a little bit of automatic fetching
of the dependencies so if you don't have
live streams already it'll go down the
open darwin site and download it for
example and it also helps automate
change rooted building so it will create
a directory it'll load up all the routes
that are needed
to change into their change the route
perform the building in that isolated
environment and the buildings poppy
those files out of that isolated
environment into a into a place that's
ready for you to use so here's some
example usages of the Darwin xref tool
and again these tools are available at
Darwin doors open Darwin org up top we
have Darwin xref and we we load the
index so we're taking build 7h 63 with
mac OS 10 3 for the plist we downloaded
from the website we load it into the
into the dark school then we can do
queries the first example is asking what
version of the bourne shell was included
in 10 3 4 and it says that was source
version 29 next we can ask it to find
filestream Shh and it notes that live
streams project installs a file that's
in user local include stream stream Shh
and finally we ask it what are the
runtime dependencies for the bourne
shell and it knows that the board self
requires live m libsystem CC tools and
the increases library in order to run
and there are other women sees which i
don't have listed here the darwin build
script as i mentioned will download
sources from the darwin source web site
so it automates that step you however
you all have them on local system it'll
use those or if you're modifying the
sources it checks the local system first
that's where you can put your modified
version and have it build up the proper
shell environment it saves roots and the
symbols from a successful build in a in
a directory hierarchy that's that's
organized and ready to be used and it
also installs any dependencies into a
group before changing into it to perform
the building so a couple examples here
we can install the header files that are
associated with the colonel by issuing
the command darwin build dash headers xn
you to do this example we just went out
we could have done Darwin build cache
headers live
and another example of building the loop
the standard c library would see in a
change route and that's as simple as
doing darwin build dash change route
would see so now i'm going to demo those
darwin build tools so we already have
our bill brute directory I'll get rid of
that echo yeah so we already have our
dart or buildroot disconnect but we
don't need any of this stuff that's
already on it so I'm just going to wipe
it away
what I'm going to do now is install the
Darwin build tools so these are
available on that Darwin source open
darwin org site and there's a read needs
that that is on the site and also
included in the guitar archive that
explains how to set this up including
creating the disk image and during the
installation but I'm going to install
this on to that build root image and
here it creates some directories it
creates sources objects symbols headers
and routes and logs these are where the
various results of your building will be
stored so after resources are fetched
from the open darwin site they'll be
stored in the sources directory after
the build has finished the symbols go
into symbols directory the headers go in
the headers directory the roots go in
the roots directory and the log of the
build is stored in the logs directory
the first thing we need to do is look up
the Darwin cross reference tool so I'll
load that up with the sample property
list that's included and you can see
there are 313 projects listed in this
property list so is the example I gave
we can ask for what the version of bosch
and it was Vash day 9 that's in the
current systems build if you have other
p lists that are of different build
numbers it's possible to add extra
arguments to the darwin cross reference
tool and having felt one of those other
builds that might be different from the
system that you're already on so here we
may want to build all of let's just do
bash for example you can see it's
fetching the stews and attempted to
download them succeeded and it's going
through and doing all the compiling it
prints out some information about the
local computer such as what version of
GCC is an old what version of the
Explorer is installed it also tells you
what values that used to set up the
shell environment variables but all the
environment variables that were
currently set on the system are what
command it used to do the build and then
it goes into a log here's configure and
now it's actually going ahead and
building some of these sources
so I'll kill the building there for time
but we can look in the logs and sure
enough we have logs this is the bash
project source version 29 attempt number
one all of that output that I was just
showing you has been saved into a log
file so you can go back and review that
at a later time now I'll give it a full
of the change rigid building I it has
the ability to download some of these
pre-built routes from open darwin org
but in the interest of time I already
have them on the local disk and i'll
just copy them over from there this is a
collection of pre-built projects
now the environment that's used to build
is all stored in this Darwin build env
file and again all these details are
available in the documentation
associated with the tools but since
we'll be in a dark project let's say for
fun that I want to enable the 386
variants of the architecture so here
what I've done is I've changed around
the variable so that not just powerpc is
specified but also 386 is specified and
I can do a Darwin build now by default
Mac os10 does not ship a 386 tabled
compiler but it is part of Darwin so to
prove that that we're changing the route
here i'm going to compile bash as we saw
for 386 and Power PC in this change
route environment so what it's doing
right now is installing those routes
which can be downloaded from open Darwin
or as we see here they're already cached
on the system it's copying all of those
into the build root directory so first
it is installed all see the libraries in
binary said that the
well maybe I can give a different
example
so as we can see here at least though
the powerpc and I 386 architectures were
specified it did compile those
architectures in the change route
environment apparently I still need to
work a little bit more on specifying the
dependencies in the property list file
but if we look in the build where you
can see it's a mini version of the of
the respect that you might expect with
directories like bin and espeon user
applications developer etc and and also
as I mentioned with mounting the the
developer filesystem Deb FS is for the
device file system sorry Deb if s is in
that change route environment so it's
the demo I have of the Darwin build
tools I'll be going back to the slides
and now talk about creating a bootable
CD so it's possible to collect the
Parwin projects install them onto a disk
image and then burn the disk image and
boot your ear from that for the sake of
simplicity I'll be talked about using
the HDI utilities to burn the CD which
can only be done on Mac OS 10 there are
steps for doing this on Darwin she'll be
able to find on the open darwin site for
a little bit more involved the first
step is to get a CD image using the HDI
to see and that shows up as an icon on
the finder then you want to copy over
the various projects that are needed to
boot the computer a few finishing
touches that need to be done which halts
books include choosing a blessed of
directory which which helps the open
firmware on the computer boot from the
CD as well as creating the text cash
which computes all of the dependencies
with the colonel and finally you burn
the CD image so the steps creating a
bootable CD is to use HDI you till the
disk image in this example I'm creating
a 650 megabyte disk image
on an HFS partition I've given it a
volume name of Darwin and this will will
do the the normal process of creating a
disk image and then we can attach it
that's when the icon will show up on the
desktop and you can change into the
directory from terminal type etc it's
important to set the ownership of this
new volume 2 root wheel again if we're
going to be copying a bunch of files
into it you want the right default
permissions so start off with root wheel
and do all the copying is root so that
all the ownership can be transferred you
can use the ditto command to do the
actual copying it's important to files
project first that project is what has
the directory hierarchy of a Mac os10
system it's what creates the user
directory or the bin directory or the
applications directory and so it's a
good base to lay down and then all the
other projects will start filling in
those directories with their executables
and with their libraries important to
copy you that's the colonel boot X which
is the boot loader with M is the
standard math library libsystem CC tools
which includes the dynamic linker start
up the end curses library bash have a
shell once you booted various file
commands such as cprm the ones you're
used to shell commands and the list on
this will change goodly streets as
things move around we'll try to keep
some about it on the on the open darn
sight but really for projects that for
any release you absolutely need to have
on the CD again there thur that probably
need to have to have on your CD it's
useful
so the next step is to bless the CD
image the command line tool called bless
which hasn't man page so I suggest
reading that and what that does is it
sets a special bit on a dressing on the
CD that lets open know that this is a CD
that can be suited to the bootloader
that should be used so in this example
we will bless the folder that's the
courses folder and that's where buddha i
installed its its image we're also as a
file label is actually then that appears
on open full image that's pretty
calculated when so a partition if you
wake up an easy-to-read name when you
hold down on your computer to decide
white and to boot from
step is the general mtext cash ashes
basically pre computing colonel
extension and their dependencies and how
iraq to get into solid chunk can be
loaded and in a single during boot the
kext cap is what lets you generate
wealth as an excellent man page so i
suggest fitting that but for what we're
doing is we're linking the mop thought
the bootable CD the extensions direct CD
and generating text file may report a
few missing dependency observe some
things of that the normal foot or two
okay let's don't worry too much feel a
large than perhaps something important
is missing and generally what font is is
you worse extensions and the folder is
what using to boot the way
you also want to create a startup script
by d these darwin boot into a mode that
looks for the login window it's a boob
Mac os10 because that's what necklace it
cook you can create the start of a
simple it just drops to and you know
what you want to do is have a little bit
to commands and drop self and convince
them you can you and I can that's what
they used launched the install automatic
Mac with the this is with binary
competitiveness them that's been around
and you on any of the systems that have
been released so far to know if it does
it does it doesn't different
instructions online source so here what
we can do is we can make a directory
called min split which lets subscript
puts an installer CD I'll at ccd which
did go and execute that pile startup and
we have the opportunity which will put
us into this oh and that's really a bit
to create full CD of doc you go and burn
at onto the CP heating & bill so porn
for me contacted the fit a manager I add
that address puts entation in the odd
make until what station about the Mac
os10 file them it sings lamp or
is an edge to it