Commit graph

889 commits

Author SHA1 Message Date
Ben Gras adf2032bc0 vm: remove secondary cache code
This commit removes the secondary cache code implementation from
VM and its usage from libminixfs. It is to be replaced by a new
implementation.

Change-Id: I8fa3af06330e7604c7e0dd4cbe39d3ce353a05b1
2013-04-24 10:18:10 +00:00
Xiaoguang Sun 20e6c9329f Change function prototype to use endpoint_t instead of int 2013-04-23 17:15:15 +02:00
Ben Gras 32a4e0d84d many new tests
. test70: regression test for m_out vfs race condition

The following tests use testcache.c to generate test i/o
patterns, generate random write data and verify the reads.

	. test71: blackbox full-stack test of FS operation, testing
	  using the regular VFS interface crazy i/o patterns
	  with various working set sizes, triggering only
	  primary cache, also secondary cache, and finally
	  disk i/o and verifying contents all the time
	. test72: unit test of libminixfs, implementing
	  functions it needs from -lsys and -lblockdriver
	  and the client in order to simulate a working
	  cache client and backend environment.
	. test73: blackbox test of secondary vm cache in isolation

Change-Id: I1287e9753182b8719e634917ad158e3c1e079ceb
2013-04-19 16:21:48 +00:00
Antoine Leca 9131e98a7d utimens(2) system call
Variant of utime(2) with struct timespec (with ns precision)
instead of time_t values; also allows for tv_nsec members
the values UTIME_NOW (force update to current time) or
UTIME_OMIT (allow to set either atim or mtim independently.)

Provides a superset of utimes(2), futimes(2), lutimes(2),
and futimens(2).
Provides the same subset of utimensat(2) as does NetBSD 6.
Also import utimens() and lutimeNS() from NetBSD-current.
2013-04-12 18:55:39 +00:00
Lionel Sambuc 08ff44c446 Reducing external/bsd/file differences
Change-Id: I0d025059ba0b200ac1162ea5a764fd756600ecd0
2013-04-12 13:25:18 +02:00
Antoine Leca c979136e4e Also apply sub-second UTIME to libpuffs 2013-04-12 11:11:59 +02:00
Antoine Leca 4069cef7f9 Subsecond timestamps support for FS
Expand REQ_UTIME to include tv_nsec members
(as in struct timespec) in addition to tv_sec==time_t

Designed with help from David van Moolenbroek
2013-04-12 11:11:59 +02:00
Antoine Leca df9d28ebe7 Libpuffs: use struct timespec instead of time_t 2013-04-12 11:11:59 +02:00
Lionel Sambuc 435f2b0095 Downgrading to netbsd zlib version
Change-Id: I83cf73d8357ea34ab5e49fe15bd4c45ce54cac01
2013-04-09 16:43:13 +02:00
Thomas Cort 15b3d77268 libc: add adjtime() system call.
Implement the adjtime() system call and add a test for it to test69.
Additionally, install the adjtime.2 and clock_*.2 man pages.
2013-04-04 15:04:54 +02:00
Thomas Cort 516fec97d9 libc: add clock_settime() system call.
This also adds the sys_settime() kernel call which allows for the adjusting
of the clock named realtime in the kernel. The existing sys_stime()
function is still needed for a separate job (setting the boottime). The
boottime is set in the readclock driver. The sys_settime() interface is
meant to be flexible and will support both clock_settime() and adjtime()
when adjtime() is implemented later.

settimeofday() was adjusted to use the clock_settime() interface.

