Thomas Veerman [Thu, 28 Feb 2013 14:44:23 +0000 (14:44 +0000)]
Spring cleanup
Remove old versions of system calls and system calls that don't have
a libc api interface anymore (dup, dup2, creat).
VFS still contains support for old system call numbers for the new stat
system calls (i.e., 65, 66, 67) to keep supporting old binaries built for
MINIX 3.2.1 (prior to the release).
Thomas Veerman [Fri, 22 Feb 2013 13:57:00 +0000 (13:57 +0000)]
RS: refresh service upon init failure
When a service fails to initialize, RS exits the service. When injecting
faults this is undesired behavior. With this patch, we're going to assume
that when starting services with the -b flag (no binary exponential
offset), we don't want to exit the service but simply restart the
initialization.
Thomas Veerman [Thu, 21 Feb 2013 16:02:42 +0000 (17:02 +0100)]
libsys: refactor frclock api
Make the frclock functions similar to the tsc utility functions. This
way, we can call frclock functions from the framebuffer driver which
will use frclock on ARM and tsc on X86.
Also, frclock_64_to_micros computed seconds, not microseconds
Thomas Veerman [Fri, 15 Feb 2013 15:00:21 +0000 (16:00 +0100)]
VFS: prevent unmapping drivers that don't support reopening
libchardriver does not support DEV_REOPEN and will return ERESTART
when you do try it. This made VFS unhappy and concluded erroneously
that the driver was EDEADEPT.
Thomas Veerman [Fri, 1 Feb 2013 12:13:19 +0000 (13:13 +0100)]
fb: introduce framebuffer support to Minix
This patch introduces a framebuffer to Minix. It's written for the ARM
port of Minix, but has an architectural split that separates the
hardware dependent part from the non-hardware dependent part. Futhermore,
this driver was developed using a screen that has a native resolution of
1024x600 pixels and having lack of support for obtaining EDID from the
screen. Consequently, it uses a hardcoded resolution of 1024x600.
The driver uses an interface based on the Linux ioctl API, but supports
only a very limited subset.
Previously, installboot would require that the given target device is
a partition. This is not strictly necessary: MINIX3 can also be
installed (manually) into one or more primary partitions, requiring
that the installboot target be the entire disk. With this patch,
specifying a disk as target is now allowed, as long as the -f (force)
option is given.
All cards in this family (RTL8101E, RTL8102E, RTL8103E, RTL8105E,
possibly others) should be recognized based on the added PCI ID.
The hardware version number of the RTL8105E has been added only to
serve as an example of a card that does not require modification of
certain undocumented registers.
- if supported, override BSY/DRQ flags and start the port anyway if it
times out with DET=3h status during device detection;
- no longer rely on the device signature to be set; unless a valid
signature is obtained, try both ATA and ATAPI device identification.
- do not start a port before the BSY and DRQ flags have been cleared;
as such, poll on device status rather than signature availability.
- change "ahci_sig_timeout" to "ahci_device_timeout" variable setting
accordingly; this variable determines the polling duration before a
newly attached device is given up on, and uses 30 seconds as default;
- use port connect changes (PCS/X/DET->1h) to kick off polling for an
attached device; detachment is still detected by means of PhyRdy
status changes (PRCS/N/DET<->3h).
- the "ahci_sig_timeout" variable now denotes the entire checking
period, and the delay between checks has been hardcoded; what was
previously "ahci_sig_checks" is now computed from those two;
- timeout values are no longer used for both millisecond and clock
tick values, and better typed;
- the computation of timeouts is no longer off by half a second.
Ben Gras [Mon, 11 Feb 2013 01:02:08 +0000 (02:02 +0100)]
__aeabi_ldivmod: fix sign logic
. signed 64-bit divide incorrectly tested for sign compensation
bits in the NEG (R5) register, causing the signedness of the
quotient and modulus to be wrong for negative numerators.
Ben Gras [Fri, 8 Feb 2013 18:11:42 +0000 (19:11 +0100)]
impove memory accounting
. the total amount of memory in the system didn't include the memory
used by the boot-time modules and some dynamic allocation by the
kernel at boot time (to map in VM). especially apparent on our
ARM board with 'only' 512MB of memory and a huge ramdisk.
. also: *add* the VM loaded module to the freelist after it has
been allocated for & mapped in instead of cutting it *out* of the
freelist! so we get a few more MB free..
Ben Gras [Sun, 10 Feb 2013 18:37:12 +0000 (19:37 +0100)]
VM: slight pagedir mapping generalization
. allow any number of pde's used for pagedir mapping
. allows >1024 NR_PROCS on x86, >64 on ARM
. allows NR_PROCS to be the same in both cases
. also cleanup: allocating spare PDE's is not necessary
throw that function out
Ben Gras [Sat, 9 Feb 2013 19:38:45 +0000 (20:38 +0100)]
ARM divsi3.S: raise(SIGFPE) when called for
. raise(SIGFPE) for modulo-0/divide-0 operations in
internal int division functions
. gcc: do not link with -lgcc anywhere so these internal
functions are always used from libc instead of (sometimes)
masked by -lgcc
. together fixes test53 on ARM
Ben Gras [Fri, 8 Feb 2013 12:12:45 +0000 (13:12 +0100)]
ldivmod, uldivmod: fix qdivrem calls
. ldivmod, uldivmod were passing the modulo argument pointer
in R4, which is bogus, as qdivrem expects it on the stack as
per the EABI, causing essentially 'random' memory to be trampled
by qdivrem. fix by pushing R4 before the call.
. also add these functions to -minc so -lminc clients can be
linked without -lgcc
Ben Gras [Mon, 4 Feb 2013 00:49:48 +0000 (01:49 +0100)]
libexec: detect short files
if an exec() fails partway through reading in the sections, the target
process is already gone and a defunct process remains. sanity checking
the binary beforehand helps that.
test10 mutilates binaries and exec()s them on purpose; making an exec()
fail cleanly in such cases seems like acceptable behaviour.
Ben Gras [Fri, 1 Feb 2013 16:48:40 +0000 (17:48 +0100)]
vm: fix sanity checks on arm
The 'polarity' of the RW bit is inversed on ARM, causing one
of the sanity check compensations to fail. ARM now runs basic
stuff with sanity checks passing.
Lionel Sambuc [Wed, 30 Jan 2013 14:36:51 +0000 (15:36 +0100)]
Fix command line history in ash
Also did some cleanup in ash sources, to make minix modifications
more obvious, as well as some simplifications (by removing code which
is never compiled)
Removed EDITLINE support, use libedit, which does the termcap/terminfo
handling.
Thomas Veerman [Tue, 29 Jan 2013 19:58:00 +0000 (20:58 +0100)]
ARM: provide free running clock to replace ccnt
The Cycle CouNTer on ARM cannot be used reliably as it wraps around
rather quickly and can be altered by user space (on Minix). Furthermore,
it's buggy when wrapping and is not implemented at all on the Linaro
Beagleboard emulator.
This patch programs GPTIMER10 as a free running clock at 1.625 MHz (it
doesn't generate interrupts). It's memory mapped into every process,
which enables libsys to provide micro_delay().
Ben Gras [Wed, 30 Jan 2013 02:13:24 +0000 (03:13 +0100)]
arm: make signal handlers work
A few kernel and calling convention adjustments to make sigsend and
sigreturn work for arm.
. provide a arch_proc_setcontext for earm in kernel
. set LR in context of signal handler to provide a proper
return address (to __sigreturn)
. change __sigreturn to retrieve the sigcontext pointer
from the sigframe struct and pass it to _sigreturn() in r0
Ben Gras [Tue, 29 Jan 2013 17:52:08 +0000 (17:52 +0000)]
vm: fix kernel-requested mappings for arm
. make vm tell kernel virtual locations of mappings
. makes _minix_kerninfo feature work
. fix for mappings being larger than what 1 pde can address
(e.g. devices memory requested on arm)
. still requires a special case for devices memory for the
kernel, which has to switch to virtual addressing