Commit graph

48 commits

Author SHA1 Message Date
Ben Gras c727357664 custom types for RS_INIT, RS_UPDATE, and others 2014-07-28 17:06:23 +02:00
Ben Gras 3f38115c7b _MINIX_SYSTEM - fixes for in-minix crossbuild
. define _MINIX_SYSTEM for all system code from minix.service.mk
	. hide some system-level declarations and definitions
	  behind _MINIX_SYSTEM to cleanly fix host tool build problems on
	  Minix (such as: NONE being defined and paddr_t being used but not
	  declared)
	. the similar definition _SYSTEM is unsuitable as it changes the
	  values of errno definitions

Change-Id: I407de79e2575115243a074b16e79546a279cfa3e
2014-07-28 17:05:14 +02:00
Lionel Sambuc afc1f71188 include/paths.h: merged
Change-Id: I5e2aa0bc99a596f82ef4224f22623bcb83cb98b5
2014-03-03 20:47: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 664b726cd3 VFS: further cleanup of device code
- all TTY-related exceptions have now been merged into the regular
  code paths, allowing non-TTY drivers to expose TTY-like devices;
- as part of this, CTTY_MAJOR is now fully managed by VFS instead of
  being an ugly stepchild of the TTY driver;
- device styles have become completely obsolete, support for them has
  been removed throughout the system; same for device flags, which had
  already become useless a while ago;
- device map open/close and I/O function pointers have lost their use,
  thus finally making the VFS device code actually readable;
- the device-unrelated pm_setsid has been moved to misc.c;
- some other small cleanup-related changes.

Change-Id: If90b10d1818e98a12139da3e94a15d250c9933da
2014-03-01 09:04:58 +01:00
David van Moolenbroek 89332ecdf1 system.conf: subsystem VID/DID matching support
- change "vid/did" to "vid:did", old form still supported for now;
- allow "vid:did/subvid:subdid" specification in system.conf, in
  which case a device will be visible to a driver if the subsystem
  VID/DID also match.

Change-Id: I7aef54da1b0bc81e24b5d98f1a28416f38f8b266
2014-03-01 09:04:57 +01:00
Lionel Sambuc 9fab85c2de Replacing timer_t by netbsd's timer_t
* Renamed struct timer to struct minix_timer
 * Renamed timer_t to minix_timer_t
 * Ensured all the code uses the minix_timer_t typedef
 * Removed ifdef around _BSD_TIMER_T
 * Removed include/timers.h and merged it into include/minix/timers.h
 * Resolved prototype conflict by renaming kernel's (re)set_timer
   to (re)set_kernel_timer.

Change-Id: I56f0f30dfed96e1a0575d92492294cf9a06468a5
2014-03-01 09:04:54 +01:00
David van Moolenbroek b48542d914 VM: readd support for forgetting cached FS blocks
Not all services involved in block I/O go through VM to access the
blocks they need.  As a result, the blocks in VM may become stale,
possibly causing corruption when the stale copy is restored by a
service that does go through VM later on.  This patch restores support
for forgetting cached blocks that belong to a particular device, and
makes the relevant file systems use this functionality 1) when
requested by VFS through REQ_FLUSH, and 2) upon unmount.

Change-Id: I0758c5ed8fe4b5ba81d432595d2113175776aff8
2014-03-01 09:04:53 +01:00
David van Moolenbroek 665198b4c2 Rewrite character driver protocol
As a side effect, remove the clone style, as the normal device style
supports device cloning now.

Change-Id: Ie82d1ef0385514a04a8faa139129a617895780b5
2014-03-01 09:04:52 +01:00
David van Moolenbroek 6331e8f845 Retire the synchronous character driver protocol
- change all sync char drivers into async drivers;
- retire support for the sync protocol in libchardev;
- remove async dev style, as this is now the default;
- remove dev_status from VFS;
- clean up now-unused protocol messages.

Change-Id: I6aacff712292f6b29f2ccd51bc1e7d7003723e87
2014-02-18 11:25:02 +01:00
Thomas Cort 4593804bf0 kernel: add padconf kernel call
On the AM335X, writes to the padconf registers must be done in privileged
mode. To allow userspace drivers to dynamically change the padconf at
runtime, a kernel call has been added.

