hubertf's NetBSD Blog
Send interesting links to hubert at feyrer dot de!
 
[20091007] man(1) can handle *roff files, now
What, *roff - never heared of? You should - it's the formatting language that predates HTML and TeX for some many years, and which all *nix manpages are written in:
% cat /usr/share/man/man1/ls.1
...
.Dd September 25, 2008
.Dt LS 1
.Os
.Sh NAME
.Nm ls
.Nd list directory contents
.Sh SYNOPSIS
.Nm
.Op Fl AaBbCcdFfghikLlmnopqRrSsTtuWwx1
.Op Ar
...
There are many formatting commands, all starting with a dot as first character, and the various commands are grouped in so-called macro packages. Example files in the old-school "man" format and the newer "mandoc" format can be found in man(7) and mdoc(7) manpages on any NetBSD installation, templates can be found in /usr/share/misc/man.template and .../mdoc.template. And in /usr/share/man. :-)

Now, with the new change to man(1), you can simply type "man /usr/share/man/man1/ls.1" and the formatted manpage will be shown, just like it always did for "man ls". The fine difference is that the latter command really just shows you a preformatted file (from /usr/share/man/cat1), while the former now really formats the given file on the fly, and shows you the result.

Before the new change to man(1), you had to run the formatting tool with the right set of parameters for macro packages and possibly other options manually. Usually, the command is something like

	nroff -mandoc /usr/share/man/man1/ls.1 | more 
for terminal output. NetBSD's "nroff" command is really from the GNU *roff utilities, and using groff(1) it is also possible to produce PostScript output for pretty-printing:
	groff -Tps -mandoc /usr/share/man/man1/ls.1 >ls.ps
	lp -dPS ls.ps 
There are more options when running nroff(1)/groff(1), plus manpages can be stored in compressed format, see /etc/man.conf for some ideas. All this is now hidden behind an easy run of man(1).

For a more in-depth introduction of the Unix documentation tools (and many more things!), I recommend reading Kernighan/Pike's Unix Programming Environment.

[Tags: , , ]


[20090309] Catching up - various items (and not source-changes, this time)
Many things have happened in NetBSD-land in the past few weeks, and as I've been slacking^Wbusy again, here's just a digest of things that I haven't seen mentioned elsewhere so far, in random order:

  • BSD-related radio-show "bsdtalk" has published an interview with NetBSD's Andrew Doran in its March 2009 issue. Besides covering Andrews work, the upcoming NetBSD 5.0 release is also discussed. Available as mp3 and ogg.

  • Cross-compiling pkgsrc packages is a long-standing dream, and it's yet waiting for someone to do it. For the time being, Jared McNeill has come up with an HowTo on how to build 32bit packages on amd64 (and probably other 64bit systems).

  • Jared McNeill's been hacking on more stuff recently, and one thing includes changes to the framebuffer console support on x86 (i.e. both i386 and amd64). In short, the recent changes are just a stop on the way to move the splashscreen code and esp. image data from the kernel to userland. I.e. that you can put something like
     menu=Boot NetBSD:vesa 1280x800;splash /logo.bmp;boot netbsd 
    into your /boot.conf in the future. But we'll see a separate announcement when that part is done. Let's stay tuned! :)

  • Martti Kumparinen has tackled generating a UFS file system on a "large" (~5.5TB) disk. As the process is not straight forward, he has posted a howto that may help in the future. Any takers for adding comments and integrating this into The NetBSD Guide? :)

  • Manpages are a major component of every Unix system. If you have ever tried to write such a manpage, you 'll have learned that they are in a funny text-based format similar to LaTeX and HTML, with its own processor - *roff. There are several *roff implementations, and the one used in NetBSD currently is the GNU implementation. To provide an alternative here is good for both removing GPL'd code from the NetBSD codebase, and also because groff is written in C++, which is slow to compile, and - well - requires a C++ compiler.

    A change for that situation may arise eventually, as Kristaps Dzonsons has been working on a groff replacement to format Unix manpages recently. See his posting and his homepage for further information.

  • I've talked about Xen support for PCI passthrough recently, and Manuel Bouyer has finished his work to get full support for passing in access to specific PCI devices from the Xen Dom0 to DomUs. See his posting to port-xen for more details!

  • Staying at Xen for a moment, David Brownlee has written instructions on Installing Windows XP in Xen under NetBSD. Just in case anyone needs to run a legacy system... :)

  • The NetBSD operating system supports many different hardware and CPU platforms. For a specific platform, binaries are compiled with a specific compiler, and there is a set of binaries for each platform. This results in a rather big number of different sets of binaries - currently about 50. A different approach with historic precedence is to have one binary work on may hardware platforms, so-called "fat" binaries.

    Gregory McGarry has posted suggestions on how to modify NetBSD's toolchain to produce fat binaries. An interesting concept which would solve a number of problems (think: support, updates, pkgsrc!)

  • Qt is a user-interface library found in widespread use in the Unix/Linux world. It's not exactly small, and its prerequirement of the X Window System doesn't it make a #1 choice for embedded systems at the first look. A Qt variant - Qt/Embedded - can be ran without X, though, and which thus avoids all the configuration and hardware support trouble of X in one go.

    On NetBSD, Qt/Embedded could talk to the wscons driver directly, and Valeriy 'uwe' Ushakov has posted about his work on patches to adopt Qt/Embedded to wscons. Who's first to post some screenshots?

