Changed various header file to support dynamically staring drivers.

Note: full recompile necessary.
This commit is contained in:
Jorrit Herder 2005-08-02 15:31:12 +00:00
parent 52965b6f17
commit 120e514506
7 changed files with 54 additions and 46 deletions

View file

@ -69,7 +69,7 @@
#define CMOSTIME 78 /* to FS */
#define GETSYSINFO 79 /* to PM or FS */
#define GETPROCNR 80 /* to PM */
#define DEVCTL 81 /* to FS */
#define FSTATFS 82 /* to FS */
#define ALLOCMEM 83 /* to PM */
#define FREEMEM 84 /* to PM */

View file

@ -39,24 +39,15 @@
#define PM_PROC_NR 0 /* process manager */
#define FS_PROC_NR 1 /* file system */
#define SM_PROC_NR 2 /* system service manager */
#define IS_PROC_NR 3 /* information server */
#define TTY 4 /* terminal (TTY) driver */
#define MEMORY 5 /* memory driver (RAM disk, null, etc.) */
#define AT_WINI (MEMORY + ENABLE_AT_WINI) /* AT Winchester */
#define FLOPPY (AT_WINI + ENABLE_FLOPPY) /* floppy disk */
#define PRINTER (FLOPPY + ENABLE_PRINTER) /* Centronics */
#define RTL8139 (PRINTER + ENABLE_RTL8139) /* Realtek RTL8139 */
#define FXP (RTL8139 + ENABLE_FXP) /* Intel Pro/100 */
#define DPETH (FXP + ENABLE_DPETH) /* ISA Network task */
#define LOG_PROC_NR (DPETH + ENABLE_LOG) /* log device */
#define BIOS_WINI (LOG_PROC_NR + ENABLE_BIOS_WINI) /* BIOS disk device */
#define INIT_PROC_NR (BIOS_WINI + 1) /* init -- goes multiuser */
#define MEMORY 3 /* memory driver (RAM disk, null, etc.) */
#define LOG_PROC_NR 4 /* log device driver */
#define TTY 5 /* terminal (TTY) driver */
#define AT_WINI 6 /* AT Winchester */
#define BIOS_WINI 7 /* BIOS disk device */
#define INIT_PROC_NR 8 /* init -- goes multiuser */
/* Number of processes contained in the system image. */
#define NR_BOOT_PROCS (NR_TASKS + \
6 + ENABLE_AT_WINI + ENABLE_FLOPPY + \
ENABLE_PRINTER + ENABLE_RTL8139 + ENABLE_FXP + \
ENABLE_DPETH + ENABLE_LOG + ENABLE_BIOS_WINI + 1 )
#define NR_BOOT_PROCS (NR_TASKS + INIT_PROC_NR + 1)
/*===========================================================================*
@ -72,7 +63,7 @@
#define NOTIFY_MESSAGE 0x1000
#define NOTIFY_FROM(p_nr) (NOTIFY_MESSAGE | ((p_nr) + NR_TASKS))
# define SYN_ALARM NOTIFY_FROM(CLOCK) /* synchronous alarm */
# define SYS_EVENT NOTIFY_FROM(SYSTEM) /* signal system event */
# define SYS_SIG NOTIFY_FROM(SYSTEM) /* system signal */
# define HARD_INT NOTIFY_FROM(HARDWARE) /* hardware interrupt */
# define NEW_KSIG NOTIFY_FROM(HARDWARE) /* new kernel signal */
# define FKEY_PRESSED NOTIFY_FROM(TTY) /* function key press */
@ -93,8 +84,19 @@
* Messages for system management server *
*===========================================================================*/
#define START_SERVICE 0
#define STOP_SERVICE 1
#define SRV_RQ_BASE 0x700
#define SRV_UP (SRV_RQ_BASE + 0) /* start system service */
#define SRV_DOWN (SRV_RQ_BASE + 1) /* stop system service */
#define SRV_STATUS (SRV_RQ_BASE + 2) /* get service status */
# define SRV_PATH_ADDR m1_p1 /* path of binary */
# define SRV_PATH_LEN m1_i1 /* length of binary */
# define SRV_ARGS_ADDR m1_p2 /* arguments to be passed */
# define SRV_ARGS_LEN m1_i2 /* length of arguments */
# define SRV_DEV_MAJOR m1_i3 /* major device number */
# define SRV_PRIV_ADDR m1_p3 /* privileges string */
# define SRV_PRIV_LEN m1_i3 /* length of privileges */
/*===========================================================================*

View file

@ -88,16 +88,6 @@
/* DMA_SECTORS may be increased to speed up DMA based drivers. */
#define DMA_SECTORS 1 /* DMA buffer size (must be >= 1) */
/* Enable or disable networking drivers. */
#define ENABLE_DPETH 0 /* enable DP8390 ethernet driver */
#define ENABLE_WDETH 0 /* add Western Digital WD80x3 */
#define ENABLE_NE2000 0 /* add Novell NE1000/NE2000 */
#define ENABLE_3C503 0 /* add 3Com Etherlink II (3c503) */
#define ENABLE_RTL8139 1 /* enable Realtek 8139 (rtl8139) */
#define ENABLE_FXP 1 /* enable Intel Pro/100 (fxp) */
#define ENABLE_LOG 1 /* /dev/klog */
/* Include or exclude backwards compatibility code. */
#define ENABLE_BINCOMPAT 0 /* for binaries using obsolete calls */
#define ENABLE_SRCCOMPAT 0 /* for sources using obsolete calls */

