Commit graph

88 commits

Author SHA1 Message Date
Ben Gras
6f77685609 Split of architecture-dependent and -independent functions for i386,
mainly in the kernel and headers. This split based on work by
Ingmar Alting <iaalting@cs.vu.nl> done for his Minix PowerPC architecture
port.

 . kernel does not program the interrupt controller directly, do any
   other architecture-dependent operations, or contain assembly any more,
   but uses architecture-dependent functions in arch/$(ARCH)/.
 . architecture-dependent constants and types defined in arch/$(ARCH)/include.
 . <ibm/portio.h> moved to <minix/portio.h>, as they have become, for now,
   architecture-independent functions.
 . int86, sdevio, readbios, and iopenable are now i386-specific kernel calls
   and live in arch/i386/do_* now.
 . i386 arch now supports even less 86 code; e.g. mpx86.s and klib86.s have
   gone, and 'machine.protected' is gone (and always taken to be 1 in i386).
   If 86 support is to return, it should be a new architecture.
 . prototypes for the architecture-dependent functions defined in
   kernel/arch/$(ARCH)/*.c but used in kernel/ are in kernel/proto.h
 . /etc/make.conf included in makefiles and shell scripts that need to
   know the building architecture; it defines ARCH=<arch>, currently only
   i386.
 . some basic per-architecture build support outside of the kernel (lib)
 . in clock.c, only dequeue a process if it was ready
 . fixes for new include files

files deleted:
 . mpx/klib.s - only for choosing between mpx/klib86 and -386
 . klib86.s - only for 86

i386-specific files files moved (or arch-dependent stuff moved) to arch/i386/:
 . mpx386.s (entry point)
 . klib386.s
 . sconst.h
 . exception.c
 . protect.c
 . protect.h
 . i8269.c
2006-12-22 15:22:27 +00:00
David van Moolenbroek
d4e6fe3546 Setjmp/longjmp updates and cleanup. 2006-12-08 16:23:18 +00:00
Ben Gras
7195fe3325 System statistical and call profiling
support by Rogier Meurs <rogier@meurs.org>.
2006-10-30 15:53:38 +00:00
Ben Gras
65a1d21963 Part of wait()/waitpid() fix in revision 2629:2634 in PM - kernel
unblocks a process that has no priority (stopped with sys_nice()
and PRIO_STOP) and reschedules it if that gives it RTS flags of 0.
2006-10-25 13:38:31 +00:00
Philip Homburg
fd448c332b Access control in do_sdevio and do_vdevio 2006-10-20 14:46:55 +00:00
Philip Homburg
dd3ee082b2 Initialize priv from user supplied priv structure in SYS_PRIV_INIT.
Added SYS_PRIV_USER call to downgrade a privileged process to a user process.
2006-10-20 14:42:48 +00:00
Philip Homburg
c5efbf71c0 first commit of extra ptrace code for fault injection 2006-08-28 14:59:56 +00:00
Philip Homburg
d40007667c Do not report non-safe sys_sdevio calls when the address is 'SELF' 2006-07-13 14:46:53 +00:00
Philip Homburg
6f4091eb8c Added do_readbios. Added debugging output for unexpected use of unsafe copy
functions.
2006-07-10 12:27:26 +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
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
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
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
Jorrit Herder
021e3234d8 Jorrit's ... "progress?" 2006-03-10 16:10:05 +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
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
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
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
32514fb5f9 Al's system call -> kernel call renaming 2005-10-14 08:58:59 +00:00
Ben Gras
ee9b08e5c0 Comment fix about sys_abort() 2005-10-13 09:43:39 +00:00
Jorrit Herder
b16a88692a New deadlock check at proc.c.
New exit checks (stop IPC).
2005-10-12 15:08:23 +00:00
Jorrit Herder
32c05f45c6 Minor bug fixes in proc.c and utility.c;
Removed debug dumps on panic from main.c;
Return error on exit when other process does IPC to/from exiting process.
2005-10-05 09:51:50 +00:00
Philip Homburg
9bee3f4b08 IOPL, VM, and serial debug output (disabled). 2005-09-30 12:54:59 +00:00
Ben Gras
d11b2e4b8c Al's double-blank-line removal request 2005-08-22 15:23:47 +00:00
Jorrit Herder
872687ddfc Scheduling updates to the kernel. Sched() function now is single point for
policy. Actual policy not yet implemented.

PM calculates nice values for processes in boot image.

IS debug dumps improved (Shift+F1-F4).
2005-08-22 15:14:11 +00:00
Jorrit Herder
a01645b788 New scheduling code in kernel. Work in progress.
Round-robin within one priority queue works fine.
Ageing algorithm to be done.
2005-08-19 16:43:28 +00:00
Jorrit Herder
2a165d972e Moved "Changes" comments from system/do_....c to system.h.
All changes are now in a single header file.
2005-08-10 10:23:55 +00:00
Jorrit Herder
1c570a7d93 Second try to fix tick delay problem ... 2005-08-05 17:02:37 +00:00
Jorrit Herder
e396496d8c Fixed small bug in alarm code.
Kernel timer count was not reset after expiry.
2005-08-05 16:46:27 +00:00
Jorrit Herder
b96c389e78 Various small cleanups and comments added. 2005-08-05 09:41:15 +00:00
Jorrit Herder
74711a3b14 Check if kernel calls is allowed (from process' call mask) added. Not yet
enforced. If a call is denied, this will be kprinted. Please report any such
errors, so that I can adjust the mask before returning errors instead of
warnings.

Wrote CMOS driver. All CMOS code from FS has been removed. Currently the
driver only supports get time calls. Set time is left out as an exercise
for the book readers ... startup scripts were updated because the CMOS driver
is needed early on. (IS got same treatment.) Don't forget to run MAKEDEV cmos
in /dev/, otherwise the driver cannot be loaded.
2005-08-04 19:23:03 +00:00
Jorrit Herder
e561081545 Miscellaneous clean ups and fixes to the kernel.
Support for FLOPPY in boot image. (Set controller=fd at boot monitor.)
Moved major device numbers to <minix/dmap.h> (maybe rename to dev.h?)
2005-08-04 09:26:36 +00:00
Jorrit Herder
ab7c0a9926 Cleaned up table. Moved policies to table.
Small fixes to do_copy, do_privctl and do_fork.
2005-08-02 15:28:09 +00:00
Jorrit Herder
0946d128cd - Kernel call handlers cleaned up. More strict checking of input parameters.
- Moved generic_handler() from system.c to system/do_irqctl.c.
- Set privileges of system processes somewhat stricter.
2005-07-29 15:26:23 +00:00
Jorrit Herder
d62e515660 Small update to SYS_IRQCTL -> setting an interrupt policy now allows the caller
to provide an index (0 .. 31) that is passed in the HARD_INT message when an
interrupt occurs. The NOTIFY_ARG field contains a bitmap with all indexes for
which an interrupt occured.
2005-07-29 12:44:42 +00:00
Jorrit Herder
bd8762263a *** empty log message *** 2005-07-29 11:50:58 +00:00
Philip Homburg
49c25df569 bios_wini driver 2005-07-29 10:21:04 +00:00
Jorrit Herder
fe0dcb5c00 AT driver is not modified (debugging only);
TTY: select and revive with new notify and FS call back;
kernel: removed old notify code; removed ugly prepare_shutdown timer
kputc: don't send to FS if PRINTF_PROC fails
2005-07-27 14:32:16 +00:00
Jorrit Herder
8866b4d0ef Kernel changes:
- reinstalled priority changing, now in sched() and unready()
- reinstalled check on message buffer in sys_call()
- reinstalled check in send masks in sys_call()
- changed do_fork() to get new privilege structure for SYS_PROCs
- removed some processes from boot image---will be dynamically started later
2005-07-26 12:48:34 +00:00
Philip Homburg
153fdabb26 Fixed do_trace to properly return (status) information. 2005-07-25 12:15:05 +00:00