User Tools

Site Tools


releases:3.2.0:developersguide:portingnetbsduserland

Porting NetBSD Userland to MINIX 3

Introduction

Porting of NetBSD userland to MINIX 3 started with libc, and since then many libraries and utilities have been added to the system. The goal is to remove the utilities in /usr/src/commands and replace them with NetBSD's, and port additional utilities at the same time. Similarly, libraries from NetBSD can replace the MINIX libraries in /usr/src/lib and additional libraries from NetBSD can be added. This page is intended to organize and coordinate the porting effort involved in bringing NetBSD userland utilities and libraries in MINIX 3.

For starters, read Porting Guide, Programming in MINIX 3 and Using NetBSD Code.

Important Points

  • Always remain updated to the master branch in minix repository. Refer to Tracking Current.
  • If you want to start porting, first build the system with the latest source. It is worthless trying to port on earlier versions of MINIX 3, as a lot has changed since then in the base system.
  • After porting an utility, always run the test suites in test/ to check nothing is broken.
  • You can debug using gdb. It is available here. Refer to this message on mailing list for more information (but remember the URL has moved since then.)

Porting Procedure and Pointers

There are a few things to keep a keep eye out for. General outline of procedure:

  • Use a git clone of current master to base your work on.
  • Add your util to the tools/nbsd_ports file.
  • Run make nbsd_fetch so that the original netbsd code from the current netbsd import date gets put in /usr/src/nbsdsrc.
  • Copy the original over to its new location in bin/ or usr.bin/, and add the subdir to the Makefile.
  • Get it working in an as clean a way as possible, i.e. with minimal edits and hacks. If the import can be cleaner by adding a dependency elsewhere (e.g. importing a library), that is preferable to hacking the imported code.
  • However: if you decide to do this, import the dependencies *first*, in an earlier commit, using this procedure (it's recursive!), then return to this util.
  • Remove commands/oldutil AND corresponding manpage entries in man/ if any, and add your new util in bin/ or usr.bin/, wherever the original is.
  • Satisfy yourself that the new utility works. Make sure there are no old copies of the utility lying around that are getting invoked while testing. Find invocations of the utility in the base system (hottest zone is /etc/rc and /usr/etc/rc, second-hottest is tools/release.sh and tools/chrootmake.sh, but they can be anywhere) and make sure the invocation won't break. At minimum do a make clean world and preferably also a sh release.sh -c in tools/ to see if world building and new release bootstrapping still works.
  • You may find that the location of the utility changes (from /bin to /usr/bin or vice versa). Sometimes this is a problem, sometimes not. If it is, the best thing to do is keep the new location and fix the problems caused by it. Second-best solution is add a symlink.
  • Such invocations can also be in pkgsrc. Clone the pkgsrc repository and look in mk/ to see if your utility is mentioned there (possibly by an absolute path). Your import should not break pkgsrc, and as pkgsrc and base system aren't tightly coupled, adding a symlink to keep that invocation working is probably the only way out.

Congratulations, you have improved the world! Submit your commit for merging with master.

Porting Status

NetBSD userland in minix-master

This section lists the libraries and utilities which have been already integrated into the master branch of minix repository.

NetBSD libraries

More often than not, there are ripple effects in case of porting foreign libraries. So, their complete port is spread across many commits. In the following table, only the initial commit is listed. Also, there are always such functions present in these libraries, porting of whose have been disabled due to missing system calls. So, you can start by porting those functions too by implementing the corresponding system call. In case of libc, refer to lib/libc/sys-minix/MISSING_SYSCALLS for the complete list.

Library Commit Web view Source location Comment
libc ad4dda469f3fa4909f4993cd07dcb05618139c91 click lib/nbsd_libc, common/lib/libc
libm 0dc9e0996aa0210b04fff9fa908b2d7ec579417c click lib/nbsd_libm
libcrypt ebffaa42502931792cfc7964b581853350489880 click lib/libcrypt
libterminfo 51e66a47d88f32e577d34ec883630a1acb2fb223 click lib/libterminfo
libcurses 51ffecc181005cb45a40108612ee28d1daaeeb86 click lib/libcurses
libutil 0c3983b25a88161cf074524e5c94585a2582ae82 click lib/libutil, common/lib/libutil

NetBSD utilities

Utility Commit Web view Comment
bin/mkdir 12d9a08f0dc451b6376fae05cacc292c8ced8743 click
usr.bin/m4 2e8d1eda1b10b1eefcc41d19325e6baa0615ae5c click
usr.bin/indent 97c7d358ea5970ca59196ed90e975115245f9e76 click
usr.bin/sed f789fee254bfd8e2872f294ed742b61d548759f1 click
usr.bin/stat 49cab1c73cb9020b90a02d49166d6760e0fa30da click
usr.bin/tic 51e66a47d88f32e577d34ec883630a1acb2fb223 click
usr.bin/mkdep 06617e7fdfd1d9f8948d46de4279aa399750295d click
usr.bin/uniq 1ea07af9da7f7a389b7bb35ca70b21a08e40a09d click
usr.bin/seq bc0a39238ecee5c8a3fb76071ef9f61668673a0d click
usr.bin/du 4aaa5377b32f40e614c177a3d061ada5b35cee82 click
usr.bin/man 0c3983b25a88161cf074524e5c94585a2582ae82 click
usr.bin/apropos 0c3983b25a88161cf074524e5c94585a2582ae82 click
usr.bin/mdocml 0c3983b25a88161cf074524e5c94585a2582ae82 click
libexec/makewhatis 0c3983b25a88161cf074524e5c94585a2582ae82 click

Other NetBSD userland utilities & libraries

Libraries

Utility Who is working Status Pull Request Comment External link
libbz2
libcrypto_idea
libcrypto_mdc2
libcrypt_rc5
libedit
libform
libgssapi
libhdb
libintl
libipsec
libkadm5clnt
libkadm5srv
libkafs
libkrb5
libl
libmenu
libresolv
librpcsvc
libksey
libsl
libss
libtelnet
liby
libz

Utilities

bin/
Utility Who is working Status Pull Request Comment External link
bin/cat Andy Kosela committed
bin/chio
bin/chmod
bin/cp
bin/csh
bin/date
bin/dd
bin/df
bin/domainname
bin/echo
bin/ed Andy Kosela committed
bin/expr
bin/hostname
bin/kill
bin/ksh
bin/ln
bin/ls
bin/mt
bin/mv
bin/pax
bin/ps
bin/pwd
bin/rcmd
bin/rcp
bin/rm
bin/rmdir
bin/sh
bin/sleep
bin/stty
bin/sync
bin/test
usr.bin/
Utility Who is working Status Pull Request Comment External link
usr.bin/apply
usr.bin/asa
usr.bin/at
usr.bin/audio
usr.bin/audiocfg
usr.bin/awk
usr.bin/banner
usr.bin/basename
usr.bin/bdes
usr.bin/biff
usr.bin/bthset
usr.bin/btkey
usr.bin/btpin
usr.bin/bzip2
usr.bin/bzip2recover
usr.bin/cal
usr.bin/calendar
usr.bin/cap_mkdb
usr.bin/cdplay
usr.bin/checknr
usr.bin/chflags
usr.bin/chpass
usr.bin/cksum
usr.bin/cmp
usr.bin/col
usr.bin/colcrt
usr.bin/colrm
usr.bin/column
usr.bin/comm
usr.bin/compile_et
usr.bin/compress
usr.bin/config
usr.bin/crontab
usr.bin/crunch
usr.bin/csplit
usr.bin/ctags
usr.bin/cut
usr.bin/db
usr.bin/deroff
usr.bin/dirname
usr.bin/eject
usr.bin/elf2aout
usr.bin/elf2ecoff
usr.bin/env
usr.bin/error
usr.bin/expand
usr.bin/extattr
usr.bin/false
usr.bin/fdformat
usr.bin/fgen
usr.bin/find
usr.bin/finger
usr.bin/fmt
usr.bin/fold
usr.bin/fpr
usr.bin/from
usr.bin/fsplit
usr.bin/fstat
usr.bin/ftp
usr.bin/gcore
usr.bin/genassym
usr.bin/gencat
usr.bin/getconf
usr.bin/getent
usr.bin/getopt
usr.bin/gprof
usr.bin/grep
usr.bin/gss
usr.bin/gzip
usr.bin/head
usr.bin/hesinfo
usr.bin/hexdump
usr.bin/hxtool
usr.bin/iconv
usr.bin/id
usr.bin/infocmp
usr.bin/innetgr
usr.bin/ipcrm
usr.bin/ipcs
usr.bin/join
usr.bin/jot
usr.bin/kdestroy
usr.bin/kdump
usr.bin/kgetcred
usr.bin/kinit
usr.bin/klist
usr.bin/krb5-config
usr.bin/ktrace
usr.bin/ktruss
usr.bin/lam
usr.bin/last
usr.bin/lastcomm
usr.bin/ldd
usr.bin/leave
usr.bin/less
usr.bin/lex
usr.bin/locale
usr.bin/locate
usr.bin/lock
usr.bin/logger
usr.bin/login
usr.bin/logname
usr.bin/look
usr.bin/lorder
usr.bin/machine
usr.bin/mail
usr.bin/make
usr.bin/menuc
usr.bin/mesg
usr.bin/midiplay
usr.bin/mixerctl
usr.bin/mk_cmds
usr.bin/mkcsmapper
usr.bin/mkesdb
usr.bin/mkfifo
usr.bin/mklocale
usr.bin/mkstr
usr.bin/mktemp
usr.bin/mkubootimage
usr.bin/moduli
usr.bin/msgc
usr.bin/msgs
usr.bin/nbperf
usr.bin/nbsvtool
usr.bin/netgroup
usr.bin/netstat
usr.bin/newgrp
usr.bin/newsyslog
usr.bin/nfsstat
usr.bin/nice
usr.bin/nl
usr.bin/nohup
usr.bin/nvi
usr.bin/pagesize
usr.bin/passwd
usr.bin/paste
usr.bin/patch
usr.bin/pathchk
usr.bin/pkill
usr.bin/pmap
usr.bin/pmc
usr.bin/pr
usr.bin/printenv
usr.bin/printf
usr.bin/progress
usr.bin/pwhash
usr.bin/qsubst
usr.bin/quota
usr.bin/radioctl
usr.bin/rdist
usr.bin/renice
usr.bin/rev
usr.bin/revoke
usr.bin/rfcomm_sppd
usr.bin/rlogin
usr.bin/rpcgen
usr.bin/rpcinfo
usr.bin/rs
usr.bin/rsh
usr.bin/rump_allserver
usr.bin/rump_dhcpclient
usr.bin/rump_halt
usr.bin/rump_server
usr.bin/rup
usr.bin/ruptime
usr.bin/rusers
usr.bin/rwall
usr.bin/rwho
usr.bin/script
usr.bin/sdiff
usr.bin/sdpquery
usr.bin/shar
usr.bin/shlock
usr.bin/shmif_dumpbus
usr.bin/showmount
usr.bin/shuffle
usr.bin/skey
usr.bin/skeyinfo
usr.bin/skeyinit
usr.bin/sockstat
usr.bin/soelim
usr.bin/sort
usr.bin/spell
usr.bin/split
usr.bin/string2key
usr.bin/su
usr.bin/systat
usr.bin/tabs
usr.bin/tail
usr.bin/talk
usr.bin/tcopy
usr.bin/tee
usr.bin/telnet
usr.bin/tftp
usr.bin/time
usr.bin/tip
usr.bin/touch
usr.bin/tpfmt
usr.bin/tput
usr.bin/tr
usr.bin/true
usr.bin/tset
usr.bin/tsort
usr.bin/tty
usr.bin/ul
usr.bin/uname
usr.bin/unexpand
usr.bin/unifdef
usr.bin/units
usr.bin/unvis
usr.bin/unzip
usr.bin/usbhidaction
usr.bin/usbhidctl
usr.bin/users
usr.bin/utoppya
usr.bin/uudecode
usr.bin/uuencode
usr.bin/uuidgen
usr.bin/vacation
usr.bin/verify_krb5_conf
usr.bin/vgrind
usr.bin/videoctl
usr.bin/vis
usr.bin/vmstat
usr.bin/vndcompress
usr.bin/w
usr.bin/wall
usr.bin/wc
usr.bin/what
usr.bin/whatis
usr.bin/whereis
usr.bin/who
usr.bin/whois
usr.bin/window
usr.bin/write
usr.bin/xargs
usr.bin/xinstall
usr.bin/xlint
usr.bin/xstr
usr.bin/yacc
usr.bin/yes
usr.bin/ypcat
usr.bin/ypmatch
usr.bin/ypwhich
usr.sbin/
Utility Who is working Status Pull Request Comment External link
usr.sbin/ac
usr.sbin/accton
usr.sbin/acpitools
usr.sbin/altq
usr.sbin/apm
usr.sbin/apmd
usr.sbin/arp
usr.sbin/bad144
usr.sbin/bootp
usr.sbin/btattach
usr.sbin/btconfig
usr.sbin/btdevctl
usr.sbin/bthcid
usr.sbin/btpand
usr.sbin/catman
usr.sbin/chroot
usr.sbin/chrtbl
usr.sbin/cnwctl
usr.sbin/cpuctl
usr.sbin/crash
usr.sbin/cron
usr.sbin/dev_mkdb
usr.sbin/dhcp
usr.sbin/diskpart
usr.sbin/dumpfs
usr.sbin/dumplfs
usr.sbin/edquota
usr.sbin/eeprom
usr.sbin/envstat
usr.sbin/eshconfig
usr.sbin/etcupdate
usr.sbin/extattrctl
usr.sbin/faithd
usr.sbin/fssconfig
usr.sbin/fusermount
usr.sbin/fwctl
usr.sbin/gpioctl
usr.sbin/grfconfig
usr.sbin/grfinfo
usr.sbin/gspa
usr.sbin/hdaudioctl
usr.sbin/hilinfo
usr.sbin/hprop
usr.sbin/ifmcstat
usr.sbin/ifwatchd
usr.sbin/inetd
usr.sbin/installboot
usr.sbin/iopctl
usr.sbin/iostat
usr.sbin/ipf
usr.sbin/iprop-log
usr.sbin/ipwctl
usr.sbin/irdaattach
usr.sbin/isdn
usr.sbin/iteconfig
usr.sbin/iwictl
usr.sbin/kadmin
usr.sbin/kcm
usr.sbin/kdc
usr.sbin/kdigest
usr.sbin/kgmon
usr.sbin/kimpersonate
usr.sbin/kstash
usr.sbin/ktutil
usr.sbin/kvm_mkdb
usr.sbin/lastlogin
usr.sbin/ldpd
usr.sbin/link
usr.sbin/lmcconfig
usr.sbin/lockstat
usr.sbin/lpr
usr.sbin/lptctl
usr.sbin/mailwrapper
usr.sbin/makefs
usr.sbin/map-mbone
usr.sbin/mdconfig
usr.sbin/mdsetimage
usr.sbin/memswitch
usr.sbin/mld6query
usr.sbin/mlxctl
usr.sbin/mmcformat
usr.sbin/mopd
usr.sbin/mountd
usr.sbin/moused
usr.sbin/mrinfo
usr.sbin/mrouted
usr.sbin/mscdlabel
usr.sbin/mtrace
usr.sbin/mtree
usr.sbin/ndbootd
usr.sbin/ndiscvt
usr.sbin/ndp
usr.sbin/netgroup_mkdb
usr.sbin/nfsd
usr.sbin/npf
usr.sbin/ofctl
usr.sbin/paxctl
usr.sbin/pcictl
usr.sbin/perfused
usr.sbin/pf
usr.sbin/postinstall
usr.sbin/powerd
usr.sbin/pppd
usr.sbin/psrset
usr.sbin/pstat
usr.sbin/puffs
usr.sbin/pvcsif
usr.sbin/pvctxctl
usr.sbin/pwd_mkdb
usr.sbin/quot
usr.sbin/quotacheck
usr.sbin/quotaon
usr.sbin/racoon
usr.sbin/racoonctl
usr.sbin/rarpd
usr.sbin/rbootd
usr.sbin/rdate
usr.sbin/repquota
usr.sbin/rip6query
usr.sbin/rmt
usr.sbin/route6d
usr.sbin/rpcbind
usr.sbin/rpc.bootparamd
usr.sbin/rpc.lockd
usr.sbin/rpc.pcnfsd
usr.sbin/rpc.statd
usr.sbin/rpc.yppasswdd
usr.sbin/rtadvd
usr.sbin/rtsold
usr.sbin/rwhod
usr.sbin/sa
usr.sbin/schedctl
usr.sbin/screenblank
usr.sbin/sdpd
usr.sbin/services_mkdb
usr.sbin/sesd
usr.sbin/sliplogin
usr.sbin/sntp
usr.sbin/spray
usr.sbin/srtconfig
usr.sbin/sti
usr.sbin/sunlabel
usr.sbin/sup
usr.sbin/syslogd
usr.sbin/tadpolectl
usr.sbin/tcpdchk
usr.sbin/tcpdmatch
usr.sbin/tcpdrop
usr.sbin/tcpdump
usr.sbin/timed
usr.sbin/tpctl
usr.sbin/tprof
usr.sbin/traceroute
usr.sbin/traceroute6
usr.sbin/trpt
usr.sbin/unlink
usr.sbin/usbdevs
usr.sbin/user
usr.sbin/veriexecgen
usr.sbin/videomode
usr.sbin/vipw
usr.sbin/vnconfig
usr.sbin/wake
usr.sbin/wiconfig
usr.sbin/wlanctl
usr.sbin/wsconscfg
usr.sbin/wsfontload
usr.sbin/wsmoused
usr.sbin/wsmuxctl
usr.sbin/ypbind
usr.sbin/yppoll
usr.sbin/ypserv
usr.sbin/ypset
usr.sbin/zdump
usr.sbin/zic
sbin/
Utility Who is working Status Pull Request Comment External link
sbin/amrctl
sbin/apmlabel
sbin/atactl
sbin/badsect
sbin/bioctl
sbin/brconfig
sbin/ccdconfig
sbin/cgdconfig
sbin/chkconfig
sbin/chown
sbin/clri
sbin/disklabel
sbin/dkctl
sbin/dkscan_bsdlabel
sbin/dmesg
sbin/drvctl
sbin/dump
sbin/dump_lfs
sbin/fastboot
sbin/fdisk
sbin/fsck
sbin/fsck_ext2fs
sbin/fsck_ffs
sbin/fsck_lfs
sbin/fsck_msdos
sbin/fsdb
sbin/fsirand
sbin/gpt
sbin/ifconfig
sbin/init
sbin/ldconfig
sbin/mbrlabel
sbin/mknod
sbin/modload
sbin/modstat
sbin/modunload
sbin/mount
sbin/mount_ados
sbin/mount_cd9660
sbin/mount_efs
sbin/mount_ext2fs
sbin/mount_fdesc
sbin/mount_ffs
sbin/mount_filecore
sbin/mount_hfs
sbin/mount_kernfs
sbin/mount_lfs
sbin/mount_msdos
sbin/mount_nfs
sbin/mount_nilfs
sbin/mount_ntfs
sbin/mount_null
sbin/mount_overlay
sbin/mount_portal
sbin/mount_procfs
sbin/mount_ptyfs
sbin/mount_puffs
sbin/mount_smbfs
sbin/mount_sysvbfs
sbin/mount_tmpfs
sbin/mount_udf
sbin/mount_umap
sbin/mount_union
sbin/newbtconf
sbin/newfs
sbin/newfs_ext2fs
sbin/newfs_lfs
sbin/newfs_msdos
sbin/newfs_sysvbfs
sbin/newfs_udf
sbin/nologin
sbin/pdisk
sbin/ping
sbin/ping6
sbin/pppoectl
sbin/raidctl
sbin/rcorder
sbin/reboot
sbin/resize_ffs
sbin/resize_lfs
sbin/restore
sbin/rndctl
sbin/route
sbin/routed
sbin/rtsol
sbin/savecore
sbin/scan_ffs
sbin/scsictl
sbin/setkey
sbin/shutdown
sbin/slattach
sbin/svhlabel
sbin/swapctl
sbin/sysctl
sbin/ttyflags
sbin/tunefs
sbin/umount
sbin/veriexecctl
sbin/wdogctl
sbin/wsconsctl
releases/3.2.0/developersguide/portingnetbsduserland.txt · Last modified: 2014/11/14 17:28 by lionelsambuc