25
include/minix/dmap.h Normal file
View file

@ -0,0 +1,25 @@
#ifndef _DMAP_H
#define _DMAP_H
#include <minix/config.h>
#include <minix/ipc.h>
/* Device table. This table is indexed by major device number. It provides
* the link between major device numbers and the routines that process them.
* The table can be update dynamically. The field 'dmap_flags' describe an
* entry's current status and determines what control options are possible.
*/
#define DMAP_MUTABLE 0x01 /* mapping can be overtaken */
#define DMAP_BUSY 0x02 /* driver busy with request */
enum dev_style { STYLE_DEV, STYLE_NDEV, STYLE_TTY, STYLE_CLONE };
extern struct dmap {
int _PROTOTYPE ((*dmap_opcl), (int, Dev_t, int, int) );
void _PROTOTYPE ((*dmap_io), (int, message *) );
int dmap_driver;
int dmap_flags;
} dmap[];
#endif /* _DMAP_H */

View file

@ -15,9 +15,6 @@ typedef struct {int m2i1, m2i2, m2i3; long m2l1, m2l2; char *m2p1;} mess_2;
typedef struct {int m3i1, m3i2; char *m3p1; char m3ca1[M3_STRING];} mess_3;
typedef struct {long m4l1, m4l2, m4l3, m4l4, m4l5;} mess_4;
typedef struct {short m5c1, m5c2; int m5i1, m5i2; long m5l1, m5l2, m5l3;}mess_5;
#if 0
typedef struct {int m6i1, m6i2, m6i3; long m6l1; char *m6c1;} mess_6;
#endif
typedef struct {int m7i1, m7i2, m7i3, m7i4; char *m7p1, *m7p2;} mess_7;
typedef struct {int m8i1, m8i2; char *m8p1, *m8p2, *m8p3, *m8p4;} mess_8;
@ -30,9 +27,6 @@ typedef struct {
mess_3 m_m3;
mess_4 m_m4;
mess_5 m_m5;
#if 0
mess_6 m_m6;
#endif
mess_7 m_m7;
mess_8 m_m8;
} m_u;
@ -72,14 +66,6 @@ typedef struct {
#define m5_l2 m_u.m_m5.m5l2
#define m5_l3 m_u.m_m5.m5l3
#if 0
#define m6_i1 m_u.m_m6.m6i1
#define m6_i2 m_u.m_m6.m6i2
#define m6_i3 m_u.m_m6.m6i3
#define m6_l1 m_u.m_m6.m6l1
#define m6_c1 m_u.m_m6.m6c1
#endif
#define m7_i1 m_u.m_m7.m7i1
#define m7_i2 m_u.m_m7.m7i2
#define m7_i3 m_u.m_m7.m7i3

View file

@ -44,7 +44,7 @@ struct svrqueryparam {
};
/* A proper system call must be created later. */
#include "/usr/src/servers/fs/dmap.h"
#include <minix/dmap.h>
struct fssignon {
dev_t dev; /* Device to manage. */
enum dev_style style; /* Management style. */

View file

@ -160,10 +160,15 @@ _PROTOTYPE( int ttyslot, (void) );
_PROTOTYPE( int fttyslot, (int _fd) );
_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 getprocnr, (void) );
_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) );
#define DEV_MAP 1
#define DEV_UNMAP 2
#define mapdriver(driver, device, style) devctl(DEV_MAP, driver, device, style)
#define unmapdriver(device) devctl(DEV_UNMAP, 0, device, 0)
_PROTOTYPE( int devctl, (int ctl_req, int driver, int device, int style));
/* For compatibility with other Unix systems */
_PROTOTYPE( int getpagesize, (void) );