Commit graph

1711 commits

Author SHA1 Message Date
Ben Gras bd535a120b . satisfy some gcc warnings (uninitialized/unused variables)
. change cloexec mask from long to fd_set to remove 32 fd's per
   process restriction (from cloexec at least)
2006-06-27 16:47:35 +00:00
Ben Gras a0f8161fe7 Stopgap for tar creating insane group ownerships due to tiny gid_t. 2006-06-27 16:30:46 +00:00
Ben Gras 59bedc2074 let dynamic allocation of table work 2006-06-27 14:15:47 +00:00
Ben Gras 607fb6bf7f Add a flag to grants system indicating a slot is VALID; so a slot
can be reserved (USED), while toggling VALID on and off.
2006-06-27 12:19:45 +00:00
Ben Gras a587273c56 . expanded grant manipulation interface to more direct
manipulation
. made fs allocate a grant for every ioctl, even if no data
  is being copied, in order to disambiguate concurrent ioctls
  on the same minor
2006-06-26 16:08:42 +00:00
Philip Homburg 2f50f92eb3 Move inet to safe copies. 2006-06-26 16:03:35 +00:00
Ben Gras 961a173573 Fix to let elle understand window size. 2006-06-26 15:15:40 +00:00
Philip Homburg de07a562d1 Vectored safe copies for inet. 2006-06-26 14:20:11 +00:00
Philip Homburg 14c9743ecf First cut at safe copies for inet. Breaks tcpstat. 2006-06-26 11:17:19 +00:00
Ben Gras 48a6203ae7 A backup of the readclock command that shouldn't have been imported into cvs. 2006-06-26 08:58:11 +00:00
Ben Gras 3b814d36d1 Rename paramctl to setgrant. 2006-06-23 15:35:05 +00:00
Philip Homburg add4be444f get_sys_bits 2006-06-23 15:32:24 +00:00
Ben Gras 002922fa4c New kernel call, SYS_PARAMCTL, that sets parameters of the caller
and is therefore unprivileged. Used to set grant tables.
2006-06-23 15:07:41 +00:00
Philip Homburg 8dfac43a75 Print ipc_to in hex. Also print the 'system' call mask. 2006-06-23 13:27:03 +00:00
Ben Gras 777dbbe3f7 Everyone's endpoint number 2006-06-23 12:16:22 +00:00
Ben Gras 0e9c6932c4 use malloc() + copy + free() instead of realloc() 2006-06-23 12:07:41 +00:00
Ben Gras 3ffa1684ae New option -E for ps that prints endpoint numbers instead of pids. 2006-06-23 11:59:20 +00:00
Ben Gras 31318a8ce5 library interface for vectored safecopy variant. 2006-06-23 11:54:35 +00:00
Ben Gras d402047222 Added vectored variant of sys_safecopy*. 2006-06-23 11:54:03 +00:00
Ben Gras 82855e9cf5 . leave out dead code from device.c
. don't loop doing a receive() after sendrec() - chance of recovering is not
  high, and can lead to receive()ing a notify() (which can't happen in sendrec()),
  which is terrible
. return status from device when DEV_CANCEL is done on a signal; hardcode EAGAIN to
  become EINTR though
2006-06-23 11:51:56 +00:00
Philip Homburg 08bb0f7708 No longer build Michael Temari's httpd. Install a httpd from ports. 2006-06-22 11:53:03 +00:00
Philip Homburg 529ca8a4df Added strlcat and strlcpy. 2006-06-22 11:47:18 +00:00
Philip Homburg bd783b901f Added prototype for inet_aton. 2006-06-22 11:45:59 +00:00
Philip Homburg 20a9ca246d Added __minix3 to make it easier to figure out that we are compiling on/for
Minix 3.
2006-06-22 11:44:17 +00:00
Ben Gras ed9be75384 <minix/safecopies> 2006-06-20 14:25:42 +00:00
Ben Gras 7b6a1e5f59 More space for rs 2006-06-20 10:59:45 +00:00
Ben Gras 0d39b17655 Changed order of -lsys and -lsysutil for printf() 2006-06-20 10:50:29 +00:00
Ben Gras 705f1039d9 order changed for printf() 2006-06-20 10:47:25 +00:00
Ben Gras cef426ee54 There is no lex. 2006-06-20 10:14:25 +00:00
Ben Gras 848b96a9a4 Fixes for usb and bios. 2006-06-20 10:13:56 +00:00
Ben Gras 223a0e7b60 Fix for KERNEL definition. 2006-06-20 10:13:32 +00:00
Ben Gras 150c964b49 Fix for losing REVIVE 2006-06-20 10:12:30 +00:00
Ben Gras 2384a85296 FS support for grant-based i/o.
For character device i/o, FS does a so-called 'magic' grant to let the
driver copy from or to user space. As this is done in FS address space,
the driver is told to do this in FS address space. The redirection to
the right user process then happens at copy-time in the kernel, using the
FS grant table. This also happens for DEV_READ and DEV_WRITE on block
devices.

For other block device i/o, which happens from/to FS buffers, FS does
a 'direct' grant to its own address space for the driver.

After the i/o returns, this access has to be K-I-L-L-E-D, revoked.
Sometimes this is after a SUSPEND and DEV_REVIVE, in which case the
revoking happens in pipe.c.

This conversion happens in safe_io_conversion() in device.c, called
by dev_io and dev_bio.

FS has to pre-allocate its own space for these grant tables. This happens
in main.c.
2006-06-20 10:12:09 +00:00
Ben Gras 54f1e6d3d4 Use endpoint_t 2006-06-20 10:04:33 +00:00
Ben Gras 7a76a7a495 Rename protected to prot
Also print size of grant table known in system
2006-06-20 10:03:48 +00:00
Ben Gras 3061d7b17a Changed do_devio not to require DIO_TYPE, but to extract type
from DIO_REQUEST. Also do_vdevio. Also do_sdevio, but this
function also supports grant id's and offsets.

do_segctl: rename protected to prot.

do_umap: support for GRANT_SEG umap.

do_privctl: support SYS_PRIV_SET_GRANTS, which sets location and size
of in-own-address-space grant table.

do_safecopy: functions to verify and perform 'safe' (grant-based) copies.
2006-06-20 10:03:10 +00:00
Ben Gras ada6592af9 Prototype of do_safecopy 2006-06-20 09:59:50 +00:00
Ben Gras bf6fa2acd0 Introduced global sys_call_code to check in called kernel call
implementation functions.

Changed check in system.c to check compile-time-sized bitmap of
kernel calls.

Added SYS_SAFECOPYFROM and SYS_SAFECOPYTO, both mapping to
do_safecopy (that's what sys_call_code is used for).
2006-06-20 09:58:58 +00:00
Ben Gras b89c6634f5 Use endpoint_t. New prototypes for related to grants and safecopy functions. 2006-06-20 09:57:00 +00:00
Ben Gras 2e89eb5270 Change allowed kernel call bitmap to an array of bitmaps to allow
any number of kernel calls.

Allowed kernel calls are stored in table.c for every image process as a
variably-sized array of allowed calls. This is used to fill the bitmap
of size determined at compile time by the number of kernel calls. This
filling is done by main.c. There is a special call called SYS_ALL_CALLS
which fills the bitmap of allowed calls completely, if that is the only
entry in the array.
2006-06-20 09:56:06 +00:00
Ben Gras eecb40cf21 Rename protected to prot for g++ 2006-06-20 09:52:11 +00:00
Ben Gras 28950e6104 Use endpoint_t type 2006-06-20 09:51:49 +00:00
Ben Gras 831bc7ecd1 Move bitmap manipulation macros to <minix/bitmap.h> 2006-06-20 09:50:26 +00:00
Ben Gras 281e76364a Conversion to safe calls, and returning grant in DEV_REVIVE messages 2006-06-20 09:49:02 +00:00
Ben Gras d61715a69e Fix for new *_ins* i/o functions 2006-06-20 09:48:26 +00:00
Ben Gras 6d8fa97233 Kick out REVIVE 2006-06-20 09:47:23 +00:00
Ben Gras b80626c878 safe conversion 2006-06-20 09:46:57 +00:00
Ben Gras 1c8b206a5d . Safe I/O, ioctl() and DIAGNOSTICS variants conversion - safe copies,
include grant id in DEV_REVIVE messages.
. Removal of TTY_FLAGS field (and so O_NONBLOCK support).
. Fixed CANCEL behaviour and return code on blocking I/O,
  previously handled by O_NONBLOCK
. Totally removed REVIVE replies, previously still possible on
  blocking ioctls (REVIVE directly called) and ptys (missing TTY_REVIVE
  check), removes deadlock bug with FS
. Removed obsolete *COMPAT options and associated code
2006-06-20 09:02:54 +00:00
Ben Gras 9fa06d5e3f safe conversion 2006-06-20 08:56:58 +00:00
Ben Gras 5350645c86 Safe I/O and ioctl functions 2006-06-20 08:56:15 +00:00