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
Antoine Leca [Mon, 21 Jan 2013 14:30:17 +0000 (14:30 +0000)]
GNU tools: improvements to fetching process
- Do not run the fetch.sh script every time
- Do not run the configure script with MKUPDATE=yes (build.sh -u)
- The fetched GNU source are hidden from `git status`
- With CLEANFETCHED=yes, `nbmake -C tools cleandir` will remove the
fetched GNU source and return the MINIX tree to its pristine state.
- Avoid (harmless) message when building in parallel, about find
running against an inexistant path
Notice that the GNU tools are "installed" on every run, even with
MKUPDATE=yes; this is a feature of the NetBSD build system, because
in case of changes in dependencies it is impossible to know them.
See commit 1.27 2004-06-12 of tools/Makefile.gnuhost in NetBSD's src/
The downloaded tarballs are not removed with CLEANFETCHED:
they are supposed to be unmodified, and the exact name is not known
to the Makefile's, since it is engraved in each fetch.sh script (and
we do not want to have the same information in several places.)
Thomas Veerman [Wed, 23 Jan 2013 14:07:04 +0000 (15:07 +0100)]
ARM: disable __minix_init for now
On ARM we can't yet globally map pages into every process. So now that
we correctly receive the pointer to the globally mapped kern_info
struct, we have to ignore it on ARM because attempting to dereference
the pointer yields a segfault.
Lionel Sambuc [Sun, 13 Jan 2013 16:20:11 +0000 (17:20 +0100)]
ARM updates
Due to the ABI we are using we have to use the earm architecture
moniker for the build system to behave correctly. This involves
then some headers to move around.
There is also a few related Makefile updates as well as minor
source code corrections.
Lionel Sambuc [Sun, 13 Jan 2013 19:06:31 +0000 (20:06 +0100)]
Reverting back to default value of MKARZERO
The value was changed to no for cross-building as the old binutils
could not handle the required flag. As this is now possible, the
default is restored.
This flags make sure that AR zeroes out some timestamps and uid/gid
fields in libraries, which would change for every build of the
library otherwise, preventing comparison between to builds.
Lionel Sambuc [Tue, 11 Dec 2012 17:42:21 +0000 (18:42 +0100)]
Fix warnings trivial warnings.
Fix warnings about:
. Unused variables
. format mismatch in printf/scanf format string and arguments
. Missing parenthesis around assignment as truth values
. Clang warnings anout unknown GCC pragma
Lionel Sambuc [Tue, 11 Dec 2012 17:03:26 +0000 (18:03 +0100)]
Changing field utmp.ut_time from int to time_t
This makes sure the types are coherent, and right now, time_t is
defined as an long, through _BSD_TIME_T_. It previously was
hardcoded as an int, so the structure's size does not change.
Lionel Sambuc [Thu, 15 Nov 2012 11:06:41 +0000 (12:06 +0100)]
Libraries updates and cleanup
* Updating common/lib
* Updating lib/csu
* Updating lib/libc
* Updating libexec/ld.elf_so
* Corrected test on __minix in featuretest to actually follow the
meaning of the comment.
* Cleaned up _REENTRANT-related defintions.
* Disabled -D_REENTRANT for libfetch
* Removing some unneeded __NBSD_LIBC defines and tests