NetBSD

2015-04-29

Installing NetBSD 6.0 on Compaq Armada 4100 series laptop

Using the slap-on CD drive docking unit with CD-ROM drive, it was a simple matter to install the system with a GENERIC kernel The system came right up, detecting the MegaHertz XJ3336 Ethernet Modem PCMCIA card, and I was on the network in no time.

Kernel rebuilding

The 13MB+ GENERIC kernel is a monolithic kernel with many, many drivers built in, and on a 32MB system it didn't leave much room for applications.

The challenge came with identifying just which driver modules that I needed for the specific hardware that I had. Actually, this was not too hard. By using the dmesg output which shows which hardware was found and which drivers were loaded, it served as a guide.

Following the guidance in Chapter 32 of the NetBSD Guide, I downloaded and unpacked the five source files. Then, moving to the configuration directory (/usr/src/sys/arch/i386/conf) I made a copy of the GENERIC configuration file as my starting point. I commented out all the things that are not exactly needed. Then the kernel was built. It comes in at about 2.7MB. Not a bad reduction in size!

A couple of things to be aware of:

  • I have only enabled the PCMCIA network driver for my specific card. I might want to add back in the whole list of PCMCIA drivers that I might eventually try.
  • I have enabled filesystems that I think might be useful in the future, including SMBFS.
  • This configuration includes support for the Armada's slap-on CD-ROM unit + game port.
  • I tried to rebuild with 'options I586_CPU' and it produced code that was slower and 10% larger! Needless to say, I have removed that option from my final configuration file.

Here is the ARMADA configuration file stripped of all comment lines and empty lines:

include         "arch/i386/conf/std.i386"
maxusers        16              # estimated number of users
options         INSECURE        # disable kernel security levels - X needs this
options         RTC_OFFSET=0    # hardware clock is this many mins. west of GMT
options         COMPAT_15       # NetBSD 1.5
options         COMPAT_16       # NetBSD 1.6
options         COMPAT_20       # NetBSD 2.0
options         COMPAT_30       # NetBSD 3.0
options         COMPAT_40       # NetBSD 4.0
options         COMPAT_50       # NetBSD 5.0
options         COMPAT_BSDPTY   # /dev/[pt]ty?? ptys.
file-system     FFS             # UFS
file-system     NFS             # Network File System client
file-system     CD9660          # ISO 9660 + Rock Ridge file system
file-system     MSDOSFS         # MS-DOS file system
file-system     PROCFS          # /proc
file-system     SMBFS           # experimental - CIFS; also needs nsmb (below)
file-system     PTYFS           # /dev/ptm support
options         INET            # IP + ICMP + TCP + UDP
options         IPFILTER_COMPAT # Compat for IP-Filter
options         WSEMUL_VT100            # VT100 / VT220 emulation
options         WSDISPLAY_CUSTOM_OUTPUT # color customization from wsconsctl(8)
options         WS_KERNEL_FG=WSCOL_GREEN
options         WSDISPLAY_CUSTOM_BORDER # custom border colors via wsconsctl(8)
options         WSDISPLAY_COMPAT_PCVT           # emulate some ioctls
options         WSDISPLAY_COMPAT_SYSCONS        # emulate some ioctls
options         WSDISPLAY_COMPAT_USL            # wsconscfg VT handling
options         WSDISPLAY_COMPAT_RAWKBD         # can get raw scancodes
options         PCKBD_CNATTACH_MAY_FAIL
options         PCDISPLAY_SOFTCURSOR
options         WSDISPLAY_SCROLLSUPPORT
config          netbsd  root on ? type ?
pci*    at mainbus? bus ?
pchb*   at pci? dev ? function ?        # PCI-Host bridges
pcib*   at pci? dev ? function ?        # PCI-ISA bridges
isa0    at pcib?
pcmcia* at pcic? controller ? socket ?
pcic0   at isa? port 0x3e0 iomem 0xd0000 iosiz 0x10000
isapnp0 at isa?
npx0    at isa? port 0xf0 irq 13        # x86 math coprocessor
pckbc0          at isa?                 # PC keyboard controller
pckbd*          at pckbc?               # PC keyboard
pms*            at pckbc?               # PS/2 mouse for wsmouse
options         PMS_SYNAPTICS_TOUCHPAD  # Enable support for Synaptics Touchpads
vga*            at pci? dev ? function ?
pcdisplay0      at isa?                 # CGA, MDA, EGA, HGA
wsdisplay*      at vga? console ?
wskbd*          at pckbd? console ?
wsmouse*        at pms? mux 0
attimer0        at isa?
pcppi0          at isa?
sysbeep0        at pcppi?
com*    at pcmcia? function ?           # Modems and serial cards
com0    at isa? port 0x3f8 irq 4        # Standard PC serial ports
com1    at isa? port 0x2f8 irq 3
com2    at isa? port 0x3e8 irq 5
lpt0    at isa? port 0x378 irq 7        # standard PC parallel ports
optiide*        at pci? dev ? function ?        # Opti IDE controllers
atabus* at ata?
options         ATADEBUG
wd*     at atabus? drive ? flags 0x0000
atapibus* at atapi?
cd*     at atapibus? drive ? flags 0x0000       # ATAPI CD-ROM drives
fdc0    at isa? port 0x3f0 irq 6 drq 2  # standard PC floppy controllers
fd*     at fdc? drive ?                 # the drives themselves
mhzc*   at pcmcia? function ?           # Megahertz Ethernet/Modem combo cards
com*    at mhzc?
sm*     at mhzc?
sm0     at isa? port 0x300 irq 10               # SMC91C9x Ethernet
sb0     at isa? port 0x220 irq 5 drq 1 drq2 5   # SoundBlaster
opl*    at sb?
audio*  at audiobus?
midi*   at midibus?
midi*   at pcppi?               # MIDI interface to the PC speaker
spkr0   at pcppi?               # PC speaker
joy0    at isa? port 0x201
pseudo-device   bpfilter                # Berkeley packet filter
pseudo-device   ipfilter                # IP filter (firewall) and NAT
pseudo-device   loop                    # network loopback
pseudo-device   pty                     # pseudo-terminals
pseudo-device   sequencer       1       # MIDI sequencer
pseudo-device   clockctl                # user control of clock subsystem
pseudo-device   ksyms                   # /dev/ksyms
pseudo-device   nsmb                    # experimental - SMB requester
pseudo-device   wsmux                   # mouse & keyboard multiplexor
pseudo-device   wsfont
pseudo-device   cmos
pseudo-device   drvctl
options         FILEASSOC               # fileassoc(9) - required for Veriexec
pseudo-device   veriexec
options         VERIFIED_EXEC_FP_RMD160
options         VERIFIED_EXEC_FP_SHA256
options         VERIFIED_EXEC_FP_SHA384
options         VERIFIED_EXEC_FP_SHA512
options         VERIFIED_EXEC_FP_SHA1
options         VERIFIED_EXEC_FP_MD5
options         PAX_MPROTECT=0          # PaX mprotect(2) restrictions
options         PAX_ASLR=0              # PaX Address Space Layout Randomization

