README (fb9f9b975cb9214fec5dab37d461199adab9b964) README (a237e38e9161f0acd6451439d4a7dd597e66291d)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License"). You may not use this file except in compliance
7# with the License.
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
22# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
21
22#
23# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23# Use is subject to license terms.
24#
24# Use is subject to license terms.
25#
25#ident "%Z%%M% %I% %E% SMI"
26# ident "%Z%%M% %I% %E% SMI"
26
27KERNEL MAKEFILE STRUCTURE
28-------------------------
29
30The advent of dynamic loading of kernel modules has obsoleted the
314.x kernel configuration scheme which was centered around a derived
32Makefile and a collection of derived header files generated by the
33config(8) program. This file describes the structure of the replacement

--- 204 unchanged lines hidden (view full) ---

238COMMON OPERATIONS
239-----------------
240
241Adding a New Kernel Module
242--------------------------
243
244 0] Create the source files (and directories) as usual.
245
27
28KERNEL MAKEFILE STRUCTURE
29-------------------------
30
31The advent of dynamic loading of kernel modules has obsoleted the
324.x kernel configuration scheme which was centered around a derived
33Makefile and a collection of derived header files generated by the
34config(8) program. This file describes the structure of the replacement

--- 204 unchanged lines hidden (view full) ---

239COMMON OPERATIONS
240-----------------
241
242Adding a New Kernel Module
243--------------------------
244
245 0] Create the source files (and directories) as usual.
246
246 1] Edit uts/*/Makefiles.files to define the set of objects. By convention
247 1] Edit uts/*/Makefile.files to define the set of objects. By convention
247 the symbolic name of this set is of the form MODULE_OBJS, where
248 MODULE is the module name (i.e.: namefs). The files in each subtree
249 should be defined in the Makefile.files in the root directory of that
250 subtree. Note that they are defined using the += operator, so that
251 the set can be built across multiple files. As example:
252
253 NAMEFS_OBJS += namevfs.o namevno.o
254

--- 35 unchanged lines hidden (view full) ---

290 for the modstubs.o assembly.
291 CLEANFILES += $(MODSTUBS_O)
292
293 4] Edit the parent Makefile.mach (i.e.: Makefile.sun4c) to know about
294 the new module:
295
296 FS_KMODS += fd fifo namefs nfs proc spec ufs
297 ------
248 the symbolic name of this set is of the form MODULE_OBJS, where
249 MODULE is the module name (i.e.: namefs). The files in each subtree
250 should be defined in the Makefile.files in the root directory of that
251 subtree. Note that they are defined using the += operator, so that
252 the set can be built across multiple files. As example:
253
254 NAMEFS_OBJS += namevfs.o namevno.o
255

--- 35 unchanged lines hidden (view full) ---

291 for the modstubs.o assembly.
292 CLEANFILES += $(MODSTUBS_O)
293
294 4] Edit the parent Makefile.mach (i.e.: Makefile.sun4c) to know about
295 the new module:
296
297 FS_KMODS += fd fifo namefs nfs proc spec ufs
298 ------
298
299 5] Add the appropriate components using nsecomp. Continuing with
300 the namefs example:
301
302 $ nsecomp add :src:uts.all:sun4c Comp namefs
303 $ nsecomp add :src:uts.all:sun4c:namefs Targ \
304 all%/usr/src/uts/sun4c/namefs/Makefile
305
306 This needs to be done for all appropriate "implementation
307 architectures".
308
309Any additional questions can be easily answered by looking at the many
310existing examples.
311
312
313Moving a Module to the "Implementation Architecture" Independent Build
314----------------------------------------------------------------------
315
316 1] Create the build directory under the appropriate "instruction

--- 12 unchanged lines hidden ---
299Any additional questions can be easily answered by looking at the many
300existing examples.
301
302
303Moving a Module to the "Implementation Architecture" Independent Build
304----------------------------------------------------------------------
305
306 1] Create the build directory under the appropriate "instruction

--- 12 unchanged lines hidden ---