Bluetooth status, compatible USB Bluetooth adapters?

2023-10-03 Thread David Young
I bought a couple of thumbnail-sized USB Bluetooth 5.0 adapters.
Today I plugged one into a Rock64 board.  I see ubt0 and bthub0
attach---great! `btconfig ubt0 inquiry` does not reveal my Apple
keyboard.

Apparently the adapter I tried today (a TP-Link UB500) does work with
Linux, however, a Realtek firmware blob has to be loaded.

By the way, to interoperate with Bluetooth Low Energy devices, is
anything beyond a compatible USB Bluetooth adapter needed?  For example,
kernel or utility changes?

David

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: problem getting hostapd and bridging to work

2023-07-18 Thread David Young
On Tue, Jul 18, 2023 at 06:56:43PM +0100, Dave Tyson wrote:
> /etc/ifconfig.run0
> apbridge
> up

run(4) may not support `hostap` mode? 

David

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


wondering about Xilinx Zynq 7000 support

2023-04-10 Thread David Young
I noticed the other day that NetBSD was ported to the Xilinx Zynq 7000,
a neat 2-core ARM SoC with FPGA on-die.  I'm curious if anyone is
currently developing on that SoC.  Are there any serious obstacles to
making use of the FPGA from NetBSD?

David

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: NPF/interface tuning? shell unusable on gateway

2022-03-27 Thread David Young
Sometimes, because of "buffer bloat," really bad things happen if the
WAN and LAN speeds are badly mismatched.  But your findings don't point
directly at buffer bloat.

Are there any packet drops or other errors? `sysctl net.interfaces`,
`sysctl net.inet6.ip6.ifq`, `sysctl net.inet.ip.ifq`, and `netstat -dvI
re0; netstat -dvI re1` may be revealing.

What link speed is negotiated on WAN and LAN ports?
Is any flow-control negotiated?

It sounds like the LAN is quite slow?  I may have misunderstood.  Is the
LAN all wired or is there any wireless involved?

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Swift Language port?

2021-02-23 Thread David Young
Just wondering if anyone already has begun a port of Apple's Swift
language to NetBSD, or if anybody still plans to do that?

It looks like there was a FreeBSD port for a while, and
as recently as December there was activity on an [OpenBSD
port](https://github.com/apple/swift/pull/35062).

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


NetBSD-friendly HDD recovery?

2020-11-23 Thread David Young
I have some old Seagate-brand spinning rust with a NetBSD system on
it.  The disk does not spin up, but I am pretty sure that the content is
intact, and I would like to have it for a reasonable price.  Is there a
service that's known to be NetBSD friendly?

Last time I checked, recovery cost about $500 USD.  IIRC, you paid that
regardless of whether recovery was successful.  Some recovery services
clearly were middlemen.  You could send a disk directly to Seagate for
recovery.  No recovery service acknowledged the existence of BSD or FFS.

I want to avoid paying a steep price to a service that scans the
medium and, finding no FAT/NTFS/HFS+/APFS volume on it, declares it
unrecoverable when, in actual fact, every bit is intact.  Is there a
service that I can trust my NetBSD disk to that has a reasonable fee
structure?

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Java for NetBSD

2020-04-05 Thread David Young
On Sun, Apr 05, 2020 at 02:42:43PM +0300, John m0t wrote:
>  Hello;
> Today I faced another problem.
> As far as I know the java in *NetBSD* is the same file/kind as Linux.
> I have downloaded the jetbrains intellij which ships with openjdk. I went
> inside the openjdk directory.
> Under sh shell {./java} command will return *not found* and under bash
> shell I get
> *no such file or directory*. the said file is executable. the {ls} command on
> that directory shows the java file.
> Could someone tell my why?

`./java` may be a script.  The program named in the #! directive in the
first line of the script may be missing.  Run `file ./java` to see if
it's a script.  Run `head -1 ./java` to look at the first line.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Portable Makefile ideas

2019-03-31 Thread David Young
On Sat, Mar 30, 2019 at 10:14:50PM -0700, Greg A. Woods wrote:
> At Sun, 10 Feb 2019 19:47:02 +0100, Benny Siegert  wrote:
> Subject: Re: Portable Makefile ideas
> >
> > Perhaps take a look at CMake. I found it to be easier than expected,
> > and it is common enough that package systems like pkgsrc support it
> > directly.
> 
> I see I'm late to the game here, but I'd like to try to dissuade anyone
> who'll hear me out to avoid CMake in any way, shape, form, or use.
> 
> It is a massive, ugly, inconsistent, and incomplete mess of C++
> spaghetti, and it does not do what you think it does, no matter what you
> think it does, nor how well you think you know it.

I've spent a bit of time with CMake simply because it seems to be the
native configuration/build tool for LLVM.  From the surface on down it
seems totally retrograde---I mean, what is that, m4 syntax?

I agree that mk-configure is delightful.  Highly recommended.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: /var on tmpfs

2018-11-16 Thread David Young
On Thu, Nov 15, 2018 at 10:28:56PM -0700, Don NetBSD wrote:
> I've a box with a DoM.  I'd like to mount / as ro and create a
> tmpfs for /var (and /tmp).  I don't think anything else NEEDS to
> be rw (the infrequent changes to /etc can be made by unlocking /
> to make those changes).
> 
> I imagine I can just make a tarball of a skeletal /var and
> unpack this over /var, once mounted?
> 
> Is there a preexisting mechanism for this sort of thing?
> Or, do I roll my own?

I have done this before.

I added an rc script for copying filesystems on non-volatile (NV)
storage to memory filesystems and then null-mount the memory
filesystems on top of the NV directories.  See attachment.

I added a line to /etc/fstab,

swap /mfs tmpfs rw,-s8M 0 0

I modified my rc.conf to 1) indicate that /etc, /var, temporary and
home directories should be on (ephemeral!) memory filesystems, and 2)
ensure that the prerequisite filesystems (/usr) were mounted before
mountcritmem ran.