Enjoy!

[Tags: , , , , , , , , , ]


[20080613] Printing NetBSD documentation (wholesome, and how to make your own)
I've had a discussion about printed sets of Unix manuals the other day. As a reminder, one can make those for NetBSD easily:
  • grab NetBSD-current sources
  • cd src/share/man/man0
  • make
The result is a bit more than 8000 pages! FWIW, I've uploaded the results for NetBSD-current as of 20080613. Anyone in for printing and publishing this?

P.S.: For those wondering how to get single pages formatted, here's a little excursion in *roff, the formatting language that Unix manual pages are written in. Take src/bin/ls/ls.1 as an example. To get a formatted page in ASCII output, use:

        nroff -man ls.1 
For a printer-ready PostScript file, use:

        groff -man -Tps ls.1 >ls.ps 
NetBSD also has a macro-set to produce HTML output:

        groff -man -Thtml ls.1 >ls.html 
Enjoy!

[Tags: , , , , , ]


Tags: , 2bsd, 34c3, 3com, 501c3, 64bit, acl, acls, acm, acorn, acpi, acpitz, adobe, adsense, Advocacy, advocacy, advogato, aes, afs, aiglx, aio, airport, alereon, alex, alix, alpha, altq, am64t, amazon, amd64, anatomy, ansible, apache, apm, apple, arkeia, arla, arm, art, Article, Articles, ascii, asiabsdcon, aslr, asterisk, asus, atf, ath, atheros, atmel, audio, audiocodes, autoconf, avocent, avr32, aws, axigen, azure, backup, balloon, banners, basename, bash, bc, beaglebone, benchmark, bigip, bind, blackmouse, bldgblog, blog, blogs, blosxom, bluetooth, board, bonjour, books, boot, boot-z, bootprops, bozohttpd, bs2000, bsd, bsdca, bsdcan, bsdcertification, bsdcg, bsdforen, bsdfreak, bsdmac, bsdmagazine, bsdnexus, bsdnow, bsdstats, bsdtalk, bsdtracker, bug, build.sh, busybox, buttons, bzip, c-jump, c99, cafepress, calendar, callweaver, camera, can, candy, capabilities, card, carp, cars, cauldron, ccc, ccd, cd, cddl, cdrom, cdrtools, cebit, centrino, cephes, cert, certification, cfs, cgd, cgf, checkpointing, china, christos, cisco, cloud, clt, cobalt, coccinelle, codian, colossus, common-criteria, community, compat, compiz, compsci, concept04, config, console, contest, copyright, core, cortina, coverity, cpu, cradlepoint, cray, crosscompile, crunchgen, cryptography, csh, cu, cuneiform, curses, curtain, cuwin, cvs, cvs-digest, cvsup, cygwin, daemon, daemonforums, daimer, danger, darwin, data, date, dd, debian, debugging, dell, desktop, devd, devfs, devotionalia, df, dfd_keeper, dhcp, dhcpcd, dhcpd, dhs, diezeit, digest, digests, dilbert, dirhash, disklabel, distcc, dmesg, Docs, Documentation, donations, draco, dracopkg, dragonflybsd, dreamcast, dri, driver, drivers, drm, dsl, dst, dtrace, dvb, ec2, eclipse, eeepc, eeepca, ehci, ehsm, eifel, elf, em64t, Embedded, embedded, emips, emulate, encoding, envsys, eol, espresso, etcupdate, etherip, euca2ools, eucalyptus, eurobsdcon, eurosys, Events, exascale, ext3, f5, facebook, falken, fan, faq, fatbinary, features, fefe, ffs, filesystem, fileysstem, firefox, firewire, fireworks, flag, flash, flashsucks, flickr, flyer, fmslabs, force10, fortunes, fosdem, fpga, freebsd, freedarwin, freescale, freex, freshbsd, friendlyAam, friendlyarm, fritzbox, froscamp, fsck, fss, fstat, ftp, ftpd, fujitsu, fun, fundraising, funds, funny, fuse, fusion, g4u, g5, galaxy, games, gcc, gdb, gentoo, geode, getty, gimstix, git, gnome, google, google-soc, googlecomputeengine, gpio, gpl, gprs, gracetech, gre, groff, groupwise, growfs, grub, gumstix, guug, gzip, hackathon, hackbench, hal, hanoi, happabsd, Hardware, hardware, haze, hdaudio, heat, heimdal, hf6to4, hfblog, hfs, history, hosting, hotplug, hp, hp700, hpcarm, hpcsh, hpux, html, httpd, hubertf, hurd, i18n, i386, i386pkg, ia64, ian, ibm, ids, ieee, ifwatchd, igd, iij, image, images, imx233, imx7, information, init, initrd, install, intel, interix, internet2, interview, interviews, io, ioccc, iostat, ipbt, ipfilter, ipmi, ipplug, ipsec, ipv6, irbsd, irc, irix, iscsi, isdn, iso, isp, itojun, jail, jails, japanese, java, javascript, jetson, jibbed, jihbed, jobs, jokes, journaling, kame, kauth, kde, kerberos, kergis, kernel, keyboardcolemak, kirkwood, kitt, kmod, kolab, kvm, kylin, l10n, landisk, laptop, laptops, law, ld.so, ldap, lehmanns, lenovo, lfs, libc, license, licensing, linkedin, links, linksys, linux, linuxtag, live-cd, lkm, localtime, locate.updatedb, logfile, logging, logo, logos, lom, lte, lvm, m68k, macmini, macppc, macromedia, magicmouse, mahesha, mail, makefs, malo, mame, manpages, marvell, matlab, maus, max3232, mbr95, mbuf, mca, mdns, mediant, mediapack, meetbsd, mercedesbenz, mercurial, mesh, meshcube, mfs, mhonarc, microkernel, microsoft, midi, mini2440, miniroot, minix, mips, mirbsd, missile, mit, mixer, mobile-ip, modula3, modules, money, mouse, mp3, mpls, mprotect, mtftp, mult, multics, multilib, multimedia, music, mysql, named, nas, nasa, nat, ncode, ncq, ndis, nec, nemo, neo1973, netbook, netboot, netbsd, netbsd.se, nethack, nethence, netksb, netstat, netwalker, networking, neutrino, nforce, nfs, nis, npf, npwr, nroff, nslu2, nspluginwrapper, ntfs-3f, ntp, nullfs, numa, nvi, nvidia, nycbsdcon, office, ofppc, ohloh, olimex, olinuxino, olpc, onetbsd, openat, openbgpd, openblocks, openbsd, opencrypto, opendarwin, opengrok, openmoko, openoffice, openpam, openrisk, opensolaris, openssl, or1k, oracle, oreilly, oscon, osf1, osjb, paas, packages, pad, pae, pam, pan, panasonic, parallels, pascal, patch, patents, pax, paypal, pc532, pc98, pcc, pci, pdf, pegasos, penguin, performance, pexpect, pf, pfsync, pgx32, php, pie, pike, pinderkent, pkg_install, pkg_select, pkgin, pkglint, pkgmanager, pkgsrc, pkgsrc.se, pkgsrcCon, pkgsrccon, Platforms, plathome, pleiades, pocketsan, podcast, pofacs, politics, polls, polybsd, portability, posix, postinstall, power3, powernow, powerpc, powerpf, pppoe, precedence, preemption, prep, presentations, prezi, products, Products, proplib, protectdrive, proxy, ps, ps3, psp, psrset, pthread, ptp, ptyfs, Publications, puffs, puredarwin, pxe, qemu, qnx, qos, qt, quality-management, quine, quote, quotes, r-project, ra5370, radio, radiotap, raid, raidframe, rants, raptor, raq, raspberrypi, rc.d, readahead, realtime, record, refuse, reiserfs, Release, releases, Releases, releng, reports, resize, restore, ricoh, rijndael, rip, riscos, rng, roadmap, robopkg, robot, robots, roff, rootserver, rotfl, rox, rs323, rs6k, rss, ruby, rump, rzip, sa, safenet, san, sata, savin, sbsd, scampi, scheduler, scheduling, schmonz, sco, screen, script, sdf, sdtemp, secmodel, security, Security, sed, segvguard, seil, sendmail, serial, serveraptor, sfu, sge, sgi, sgimips, sh, sha2, shark, sharp, shisa, shutdown, sidekick, size, slackware, slashdot, slides, slit, smbus, smp, sockstat, soekris, softdep, softlayer, software, solaris, sony, sound, source, source-changes, spanish, sparc, sparc64, spider, spreadshirt, spz, squid, ssh, sshfs, ssp, statistics, stereostream, stickers, storage, stty, studybsd, subfile, sudbury, sudo, summit, sun, sun2, sun3, sunfire, sunpci, support, sus, suse, sushi, susv3, svn, swcrypto, symlinks, sysbench, sysctl, sysinst, sysjail, syslog, syspkg, systat, systrace, sysupdate, t-shirt, tabs, talks, tanenbaum, tape, tcp, tcp/ip, tcpdrop, tcpmux, tcsh, teamasa, tegra, teredo, termcap, terminfo, testdrive, testing, tetris, tex, TeXlive, thecus, theopengroup, thin-client, thinkgeek, thorpej, threads, time, time_t, timecounters, tip, tk1, tme, tmp, tmpfs, tnf, toaster, todo, toolchain, top, torvalds, toshiba, touchpanel, training, translation, tso, tty, ttyrec, tulip, tun, tuning, uboot, ucom, udf, ufs, ukfs, ums, unetbootin, unicos, unix, updating, upnp, uptime, usb, usenix, useradd, userconf, userfriendly, usermode, usl, utc, utf8, uucp, uvc, uvm, valgrind, vax, vcfe, vcr, veriexec, vesa, video, videos, virtex, virtualization, vm, vmware, vnd, vobb, voip, voltalinux, vpn, vpnc, vulab, w-zero3, wallpaper, wapbl, wargames, wasabi, webcam, webfwlog, wedges, wgt624v3, wiki, willcom, wimax, window, windows, winmodem, wireless, wizd, wlan, wordle, wpa, wscons, wstablet, X, x.org, x11, x2apic, xbox, xcast, Xen, xen, xfree, xfs, xgalaxy, xilinx, xkcd, xlockmore, xmms, xmp, xorg, xscale, youos, youtube, zaurus, zdump, zfs, zlib

'nuff. Grab the RSS-feed, index, or go back to my regular NetBSD page

Disclaimer: All opinion expressed here is purely my own. No responsibility is taken for anything.

Access count: 34936800
Copyright (c) Hubert Feyrer