Skip to content

Commit

Permalink
xnu-344
Browse files Browse the repository at this point in the history
  • Loading branch information
Darwin authored and das committed Jun 4, 2017
1 parent e82021f commit d738f90
Show file tree
Hide file tree
Showing 1,936 changed files with 123,607 additions and 190,001 deletions.
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
ifndef VERSDIR
export VERSDIR=$(shell /bin/pwd)
endif
ifndef SRCROOT
export SRCROOT=$(shell /bin/pwd)
endif
ifndef OBJROOT
export OBJROOT=$(SRCROOT)/BUILD/obj
endif
ifndef DSTROOT
export DSTROOT=$(SRCROOT)/BUILD/dst
endif
ifndef SYMROOT
export SYMROOT=$(SRCROOT)/BUILD/sym
endif

export MakeInc_cmd=${VERSDIR}/makedefs/MakeInc.cmd
export MakeInc_def=${VERSDIR}/makedefs/MakeInc.def
Expand Down Expand Up @@ -46,5 +58,8 @@ INSTALL_FILE_LIST= \
INSTALL_FILE_DIR= \
/

INSTMAN_SUBDIRS = \
bsd

include $(MakeInc_rule)
include $(MakeInc_dir)
15 changes: 0 additions & 15 deletions PB.project

This file was deleted.

68 changes: 20 additions & 48 deletions README
Original file line number Diff line number Diff line change
@@ -1,45 +1,6 @@
How to build XNU:

1) Setup your environment:

Create and go to your sandbox directory </sandbox/my_xnu>

$ cd </sandbox/my_xnu>

Extract the xnu project from cvs:

$ cvs co -r <xnu-tag> xnu

where <xnu-tag> must be replaced by the matching xnu tag for
the xnu project level.

Go to the top directory in your XNU project.

$ cd </sandbox/my_xnu>/xnu

If you are using a sh-style shell, run the following command:
$ . SETUP/setup.sh

If you are using a csh-style shell, run the following command:
% source SETUP/setup.csh

This will define the following environmental variables:
SRCROOT, OBJROOT, DSTROOT, SYMROOT

2) Export the Component Header Files

From the top directory, run:

$ make exporthdrs

This exports the component header files in the $OBJROOT/EXPORT_HDRS
directory.

3) Build all the Components

From the top directory. run:

$ make all
1) Type: "make"

This builds all the components for all architectures defined in
ARCH_CONFIGS and for all kernel configurations defined in KERNEL_CONFIGS.
Expand All @@ -52,7 +13,18 @@ How to build XNU:
$(OBJROOT)/RELEASE_PPC/osfmk/RELEASE/osfmk.o: pre-linked object for osfmk component
$(OBJROOT)/RELEASE_PPC/mach_kernel: bootable image

4) Building a Component
2) Building a Component

Go to the top directory in your XNU project.

If you are using a sh-style shell, run the following command:
$ . SETUP/setup.sh

If you are using a csh-style shell, run the following command:
% source SETUP/setup.csh

This will define the following environmental variables:
SRCROOT, OBJROOT, DSTROOT, SYMROOT

From a component top directory:

Expand All @@ -63,9 +35,6 @@ How to build XNU:
By default, ARCH_CONFIGS contains one architecture, the build machine
architecture, and KERNEL_CONFIGS is set to build for RELEASE .

WARNING: If a component header file has been modified, you will have to do
the above procedures 3 and 4.

Example:
$(OBJROOT)/RELEASE_PPC/osfmk/RELEASE/osfmk.o: pre-linked object for osfmk component

Expand All @@ -76,7 +45,10 @@ How to build XNU:
This includes your component in the bootable image, mach_kernel, and
in the kernel binary with symbols, mach_kernel.sys.

5) Building DEBUG
WARNING: If a component header file has been modified, you will have to do
the above procedure 1.

3) Building DEBUG

