Lionel Sambuc [Fri, 8 Mar 2013 18:18:09 +0000 (19:18 +0100)]
Install default users directly
Install /home/ast and /home/bin as part of the system build procedure,
as the setup script is not ran on the arm image.
/home/bin is needed for successful completion of our test suite.
This patch does not change the setup script, as it is not bothered by
those files/directiories being already there, and may be useful during
reinstallation on intel systems.
Thomas Veerman [Fri, 8 Mar 2013 14:17:13 +0000 (14:17 +0000)]
UDS: terminate canonical path string
When you provided a string with junk after the terminating nul to a
UNIX domain socket and used bind(2), the canonical path function would
not properly terminate the new string. This caused VFS to return
ENAMETOOLONG on an otherwise valid path name.
* Use the same output directory as was previously the standard.
* Add copying of uEnv and cmdline to the obj directory to allow booting from tftp.
* No longer start qemu at the end of the process.
* Use sudo if the script was called as non root user.
Lionel Sambuc [Wed, 27 Feb 2013 16:53:12 +0000 (17:53 +0100)]
Let the build system manage compilation flags
Do not hardcode warning and optimisation flags, otherwise the
main options (i.e. DBG, CPPFLAGS) will not work as expected.
You can still provide specific default by using DBG?=<value>.
Doing so leaves the opportunity to override the setting from the
commandline, while the default value from the build system is
then ignored for that particular package.
When crosscompiling, and using build.sh, adding -V DBG=<value> has
this same effect as make DBG=<value>.
Ben Gras [Wed, 6 Mar 2013 18:27:47 +0000 (19:27 +0100)]
kernel, ramdisk: some boot unification
To use the new SD building script, Linux has to be configured with
loop.max_part=15 on the command line (or set at module load time)
to make the loopback device see the partitions.
This commit removes a lot of differences between the ARM and x86
boot ramdisk and rc scripts. It changes the ARM build from running
from ramdisk to requiring a full filesystem on the SD image and
booting into it.
. ramdisk: remove some arm-only utilities only used for running
from the shell
. remove ARM-only rc.arm, proto.arm.small, ttys and mylogin.sh
boot-time ramdisk files
. change kernel to add "arch" variable so userland knows what
we're running on from sysenv
. make ARM use the regular ramdisk rc file, changed to distinguish
i386-only and ARM-only drivers; requires rootdevname to be set
. change /etc/rc and /usr/etc/rc to start i386-only drivers only on
i386 systems
. change the kernel/arm to have a special case for the memory
driver to load it higher so it can be bigger
. add uEnv.txt, cmdline.txt and a for now highly linux-dependent
SD preparation script arm_sdimage.sh to the git repository in
releasetools/
Thomas Veerman [Tue, 5 Mar 2013 10:10:41 +0000 (10:10 +0000)]
UDS: check connection state better
Select(2)ing on UNIX domain sockets was not working properly because
connection state wasn't properly checked/propagated. So selecting for
a read descriptor and closing the write descriptor on the other end
didn't cause select to return. Similarly, read(2) kept blocking while
it should return an error when the other end closed the socket.
Ben Gras [Tue, 5 Mar 2013 16:17:21 +0000 (17:17 +0100)]
VM: shared memory pagefault fix
. if there is no memory there, it's not writable; this
check bug by the shared memory's writable() method causes
pagefaults not to be handled at all in certain situations,
triggering an assert() in pt_writemap()
. added some assert()s to catch this and similar situations
in the future
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.