BSD daemon

NetBSD Developer Documentation:

Misc developer notes

If some nugget of information is useful enough for NetBSD developers to know - list it here.

Misc developer notes


Misc developer notes


ELF vs. a.out .align (top)

Klaus Klein writes:

Just as a short reminder for those who are about to switch over their m68k port to ELF: the interpretation of the .align directive has changed in the m68k/ELF toolchain. While its argument is log2(alignment) on m68k/a.out, it is now linear; I've updated the ports which have already been switched to reflect this.

(This is also true for i386, but neither for ARM ("different" vs. log2) nor SPARC (both linear).)

Logs when bumping a kernel version number or an shlib_version file (top)

When one bumps either the kernel version number or an shlib_version file, please include both the interface changed and the new version number in the log message. Otherwise it's hard to figure out what a particular version bump means by reading the cvs log.

Sharing userland and MACHINE_ARCH (top)

Userland should be shareable between machines of the same MACHINE_ARCH. Some obvious issues:

Adding a new library (top)

The following is intended to be a brief list of items that need to be addressed when adding a new library to the NetBSD tree. In the following example pathnames, foo is the name of the library, 0 is the library's major number and 0 is the library's minor number. A new library would normally have 0 for both the major and minor number.

Changing the version number of a library (top)

The minor number of a library should be incremented when it is possible for external programs to call any new functions or varibles added.

The major number should be incremented and the minor set to zero when an externally visible structure changed size, or function changed arguments. This can cause significant disruption and version renaming is frequently used to avoid this.

With the current C ABIs changing functions (previously void) to return a value of either integer, pointer, or floating-point type does not necessitate incrementing the major number since return values are always passed in (unconditionally) caller-saved registers. In such a case the minor number should be incremented to note the "additions".

If you bump the major of a library, you should:

  1. Bump the major of any library that depends on it.
  2. Send mail to <current-users@NetBSD.org> warning about it, so that if anybody's built a shared library that depends on it they can know to do the right thing.
  3. Note it in the install notes, for people upgrading to the next release (or, presumably, to -current via binary snapshots).

Notes on syscall passing (top)

Christos Zoulas writes:

I'd like to mention for future reference, that our syscall argument passing mechanism does not handle passing structs or unions properly on all architectures, so syscall implementors need to convert those to pointers and provide stubs in userland that &struct or &union before calling the kernel stub.

Writing a manpage (top)

  1. The mdoc.samples(7) and mdoc(7) manpages are excellent for reference (if a little lengthy).
  2. Work from the template in /usr/share/misc/mdoc.template, and refer to an existing manpage (for example who(1) for a command, and err(3) for a function).
  3. When done, remember to add the formatted (/usr/share/man/mansection/name.section) and formatted (/usr/share/man/catsection/name.0) to src/distrib/sets/lists/man/mi.

Renaming or removing installed binaries (top)

If your change filename, or remove any of files installed to DESTDIR, you will need to do something like the following. You need to decide which list file to update, based on the file you will be removing.

  1. Remove the old filename (or removed filename) from distrib/sets/lists/base/mi (or relevant file).
  2. Add the old filename (or removed filename) to distrib/sets/lists/base/obsolete.mi. This is for upgrade installations.
  3. And of course, don't forget to add new filename to distrib/sets/lists/base/mi.

Cleaning your tree (top)

Perry E. Metzger writes:

At periodic intervals, I find that my checked out tree gets filled with garbage that cvs update normally doesn't "?" because it is in the ignored list -- stuff like .orig files from patching runs or .o files for things that don't exist any more. Since CVS ignores them, one never finds out one's tree has the junk in it.

I'm sure I'm the last person to discover this trick, but in case I'm not, I have found that doing

        cvs update -I \! -I CVS

nicely yields lots of good complaints about left-over garbage like this.

When to add weak-symbol to library functions? (top)

In short, to quote Klaus Klein:

The weak symbol reference has two goals:

What files need updating on each Jan 1st? (top)

On the first of each year, the following files need to be updated to list the new year in the Copyright strings

What is the job of a mailing list moderator? (top)

A short summary (by Herb Peyerl):

You have to accept and read all bounce messages from the lists you own to make sure they're not legitimate postings. You then forward all legitimate postings that have bounced to the list in question using the majordomo 'approve' script. You also have to do any subscribes or unsubscribes from people whose email addresses didn't match exactly the email address they subscribed with.

In the case of moderated lists (-announce, -news) you need to make sure the postings match the charter of the list(s) and approve them if they are appropriate, or reply to the author and explain why you can't approve their postings.

You'll also get keyword bounces which are usually spam (that you have to read) and if they're legitimate postings, determine where the keyword match was and decide whether it was legitimate and forward it. If not, communicate back to the author to ask him/her to rephrase their posting.

The above task becomes fairly onerous during virus season.


NetBSD Home Page
NetBSD Developer Documentation

(Contact us) $NetBSD: notes.html,v 1.41 2004/01/06 02:19:16 lukem Exp $
Copyright © 1994-2003 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.