# When /usr is on a different filesystem than /, I mount it
# before the memory filesystems so that pax can run programs
# from it.
#
critical_filesystems_beforemem="/usr"

# Do not mount /var, it's a memory fs. Superfluous, since NetBSD
# will not mount /var a second time, anyway.
#
# critical_filesystems_local=""

# Don't mount /usr, it comes with / on the CD-ROM.
#
critical_filesystems_remote=""

# Don't mount /usr, it comes with / on the CD-ROM.
#
critical_filesystems_memory="/etc /home /root /tmp /var"

If this works for you, too, maybe mountcritmem should go into the base
system.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981
#!/bin/sh
#
# $NetBSD$
# $Id: mountcritmem 4133 2006-08-26 06:10:29Z dyoung $
#

# PROVIDE: mountcritmem
# REQUIRE: root
# BEFORE: mountcritlocal

$_rc_subr_loaded . /etc/rc.subr

name="mountcritmem"
required_dirs="/mfs /permanent $critical_filesystems_memory"

for _d in $critical_filesystems_memory; do
d=${_d#/}
required_dirs="$required_dirs /permanent/$d"
done

start_cmd="mountcritmem_start"
stop_cmd="mountcritmem_stop"

#
# Example /etc/fstab
#
# /dev/wd0a / ffs ro 0 0
# swap /mfs mfs rw,-s=10880k,-i=256 0 0

abort_mountcritmem()
{
if [ "$autoboot" = yes ]; then
echo "ERROR: ABORTING BOOT (sending SIGTERM to parent)!"
kill -TERM $$
exit 1
fi
}

mountcritmem_start()
{
if [ "${critical_filesystems_memory:-}" = "" ]; then
return 0
fi

echo "Mounting critical memory filesystems"
_fs_list=
for _d in $critical_filesystems_memory; do
d=${_d#/}
_fs_list="$_fs_list $d"
done
for d in $_fs_list; do
if [ ! -d /permanent/$d ]; then
echo "ERROR: missing /permanent/$d"
abort_mountcritmem
return 1
fi
done

for d in $_fs_list; do
if ! mount /mfs; then
echo "ERROR: cannot mount /mfs"
abort_mountcritmem
return 1
fi
break
done

for d in $_fs_list; do
if ! mkdir /mfs/$d; then
echo "ERROR: cannot mkdir /mfs/$d"
abort_mountcritmem
return 1
fi
done

for d in $_fs_list; do
if ! mount -t null /$d /permanent/$d; then
echo "ERROR: cannot mount /permanent/$d"
abort_mountcritmem
return 1
fi
done

for d in $_fs_list; do
cd /permanent/$d
if ! mount -t null /mfs/$d /$d; then
echo "ERROR: cannot mount /mfs/$d"
abort_mountcritmem
return 1
fi
if ! pax -pe -rw . /$d ; then
echo "ERROR: cannot populate /mfs/$d"
abort_mountcritmem
return 1
fi
cd -
done
}

mountcritmem_stop()
{
if [ "${critical_filesystems_memory:-}" = "" ]; then
return 0
fi

_rev_fs_list=
for _d in $critical_filesystems_memory; do
d=${_d#/}
_rev_fs_list="$d $_rev_fs_list"
done
for d in $_rev_fs_list; do
umount /mfs/$d
umount /permanent/$d
done
for d in $_rev_fs_list; do
umount /mfs
break
done
}

load_rc_config $name
run_rc_command "$1"


Re: Simple way to securely access remote machine that's behind a NAT?

2018-09-25 Thread David Young
On Tue, Sep 25, 2018 at 03:04:56PM +0545, Brook Milligan wrote:
> Just curious, could one also use either gre or gif to create a tunnel or does 
> NAT mess that up?

I added UDP encapsulation to gre(4) in NetBSD specifically to pierce NAT
firewalls, however, I don't know if Linux also has a UDP encapsulation
for GRE.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: reading older disks

2018-08-22 Thread David Young
If all else fails, and one decides to send a disk for recovery, is
the manufacturer the best bet (I see that Seagate will try to recover
its own disks for a rather high flat fee), or is there a BSD-friendly
service provider?

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: How to debug IPV6

2018-06-17 Thread David Young
I always check for a basic level of connectivity by pinging the
all-hosts multicast address, e.g.,

ping6 ff02::1%wm0

You can also try pinging the second host's link-local address,

ping6 fe80::221:9bff:fefc:c5cc%wm0

Maybe the subnet 2605:2600:1001::/64 wasn't installed properly when
the interface was configured?  When I get unexpected results, I
like to check for a route to the particular host:

route -n get -inet6 2605:2600:1001::43

Hope that helps.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Status of run0 support on NetBSD 8.0_RC1

2018-06-12 Thread David Young
On Tue, Jun 12, 2018 at 05:09:20PM +0100, Patrick Welche wrote:
> On Tue, Jun 12, 2018 at 03:05:40PM +0100, Patrick Welche wrote:
> > On Tue, Jun 12, 2018 at 03:02:26PM +0100, Patrick Welche wrote:
> > > That reminds me of:
> > > 
> > > http://mail-index.netbsd.org/tech-net/2017/01/19/msg006248.html
> > > 
> > > Some feedback would have been / would be nice...
> > 
> > Instant feedback:
> > 
> > +   } else if (sc->mac_ver == 0x3070 && sc->mac_rev < 0x0201) {
> > 
> > can't be right...
> 
> ... but it's in the FreeBSD driver:
> 
> https://svnweb.freebsd.org/base/head/sys/dev/usb/wlan/if_run.c?view=markup&pathrev=257955#l4608

At first glance, that line looks like it's performing an impossible test
on one member of `sc`: `mac_ver` cannot both equal 0x3070 and be less
than 0x0201.  I think that's what you mean when you say that it can't be
right?

On second glance, there are actually two members involved: one is a
`version` number and the other is `revision` number.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Unable to join open WEP wireless network

2018-02-01 Thread David Young
On Thu, Feb 01, 2018 at 11:25:21AM +, Chen, Xianwen (陈贤文) wrote:
> Dear NetBSD users,
> 
> I am having trouble connecting NetBSD to an open WEP wireless network,
> called "ks-guest". Because my Android mobile phone is able to connect
> to "ks-guest", the network is functioning.

What do you mean by an "open WEP" network?  Seems like any WEP network
should have a key, but you're not configuring the interface with any
key.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981



Re: Error trying to create gre tunnel

2017-08-14 Thread David Young
On Sat, Aug 12, 2017 at 12:05:00PM +0700, Robert Elz wrote:
> Date:Fri, 11 Aug 2017 22:55:41 -0400
> From:"D'Arcy Cain" 
> Message-ID:  <711b9619-36ef-fedf-cfcf-39a9b969d...@netbsd.org>
> 
>   | I thought about that but my Linksys WRT router doesn't appear to have 
>   | the ability to forward anything but TCP and UDP.
> 
> Since you have control over both ends, you could switch to GRE over UDP
> and suffer the small MTU hit.

Just in case it helps

About the same time that I added GRE over UDP to the kernel, I wrote the
attached tunnel daemon.  It acts as server or client depending on the
parameters you provide.

The routers on our (defunct) community wireless network ran this daemon
in client mode.  The server ran on a Soekris net4521 at my office.
Many of the routers were behind NAT firewalls, so the NAT-piercing UDP
tunnels helped us maintain administrative control of them.

There is no authentication, but a determined developer should be able to
add some.  I guess that you could add privacy with IPsec.

Dave
 
-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981
# $Id: Makefile 4324 2006-10-09 07:27:15Z dyoung $

NOMAN=
.include 

LIBLOG != cd ${.CURDIR}/../log && ${PRINTOBJDIR}
LIBMISC != cd ${.CURDIR}/../misc && ${PRINTOBJDIR}
LIBSSRV != cd ${.CURDIR}/../ssrv && ${PRINTOBJDIR}

CPPFLAGS=-I${.CURDIR}/.. -Wall -pedantic -std=c99 -fPIC
BINOWN=root
BINGRP=wheel
BINMODE=0755
BINDIR=/usr/sbin
LDADD+=-L${LIBSSRV} -lssrv
LDADD+=-L${LIBLOG} -llog
LDADD+=-L${LIBMISC} -lmisc
LDADD+=-levent -lutil

DPADD+= ${LIBLOG}/liblog.a
DPADD+= ${LIBSSRV}/libssrv.a ${LIBMISC}/libmisc.a

PROG=utd
INCS=   utd.h
SRCS=   main.c utd.c utd_sm.c

LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${PROG}6

CPPFLAGS+=-DUTD_DEBUG
CPPFLAGS+=-DDIAGNOSTIC
CFLAGS+=-g -O1
#-DDEBUG

.include "../mk/cuwin.mk"
.include 
utd: UDP Tunnel Daemon

WORK IN PROGRESS

A basic daemon for setting up UDP+GRE-encapsulated IP tunnels.

usage: utd [-d] [-e] local-outer,port local-inner[/masklen]
   [remote-outer,port remote-inner]

-d  tells utd not to daemonize.  utd will write debug messages
to the standard error.

-e  tells utd to add an EUI64 to the local inner address, if
it is an IPv6 address with mask length equal to 64 and
zeroes in the host part of the address.

-m Ntells utd that the gre(4) unit numbers it uses should
roll over at N.  That is, utd should choose unit number 0
after unit number N - 1.

utd acts as a server when it is run with two arguments.  utd acts
as a client when it is run with four arguments.

A utd server binds a UDP socket to local-outer,port and listens
for messages from utd clients.  A utd client also binds local-outer,port,
but it connects the socket to remote-outer,port and sends a message
that initiates the client-server handshake that creates a tunnel.

The handshake is like this,

1 client sends probe request

2 server receives request; sends probe reply to the probe's
  source

3 client receives reply, creates tunnel, sends acknowledgement,
  starts monitoring tunnel's input-packet count

4 server receives acknowledgement, creates tunnel, starts
  monitoring tunnel's input-packet count

If the input-packet count stops ascending for a minute, then utd
will destroy the tunnel and restart the handshake.

A utd client creates one GRE interface, sets its local address to
local-inner, and sets the address of the remote tunnel endpoint to
remote-inner.

A utd server creates a tunnel interface for each client.  It sets
the local address of each interface to local-inner.  It sets the
address of the remote tunnel endpoint on each interface to the
address specified by the client in the handshake.
/* $Id: main.c 5026 2008-05-09 17:50:11Z dyoung $ */
/*
 * Copyright (c) 2005, 2006, 2007 David Young.  All rights reserved.
 *
 * This file contains code contributed by David Young.
 *
 * Redistribution and use in source and binary forms, with or
 * without modification, are permitted provided that the following
 * conditions are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above
 *copyright notice, this list of conditions and the following
 *disclaimer in the documentation and/or other materials provided
 *with the distribution.
 * 3. David Young's name may not be used to endorse or promote
 *products derived from this software without specific prior
 *written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 * PARTICULAR PURPOSE ARE DISCLAIMED.  IN 

Re: 8.0 BETA i386 : atheros wifi support

2017-06-09 Thread David Young
On Fri, Jun 09, 2017 at 03:11:50PM +, Christos Zoulas wrote:
> FreeBSD has support for it, OpenBSD does not. Our driver comes from OpenBSD...
> It would take some work to add the changes needed.

It's disappointing that we picked up an OpenBSD driver after Atheros
came around and started collaborating with open-source developers,
especially since AFAIR the OpenBSD driver did not support all of the
same devices as the previous driver did.

That being said, the 802.11 virtual AP architecture in FreeBSD *is*
unfortunate, but it's something that you could probably paper over.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: NetBSD on embedded devices

2017-06-04 Thread David Young
On Sun, Jun 04, 2017 at 01:25:14PM -0400, Thor Lancelot Simon wrote:
> You're describing a fairly basic dual-image embedded setup.  Several
> of us have done this with NetBSD over the years but, sad to say, I
> think the results belong to each of our former employers.

I have made a dual-image embedded setup in open source, too.  I would be
happy to share the scripts if you want to mine them for ideas.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Updates to man-k.org

2017-05-14 Thread David Young
On Sun, May 14, 2017 at 06:09:01PM +0530, Abhinav Upadhyay wrote:
> I didn't want to change the dropdown in the main search page to a
> checkbox based one, therefore put this on a page of its own. I will
> try to provide a hyperlink to it from the main page.

It's exciting to watch these improvements to man-k.org.

In case you were not aware, the web pages don't seem to be indexed by
author (try searching for Abhinav).

Here a couple of UI nits that you may or may not want to pick:

On my 15-inch laptop, the man-k.org homepage has several square inches
of blank space, plenty of room for all of the choices under the
dropdown.  If you replace the dropdown with checkboxes, then it will
take about half as long to make a selection, and the user can apprehend
more of the possibilities without exploring the page with the mouse.

Usually it is best if controls or gestures are one-to-one with choices:
consider using a pair of radio buttons instead of checkboxes to
select/deselect each OS, if space allows.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Problem with Intel WiFi card

2017-02-14 Thread David Young
On Wed, Feb 08, 2017 at 10:20:57AM +0100, Rocky Hotas wrote:
> > Sent: Tuesday, February 07, 2017 at 4:00 PM
> > From: "Christos Zoulas" 
> > To: netbsd-users@netbsd.org
> > Subject: Re: Problem with Intel WiFi card
> >
> [...]
> > 
> > ppb is in /usr/src/sys/dev/pci/ppb.c. There is a ppbattach function there
> > and you can add the resources function in that file. The field names 
> > probably
> > don't match but there should be equivalent ones.
> 
> I did as you suggested. Obviously it doesn't compile, but this was expected.
> First example: the struct `pci_attach_args' in NetBSD seems to miss the 
> following members (from OpenBSD `/src/sys/dev/pci/pcivar.h'):
> 
> struct extent *pa_ioex;
> struct extent *pa_memex;
> struct extent *pa_pmemex;
> struct extent *pa_busex;

This sounds like something that I was working on at one time.  Rather
than extents, I used vmem(9) arenas, but I think that I was trying to
accomplish the same thing.

I wanted to unify CardBus and PCI, CardBus just being PCI in a different
form-factor, and then add some stuff like PCI exception handling, and
(eventually) a little better protection from errant DMA.  CardBus always
has to dynamically allocate bus resources because you don't know what
card will be plugged in.

ISTR that I was able to make most CardBus attachments (dev? at cardbus?)
to PCI attachments (dev? at pci?) before I ran out of time to work on
the project.

I can probably scratch up the code, but it's probably bit-rotted, and I
don't know if I would carry on with the same project using C.  Swift in
the kernel, anyone?

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


portable /usr/share/mk/ ?

2016-12-14 Thread David Young
Through the magic of pkgsrc, I can use BSD make and make includes files
like bsd.prog.mk on various operating systems.

Alas, the .mk files that come with pkgsrc are rather old compared with
NetBSD's.  Some targets seem to work slightly differently than they do
in NetBSD, or not at all.

Has anyone produced a portable version of the NetBSD .mk files?

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Semetic/fuzzy-logic code comparison tool ?

2016-12-13 Thread David Young
On Tue, Dec 13, 2016 at 03:08:02PM -0700, Swift Griggs wrote:
> Let's say one wants to make general statement that "This code is 30%
> the same as that code!" Another example would be someone wants to
> make the statement that "XX% of this code really came from project
> X." In my case I'm only interested in "honest" code, not trying to
> catch someone stealing/permuting existing code. Oh, and everything I
> care about is in C.
> 
> My questions are:
> 
> * Are there tools that already do this?

I don't know if there is a tool that does what you want---please let
us know what you find.

You might have a look at 'spdiff', a program that infers "semantic
patches" that can be applied with the Coccinelle program, spatch.  I'm
not sure how you would assign a "sameness" to the result.  Shortness of
the patch, maybe?

You might look at my ARFE tools, which I have put in NetBSD's othersrc
repo.  ARFE uses a dynamic programming algorithm to align one text with
another, seeking to match like characters or lexical items ("tokens")
with like while minimizing the amount of unmatched text ("residue").
Imperfect matches and residue are added up to produce a "score" for the
alignment.  The algorithm, a variant of Hirschberg's algorithm, seeks to
minimize the score.  ARFE understands some common tokens like numbers,
whitespace, and C-like identifiers.

ARFE does not "understand" nested structures, yet.  Also, it does not
favor an alignment where every instance of a token x in the first text
is replaced by the token y in a second text, over an alignment where x
has assorted replacements.  I cannot make up my mind whether it would be
more difficult to make ARFE understand nested structures, or to favor
alignments where one token always replaced another.  Since you are
concerned with comparing C programs, you would want to do both, and you
would want to respect the scope rules.

Speaking of nested structures, there are algorithms for aligning trees
rather than strings.  You could conceivably compare the abstract syntax
trees produced by two C programs, and judge their sameness that way.

> I know that this is essentially an AI problem and thus can get
> complex in a hurry.

I wouldn't call it an AI problem, myself.  It's an optimization problem.
Or maybe that is just the way I choose to think of it. :-)

I suspect that it is easier to produce a tool that produces useful
results on many (but not all) texts consisting of tokens and nested
structures that are common on the web, than to produce a tool that in
produces a perfect result on, say, every compilable C program.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Tracking down TCP & UDP listeners

2016-11-16 Thread David Young
On Wed, Nov 16, 2016 at 10:54:19PM -0500, Scott Burns wrote:
> 3) Any idea what is listening on TCP and UDP for ports 1021, 1022, 1023?
>   - Yellowpages / NIS?
>   - Can this listener be disabled if we determine we are not using
> what the listener is for?

fstat(1) will reveal what processes have sockets open on those ports.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Exist operating systems that ship without blobs?

2016-02-23 Thread David Young
On Sun, Feb 21, 2016 at 09:25:52PM -0500, Thor Lancelot Simon wrote:
> On Fri, Feb 19, 2016 at 04:33:40PM -0600, David Young wrote:
> > 
> > BTW, I think a reasonable precaution to take with a lot of devices,
> > their firmware and drivers, open- or closed-source (but especially
> > closed source), is to put them under supervision of, say, an IOMMU.
> 
> It's reasonable, for sure, but it's not enough.  There are BSD derived
> operating systems out there which do this to complicate life for 
> malicious hot-plug PCIe devices.  Unfortunately, it doesn't really work,
> since you can always find some sensitive region that does have DMA enabled
> (if you get in early enough, the pages used for the disk transfers that
> bring in kernel modules, for example -- or libc) and scribble on it.

Not sure I follow.  You are talking about a malicious device that
performs bus-mastering accesses before the OS has initialized the IOMMU?

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Exist operating systems that ship without blobs?

2016-02-19 Thread David Young
On Thu, Feb 18, 2016 at 10:53:21AM -0300, Jorge Luis wrote:
> Theo de Raadt wrote:
> The result is that we end up with additional support because of them. Some
> of them write device drivers, or some of them create pressure against
> vendors and then things become free. And in the end, the whole goal is that
> we can keep on running on stuff that is completely open so that we can see
> it so that we can check it.
> 

Interesting wording there, "some of them create pressure against vendors
and then things become free".  Theo would probably like to *believe*
that the pressure *made* things free but, doubting it, he could not
quite make himself say it.

FWIW, I found that politely asking vendors for documentation worked.
I could not see that OpenBSD's theatrical (you could say terroristic)
tactic of distributing the email addresses and phone numbers of the
employees of vendors, and urging people to hound them, made much
positive difference.

BTW, I think a reasonable precaution to take with a lot of devices,
their firmware and drivers, open- or closed-source (but especially
closed source), is to put them under supervision of, say, an IOMMU.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Firsts in NetBSD

2016-01-07 Thread David Young
On Thu, Jan 07, 2016 at 11:13:12AM -0700, Swift Griggs wrote:
> 
> I'm writing some documentation for a class I'm teaching soon at my
> job. One section covers various BSD's (each separate) contribution
> to features in the collective endowment of Unix variants out there.
> 
> Here are the things I believe NetBSD was first at doing. Can anyone
> else think of ones that'd be worthy of note to a group of
> up-and-coming Unix geeks ?
> 
> * First with a USB stack (beat Linux didn't it?)
> * First with TCP Auto tuning (Linux's autotune based on NetBSD's strategy)
> * First with Free ports to Alpha, HPPA, and MIPS (true?)
> 
> I know there are more NetBSD "first to do XYZ". Does anyone care to
> correct those three or give me some more? Thanks in advance,
> friends.

First with an 802.11 stack, net80211, by Atsushi Onoe.

First with the extensible 802.11 radio-information header, radiotap.

When the 802.11 MACs known as "dumb packet engines" came out, NetBSD led
with some of the first drivers that were fully open-source (no binary
vendor blob), for ADMtek and Realtek chipsets.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


re-introducing ARFE; teaching ARFE new tricks

2015-09-16 Thread David Young
ARFE is a new text-processing toolkit that I recently started sharing
with the NetBSD community.  I introduced ARFE on tech-userlevel@ in
August,
<http://mail-index.netbsd.org/tech-userlevel/2015/08/11/msg009269.html>.

ARFE is an experiment in making UNIX text-processing more *applicable*
and *accessible*.

applicable: ARFE is designed to process record- and field-oriented
texts as they actually appear in UNIX and on the web: semi-regular,
defect-ridden, and conforming to no written specification.

accessible: ARFE avoids excessive abstraction, tricky notation, and
precarious flexibility to the greatest practical extent.  ARFE
encourages users to be *concrete*.  Typically an ARFE user expresses
the input and output forms they expect by providing an example
instead of a description, and ARFE tolerates some mistakes in the
examples users give.  With ARFE, it isn't necessary to name input
data fields, or to count off input fields from the beginning of a
record.

I'm creating ARFE in the hope that it will invite non-programmers to
attempt text-processing automation, and that programmers will find that
it relieves some text-processing tedium so that they can tackle bigger
problems.

Since I introduced ARFE, I have added new data detectors: ARFE now
detects hexadecimal numbers, IPv4 and MAC addresses.

There is a new program in the ARFE toolsuite called TT for (t)ransform
(t)ext.  TT transforms its input based on a match-/transform-template
pair that exemplify the changes to be made.  The templates show what
a sample input looks like before TT transforms it, and after---you
could call the templates a before/after pair.  I have attached a
match/transform pair that produces a digest of ifconfig(8) output.

ARFE is in the NetBSD CVS repository.  The path to ARFE is
othersrc/external/bsd/arfe/.

Next steps for ARFE include adding more data detectors (floating point
numbers, IPv6 addresses), making ARFE prefer matches that are "compact",
and adding support for multiple records per input.  After ARFE supports
multiple records per input, a couple of really interesting programs
should be possible.  Alas, it may be at least as difficult to program an
algorithm for identifying record boundaries as to program everything in
ARFE that came before!

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981
wm0: flags=8843 mtu 1492

capabilities=2bf80

enabled=2bf80
address: aa:ab:ac:ad:ae:af
media: Ethernet autoselect (1000baseT full-duplex)
status: active
input: 745177 packets, 455120099 bytes, 74377 multicasts
output: 540500 packets, 121290742 bytes, 253 multicasts
inet 0.0.0.0 netmask 0x broadcast 255.255.255.255
inet6 fe80::10f:20f:30f1:40f%wm0 prefixlen 79 scopeid 0x7
wm0 mtu 1492
link aa:ab:ac:ad:ae:af
inet 0.0.0.0 netmask 0x broadcast 255.255.255.255
inet6 fe80::10f:20f:30f1:40f%wm0 / 79 scopeid 0x7


groff & NetBSD & relevance (was Re: Re: Re: Request to reconsider removal of groff from base system)

2015-04-08 Thread David Young
On Tue, Apr 07, 2015 at 11:27:02AM +, Ron Swiernik wrote:
> Again this is an enhancement? Can mandoc handle tbl and pic input?
> 
> UNIX has had the *roff tool suite for a long time. A text formatter is how 
> they
> got support from management to continue work on UNIX. I doubt we would be
> talking about UNIX today if it wasn't for the suite.

There can be no denying that the MS office suite has serious usability
problems (not to mention problems with usefulness, relevance, and
resilience), but I don't think a batch-oriented system using dot
commands is any kind of improvement.

I don't think that arguments whether one old technology (MS Office is,
by now, rather long in the tooth) is an improvement or not over an older
technology (just how old is *roff?) really advance the project.

Document preparation is important.  Deleting the only or best document
preparation system in NetBSD (supposing that is even what's going on)
is pretty lame, but it seems to me that neither *roff nor an MS Office
knock-off will buy UNIX much relevance in 2015.  What's next?

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: ixg(4) performances

2014-07-09 Thread David Young
On Wed, Jul 09, 2014 at 06:36:59AM +, Emmanuel Dreyfus wrote:
> ifconfig does not want tcp4csum-rx and udp4csum-rx despite advertising 
> them as available.

In the hardware, you cannot independently enable layer-4 Rx checksums
for TCP or UDP, IPv4 or IPv6.  It's all or nothing.  So that you cannot
set the flags to a different state than the hardware, SIOCSIFCAP returns
EINVAL when you make an unsupported selection.

Try 'ifconfig ixg0 tcp4csum-rx tcp6csum-rx udp4csum-rx udp6csum-tx',
that should work.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: RAM based block device driver

2014-06-16 Thread David Young
On Mon, Jun 16, 2014 at 02:53:51PM +0200, Stephan wrote:
> Hi all,
> 
> is there anything like a RAM based block device driver for NetBSD? I
> saw some implementations in the Linux world, e.g.
> 
> http://www.opensourceforu.com/2012/02/device-drivers-disk-on-ram-block-drivers/
> http://blog.superpat.com/2010/05/04/a-simple-block-driver-for-linux-kernel-2-6-31/comment-page-2/
> http://lkml.iu.edu/hypermail/linux/kernel/1406.1/04553.html

Yes, see md(4) and mdconfig(8).

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: oversize frame

2014-03-27 Thread David Young
On Wed, Mar 26, 2014 at 10:35:43PM -0700, Aaron J. Grier wrote:
> (necromancing old threads...)
> 
> On Fri, Nov 08, 2013 at 11:09:59AM -0500, Michael T. Davis wrote:
> > Every so often, the NetBSD-6 kernel reports...
> > 
> > Nov  8 09:44:17 fw /netbsd: wm1: discarding oversize frame (len=1518)
> > 
> > It only ever cites wm1 and the length is always 1518.  Since the MTU
> > for this interface is set to 1500, doesn't this mean that another
> > system attached to that interface is generating an invalid packet,
> > presumably due to a mis-configuration?
> 
> FWIW I see this on nfe on my sunfire x2200m2.  the nfe is attached by a
> vlan, but vlan packets are 1504 bytes -- 1518 seems a very strange
> number.

I recognize the number, here is how I think it comes about: 6-byte
destination MAC + 6-byte source MAC + 2-byte outer ethertype (VLAN) +
2-byte VLAN tag + 2-byte inner ethertype + 1500 MTU = 1518 bytes.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


bonjour printer?

2014-03-08 Thread David Young
Has anyone successfully set up NetBSD to detect and to print to a
Bonjour printer (mine is a Brother HL-5470DW)?  What packages did you
have to install?

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Downloading NetBSD - Too complicated ?

2014-02-07 Thread David Young
On Thu, Feb 06, 2014 at 01:51:06PM +0100, Zafer Aydoğan wrote:
> Hello NetBSD-Users,
> 
> A couple of days ago I stumbled across the announcement of PCBSD 10
> and gave it a shot.
> Downloading was easy and fast, because it utilizes a CDN.
> At that point, I crosschecked with www.netbsd.org and was embarrassed, how
> complicated it is to get a copy of NetBSD.
> 
> Here is the click path to get a copy of NetBSD, starting from www.netbsd.org:
> 
> 1.: Click on "Get NetBSD" link
> 2.: Click on FTP link
> 3.: Click on one of the mirrors
> 4.: Click on a version, e.g. 6.1.3
> 5.: Click on images
> 6.: Click on an iso file

You're right, Zafer, the website shows some room for improvement.

I've read arguments that the long click path serves as a qualifying exam
for NetBSD users: the ones who figure it out are the ones who we want to
use NetBSD.  I disagree.  The path is going to lose website visitors who
have limited time and patience, no matter how intelligent or educable
they are.  The more sensitive a visitor is to efficiency in website
organization and to a proper division of labor between user / designer /
computer, the more exasperating that click path may be!

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


kernel dumps on ahci, known to be broken in 6?

2014-01-23 Thread David Young
Is this a known issue?  Have there been any changes in this area since
6.0 was released?

cpu0: End traceback...  

dumping to dev 0,4 offset 2679  
dump ahcisata0 port 0: device present, speed: 6.0Gb/s   
ahcisata0: BSY never cleared, TD 0x80   
148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 
128 127 126 125 wd0k: error writing fsbn 729240 of 729240-729243 (wd0 bn
13158615; cn 13054 tn 2 sn 57), retrying
wd0: (interface CRC error)  
wddump: wd0: (interface CRC error)  

i/o error

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Wi-fi problems with channel 12

2014-01-02 Thread David Young
On Sat, Dec 28, 2013 at 09:39:38AM +, Ottavio Caruso wrote:
> On 28 December 2013 00:30, Greg Troxel  wrote:
> 
> > You don't mention where you are, and if 12 is an authorized channel
> > there.
> 
> I'm in the Netherlands, channels 1-13 are authorized here.
> 
> >
> > You can read the soruce code, but I would be surprised if this is
> > hardcoded in NetBSD.  I would think it more likely to be in the
> > firmware/ROM of the adaptor.
> 
> I don't think so, I think the limitation is in either the iwn(4) or
> the ath(4) driver. If it was in the firmware why would it work
> straight ouf the box in Windows?

There are various ways to skin this cat, and the Wi-Fi vendors have used
at least three of them:

the EEPROM tells which country's regulations the device
complies with, and it lists the legal channels, the proper
transmit power, and perhaps some digital filter parameters
for each legal channel

the EEPROM tells the legal channels, proper transmit power,
et cetera, for most countries' regulations; it's up to the
operating system to choose the parameters that are legal
in the country where the device is operating---that might
be determined

something more sophisticated or complicated than the above

It could be that not all of our drivers are selecting the set of legal
channels in the way that the vendor intended.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: some keys not seen in xev(1) when pressed in combination with both Alt_L and Alt_R

2013-12-27 Thread David Young
On Fri, Dec 27, 2013 at 08:05:42PM +1030, Brett Lymn wrote:
> On Thu, Dec 26, 2013 at 05:09:27PM +0100, Michai Ramakers wrote:
> > 
> > Thank you, that made things very clear. Following that spec, it is
> > also true that 4-key combinations (ShiftL + AltL + CtrlL + letterkey
> > for instance) are not guaranteed to work (consistently) accross
> > keyboards either, is that right?
> > 
> 
> If you get the right keyboard you may be able to do what you want.  I
> think that a high end "gamer" keyboard that advertises "n-key rollover"
> would.  I have one of these keyboards:

Wow.  I thought that n-key rollover was standard behavior since the
1980s!

I thought that you could count on every keyboard to generate "key
up" and "key down" events on every press/release of every key, with
occasional exceptions (e.g., some implementations of "lock" keys are
odd).  Any other events or flags (e.g., indications of the modifier keys
held down) were just a bit of "icing".  I also thought that you could
could dependable press/release events even if you held 10 keys at a
time, since we have 10 fingers

Is there a "raw" mode for these keyboards that activates n-key rollover?

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: NetBSD on modern laptops

2013-05-26 Thread David Young
On Sun, May 26, 2013 at 07:02:46PM +0200, Peter Bex wrote:
> On Sun, May 26, 2013 at 03:59:28PM +, Michael van Elst wrote:
> > >I don't know what kind of devices these are, exactly (I'm pretty sure I
> > >don't have three modems in it, and no old-fashioned COM port either),
> > 
> > The 3 modems report as Lenovo H5321, that's a broadband interface (UMTS
> > or similar). Your laptop probably has a slot for a SIM card.
> 
> It does on the inside, I'm told ;)
> 
> > puc0/com0 is a serial port in the Intel chipset but the signals are probably
> > only routed to an original Lenovo docking station.
> 
> Thanks for the hints!  Is there any way to disable these devices (besides
> compiling a custom kernel of course), since I'm not currently using them?
> It would be great to use hibernation on this laptop.

See if you can detach any of the devices after boot.  Try, for example,
'drvctl -d puc0'.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981


Re: Question about nmbclusters

2013-05-26 Thread David Young
On Thu, May 23, 2013 at 11:11:04PM +0200, Konrad Neuwirth wrote:
> Okay, this is getting more puzzling. 
> Am 23.05.2013 um 03:50 schrieb yancm:
> 
> > On 2013-05-22 19:07, Konrad Neuwirth wrote:
> >> Hello everyone,
> > I am pretty sure you will need to compile this into a new kernel.
> > I have used:
> > options NKMEMPAGES=98352
> > options NMBCLUSTERS=65568
> 
> I did. We are running the new kernel now, and it contains the following: 
> 
> options NKMEMPAGES=98352
> options NMBCLUSTERS=262140

This probably won't help with the particular problem at hand, but I will
make a few general observations about clusters.

262140 clusters is about 512 megabytes.  Typically no less than a
quarter of it is wasted because the kernel loads the 2kB buffers with
1500-byte ethernet frames.  I figure there's a lot more waste than
that because you may have hundreds or thousands of clusters dormant on
receive rings, clusters containing runty packets, etc.

Ignoring waste and overhead for a minute, 512 megs is enough memory to
buffer more than 4 seconds of packets if you're receiving them at 1
gigabit/second.  If your box is just a router and it's not forwarding
more than 1 Gb/s, you don't ordinarily need or want to buffer so many
packets.

For a box with many active socket servers, it may be reasonable to
buffer >4 seconds of packets, however, it seems to me that the kernel
should shift packets from the kernel's maps & limits and onto the user
servers' maps & limits much more aggressively than it does, today.

So you see there is lots of room for improvement.

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981