Commit graph

985 commits

Author SHA1 Message Date
David van Moolenbroek 83a31a3592 Kernel: fix getrusage microsecond computation
Change-Id: I5e443ddbed1bcd49ed81721afda3aa3c1880ad52
2014-07-28 17:05:56 +02:00
Jan Kobler 29fe671680 arm: clear highly mapped kernel bss
. added bss range values for the high (paged) kernel and
	  clear it in pre_init
	. this changes the meaning of the current _edata end _end in the
	  pre_init phase to mean: highly mapped bss; and the new symbols
	  _kern_unpaged_edata ... _kern_unpaged_edata to mean directly
	  mapped (pre_init) bss. This was previously _edata and _end.
	. added a sanity check in kmain (ben@)

The values can be verified by:

${CROSS_TOOLS}/arm-elf32-minix-objdump -xD ${OBJ}/kernel/kernel

Signed-off-by: Jan Kobler <eng1@koblersystems.de>
2014-07-28 17:05:55 +02:00
Lionel Sambuc 5277fbe9f6 Message type for SYS_CLEAR
Change-Id: I3d894edcf672d180aee38fd84bd06339bdf7fa9b
2014-07-28 17:05:49 +02:00
Lionel Sambuc 886c867c38 Message type for SYS_EXEC
Change-Id: I349e28b8bb3705386f04e4860cffc6ed74a5532f
2014-07-28 17:05:49 +02:00
Lionel Sambuc cc0c1fbd75 Message type for SYS_FORK
Change-Id: Ibcf4fdfec51129b2be3d667ec07aea0f42e3fd89
2014-07-28 17:05:49 +02:00
Lionel Sambuc 2027f8bc78 Message type for SYS_{S,G}ETMCONTEXT
Change-Id: I388eee89ba8cc6e6603b3193297b81179c1e6975
2014-07-28 17:05:49 +02:00
Lionel Sambuc f06c676a47 Message type for SYS_SETGRANT
Change-Id: I542f839d7992d3348fef19c51bfcb58bb408d9f4
2014-07-28 17:05:48 +02:00
Lionel Sambuc dd2552d6d4 Message type for SYS_PRIVCTL
Change-Id: I5bf4d88ca571f2a701e426aae67c6b04705ce511
2014-07-28 17:05:48 +02:00
Lionel Sambuc f7c72375ea Message type for SYS_STATECTL
Change-Id: I19443aa018d6c670e2b44f1f98bce2fb297a7f21
2014-07-28 17:05:48 +02:00
Lionel Sambuc 333fd250f5 Message type for SYS_TRACE
Change-Id: Ib579fab949b76797ea7d6cb5ff4ae3d9b32f630c
2014-07-28 17:05:48 +02:00
Lionel Sambuc c59c5caceb Message type for SYS_SETTIME
Change-Id: I10c2c27c0c9749b49d70735175e530b4341440dc
2014-07-28 17:05:48 +02:00
Lionel Sambuc 9d1ed02a04 Message type for SYS_STIME
Change-Id: Ic4401e736bb66960e2ea4b30f5e1946dd93fd76e
2014-07-28 17:05:48 +02:00
Lionel Sambuc 1ca0b449b2 Message type for SYS_TIMES
Change-Id: Ia408aa7d76c47da9f600a724f82b347ba6ac641b
2014-07-28 17:05:47 +02:00
Lionel Sambuc dcb7493a05 Message type for SYS_GETINFO and SYS_GETWHOAMI
Change-Id: I9cea3f65b29e30555c8b47865e12c7d19a74a3c3
2014-07-28 17:05:47 +02:00
Lionel Sambuc f1dff35292 Message type for SYS_VUMAP
Change-Id: I9accdf887c119566429ab0803436b068729bcd85
2014-07-28 17:05:47 +02:00
Lionel Sambuc dc823abec2 Message type for SYS_UMAP{,_REMOTE}
Change-Id: Id46df10aee6189a0d3673013b498c7cc79edcc7e
2014-07-28 17:05:47 +02:00
Lionel Sambuc 5735105bc8 Message type for SYS_{VIR,PHYS}COPY
Change-Id: I15d1acf9992d1b799f5687adffb186875fcd0c84
2014-07-28 17:05:47 +02:00
Lionel Sambuc 05f155c0a9 Message type for SYS_IOPENABLE
Change-Id: I8b089c30c7f9ae75e404f63495bbb199d583f1cd
2014-07-28 17:05:47 +02:00
Lionel Sambuc e412a58209 Message type for SYS_ABORT
Change-Id: Ic24a4779cc7955cb94f81fec58a358057ca85cb1
2014-07-28 17:05:46 +02:00
Lionel Sambuc b3085e334c Message type for SYS_IRQCTL
Change-Id: Idef5a1e49aea3eea690e2a9bf046348766a8b944
2014-07-28 17:05:46 +02:00
Lionel Sambuc 30eae10274 Message type for SYS_SETALARM
Change-Id: I2c2ee24c19085cbd1e7ffba7b2db714b2561ff17
2014-07-28 17:05:46 +02:00
Lionel Sambuc 85e7cb92a9 Message type for SYS_VDEVIO
Change-Id: I62ceb5d487c5acd08cb100f340dd387e733180b4
2014-07-28 17:05:46 +02:00
Lionel Sambuc a8c16a502a Message type for SYS_SDEVIO
Change-Id: I2d60a2ccad325236998a7f9af9b4e82fe0c8131f
2014-07-28 17:05:46 +02:00
Lionel Sambuc 3ed35f3958 Message type for SYS_MEMSET
Change-Id: Icebd04e0c53d9653301550bb598df8719aa66ada
2014-07-28 17:05:46 +02:00
Lionel Sambuc b694a09a53 Message type for SCHEDULING_NO_QUANTUM, SYS_SCHEDULE
Change-Id: Ia0f2689067159b4d821092d4ac60efa75e396f7c
2014-07-28 17:05:42 +02:00
Lionel Sambuc 8ba159d242 Message type for SYS_SCHEDCTL
Change-Id: Iaccbac1ef99124bc494b835e0d0cf999ea2e3f5a
2014-07-28 17:05:42 +02:00
Lionel Sambuc b6ca6448bc fix declaration of minix_kerninfo_user 2014-07-28 17:05:15 +02:00
Lionel Sambuc 0472cd6e9d Move Assert to check MAGIC before actual use of the MBI record 2014-07-28 17:05:15 +02:00
Ben Gras 565f13088f make vfs & filesystems use failable copying
Change the kernel to add features to vircopy and safecopies so that
transparent copy fixing won't happen to avoid deadlocks, and such copies
fail with EFAULT.

