Thomas Cort [Mon, 14 Oct 2013 14:02:42 +0000 (10:02 -0400)]
Importing usr.bin/nl
* Add _SC_LINE_MAX to unistd.h (value of 15 from NetBSD).
* Add _SC_LINE_MAX case to sysconf(3) in libc.
* usr.bin/nl itself required no Minix specific changes.
- exclude .git instead of .svn when using local source (-c);
- put the git tag (or "copy") in /etc/version rather than something
outdated related to SVN;
- remove SVN-specific -s flag (suggested by Erik).
Ben Gras [Thu, 3 Oct 2013 15:22:07 +0000 (17:22 +0200)]
avoid alloc_contig() for iovec, mfs superblock
. initial workaround for assert() firing on iovec
size on ARM. likely due to alloc_contig() allocating
unusually mapped memory in STATICINIT.
. for the same reason use the regular cache i/o functions
to read the superblock in mfs - avoid the alloc_contig()
that STATICINIT does.
Thomas Cort [Fri, 11 Oct 2013 14:29:16 +0000 (10:29 -0400)]
ipc: add missing printf argument.
A printf statement that only gets compiled when DEBUG_SEM is
defined had a '%' conversion without a corresponding argument.
This patch adds the argument.
Change-Id: I469fbbe6f49802cb86d81b059cb454d967f47079
Reason: Introduces new device nodes and removes old devices nodes which where unintended at this point.
Ben Gras [Fri, 27 Sep 2013 14:29:08 +0000 (14:29 +0000)]
test75: force child to use a minimum of cpu time
test75 sometimes false-fails if something else is going on
at the same time, presumably because the child doesn't spin
enough to register a nonzero getrusage() cpu time value, as
spin() uses the real time to limit the spinning.
this change forces spin() to do a minimum amount of spinning
before exiting, regardless of scheduling.
Ben Gras [Thu, 26 Sep 2013 11:42:31 +0000 (13:42 +0200)]
arm_sdimage.sh: use native minix partition util
. make filesystems on primary partitions to make it
easier on the minix partition util
. so sfdisk isn't required as an external tool
. also make partition and hitherto x86-only utilities
arch-independent
arm:ensure read_tsc_64 always returns a valid value.
Before this change overflowing the free running clock counter
between the time the timer was read and the time the overflow
check was done resulted in read_tsc_64 returning a to high value.
arm:caching access the l1 pages over cacheable memory.
When we start using a new pagetable (for a new process)
the last part is to ensure the pagetable itself can be
accessed by VM. This is done in pt_bind by updating
the "pagetable of pagetables" and we want this mapping
to match other mappings to the l1 pagetable.
* Allow to change the timer frequency using the hz paramter.
* Unmask the interrupt only after registering the handler.
* Pass the hz parameter in the command line.
Ben Gras [Tue, 24 Sep 2013 13:15:55 +0000 (15:15 +0200)]
x86 hd image creator
A script that creates a HD image ready to be booted by an x86
emulator, ready to work in a crossbuild environment.
It's really just for qemu/kvm as there's no boot code in
the MBR and no bootloader installed so we rely on the in-kvm
multiboot implementation for now. This is very convenient for
passing args too.
To minimize reliance on external tools, we use the Minix
'partition' utility to write the partition table of the HD
image, which therefore has to be compiled natively.
. new script releasetools/x86_hdimage.sh
. natively compile minix 'partition' utility
. make <machine/partition.h> 64-bit safe for it
Thomas Cort [Mon, 16 Sep 2013 23:16:12 +0000 (19:16 -0400)]
i2c: increase read/write timeout
The sht21 temperature and humidity sensor holds the i2c bus while
an ADC conversion is in progress. For example, a temperature
measurement is requested, a read operation is started, and the
sht21 doesn't respond to the read request until the result of
the measurement is ready. The conversion time isn't constant.
On rare occations (one in hundreds of samples) the timeout in the
i2c driver expires returning an error.
The example code from Sensirion, the sht21's manufacturer, suggests
a bus timeout of 1 second to accommodate the sht21. This commit
increases the bus timeout to 1 second. The timeout is only reached
when chips do not respond normally, so the change doesn't affect the
performance of any other drivers.
Thomas Cort [Mon, 16 Sep 2013 17:33:00 +0000 (13:33 -0400)]
libi2cdriver: add functions for IC register access
Many i2c device drivers used similar code to access registers on
the ICs they drive. This commit implements that functionality in
libi2cdriver and updates the drivers to use the library instead of
their own register access functions. The net result is 375+ fewer
lines of code and less work for people developing new drivers.
The two exceptions were cat24c256 and parts of tda19988. They access
the bus in uncommon ways. It doesn't make sense at this time to
move their read/write functions into libi2cdriver.
Thomas Cort [Sun, 15 Sep 2013 23:48:29 +0000 (19:48 -0400)]
tda19988: add missing blockdriver_announce() call
To provide EDID to fb, the TDA19988 implements the block device
protocol with libblockdriver. To properly use the library,
blockdriver_announce() should be called by the driver.
Ben Gras [Mon, 16 Sep 2013 15:33:44 +0000 (15:33 +0000)]
test70: reduce ITERATIONS
. full number was needed to reliably trigger the race
condition
. takes a bit too long (7 mins on fast x86 hardware) for a
condition that "can't" happen again, so let's cut the iteration
count and trust that the test will trigger soon enough for
a similar condition in the future.
Ben Gras [Fri, 13 Sep 2013 12:05:50 +0000 (12:05 +0000)]
vm: enable filemap=1 by default
. turns on mmap() functionality for files by default
. also causes exec() to use it to map in executables
without copying and with sharing those pages with the
disk cache and other instances of the executable
According to the virtio specifications, the host present the supported
features to the guest, and the guest should answer woth the features it
supports. This allows the host to disable support for features that the
guest is not going to use.
Minix tells to the host it doesn't support any extended features, while
it uses at least VIRTIO_NET_F_MAC and VIRTIO_NET_F_CTRL_VQ. For the
latter it seems it only allocate the queue while not using it later.
However starting with QEMU 1.4.0, with multiqueue support added, the
control queue is not allocated on the host side if the guest doesn't
tell it supports this feature. This cause virtio-net to crash on the
Minix side.
This patch fixes that by correctly telling the features that are
used by the Minix guest for more than printing a debug message. This
fixes virtio-net on QEMU 1.4.x.
Thomas Cort [Tue, 3 Sep 2013 11:47:59 +0000 (07:47 -0400)]
gpio: port to am335x
* port libgpio to am335x.
* increase NR_IRQ to 16 to avoid too many IRQs requested error.
* move gpio binary to /sbin (that's where mount looks for drivers).
* fix bug that re-enabled banks that were disabled due to bad revision.
* fix padconf masks for dm37xx in gpio driver (should be 16-bit).
* fix a few typos in README.txt and comments.
Thomas Cort [Wed, 28 Aug 2013 04:43:45 +0000 (00:43 -0400)]
kernel: add padconf kernel call
On the AM335X, writes to the padconf registers must be done in privileged
mode. To allow userspace drivers to dynamically change the padconf at
runtime, a kernel call has been added.
Thomas Cort [Mon, 26 Aug 2013 02:07:42 +0000 (22:07 -0400)]
weatherstation: BeagleBone Weather Cape demo app.
The BeagleBone Weather cape enhances the BeagleBone's capabilities
by providing environment sensors (temperature, humidity, pressure,
and ambient light level).
The weatherstation demo is a port of the bonescript weatherstation
to Minix. It provides a nice visual display of the sensor data in
a web browser.
The code is installed to /usr/share/beaglebone/weather on 'earm'
and an embedded web server is started at boot time on port 80
when the cape is attached. Further details are provided in the
README.txt file.
Thomas Cort [Thu, 22 Aug 2013 15:22:01 +0000 (11:22 -0400)]
rc: start drivers for attached BeagleBone Capes
BeagleBone Capes add additional hardware to the BeagleBone to
improve functionality.
This patch probes the third i2c bus for capes and loads the
appropriate drivers for each detected cape. Currently only
the 'BeagleBone Weather' cape is supported.
Thomas Cort [Thu, 22 Aug 2013 15:16:08 +0000 (11:16 -0400)]
eepromread: add board info for BeagleBone Capes
Capes (i.e. expansion boards for the BeagleBone and BeagleBone Black)
each have their own cat24c256 EEPROM with information about the cape
such as the name of the cape, pins used, power requirements, etc.
This patch adds support for displaying the cape data fields. It
can be used in shell scripts to detect and identify attached capes.
PFS: unblock the child when unsuspending an accept
Previously, PFS would incorrectly try to unsuspend the parent (i.e.,
the listening socket), resulting in the child hanging until the other
side performed another action. Test56 started failing on this now.
Arne Welzel [Thu, 15 Nov 2012 11:05:51 +0000 (12:05 +0100)]
libaudiodriver: handle interrupt only once
Apparently, qemu's sb16 doesn't reset the interrupt register
of the mixer and the driver ends up in an endless loop when
playing a "multi-fragment" sample.
Arne Welzel [Wed, 14 Nov 2012 21:43:42 +0000 (22:43 +0100)]
libaudiodriver: allocate mem lower 16 MB and 64K aligned
Righ now, the DMA controller will access some random memory below 16 MB,
as the physical address returned by alloc_contig() is simply truncated
when given to the DMA controller.