Commit graph

183 commits

Author SHA1 Message Date
Ben Gras
407eefe63a Compile fix 2006-06-29 14:23:33 +00:00
Ben Gras
f1222a09a6 Make stack traces on exceptions possible. 2006-06-29 13:35:27 +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
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
Ben Gras
d402047222 Added vectored variant of sys_safecopy*. 2006-06-23 11:54:03 +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
Philip Homburg
15b8fe54a8 Better initialization of the memory map of processes that are part of the
image. Removed NO_MAP flag.
2006-05-11 14:49:46 +00:00
Ben Gras
3172b4d0ad Patches by Jeff Bailey for posixifications. 2006-04-09 23:16:13 +00:00
Ben Gras
eae250dea4 . load average calculation changed to calculate it all over every tick
instead of keeping a running total of enqueued processes
   (because somehow the load average was broken)
 . added SI_KPROC_TAB to get a copy of kernel process table from PM, for
   a top implementation
 . fixed arg to sys_nice() to make it an endpoint, not a slot number
2006-03-16 09:33:35 +00:00
Philip Homburg
7f861650b0 Use the sysutil library's printf code also for the kernel. 2006-03-15 16:15:23 +00:00
Philip Homburg
c1da6e6e24 Allow a process to kill itself. Remove the endpoint of a process that kills
itself before reporting the singal to pm.
2006-03-15 12:01:59 +00:00
Ben Gras
55bdde85f0 Hack out of proc.c; function and flags width in ipc.h back to nibbles
instead of bytes for backwards compatability
2006-03-15 11:29:54 +00:00
Ben Gras
8500d0f238 Backwards compatability hack 2006-03-15 11:11:54 +00:00
Ben Gras
c236121692 Let reboot work again by making PM check for RBT_REBOOT 2006-03-10 16:50:27 +00:00
Jorrit Herder
021e3234d8 Jorrit's ... "progress?" 2006-03-10 16:10:05 +00:00
Ben Gras
0d831b9c22 Don't print anything if anything is wrong in send_sig() 2006-03-09 14:02:56 +00:00
Ben Gras
6d98f7205a Verify if log process numbers are sensible 2006-03-09 14:00:33 +00:00
Ben Gras
5498a74d87 Typo in comment. 2006-03-09 13:59:59 +00:00
Philip Homburg
4b62006c04 Fixed typo. 2006-03-08 12:30:43 +00:00
Philip Homburg
167ea0faa5 Added some disabled debug code. 2006-03-08 12:06:33 +00:00
Philip Homburg
9a1dfc5128 Do not confuse proc with proc_addr if you want a bug free kernel. 2006-03-08 11:59:59 +00:00
Ben Gras
1335d5d700 'proc number' is process slot, 'endpoint' are generation-aware process
instance numbers, encoded and decoded using macros in <minix/endpoint.h>.

proc number -> endpoint migration
  . proc_nr in the interrupt hook is now an endpoint, proc_nr_e.
  . m_source for messages and notifies is now an endpoint, instead of
    proc number.
  . isokendpt() converts an endpoint to a process number, returns
    success (but fails if the process number is out of range, the
    process slot is not a living process, or the given endpoint
    number does not match the endpoint number in the process slot,
    indicating an old process).
  . okendpt() is the same as isokendpt(), but panic()s if the conversion
    fails. This is mainly used for decoding message.m_source endpoints,
    and other endpoint numbers in kernel data structures, which should
    always be correct.
  . if DEBUG_ENABLE_IPC_WARNINGS is enabled, isokendpt() and okendpt()
    get passed the __FILE__ and __LINE__ of the calling lines, and
    print messages about what is wrong with the endpoint number
    (out of range proc, empty proc, or inconsistent endpoint number),
    with the caller, making finding where the conversion failed easy
    without having to include code for every call to print where things
    went wrong. Sometimes this is harmless (wrong arg to a kernel call),
    sometimes it's a fatal internal inconsistency (bogus m_source).
  . some process table fields have been appended an _e to indicate it's
    become and endpoint.
  . process endpoint is stored in p_endpoint, without generation number.
    it turns out the kernel never needs the generation number, except
    when fork()ing, so it's decoded then.
  . kernel calls all take endpoints as arguments, not proc numbers.
    the one exception is sys_fork(), which needs to know in which slot
    to put the child.
2006-03-03 10:00:02 +00:00
Philip Homburg
7034c0795d Moved PCI driver to the ramdisk. 2006-02-15 14:21:56 +00:00
Philip Homburg
c3a88d15d8 Initial root filesystem is now on a ramdisk that is part of the image. 2006-02-15 11:18:21 +00:00
Ben Gras
88ba4b5268 added reenter check to lock_dequeue() to avoid unlocking of interrupts
via cause_sig() during an exception.

moved lock check configuration to <minix/sys_config.h> instead of
kernel/config.h, because the 'relocking' field in kinfo depends on it.

other prettification: common locking macro, whether lock timing is on or
not.
2006-02-10 16:53:51 +00:00
Ben Gras
0a02bfb056 Moved ipc debug out of conditional.
Gave pci server sys_getinfo privilege.
2006-02-06 15:16:14 +00:00
Philip Homburg
38a16399f8 Store resource lists for drivers. Limited checks to enforce those lists. 2006-01-27 13:21:12 +00:00
Philip Homburg
d9d970bdfa GET_IRQACTIDS, allow SELF in do_vm_map. 2006-01-12 14:38:51 +00:00
Philip Homburg
eec836014a PCI support in a separate driver 2005-12-02 14:45:38 +00:00
Ben Gras
87f2236ad2 load average measurement implementation, accessable through
getloadavg() system call in the library.
2005-11-14 15:50:46 +00:00
Philip Homburg
b85736bd7b Grant tty permission to use SYS_VM_MAP and SYS_IOPENABLE. 2005-11-09 15:48:41 +00:00
Philip Homburg
0b7fcbfd70 Only the memory driver should be allowed access to SYS_IOPENABLE 2005-11-04 17:06:49 +00:00
Philip Homburg
bfa0a555ad Removed debug printfs. 2005-10-24 13:48:50 +00:00
Ben Gras
85209d2e29 Test for SENDING else RECEIVING should be SENDING, then RECEIVING. 2005-10-21 18:13:10 +00:00
Ben Gras
81fa8fc3b8 Don't enqueue processes unless their flags have become 0 2005-10-21 17:35:39 +00:00
Jorrit Herder
78f20c3959 Rest ... 2005-10-21 13:46:47 +00:00
Ben Gras
cf16c73e62 . check for notify() from NONE (shouldn't happen any more)
. test for cleared process slots when checking processes on exiting
 . clear process slot first, then do cleanup on exiting
2005-10-20 20:59:02 +00:00
Jorrit Herder
86e3333454 New error codes for IPC errors.
Made VM code debug output disappear.
2005-10-20 20:25:32 +00:00
Ben Gras
2bf8bfe126 Turn IPC warning messages off by default
(because inet deadlocks are normal and will confuse our users).
2005-10-18 16:13:12 +00:00
Ben Gras
ea75918df1 printf() by kernel and servers now send messages to an array of processes,
OUTPUT_PROCS_ARRAY in <minix/config.h>, in that order, terminated by NONE.
log no longer forwards messages to tty itself. This leads to less funny
loops and more robust debug-message handling. Also the list of
processes receiving messages can easily be changed around or disabled by
editing the array (e.g. disable it by changing the array to { NONE }.).
2005-10-18 10:34:54 +00:00
Ben Gras
61b6139752 Al's system -> kernel call change 2005-10-14 09:13:52 +00:00