Change-Id: I4b25d2879399b1785a360912faa0e90b5c258533
2013-08-28 12:53:05 -04:00
David van Moolenbroek 8e87bd84b4 Remove VM_VFS_REPLY from VM_BASIC_CALLS
Change-Id: I0a03f1c95fd7ef87cecb01a028f59696a8447738
2013-08-08 23:23:13 +02:00
Ben Gras 33a7ac7557 vfs: mmap support
. libc: add vfs_mmap, a way for vfs to initiate mmap()s.
	  This is a good special case to have as vfs is a slightly
	  different client from regular user processes. It doesn't do it
	  for itself, and has the dev & inode info already so the callback
	  to VFS for the lookup isn't necessary. So it has different info
	  to have to give to VM.
	. libc: also add minix_mmap64() that accepts a 64-bit offset, even
	  though our off_t is still 32 bit now.
	. On exec() time, try to mmap() in the executable if available.
	  (It is not yet available in this commit.)
	. To support mmap(), add do_vm_call that allows VM to lookup
	  (to ino+dev), do i/o from and close FD's on behalf of other
	  processes.

Change-Id: I831551e45a6781c74313c450eb9c967a68505932
2013-05-31 15:42:00 +00:00
Ben Gras 49eb1f4806 vm: new secondary cache code
Primary purpose of change: to support the mmap implementation, VM must
know both (a) about some block metadata for FS cache blocks, i.e.
inode numbers and inode offsets where applicable; and (b) know about
*all* cache blocks, i.e.  also of the FS primary caches and not just
the blocks that spill into the secondary one. This changes the
interface and VM data structures.

This change is only for the interface (libminixfs) and VM data
structures; the filesystem code is unmodified, so although the
secondary cache will be used as normal, blocks will not be annotated
with inode information until the FS is modified to provide this
information. Until it is modified, mmap of files will fail gracefully
on such filesystems.

This is indicated to VFS/VM by returning ENOSYS for REQ_PEEK.

Change-Id: I1d2df6c485e6c5e89eb28d9055076cc02629594e
2013-04-24 10:18:16 +00:00
Lionel Sambuc c3ae1bdfcd Switch to disable bin. exp. wait time in RS 2013-02-16 19:35:19 +01:00
Lionel Sambuc 22e69f558e Cleaning usage of MAJOR/MINOR
Change-Id: I4d7718c51967930375a5f0657b61f869745cf644
2013-01-14 11:36:26 +01:00
Ben Gras a5f09d5196 service: nonfatally ignore unknown call keywords
. makes switching between revisions with new system.conf
	  keywords less risky
2013-01-08 18:54:04 +00:00
Ben Gras 053fa581b5 vm: remove stack handling for signals
. moved to the kernel as the handling was only
	  reading it; the kernel may as well write it too
2012-08-29 17:31:38 +02:00
Thomas Veerman f93afa00e9 Remove MINIXSRCDIR and use NETBSDSRCDIR
NETBSDSRCDIR is used all over the place anyway, and this reduces
our diff with NetBSD a little.
2012-06-18 10:53:35 +00:00
Ben Gras 769af57274 further libexec generalization
. new mode for sys_memset: include process so memset can be
	  done in physical or virtual address space.
	. add a mode to mmap() that lets a process allocate uninitialized
	  memory.
	. this allows an exec()er (RS, VFS, etc.) to request uninitialized
	  memory from VM and selectively clear the ranges that don't come
	  from a file, leaving no uninitialized memory left for the process
	  to see.
	. use callbacks for clearing the process, clearing memory in the
	  process, and copying into the process; so that the libexec code
	  can be used from rs, vfs, and in the future, kernel (to load vm)
	  and vm (to load boot-time processes)
2012-06-07 15:15:02 +02:00
Ben Gras ee4016155e vm: add third-party mmap() mode and PROCCTL
these two functions will be used to support all exec() functionality
going into a single library shared by RS and VFS and exec() knowledge
leaving VM.

	. third-party mmap: allow certain processes (VFS, RS) to
	  do mmap() on behalf of another process
	. PROCCTL: used to free and clear a process' address space
2012-06-07 12:43:16 +02:00
Thomas Veerman d729ecb11b service: make clear who is printing the error 2012-04-13 13:51:56 +00:00
Ben Gras 7336a67dfe retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
David van Moolenbroek 70abb127cc Add sys_vumap() kernel call
This new call is a vectored version of sys_umap(). It supports batch
lookups, non-contiguous memory, faulting in memory, and basic access
checks.
2012-03-24 19:51:13 +01:00
Thomas Veerman d4cdd59eaa service: allow starting service with user's realuid 2012-02-01 13:21:56 +00:00
Thomas Veerman becf700bc2 APFS: drop privileges upon startup
Move SERVICE_LOGIN to rs.h global header so it's accessible for all.
2012-01-30 15:16:20 +00:00
Ben Gras 4668b84158 vm_remap_ro
- allows shared memory to be mapped in readonly