Transparently making copying work from filesystems (as normally done by
the kernel & VM when copying fails because of missing/readonly memory)
is problematic as it can happen that, for file-mapped ranges, that that
same filesystem that is blocked on the copy request is needed to satisfy
the memory range, leading to deadlock. Dito for VFS itself, if done with
a blocking call.

This change makes the copying done from a filesystem fail in such cases
with EFAULT by VFS adding the CPF_TRY flag to the grants. If a FS call
fails with EFAULT, VFS will then request the range to be made available
to VM after the FS is unblocked, allowing it to be used to satisfy the
range if need be in another VFS thread.

Similarly, for datacopies that VFS itself does, it uses the failable
vircopy variant and callers use a wrapper that talk to VM if necessary
to get the copy to work.

	. kernel: add CPF_TRY flag to safecopies
	. kernel: only request writable ranges to VM for the
	  target buffer when copying fails
	. do copying in VFS TRY-first
	. some fixes in VM to build SANITYCHECK mode
	. add regression test for the cases where
	  - a FS system call needs memory mapped in a process that the
	    FS itself must map.
	  - such a range covers more than one file-mapped region.
	. add 'try' mode to vircopy, physcopy
	. add flags field to copy kernel call messages
	. if CP_FLAG_TRY is set, do not transparently try
	  to fix memory ranges
	. for use by VFS when accessing user buffers to avoid
	  deadlock
	. remove some obsolete backwards compatability assignments
        . VFS: let thread scheduling work for VM requests too
          Allows VFS to make calls to VM while suspending and resuming
          the currently running thread. Does currently not work for the
          main thread.
        . VM: add fix memory range call for use by VFS