Define KERNEL_CONFIGS to DEBUG in your environment or when running a
make command. Then, apply procedures 4, 5
Expand All @@ -92,7 +64,7 @@ How to build XNU:
$(OBJROOT)/DEBUG_PPC/osfmk/DEBUG/osfmk.o: pre-linked object for osfmk component
$(OBJROOT)/DEBUG_PPC/mach_kernel: bootable image

6) Building fat
4) Building fat

Define ARCH_CONFIGS in your environment or when running a make command.
Apply procedures 3, 4, 5
Expand All @@ -104,13 +76,13 @@ How to build XNU:
$ export ARCH_CONFIGS="PPC I386"
$ make exporthdrs all

7) Build check before integration
5) Build check before integration

From the top directory, run:

$ ~rc/bin/buildit . -arch ppc -arch i386 -noinstallsrc -nosum

8) Creating tags and cscope
6) Creating tags and cscope

Set up your build environment as per instructions in 2a

Expand Down
10 changes: 2 additions & 8 deletions bsd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,15 @@ INSTINC_SUBDIRS = \
crypto \
dev \
hfs \
include \
isofs \
libkern \
machine \
miscfs \
net \
netat \
netccitt \
netinet \
netinet6 \
netiso \
netkey \
netns \
nfs \
sys \
ufs \
Expand All @@ -39,19 +35,15 @@ EXPINC_SUBDIRS = \
crypto \
dev \
hfs \
include \
isofs \
libkern \
machine \
miscfs \
net \
netat \
netccitt \
netinet \
netinet6 \
netiso \
netkey \
netns \
nfs \
sys \
ufs \
Expand All @@ -72,6 +64,8 @@ COMP_SUBDIRS = \

INST_SUBDIRS = \

INSTMAN_SUBDIRS = \
man

include $(MakeInc_rule)
include $(MakeInc_dir)
Expand Down
29 changes: 22 additions & 7 deletions bsd/conf/MASTER
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ options IPFIREWALL_FORWARD #Transparent proxy # <ipfirewall>
options IPFIREWALL_DEFAULT_TO_ACCEPT # allow everything by default # <ipfirewall>
options IPFIREWALL_KEXT # Kernel extension # <ipfirewall>
options MULTICAST # Internet Protocol Class-D $
options TCPDEBUG # TCP debug # <tcpdebug>
options RANDOM_IP_ID # random (not sequential) ip ids # <randomipid>
options TCP_DROP_SYNFIN # Drop TCP packets with SYN+FIN set # <tcpdrop_synfin>
options ICMP_BANDLIM # ICMP bandwidth limiting sysctl


#
Expand All @@ -154,9 +158,7 @@ options KTRACE # ktrace support # <ktrace>
#
options FFS # Fast Filesystem Support # <ffs>
options HFS # HFS/HFS+ support # <hfs>
options HFS_HARDLINKS # HFS+ hardlink support # <hfs>
options FIFO # fifo support # <fifo>
options PORTAL # portal_fs support # <portal>
options UNION # union_fs support # <union>
options FDESC # fdesc_fs support # <fdesc>
options CD9660 # ISO 9660 CD-ROM support # <cd9660>
Expand Down Expand Up @@ -186,20 +188,27 @@ options OBJCTEST # Objc internal test # <objctest>
options KERNEL_STACK # MI kernel stack support # <kernstack>
profile # build a profiling kernel # <profile>

#
# Point-to-Point Protocol support
#
pseudo-device ppp 2 # <ppp>

#
# IPv6 (Kame Stable 20000425) Support
# IPv6 Support
#
options "INET6" # kernel IPv6 Support # <inet6>
options MAPPED_ADDR_ENABLED # enable IPv4, on IPv6 socket # <inet6>
options IPSEC # IP security # <ipsec>
options IPSEC_ESP # IP security # <ipsec>
options "IPV6FIREWALL" # IPv6 Firewall Feature # <ipv6firewall>
options "IPV6FIREWALL_DEFAULT_TO_ACCEPT" #IPv6 Firewall Feature # <ipv6firewall>
options "IPV6FIREWALL_VERBOSE" #IPv6 Firewall Feature # <ipv6firewall>
options NATPT # KAME/IPv6 NAT feature #<natpt>
pseudo-device gif 2 # <gif>

