Various updates.

* Removed some variants of the SYS_GETINFO calls from the kernel;
  replaced them with new PM and utils libary functionality. Fixed
  bugs in utils library that used old get_kenv() variant.
* Implemented a buffer in the kernel to gather random data.
  Memory driver periodically checks this for /dev/random.
  A better random algorithm can now be implemented in the driver.
  Removed SYS_RANDOM; the SYS_GETINFO call is used instead.
* Remove SYS_KMALLOC from the kernel. Memory allocation can now
  be done at the process manager with new 'other' library functions.
This commit is contained in:
Jorrit Herder
2005-06-03 13:55:06 +00:00
parent 4904a5537a
commit f2a85e58d9
43 changed files with 245 additions and 222 deletions
+2 -2
View File
@@ -71,5 +71,5 @@
#define GETPROCNR 80 /* to PM */
#define FSTATFS 82 /* to FS */
#define MEM_ALLOC 83 /* to PM */
#define MEM_FREE 84 /* to PM */
#define ALLOCMEM 83 /* to PM */
#define FREEMEM 84 /* to PM */
+5 -5
View File
@@ -196,7 +196,7 @@
# define SYS_ABORT 9 /* sys_abort() */
# define SYS_KILL 10 /* sys_kill(proc_nr, sig) */
# define SYS_UMAP 11 /* sys_umap(proc_nr, etc) */
# define SYS_RANDOM 12 /* sys_random(...) */
# define SYS_TRACE 13 /* sys_trace(req,pid,addr,data) */
# define SYS_SIGNALRM 15 /* sys_signalrm(proc_nr, ticks) */
@@ -210,7 +210,7 @@
# define SYS_DEVIO 23 /* sys_devio(port, value) */
# define SYS_VDEVIO 24 /* sys_vdevio(buf_ptr, nr_ports) */
# define SYS_IRQCTL 25 /* sys_irqctl() */
# define SYS_KMALLOC 26 /* sys_kmalloc(size, phys_base) */
# define SYS_IOPENABLE 27 /* sys_enable_iop() */
# define SYS_SEGCTL 28 /* sys_segctl(*idx, *seg, *off, phys, size) */
# define SYS_EXIT 29 /* sys_exit(status) */
@@ -220,7 +220,7 @@
# define SYS_PHYSZERO 33 /* sys_physzero(addr,count) */
#define NR_SYS_CALLS 34 /* number of system calls */
/* Field names for SYS_MEM, SYS_KMALLOC. */
/* Field names for SYS_SEGCTL. */
#define MEM_CHUNK_BASE m4_l1 /* physical base address */
#define MEM_CHUNK_SIZE m4_l2 /* size of mem chunk */
#define MEM_TOT_SIZE m4_l3 /* total memory size */
@@ -306,8 +306,8 @@
#define I_REQUEST m7_i3 /* what info to get */
# define GET_KINFO 0 /* get kernel information structure */
# define GET_IMAGE 1 /* get system image table */
# define GET_PROCTAB 2 /* get (kernel) process table */
# define GET_PROCNR 3 /* find nr of process with name */
# define GET_PROCTAB 2 /* get kernel process table */
# define GET_RANDOMNESS 3 /* get randomness buffer */
# define GET_MONPARAMS 4 /* get monitor parameters */
# define GET_KENV 5 /* get kernel environment string */
# define GET_IRQHOOKS 6 /* get the IRQ table */
+1 -4
View File
@@ -109,7 +109,6 @@ _PROTOTYPE(int sys_umap, (int proc_nr, int seg, vir_bytes vir_addr,
_PROTOTYPE(int sys_segctl, (int *index, u16_t *seg, vir_bytes *off,
phys_bytes phys, vir_bytes size));
_PROTOTYPE(int sys_enable_iop, (int proc_nr) );
_PROTOTYPE(int sys_kmalloc, (size_t size, phys_bytes *phys_base) );
/* Shorthands for sys_getinfo() system call. */
#define sys_getkmessages(dst) sys_getinfo(GET_KMESSAGES, dst, 0,0,0)
@@ -117,14 +116,12 @@ _PROTOTYPE(int sys_kmalloc, (size_t size, phys_bytes *phys_base) );
#define sys_getmachine(dst) sys_getinfo(GET_MACHINE, dst, 0,0,0)
#define sys_getproctab(dst) sys_getinfo(GET_PROCTAB, dst, 0,0,0)
#define sys_getproc(dst,nr) sys_getinfo(GET_PROC, dst, 0,0, nr)
#define sys_getprocnr(dst,k,kl) sys_getinfo(GET_PROCNR, dst, 0,k,kl)
#define sys_getrandomness(dst) sys_getinfo(GET_RANDOMNESS, dst, 0,0,0)
#define sys_getimage(dst) sys_getinfo(GET_IMAGE, dst, 0,0,0)
#define sys_getirqhooks(dst) sys_getinfo(GET_IRQHOOKS, dst, 0,0,0)
#define sys_getmemchunks(dst) sys_getinfo(GET_MEMCHUNKS, dst, 0,0,0)
#define sys_getmonparams(v,vl) sys_getinfo(GET_MONPARAMS, v,vl, 0,0)
#define sys_getkenv(k,kl,v,vl) sys_getinfo(GET_KENV, v,vl, k,kl)
#define sys_getschedinfo(v1,v2) sys_getinfo(GET_SCHEDINFO, v1,0, v2,0)
#define sys_getkaddr(dst) sys_getinfo(GET_KADDRESSES, dst, 0,0,0)
#define sys_getlocktimings(dst) sys_getinfo(GET_LOCKTIMING, dst, 0,0,0)
_PROTOTYPE(int sys_getinfo, (int request, void *val_ptr, int val_len,
void *key_ptr, int key_len) );
+4 -3
View File
@@ -1,6 +1,10 @@
#ifndef _TYPE_H
#define _TYPE_H
#ifndef _CONFIG_H
#include <minix/config.h>
#endif
#ifndef _TYPES_H
#include <sys/types.h>
#endif
@@ -102,9 +106,6 @@ struct kinfo {
phys_bytes bootdev_size;
phys_bytes params_base; /* parameters passed by boot monitor */
phys_bytes params_size;
long nr_ntf_pending;
long lock_notify;
long lock_send;
int nr_procs; /* number of user processes */
int nr_tasks; /* number of kernel tasks */
char version[8]; /* kernel version number */
+5
View File
@@ -125,6 +125,9 @@ _PROTOTYPE( int unlink, (const char *_path) );
_PROTOTYPE( ssize_t write, (int _fd, const void *_buf, size_t _n) );
#ifdef _MINIX
#ifndef _TYPE_H
#include <minix/type.h>
#endif
_PROTOTYPE( int brk, (char *_addr) );
_PROTOTYPE( int chroot, (const char *_name) );
_PROTOTYPE( int mknod, (const char *_name, Mode_t _mode, Dev_t _addr) );
@@ -145,6 +148,8 @@ _PROTOTYPE( char *crypt, (const char *_key, const char *_salt) );
_PROTOTYPE( int getsysinfo, (int who, int what, void *where) );
_PROTOTYPE( int getprocnr, (int *proc_nr) );
_PROTOTYPE( int findproc, (char *proc_name, int *proc_nr) );
_PROTOTYPE( int allocmem, (phys_bytes size, phys_bytes *base) );
_PROTOTYPE( int freemem, (phys_bytes size, phys_bytes base) );
#endif
_PROTOTYPE( int setcache, (int kb));