Change-Id: I295794269cea51a3163519a9cfe5901301d90b32
2014-07-28 17:05:14 +02:00
Kees Jongenburger e54d075f6f arm-refactor:remove dependency from memory.c to omap_timer.h.
Remove the dependency from memory.c to omap_timer.h.

Change-Id: I1f1a0e5436ac725e4b0db9d7d404194384794802
2014-07-28 17:05:09 +02:00
Kees Jongenburger c97a47f54e arm-refactor:indent the omap bsp code.
Indent the omap bsd code using indent with the following settings
in indent.pro.
-bap -br -ce -ci4 -cli0 -d0 -di0 -i8 -ip4 -l79 -nbc -ncdb -ndj
-nfc1 -nlp -npcs -psl -sc -sob -fca -l79 -lc79

Change-Id: I09e7de9ad4b33f78bff96e3de4470f1c5ba854ce
2014-07-28 17:05:09 +02:00
Lionel Sambuc 84d9c625bf Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
2014-07-28 17:05:06 +02:00
David van Moolenbroek 4316052bbe Kernel: fix register corruption on signal delivery
This fixes problems with test79 and other programs.

Change-Id: I14de097a3b01114ec5dbd687ab5be9290ad13fc7
2014-03-03 20:47:07 +01:00
Ben Gras 7597f4a8fc <machine/signal.h>
. use netbsd sigframe, sigcontext struct
	. netbsd sigframe *contains* sigcontext; use that directly
	  in kernel sigsend
	. drop two fields from minix x86 stackframe.h (process context)
	  that were unused, retadr and st

use in-sigframe sigcontext

Change-Id: Ib59d699596dc3a78163dee59f19730482fdddf11
2014-03-03 20:47:07 +01:00
Ben Gras be9fe09e97 x86 multiboot.h
Change-Id: I245564a98fb9e2572b88f8feb7411ad6800a543c
2014-03-03 20:47:05 +01:00
Ben Gras f4f382d8c0 align ARM cpu.h importing & using armreg.h
Change-Id: I4793517d936f71b0bb7088fbfe67e73a65fafb11
2014-03-03 20:47:04 +01:00
Ben Gras 5cecdfcb3e <machine/mcontext.h>
Change-Id: I2ad64018f3f402e7ccc5c4dc037dd0a3fe56a929
2014-03-03 20:47:03 +01:00
Lionel Sambuc 94c9376df5 Removing SYS_SIG_* field macros.
Change-Id: Ib4f1b48268d4539ae6d4502ad647ecb73ea87f79
2014-03-03 20:47:00 +01:00
Lionel Sambuc 175d3e7eae Changing the message union to anonymous.
This allows us to write things like this:
  message m;
  m.m_notify.interrupts = new_value;

or
  message *mp;
  mp->m_notify.interrupts = new_value;

The shorthands macro have been adapted for the new scheme, and will be
kept as long as we have generic messages being used.

Change-Id: Icfd02b5f126892b1d5d2cebe8c8fb02b180000f7
2014-03-03 20:46:47 +01:00
Lionel Sambuc 55d9e9954b Extending time_t to 64bits.
Change-Id: Ia96b8bfba19cb8179a0237a7d2122d415c24d73f
2014-03-03 20:45:28 +01:00
Gerard 78da142dab Replaced common u64.h functions with operators.
Change-Id: I71b7b4879209eeff89ce5748d67102afebf871dc
2014-03-02 12:28:32 +01:00
Ben Gras 8ccb12bb5a use netbsd <sys/signal.h> and sigset_t
. create signals-related struct message type to store sigset_t
	  directly
	. create notify-specific message types, so the generic NOTIFY_ARG
	  doesn't exist anymore
	. various related test expansions, improvements, fixes
	. add a few error-checks to sigismember() calls
	. rename kernel call specific signals fields to SYS_*