pseudo-device gif 1 # <gif>
pseudo-device dummy 2 # <dummy>
pseudo-device faith 1 # <faith>
pseudo-device stf 1 # <stf>

options crypto # <ipsec,crypto>

makeoptions LIBDRIVER = "libDriver_kern.o" # <libdriver>
makeoptions LIBOBJC = "libkobjc.o" # <kernobjc>
Expand Down Expand Up @@ -231,7 +240,13 @@ pseudo-device loop
#
# UCB pseudo terminal service
#
pseudo-device pty 32 init pty_init
pseudo-device pty 128 init pty_init

#
# vnode device
pseudo-device vndevice 4 init vndevice_init

#
#
# packet filter device
#
Expand Down
8 changes: 2 additions & 6 deletions bsd/conf/MASTER.i386
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
# Standard Apple Research Configurations:
# -------- ----- -------- ---------------
#
# RELEASE = [intel pc mach medium event vol pst gdb kernobjc libdriver fixpri simple_clock mdebug kernserv driverkit uxpr kernstack ipc_compat ipc_debug nfsclient nfsserver quota fifo fdesc union ffs cd9660 compat_43 devfs revfs hfs mrouting ipdivert ipfirewall]
# RELEASE = [intel pc mach medium event vol pst gdb kernobjc libdriver fixpri simple_clock mdebug kernserv driverkit uxpr kernstack ipc_compat ipc_debug nfsclient nfsserver quota fifo fdesc union ffs cd9660 compat_43 volfs devfs synthfs revfs hfs mrouting ipdivert ipfirewall inet6 ipsec gif tcpdrop_synfin ktrace stf]
# PROFILE = [RELEASE profile]
# DEBUG = [intel pc mach medium event vol pst gdb kernobjc libdriver_g fixpri debug simple_clock mdebug kernserv driverkit xpr_debug uxpr kernstack ipc_compat ipc_debug nfsclient nfsserver quota fifo fdesc union ffs cd9660 compat_43 revfs hfs devfs mach_assert mrouting ipdivert ipfirewall]
# DEBUG = [intel pc mach medium event vol pst gdb kernobjc libdriver_g fixpri debug simple_clock mdebug kernserv driverkit xpr_debug uxpr kernstack ipc_compat ipc_debug nfsclient nfsserver quota fifo fdesc union ffs cd9660 compat_43 revfs hfs volfs devfs synthfs mach_assert mrouting ipdivert ipfirewall inet6 ipsec gif tcpdrop_synfin ktrace stf]
#
######################################################################
#
Expand Down Expand Up @@ -85,7 +85,3 @@ pseudo-device nfsmeas # <nfsmeas>
#
pseudo-device vol # <vol>