X Windows configuration

Out of the box, X Windows WILL NOT work. I had to do some research and cobble together a configuration file on my own. Here is the /etc/X11/xorg.conf that works on the Armada 4100 series:

Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
        ModulePath   "/usr/X11R7/lib/modules"
        FontPath     "/usr/X11R7/lib/X11/fonts/misc/"
        FontPath     "/usr/X11R7/lib/X11/fonts/TTF/"
        FontPath     "/usr/X11R7/lib/X11/fonts/Type1/"
        FontPath     "/usr/X11R7/lib/X11/fonts/75dpi/"
        FontPath     "/usr/X11R7/lib/X11/fonts/100dpi/"
EndSection

Section "Module"
        Load  "dbe"
        Load  "dri"
        Load  "dri2"
        Load  "extmod"
        Load  "glx"
        Load  "record"
        Load  "shadow"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "wsmouse"
        Option      "Device" "/dev/wsmouse"
        Option      "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor" 
   Identifier    "Compaq Armada 4120 TFT LCD" 
   VendorName    "Compaq" 
   ModelName     "Armada 4120" 
   HorizSync     31-69 
   VertRefresh   55-120 
   ModeLine      "800x600"  45 800 840 968 1056 600 601 605 628 
   ModeLine      "640x480"  25.175 640 664 760 800 480 491 493 525 
EndSection 

Section "Device" 
     Identifier  "Cirrus CL-GD7548" 
     VendorName  "Cirrus" 
     BoardName   "CL-GD7548" 

     VideoRam    1024 
     Driver      "cirrus"
     Option      "linear" 
     Option      "no_accel" 
EndSection 

Section "Screen" 
     Identifier  "Screen0"
     Device      "Cirrus CL-GD7548" 
     Monitor     "Compaq Armada 4120 TFT LCD" 
     DefaultColorDepth  16
     Subsection  "Display" 
         Depth       8 
         Modes       "800x600" "640x480" 
     EndSubsection 
     Subsection  "Display" 
         Depth       16 
         Modes       "800x600" "640x480" 
     EndSubsection 
EndSection

Enabling root login via ssh

Edit /etc/ssh/sshd.conf and change to read:

#PermitRootLogin no
PermitRootLogin yes

Then restart the sshd server with:

/etc/rc.d/sshd restart

Enable telnet logins

Edit /etc/inetd.conf and change to include

telnet stream tcp nowait root /usr/libexec/telnetd telnetd -a none

NOTE: the use of 'none' at the end of the line!