One side note discovered during testing: uptime(1) (part of the last(1)),
uses wtmp to determine boottime (not Minix's times(2)). This leads `uptime`
to report odd results when you set the time to a time prior to boottime.
This isn't a new bug introduced by my changes. It's been there for a while.
2013-04-04 15:04:54 +02:00
Thomas Cort e67fc5771d libc: add clock_getres()/clock_gettime() system calls.
In order to make it more clear that ticks should be used for timers
and realtime should be used for timestamps / displaying the date/time,
getuptime() was renamed to getticks() and getuptime2() was renamed to
getuptime().

Servers, drivers, libraries, tests, etc that use getuptime()/getuptime2()
have been updated. In instances where a realtime was calculated, the
calculation was changed to use realtime.

System calls clock_getres() and clock_gettime() were added to PM/libc.
2013-04-04 15:04:53 +02:00
Tomas Hruby a1fa603ed5 lwip (inet's alternative) is compiled by default 2013-03-25 16:51:25 +01:00
Tomas Hruby 566af1516a LIBLWIP - ARP fix
- does not crash KVM anymore
2013-03-25 16:51:25 +01:00
Ambarisha B 2d9009b0ab LWIP - fixed makefiles
- Modified libnetsock/Makefile and servers/lwip/Makefile to
  include ipvX headers

Signed-off-by: Tomas Hruby <tom@minix3.org>
2013-03-25 16:51:25 +01:00
Ambarisha B 7e55dbac33 LIBLWIP - updated to LwIP trunk
commit a4a41b9023ef5b3a7c4a1cd82fb167fc63e706df
Author: goldsimon <goldsimon@gmx.de>
Date:   Wed Sep 26 21:50:42 2012 +0200

- This also brings in LwIP's IPv6 codebase

Signed-off-by: Tomas Hruby <tom@minix3.org>
2013-03-25 16:51:24 +01:00
Tomas Hruby 9d66e2299d LIBLWIP - fixed clang warnings 2013-03-25 16:51:24 +01:00
David van Moolenbroek 3be9c7c33b Rename "struct partition" to "struct part_geom"
Change-Id: Ifaf9795ba70f5b933599b2a6ec9415e6bd13200c
2013-03-20 16:14:21 +00:00
Lionel Sambuc fbd82e76a4 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>.

Change-Id: Ic610e4d33b945acad64571e1431f1814291e2d84
2013-03-08 09:41:49 +01:00
Lionel Sambuc b9674650f1 Fix signal handling for services on abort/exit
Change-Id: I970a25ae0dd52f0d928fda376296e7b39e3e17eb
2013-03-07 13:11:31 +01:00
Ben Gras a9f55a2e46 VFS, FSes: add REQ_PEEK request type
REQ_PEEK behaves just like REQ_READ except that it does not copy
data anywhere, just obtains the blocks from the FS into the cache.

To be used by the future mmap implementation.

Change-Id: I1b56de304f0a7152b69a72c8962d04258adb44f9
2013-03-07 10:57:38 +00:00
Thomas Veerman 49ad4e8888 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).

Change-Id: I721779b58a50c7eeae20669de24658d55d69b25b
2013-03-06 09:56:08 +00:00
Thomas Veerman 39fad09a94 libc: drop Minix popen and use NetBSD's
Change-Id: I56f253d855671a6e1c8d53c7383107565164ab8d
2013-02-28 10:08:54 +00:00
Thomas Veerman 473547c777 VFS: implement pipe2
Change-Id: Iedc8042dd73a903456b25ba665d12577f5589ca2
2013-02-28 10:08:53 +00:00
Thomas Veerman fa78dc389f socket: implement SOCK_CLOEXEC and SOCK_NONBLOCK
Change-Id: I3fa36fa999c82a192d402cb4d913bd397e106e53
2013-02-28 10:08:53 +00:00
Thomas Veerman fd610ba1b0 VFS: add ability to open files O_CLOEXEC
.adjust libc to make use of it (undo __minix diff)

Change-Id: I90a1aa219fcd1b12b6bc60e72176f326eac8184a
2013-02-28 10:08:53 +00:00
Lionel Sambuc f640210005 Removing obsolete _NBSD_LIBC define
Change-Id: Ia6ce84ccdf36cf6f64540b990baaa7d85c53533d
2013-02-26 09:44:24 +00:00
Lionel Sambuc afa4fd56ac Removing obsolete _MINIX_COMPAT define
Change-Id: If1f5901a53bbc454c04ee33ebb469a58f0566df7
2013-02-26 09:44:23 +00:00
Lionel Sambuc 813d4c6a36 Removing obsolete _MINIX_SOURCE define
Change-Id: I924d5af294cd5daf17c73f71803f060cea3c3d8b
2013-02-26 09:44:21 +00:00
Lionel Sambuc 8e4736f2df Removing obsolete _MINIX define
Change-Id: Id33ac7e973d1c0e249b690fe44a597474fac6076
2013-02-26 09:44:20 +00:00
Thomas Veerman 4de18d528b Remove unintentionally commited file
Change-Id: I2e0f66f5d8033e98c4e9e20d60773548af9e8c35
2013-02-22 13:56:25 +00:00
Thomas Veerman 2b793e4945 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

Change-Id: I6718ae0fb7db050794f6f032205923e1a32dc1ac
2013-02-22 13:08:21 +00:00
Ben Gras 7a07b58aa8 test66: float smoke test, floating point fixes (arm)
Change-Id: Idd209ab6f341fbfb6b2dca77290ff440695bc2c1
2013-02-20 12:29:37 +00:00
Ben Gras 7df45744ad libexec: quiet
. harmless errors in the case of shell scripts

Change-Id: I461776024a21233e291102ca6d05dc7fa767f71a
2013-02-10 19:52:25 +01:00
Ben Gras 95513e73da opendir change: refinement
Change-Id: I90cc6929c9e7678da8e200688dcd40441efe030f
2013-02-08 23:09:21 +00:00
Ben Gras 4505b4a30a add opendir alias
Change-Id: Ib121e763bac7bea44a2f2533c454ff7d9361dc8d
2013-02-08 21:40:57 +00:00
Ben Gras f5cfab17d6 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

Change-Id: I90b0b28b51a188c93da5de6afb108224749ea794
2013-02-08 14:09:45 +01:00
Kees Jongenburger 3357fcb24a GPIO:further development
* Generalize GPIO handling.
* Add libs to configure gpio's clocks and pads
* Add Interrupt handling.
* Introduce mmio.h and log.h

Change-Id: I928e4c807d15031de2eede4b3ecff62df795f8ac
2013-02-06 16:07:43 +01:00
Ben Gras 298b41b523 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.

fixes test10 on ARM.

Change-Id: I1ed9bb200ce469d4d349073cadccad5503b2fcb0
2013-02-04 12:04:35 +01:00
Ben Gras 57bab02d57 kernel, libc: signals fixes
. kernel: signal handler args for ARM
	. kernel: sanity check return address (LSB indicates thumb mode)
	. libc: properly retrieve signal mask for ARM

together fix test37 on ARM.

Change-Id: I4e00f754c50104ed85c7fdf8ec5ad54568f20a81
2013-02-04 12:03:46 +01:00
Lionel Sambuc 252a83f614 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.

Change-Id: I19f7f425ed6a61298844631f9d7f3173cf7f30c0
2013-02-01 11:41:47 +01:00
Thomas Veerman db8c1ee9d0 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().

Change-Id: Iba004c6c62976762fe154ea390d69e518eec1531
2013-01-31 15:19:11 +00:00
Ben Gras e3e5cf6d34 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

Change-Id: Icd135a70595382c79d11d8dd9876f6a6f1df41f8
2013-01-30 04:10:12 +00:00
Ben Gras b6d285faba libc: add stat aliases
. add non-internal aliases for stat, lstat, fstat

Change-Id: I87e025b2bf073ff56a5742fc1dcf5badb2b7b321
2013-01-29 20:11:16 +00:00
Ben Gras 08cb986d3f 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

Change-Id: I2e94090aa432346fa4da0edeba72f0b7406c2ad7
2013-01-29 17:57:04 +00:00
Thomas Veerman fe892c5e66 libcsu: store argc and argv on the stack 2013-01-25 17:07:02 +00:00
Thomas Veerman fe45ee7ed0 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.
2013-01-25 17:07:02 +00:00
Thomas Veerman e52ecfbf5d ARM: correctly store kernel_info_struct pointer 2013-01-25 17:07:02 +00:00
Thomas Veerman 264c20159d Split libsys in arch dependent parts
The ARM part is not finished yet and will be fixed in a later commit.
2013-01-25 17:07:01 +00:00
Ben Gras 8ebdbed79c getifaddrs: add un-namespaced alias
. needed for security/heimdal, needed for git

Change-Id: I8638945dffd0abffd487c47281ad7616da1b70db
2013-01-24 21:57:15 +00:00