#
# Point-to-Point Protocol support
#
pseudo-device ppp 2 # <ppp>
10 changes: 3 additions & 7 deletions bsd/conf/MASTER.ppc
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
# Standard Apple Research Configurations:
# -------- ----- -------- ---------------
#
# RELEASE = [ppc mach medium vol pst gdb simple_clock kernstack nfsclient nfsserver quota fifo fdesc union ffs cd9660 compat_43 revfs noprofiling hfs volfs devfs synthfs netat mrouting ipdivert ipfirewall]
# RELEASE = [ppc mach medium vol pst gdb simple_clock kernstack nfsclient nfsserver quota fifo fdesc union ffs cd9660 compat_43 revfs noprofiling hfs volfs devfs synthfs netat mrouting ipdivert ipfirewall ktrace inet6 ipsec tcpdrop_synfin gif stf]
# RELEASE_TRACE = [RELEASE kdebug]
# PROFILE = [ppc mach medium vol pst gdb debug simple_clock kernstack nfsclient nfsserver quota fifo fdesc union ffs cd9660 compat_43 revfs profile hfs volfs devfs synthfs netat mrouting ipdivert ipfirewall]
# DEBUG = [ppc mach medium vol pst gdb debug simple_clock kernstack nfsclient nfsserver quota fifo fdesc union ffs cd9660 compat_43 revfs profiling hfs volfs devfs synthfs netat mrouting mach_assert ipdivert ipfirewall]
# PROFILE = [ppc mach medium vol pst gdb debug simple_clock kernstack nfsclient nfsserver quota fifo fdesc union ffs cd9660 compat_43 revfs profile hfs volfs devfs synthfs netat mrouting ipdivert ipfirewall ktrace inet6 ipsec tcpdrop_synfin gif stf]
# DEBUG = [ppc mach medium vol pst gdb debug simple_clock kernstack nfsclient nfsserver quota fifo fdesc union ffs cd9660 compat_43 revfs profiling hfs volfs devfs synthfs netat mrouting mach_assert ipdivert ipfirewall ktrace inet6 ipsec tcpdrop_synfin gif stf]
# DEBUG_TRACE = [DEBUG kdebug]
#
######################################################################
Expand Down Expand Up @@ -81,7 +81,3 @@ pseudo-device nfsmeas # <nfsmeas>
#
pseudo-device vol # <vol>

#
# Point-to-Point Protocol support
#
pseudo-device ppp 2 # <ppp>
7 changes: 3 additions & 4 deletions bsd/conf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ do_setup_conf: $(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)/$(COMPONENT)/doconf \

do_all: do_setup_conf
@echo "[ $(SOURCE) ] Starting do_all $(COMPONENT) $(BSD_KERNEL_CONFIG) $(ARCH_CONFIG) $(TARGET)"; \
(cd $(COMPOBJROOT)/$(BSD_KERNEL_CONFIG); \
next_source=$(subst conf/,,$(SOURCE)); \
${MAKE} MAKEFILES=$(TARGET)/$(BSD_KERNEL_CONFIG)/Makefile \
${MAKE} -C $(COMPOBJROOT)/$(BSD_KERNEL_CONFIG) \
MAKEFILES=$(TARGET)/$(BSD_KERNEL_CONFIG)/Makefile \
SOURCE=$${next_source} \
TARGET=$(TARGET) \
INCL_MAKEDEP=FALSE \
build_all \
); \
build_all; \
echo "[ $(SOURCE) ] Returning do_all $(COMPONENT) $(BSD_KERNEL_CONFIG) $(ARCH_CONFIG) $(TARGET)";

do_build_all: do_all
Expand Down
10 changes: 4 additions & 6 deletions bsd/conf/Makefile.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
#
export IDENT

#
# XXX: INCFLAGS
#
INCFLAGS_MAKEFILE= -I$(SOURCE) -I$(SOURCE)include -I$(SOURCE)netat -I$(SOURCE)netat/h -I$(SOURCE)netat/at -I$(SOURCE_DIR)

export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
Expand All @@ -26,7 +21,10 @@ include $(MakeInc_def)
#
# XXX: CFLAGS
#
CFLAGS+= -imacros meta_features.h -DARCH_PRIVATE -DKERNEL -DDRIVER_PRIVATE -D_KERNEL_BUILD -DKERNEL_BUILD -DMACH_KERNEL -DBSD_BUILD -DNCPUS=1 -Wno-four-char-constants -fpascal-strings -D__APPLE__ -I.
CFLAGS+= -imacros meta_features.h -DARCH_PRIVATE -DKERNEL -DDRIVER_PRIVATE \
-D_KERNEL_BUILD -DKERNEL_BUILD -DMACH_KERNEL -DBSD_BUILD \
-DBSD_KERNEL_PRIVATE -DNCPUS=1 -Wno-four-char-constants -fpascal-strings \
-D__APPLE__ -I.

# XXX: ld flags for bsd.o
export LDFLAGS_COMPONENT += -keep_private_externs
Expand Down
Loading

0 comments on commit d738f90

Please sign in to comment.