- ben@minix3.org & tom@minix3.org
2012-01-13 11:30:01 +00:00
Ben Gras 349a158056 base system hooks for pkgsrc drivers
. rc script and service know to look in /usr/pkg/.. for
	  extra binaries and conf files
	. service split into parsing config and doing RS request
	  so that a new utility (printconfig) can just print the
	  config in machine-parseable format for netconf integration
	. converted all base system eth drivers/netconf
2011-11-16 16:18:21 +01:00
Ben Gras d477a9ed82 vm/ipc: only report signals when it matters to ipc
. ipc wants to know about processes that get
	  signals, so that it can break blocking ipc operations
	. doing it for every single signal is wasteful
	  and causes the annoying 'no slot for signals' message
	. this fix tells vm on a per-process basis it (ipc)
	  wants to be notified, i.e. only when it does any ipc calls
	. move ipc config to separate config file while we're at it
2011-08-05 20:52:32 +00:00
Thomas Veerman ece4c9d565 Add DEV_CLONE_A dev type 2011-07-27 12:23:03 +00:00
Erik van der Kouwe 6e0f3b3bda Split off sys_umap_remote from sys_umap
sys_umap now supports only:
- looking up the physical address of a virtual address in the address space
  of the caller;
- looking up the physical address of a grant for which the caller is the
  grantee.

This is enough for nearly all umap users. The new sys_umap_remote supports
lookups in arbitrary address spaces and grants for arbitrary grantees.
2011-06-10 14:28:20 +00:00
Erik van der Kouwe e969b5e11b Remote unused segctl kernel call 2011-04-26 23:28:23 +02:00
Dirk Vogt 77fa5b4116 incoporate davman into server/rs 2011-02-25 12:25:03 +00:00
Arun Thomas 2bc8ac55ce service: Improve failure message 2011-02-23 12:55:10 +00:00
Arun Thomas 998af6f111 Move minix/paths.h to paths.h
Also, merge in relevant macros from NetBSD
2010-11-06 20:40:15 +00:00
David van Moolenbroek d299a6422b make all other commands use ProcFS 2010-09-14 21:31:56 +00:00
Ben Gras b1847ae244 make service look in /etc/system.conf.d/<progname> first for config file.
This makes it easier to
  - have non-base system drivers (get clobbered by global system.conf)
  - have drivers as packages (can't touch global system.conf)
  - make configs part of the drivers/servers instead of in global file
    (makes system parts more self-contained)
2010-08-31 14:33:31 +00:00
Tomas Hruby 62d44dc9ef service utility fix
- of course 0 is a valid cpu
2010-07-22 09:57:14 +00:00
Tomas Hruby f248bffc9e service utility can par cpu option in system.conf
- does not have any effect, solely for debugging SMP

- backward compatible with older RS instance
2010-07-20 07:27:45 +00:00
Cristiano Giuffrida f8a8ea0a79 Dynamic configuration in system.conf for boot system services. 2010-07-13 21:11:44 +00:00
Cristiano Giuffrida 3de6a807ce Configure settings for system services dynamically with the new service edit command. 2010-07-05 19:37:08 +00:00
Erik van der Kouwe 37325bd7c5 Make service ABI backwards compatible again 2010-07-03 05:02:59 +00:00
Cristiano Giuffrida 03f64ac97a Self update support in RS. 2010-07-01 18:48:25 +00:00
Erik van der Kouwe 23284ee7bd User-space scheduling for system processes 2010-07-01 08:32:33 +00:00
Cristiano Giuffrida 869a223d43 service clone command to clone system services on demand. 2010-06-28 21:38:29 +00:00
Arun Thomas c0c8d25799 Rename mkfiles from minix.*.mk to bsd.*.mk
Makes things easier for pkgsrc
2010-06-25 18:29:09 +00:00
Erik van der Kouwe fc7438181b Avoid use of C++ reserved word class in headers (reported by Aki Goto, tracker item 375) 2010-05-27 09:18:49 +00:00
Arun Thomas b48b037fbe Reorganize some directories
servers/hgfs/hgfs_server => servers/hgfs
servers/hgfs/libhgfs => lib/libhgfs
servers/rs/service => commands/service
drivers/memory/memory_driver => drivers/memory
drivers/memory/ramdisk => drivers/ramdisk
2010-05-26 22:49:57 +00:00