Change-Id: I53c18999b5eaf0cfa0cb25f5330bee9e7ad2b478
2014-03-02 12:28:31 +01:00
Ben Gras 25719b5d92 bigger message
Change-Id: Ie770140c55799bdc3bb8f0ad6994d59938155a1a
2014-03-02 12:28:31 +01:00
Ben Gras a06e2ab395 big <utmp.h>-inspired netbsd switch
import/switch of:
init, getty, reboot, halt, shutdown, wall, last

changes:
	. change reboot() call to netbsd prototype and args
	. allows pristine <utmp.h>
	. use clean <sys/reboot.h> instead of <minix/reboot.h>
	. implement TIOCSCTTY for use by getty so getty can get
	  controlling terminal from init's child(ren)
	. allow NULL envp for exec

Change-Id: I5ca02cb4230857140c08794bbfeba7df982c58a3
2014-03-01 09:05:02 +01:00
Lionel Sambuc c3fc9df84a Adding ipc_ prefix to ipc primitives
* Also change _orig to _intr for clarity
 * Cleaned up {IPC,KER}VEC
 * Renamed _minix_kernel_info_struct to get_minix_kerninfo
 * Merged _senda.S into _ipc.S
 * Moved into separate files get_minix_kerninfo and _do_kernel_call
 * Adapted do_kernel_call to follow same _ convention as ipc functions
 * Drop patches in libc/net/send.c and libc/include/namespace.h

Change-Id: If4ea21ecb65435170d7d87de6c826328e84c18d0
2014-03-01 09:05:01 +01:00
David van Moolenbroek 24ec0d73b5 Clean up interface to PM and VFS
- introduce new call numbers, names, and field aliases;
- initialize request messages to zero for all ABI calls;
- format callnr.h in the same way as com.h;
- redo call tables in both servers;
- remove param.h namespace pollution in the servers;
- make brk(2) go to VM directly, rather than through PM;
- remove obsolete BRK, UTIME, and WAIT calls;
- clean up path copying routine in VFS;
- move remaining system calls from libminlib to libc;
- correct some errno-related mistakes in libc routines.

Change-Id: I2d8ec5d061cd7e0b30c51ffd77aa72ebf84e2565
2014-03-01 09:05:01 +01:00
David van Moolenbroek 80bd109cd3 libsys: various updates
- move system calls for use by services from libminlib into libsys;
- move srv_fork(2) and srv_kill(2) from RS and into libsys;
- replace getprocnr(2) with sef_self(3);
- rename previous getnprocnr(2) to getprocnr(2);
- clean up getepinfo(2);
- change all libsys calls that used _syscall to use _taskcall, so as
  to avoid going through errno to pass errors; this is already how
  most calls work anyway, and many of the calls previously using
  _syscall were already assumed to return the actual error;
- initialize request messages to zero, for future compatibility
  (note that this does not include PCI calls, which are in need of a
  much bigger overhaul, nor kernel calls);
- clean up more of dead DS code as a side effect.

Change-Id: I8788f54c68598fcf58e23486e270c2d749780ebb
2014-03-01 09:05:00 +01:00
David van Moolenbroek f30a16b159 Remove support for MKTRACE, MKMCONTEXT, MKSTATECTL
Change-Id: Ib5fa53913ecb7b46d30d391dbdd3e8ef21eb2254
2014-03-01 09:04:59 +01:00
Thomas Cort f5dbfe789e uname: normalize release and version
Most systems provide the full version number in the
'release' field and the kernel version in 'version'.
Minix used to split the full version number between
release and version which caused problems for pkgsrc
and other applications. This patch brings Minix's
uname in line with other systems such as NetBSD.
It also brings the getty banner in line with NetBSD.

Old Minix uname:
	sysname->Minix
	nodename->10.0.2.15
	release->3
	version->2.1
	machine->i686

New Minix uname:
	sysname->Minix
	nodename->10.0.2.15
	release->3.2.1
	version->Minix 3.2.1 (GENERIC)
	machine->i686

Change-Id: I966633dfdcf2f9485966bb0d0d042afc45bbeb7d
2014-03-01 09:04:55 +01:00
David van Moolenbroek 36ac0dbcf8 Take LOG out of the boot image
Change-Id: Id2629776b53aae46629b04a42c15cbbacac9b949
2014-03-01 09:04:55 +01:00