diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index 1e32d32cb..d0a664697 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -19,7 +19,6 @@ #include -#if ENABLE_AT_WINI #define ATAPI_DEBUG 0 /* To debug ATAPI code. */ @@ -466,12 +465,14 @@ PRIVATE int w_identify() return(ERR); } +#if VERBOSE printf("%s: user-space AT Winchester driver detected ", w_name()); if (wn->state & (SMART|ATAPI)) { printf("%.40s\n", id_string); } else { printf("%ux%ux%u\n", wn->pcylinders, wn->pheads, wn->psectors); } +#endif /* Everything looks OK; register IRQ so we can stop polling. */ wn->irq = w_drive < 2 ? AT_WINI_0_IRQ : AT_WINI_1_IRQ; @@ -1250,4 +1251,3 @@ PRIVATE int atapi_intr_wait() return(r); } #endif /* ENABLE_ATAPI */ -#endif /* ENABLE_AT_WINI */ diff --git a/drivers/at_wini/at_wini.h b/drivers/at_wini/at_wini.h index b1c64ccf1..61e6af3e3 100644 --- a/drivers/at_wini/at_wini.h +++ b/drivers/at_wini/at_wini.h @@ -4,3 +4,5 @@ _PROTOTYPE(void main, (void)); +#define VERBOSE 0 /* display identify messages during boot */ +#define ENABLE_ATAPI 1 /* add ATAPI cd-rom support to driver */ diff --git a/drivers/bios_wini/bios_wini.c b/drivers/bios_wini/bios_wini.c index ab2fd1ade..c58e9cfda 100644 --- a/drivers/bios_wini/bios_wini.c +++ b/drivers/bios_wini/bios_wini.c @@ -29,7 +29,6 @@ #include #include -#if ENABLE_BIOS_WINI #define ME "BIOS_WINI" @@ -473,4 +472,3 @@ message *m_ptr; return OK; } -#endif /* ENABLE_BIOS_WINI */ diff --git a/drivers/dpeth/3c501.c b/drivers/dpeth/3c501.c index d99eeba43..35ed8d092 100644 --- a/drivers/dpeth/3c501.c +++ b/drivers/dpeth/3c501.c @@ -9,6 +9,9 @@ ** network environments. ** ** $Log$ +** Revision 1.2 2005/08/03 11:53:34 jnherder +** Miscellaneous cleanups. +** ** Revision 1.1 2005/06/29 10:16:46 beng ** Import of dpeth 3c501/3c509b/.. ethernet driver by ** Giovanni Falzoni . @@ -26,7 +29,7 @@ #include #include "dp.h" -#if (ENABLE_NETWORKING == 1 && ENABLE_3C501 == 1) +#if (ENABLE_3C501 == 1) #include "3c501.h" @@ -423,6 +426,6 @@ PUBLIC int el1_probe(dpeth_t * dep) return TRUE; /* Etherlink board found */ } -#endif /* ENABLE_NETWORKING */ +#endif /* ENABLE_3C501 */ /** 3c501.c **/ diff --git a/drivers/dpeth/3c503.c b/drivers/dpeth/3c503.c index 45b4ca517..bde6d8107 100644 --- a/drivers/dpeth/3c503.c +++ b/drivers/dpeth/3c503.c @@ -9,6 +9,9 @@ ** the rest is in 8390.c Code specific for ISA bus only ** ** $Log$ +** Revision 1.2 2005/08/03 11:53:34 jnherder +** Miscellaneous cleanups. +** ** Revision 1.1 2005/06/29 10:16:46 beng ** Import of dpeth 3c501/3c509b/.. ethernet driver by ** Giovanni Falzoni . @@ -24,7 +27,7 @@ #include #include "dp.h" -#if ENABLE_NETWORKING == 1 && ENABLE_3C503 == 1 +#if (ENABLE_3C503 == 1) #include "8390.h" #include "3c503.h" @@ -170,6 +173,6 @@ int el2_probe(dpeth_t * dep) dep->de_stopf = el2_stop; return TRUE; } -#endif /* ENABLE_NETWORKING && ENABLE_3C503 */ +#endif /* ENABLE_3C503 */ /** 3c503.c **/ diff --git a/drivers/dpeth/3c509.c b/drivers/dpeth/3c509.c index d3a182c5d..3d059a964 100644 --- a/drivers/dpeth/3c509.c +++ b/drivers/dpeth/3c509.c @@ -9,6 +9,9 @@ ** I/O base and IRQ. The driver is for ISA bus only ** ** $Log$ +** Revision 1.2 2005/08/03 11:53:34 jnherder +** Miscellaneous cleanups. +** ** Revision 1.1 2005/06/29 10:16:46 beng ** Import of dpeth 3c501/3c509b/.. ethernet driver by ** Giovanni Falzoni . @@ -27,7 +30,7 @@ #include "dp.h" -#if ENABLE_NETWORKING == 1 && ENABLE_3C509 == 1 +#if (ENABLE_3C509 == 1) #include "3c509.h" @@ -598,6 +601,6 @@ PUBLIC int el3_probe(dpeth_t * dep) return(el3_checksum(id_port) == 0); /* Etherlink board found/not found */ } -#endif /* ENABLE_NETWORKING */ +#endif /* ENABLE_3C509 */ /** 3c509.c **/ diff --git a/drivers/dpeth/8390.c b/drivers/dpeth/8390.c index 8c7231a3a..5051ad7ee 100644 --- a/drivers/dpeth/8390.c +++ b/drivers/dpeth/8390.c @@ -10,6 +10,9 @@ ** to extract the NS 8390 common functions. ** ** $Log$ +** Revision 1.2 2005/08/03 11:53:34 jnherder +** Miscellaneous cleanups. +** ** Revision 1.1 2005/06/29 10:16:46 beng ** Import of dpeth 3c501/3c509b/.. ethernet driver by ** Giovanni Falzoni . @@ -27,7 +30,7 @@ #include #include "dp.h" -#if (ENABLE_NETWORKING == 1 && ENABLE_DP8390 == 1) +#if (ENABLE_DP8390 == 1) #define PIO16 0 /* NOTE: pio 16 functions missing */ @@ -734,6 +737,6 @@ static void dp_pio16_nic2user(dpeth_t * dep, int nic_addr, int count) #endif /* PIO16 == 1 */ -#endif /* ENABLE_NETWORKING && ENABLE_DP8390 */ +#endif /* ENABLE_DP8390 */ /** end 8390.c **/ diff --git a/drivers/dpeth/devio.c b/drivers/dpeth/devio.c index ee16fdacb..5f9aa21e6 100644 --- a/drivers/dpeth/devio.c +++ b/drivers/dpeth/devio.c @@ -7,6 +7,9 @@ ** from/to the device registers. ** ** $Log$ +** Revision 1.2 2005/08/03 11:53:34 jnherder +** Miscellaneous cleanups. +** ** Revision 1.1 2005/06/29 10:16:46 beng ** Import of dpeth 3c501/3c509b/.. ethernet driver by ** Giovanni Falzoni . @@ -22,8 +25,7 @@ #include #include "dp.h" -#if ENABLE_NETWORKING == 1 -#if USE_IOPL == 0 +#if (USE_IOPL == 0) static void warning(const char *type, int err) { @@ -137,5 +139,4 @@ PUBLIC void outsw(unsigned short port, int proc_nr, void *buffer, int count) #else #error To be implemented #endif /* USE_IOPL */ -#endif /* ENABLE_NETWORKING */ /** devio.c **/ diff --git a/drivers/dpeth/dp.h b/drivers/dpeth/dp.h index 6f098accc..d331e36a7 100644 --- a/drivers/dpeth/dp.h +++ b/drivers/dpeth/dp.h @@ -6,6 +6,9 @@ ** Interface description for ethernet device driver ** ** $Log$ +** Revision 1.3 2005/08/03 11:53:34 jnherder +** Miscellaneous cleanups. +** ** Revision 1.2 2005/08/02 15:30:35 jnherder ** Various updates to support dynamically starting drivers. ** Output during initialization should be suppressed. Unless an error occurs. @@ -29,8 +32,6 @@ #undef ENABLE_WDETH #undef ENABLE_DP8390 -#define ENABLE_NETWORKING 1 - #define ENABLE_3C501 1 /* enable 3Com Etherlink I board */ #define ENABLE_3C503 1 /* enable 3Com Etherlink II board */ #define ENABLE_3C509 1 /* enable 3Com Etherlink III board */ diff --git a/drivers/dpeth/ne.c b/drivers/dpeth/ne.c index 4829e18e2..0e40e4ee2 100644 --- a/drivers/dpeth/ne.c +++ b/drivers/dpeth/ne.c @@ -12,6 +12,9 @@ ** Adapted to interface new main network task. ** ** $Log$ +** Revision 1.2 2005/08/03 11:53:34 jnherder +** Miscellaneous cleanups. +** ** Revision 1.1 2005/06/29 10:16:46 beng ** Import of dpeth 3c501/3c509b/.. ethernet driver by ** Giovanni Falzoni . @@ -27,7 +30,7 @@ #include #include "dp.h" -#if (ENABLE_NETWORKING == 1 && ENABLE_NE2000 == 1) +#if (ENABLE_NE2000 == 1) #include "8390.h" #include "ne.h" @@ -196,6 +199,6 @@ PUBLIC int ne_probe(dpeth_t * dep) return TRUE; } -#endif /* ENABLE_NETWORKING && ENABLE_NE2000 */ +#endif /* ENABLE_NE2000 */ /** ne.c **/ diff --git a/drivers/dpeth/netbuff.c b/drivers/dpeth/netbuff.c index 327fcf74c..70d96e885 100644 --- a/drivers/dpeth/netbuff.c +++ b/drivers/dpeth/netbuff.c @@ -7,6 +7,9 @@ ** for network packets. ** ** $Log$ +** Revision 1.2 2005/08/03 11:53:34 jnherder +** Miscellaneous cleanups. +** ** Revision 1.1 2005/06/29 10:16:46 beng ** Import of dpeth 3c501/3c509b/.. ethernet driver by ** Giovanni Falzoni . @@ -22,7 +25,7 @@ #include #include "dp.h" -#if ENABLE_NETWORKING == 1 && HAVE_BUFFERS == 1 +#if (HAVE_BUFFERS == 1) static m_hdr_t *allocptr = NULL; static char tx_rx_buff[8192]; @@ -171,6 +174,6 @@ PUBLIC void user2mem(dpeth_t *dep, buff_t *txbuff) return; } -#endif /* ENABLE_NETWORKING */ +#endif /* HAVE_BUFFERS */ /** netbuff.c **/ diff --git a/drivers/dpeth/wd.c b/drivers/dpeth/wd.c index 6ac888d24..e506b4fb2 100644 --- a/drivers/dpeth/wd.c +++ b/drivers/dpeth/wd.c @@ -12,6 +12,9 @@ ** Adaptation to interfacing new main network task. ** ** $Log$ +** Revision 1.2 2005/08/03 11:53:34 jnherder +** Miscellaneous cleanups. +** ** Revision 1.1 2005/06/29 10:16:46 beng ** Import of dpeth 3c501/3c509b/.. ethernet driver by ** Giovanni Falzoni . @@ -27,7 +30,7 @@ #include #include "dp.h" -#if (ENABLE_NETWORKING == 1 && ENABLE_WDETH == 1) +#if (ENABLE_WDETH == 1) #include "8390.h" #include "wd.h" @@ -318,6 +321,6 @@ dpeth_t *dep; return tlb == E_TLB_SMC8216C; } -#endif /* ENABLE_NETWORKING && ENABLE_WDETH */ +#endif /* ENABLE_WDETH */ /** wd.c **/ diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index 260f040e9..2a80de1fc 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -57,10 +57,6 @@ #define printW() ((void)0) #define vm_1phys2bus(p) (p) -#if !ENABLE_PCI -#error PCI support not enabled -#endif - #include "assert.h" #include "../libpci/pci.h" #include "fxp.h" diff --git a/drivers/libdriver/driver.c b/drivers/libdriver/driver.c index b6bcc2e1f..a95f7014b 100644 --- a/drivers/libdriver/driver.c +++ b/drivers/libdriver/driver.c @@ -41,7 +41,7 @@ #if (CHIP == INTEL) -#if ENABLE_AHA1540_SCSI && DMA_BUF_SIZE < 2048 +#if USE_EXTRA_DMA_BUF && DMA_BUF_SIZE < 2048 /* A bit extra scratch for the Adaptec driver. */ #define BUF_EXTRA (2048 - DMA_BUF_SIZE) #else diff --git a/drivers/libdriver/driver.h b/drivers/libdriver/driver.h index 884a5bd6e..52d84e336 100644 --- a/drivers/libdriver/driver.h +++ b/drivers/libdriver/driver.h @@ -79,6 +79,7 @@ _PROTOTYPE( int do_diocntl, (struct driver *dp, message *m_ptr) ); #define SECTOR_MASK 511 /* and remainder */ /* Size of the DMA buffer buffer in bytes. */ +#define USE_EXTRA_DMA_BUF 0 /* usually not needed */ #define DMA_BUF_SIZE (DMA_SECTORS * SECTOR_SIZE) #if (CHIP == INTEL) diff --git a/drivers/libpci/pci.c b/drivers/libpci/pci.c index ebcb761e8..55403be12 100644 --- a/drivers/libpci/pci.c +++ b/drivers/libpci/pci.c @@ -22,7 +22,6 @@ Created: Jan 2000 by Philip Homburg #include "config.h" #endif -#if ENABLE_PCI #if !__minix_vmd #define debug 0 @@ -1317,7 +1316,6 @@ u16_t value; outl(PCII_CONFADD, PCII_UNSEL); #endif } -#endif /* ENABLE_PCI */ /* * $PchId: pci.c,v 1.7 2003/08/07 09:06:51 philip Exp $ diff --git a/drivers/libpci/pci.h b/drivers/libpci/pci.h index 77d2d2409..6d8e127cc 100644 --- a/drivers/libpci/pci.h +++ b/drivers/libpci/pci.h @@ -4,7 +4,6 @@ pci.h Created: Jan 2000 by Philip Homburg */ -#if ENABLE_PCI /* tempory functions: to be replaced later (see pci_intel.h) */ _PROTOTYPE( unsigned pci_inb, (U16_t port) ); @@ -31,7 +30,6 @@ _PROTOTYPE( u32_t pci_attr_r32, (int devind, int port) ); _PROTOTYPE( void pci_attr_w16, (int devind, int port, U16_t value) ); _PROTOTYPE( void pci_attr_w32, (int devind, int port, u32_t value) ); -#endif /* ENABLE_PCI */ #define PCI_VID 0x00 /* Vendor ID, 16-bit */ #define PCI_DID 0x02 /* Device ID, 16-bit */ diff --git a/drivers/libpci/pci_table.c b/drivers/libpci/pci_table.c index cb6e49870..b5cbac39d 100644 --- a/drivers/libpci/pci_table.c +++ b/drivers/libpci/pci_table.c @@ -19,7 +19,6 @@ See the Linux PCI ID Repository . #include "config.h" #endif -#if ENABLE_PCI struct pci_vendor pci_vendor_table[]= { @@ -257,7 +256,6 @@ struct pci_pcibridge pci_pcibridge[]= { 0x1106, 0x8305, PCI_AGPB_VIA, }, /* VIA VT8365 [KM133 AGP] */ { 0x0000, 0x0000, 0, }, }; -#endif /* ENABLE_PCI */ /* * $PchId: pci_table.c,v 1.7 2003/09/05 10:53:22 philip Exp $ diff --git a/drivers/memory/memory.c b/drivers/memory/memory.c index fd6f0073a..60f89633c 100644 --- a/drivers/memory/memory.c +++ b/drivers/memory/memory.c @@ -307,9 +307,6 @@ PRIVATE void m_init() #error /* memory limit not set up */ #endif /* !(CHIP == M68000) */ #endif /* !(CHIP == INTEL) */ - - /* Initialization succeeded. Print welcome message. */ - report("MEM","user-space memory driver has been initialized.", NO_NUM); } diff --git a/drivers/rtl8139/rtl8139.c b/drivers/rtl8139/rtl8139.c index fd9d20ab1..3656cd39c 100755 --- a/drivers/rtl8139/rtl8139.c +++ b/drivers/rtl8139/rtl8139.c @@ -79,11 +79,7 @@ #define printW() ((void)0) #define vm_1phys2bus(p) (p) -#define VERBOSE 0 /* display message during init */ - -#if !ENABLE_PCI -#error PCI support not enabled -#endif +#define VERBOSE 0 /* display message during init */ #include "../libpci/pci.h" #include "rtl8139.h" diff --git a/drivers/rtl8139/rtl8139.h b/drivers/rtl8139/rtl8139.h index 1bacfc4c3..678edd759 100755 --- a/drivers/rtl8139/rtl8139.h +++ b/drivers/rtl8139/rtl8139.h @@ -4,7 +4,6 @@ ibm/rtl8139.h Created: Aug 2003 by Philip Homburg */ -#define ENABLE_RTL8139 1 #define RL_IDR 0x00 /* Ethernet address * Note: RL_9346CR_EEM_CONFIG mode is diff --git a/drivers/tty/tty.h b/drivers/tty/tty.h index 175c635a3..4dff4dd03 100644 --- a/drivers/tty/tty.h +++ b/drivers/tty/tty.h @@ -2,6 +2,7 @@ #include +#define LINEWRAP 1 /* console.c - wrap lines at column 80 */ #define TTY_IN_BYTES 256 /* tty input queue size */ #define TAB_SIZE 8 /* distance between tab stops */ diff --git a/include/minix/com.h b/include/minix/com.h index 472605286..843e2733f 100755 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -1,6 +1,5 @@ - #ifndef _MINIX_COM_H -#define _MINIX_COM_H 1 +#define _MINIX_COM_H /*===========================================================================* * Magic process numbers * @@ -32,7 +31,7 @@ /* Number of tasks. Note that NR_PROCS is defined in . */ #define NR_TASKS 4 -/* Magic numbers for controllers. Device driver mapping is dynamic. */ +/* Magic numbers for controllers. Device to driver mapping is dynamic. */ #define CTRLR(n) (NONE + (n)) /* User-space processes, that is, device drivers, servers, and INIT. */ @@ -50,6 +49,34 @@ #define NR_BOOT_PROCS (NR_TASKS + INIT_PROC_NR + 1) +/*===========================================================================* + * Major and minor device numbers * + *===========================================================================*/ + +/* Major and minor device numbers for MEMORY driver. */ +#define MEMORY_MAJOR 1 /* major device for memory devices */ +# define RAM_DEV 0 /* minor device for /dev/ram */ +# define MEM_DEV 1 /* minor device for /dev/mem */ +# define KMEM_DEV 2 /* minor device for /dev/kmem */ +# define NULL_DEV 3 /* minor device for /dev/null */ +# define BOOT_DEV 4 /* minor device for /dev/boot */ +# define RANDOM_DEV 5 /* minor device for /dev/(u)random */ +# define URANDOM_DEV RANDOM_DEV +# define ZERO_DEV 6 /* minor device for /dev/zero */ + +/* Full device numbers that are special to the boot monitor and FS. */ +# define DEV_RAM 0x0100 /* device number of /dev/ram */ +# define DEV_BOOT 0x0104 /* device number of /dev/boot */ + +#define TTY_MAJOR 4 /* major device for ttys */ +#define CTTY_MAJOR 5 /* major device for /dev/tty */ + +#define INET_MAJOR 7 /* major device for inet */ + +#define LOG_MAJOR 15 /* major device for log driver */ +# define IS_KLOG_DEV 0 /* minor device for /dev/klog */ + + /*===========================================================================* * Kernel notification types * *===========================================================================*/ @@ -68,10 +95,6 @@ # define NEW_KSIG NOTIFY_FROM(HARDWARE) /* new kernel signal */ # define FKEY_PRESSED NOTIFY_FROM(TTY_PROC_NR)/* function key press */ -#define NOTIFICATION 0x800 /* flag for notifications */ -# define DEV_SELECTED (NOTIFICATION | 5) /* select() notification */ -#define NR_NOTIFY_TYPES 6 /* nr of bits in mask */ - /* Shorthands for message parameters passed with notifications. */ #define NOTIFY_SOURCE m_source #define NOTIFY_TYPE m_type @@ -80,42 +103,24 @@ #define NOTIFY_FLAGS m2_i1 -/*===========================================================================* - * Messages for system management server * - *===========================================================================*/ - -#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 */ - - /*===========================================================================* * Messages for BLOCK and CHARACTER device drivers * *===========================================================================*/ +/* Message types for device drivers. */ #define DEV_RQ_BASE 0x400 /* base for device request types */ #define DEV_RS_BASE 0x500 /* base for device response types */ -#define CANCEL 0 /* general req to force a task to cancel */ -#define DEV_READ 3 /* fcn code for reading from tty */ -#define DEV_WRITE 4 /* fcn code for writing to tty */ -#define DEV_IOCTL 5 /* fcn code for ioctl */ -#define DEV_OPEN 6 /* fcn code for opening tty */ -#define DEV_CLOSE 7 /* fcn code for closing tty */ -#define DEV_SCATTER 8 /* fcn code for writing from a vector */ -#define DEV_GATHER 9 /* fcn code for reading into a vector */ -#define TTY_SETPGRP 10 /* fcn code for setpgroup */ -#define TTY_EXIT 11 /* a process group leader has exited */ +#define CANCEL (DEV_RQ_BASE + 0) /* general req to force a task to cancel */ +#define DEV_READ (DEV_RQ_BASE + 3) /* read from minor device */ +#define DEV_WRITE (DEV_RQ_BASE + 4) /* write to minor device */ +#define DEV_IOCTL (DEV_RQ_BASE + 5) /* I/O control code */ +#define DEV_OPEN (DEV_RQ_BASE + 6) /* open a minor device */ +#define DEV_CLOSE (DEV_RQ_BASE + 7) /* close a minor device */ +#define DEV_SCATTER (DEV_RQ_BASE + 8) /* write from a vector */ +#define DEV_GATHER (DEV_RQ_BASE + 9) /* read into a vector */ +#define TTY_SETPGRP (DEV_RQ_BASE + 10) /* set process group */ +#define TTY_EXIT (DEV_RQ_BASE + 11) /* process group leader exited */ #define DEV_SELECT (DEV_RQ_BASE + 12) /* request select() attention */ #define DEV_STATUS (DEV_RQ_BASE + 13) /* request driver status */ @@ -125,8 +130,6 @@ #define DEV_IO_READY (DEV_RS_BASE + 3) /* selected device ready */ #define DEV_NO_STATUS (DEV_RS_BASE + 4) /* empty status reply */ -#define SUSPEND -998 /* used in interrupts when tty has no data */ - /* Field names for messages to block and character device drivers. */ #define DEVICE m2_i1 /* major-minor device */ #define PROC_NR m2_i2 /* which (proc) wants I/O? */ @@ -143,6 +146,7 @@ /* Field names used in reply messages from tasks. */ #define REP_PROC_NR m2_i1 /* # of proc on whose behalf I/O was done */ #define REP_STATUS m2_i2 /* bytes transferred or error number */ +# define SUSPEND -998 /* status to suspend caller, reply later */ /* Field names for messages to TTY driver. */ #define TTY_LINE DEVICE /* message parameter: terminal line */ @@ -155,29 +159,6 @@ #define TAPE_STAT0 m2_l1 #define TAPE_STAT1 m2_l2 -/* Major and minor device numbers for MEMORY driver. */ -# define MEMORY_MAJOR 1 /* major device for memory devices */ -# define RAM_DEV 0 /* minor device for /dev/ram */ -# define MEM_DEV 1 /* minor device for /dev/mem */ -# define KMEM_DEV 2 /* minor device for /dev/kmem */ -# define NULL_DEV 3 /* minor device for /dev/null */ -# define BOOT_DEV 4 /* minor device for /dev/boot */ -# define RANDOM_DEV 5 /* minor device for /dev/(u)random */ -# define URANDOM_DEV RANDOM_DEV -# define ZERO_DEV 6 /* minor device for /dev/zero */ - -#define TTY_MAJOR 4 /* major device no. for ttys */ -#define CTTY_MAJOR 5 /* major device no. for /dev/tty */ - -#define INET_MAJOR 7 /* major device no. for inet */ - -#define LOG_MAJOR 15 /* major device no. for LOG */ -#define IS_KLOG_DEV 0 /* minor device for /dev/klog */ - -/* Full device numbers that are special to the boot monitor and FS. */ -# define DEV_RAM 0x0100 /* device number of /dev/ram */ -# define DEV_BOOT 0x0104 /* device number of /dev/boot */ - /*===========================================================================* * Messages for networking layer * @@ -417,7 +398,7 @@ #define PR_MEM_PTR m1_p1 /* tells where memory map is for sys_newmap */ /* Field names for SYS_INT86 */ -#define INT86_REG86 m1_p1 /* Point to registers */ +#define INT86_REG86 m1_p1 /* pointer to registers */ /* Field names for SELECT (FS). */ #define SEL_NFDS m8_i1 @@ -426,8 +407,28 @@ #define SEL_ERRORFDS m8_p3 #define SEL_TIMEOUT m8_p4 + /*===========================================================================* - * Miscellaneous messages, mainly used by IS * + * Messages for system management server * + *===========================================================================*/ + +#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 */ + + +/*===========================================================================* + * Miscellaneous messages used by TTY * *===========================================================================*/ /* Miscellaneous request types and field names, e.g. used by IS server. */ @@ -445,4 +446,4 @@ # define DIAG_PROC_NR m1_i2 -#endif +#endif /* _MINIX_COM_H */ diff --git a/include/minix/config.h b/include/minix/config.h index 8af7ccf49..3f92ec9f0 100755 --- a/include/minix/config.h +++ b/include/minix/config.h @@ -5,7 +5,6 @@ #define OS_RELEASE "3" #define OS_VERSION "0.6" -#define _MINIX_VERSION 3 /* This file sets configuration parameters for the MINIX kernel, FS, and PM. * It is divided up into two main sections. The first section contains @@ -53,10 +52,6 @@ #define NR_BUF_HASH 512 /* size of buf hash table; MUST BE POWER OF 2*/ #endif -/* Defines for driver and kernel configuration. */ -#define AUTO_BIOS 0 /* xt_wini.c - use Western's autoconfig BIOS */ -#define LINEWRAP 1 /* console.c - wrap lines at column 80 */ - /* Number of controller tasks (/dev/cN device classes). */ #define NR_CTRLRS 2 @@ -66,24 +61,10 @@ /* Enable or disable swapping processes to disk. */ #define ENABLE_SWAP 1 -/* Include or exclude an image of /dev/boot in the boot image. */ -#define ENABLE_BOOTDEV 0 - -/* Include or exclude device drivers. Set to 1 to include, 0 to exclude. */ -#define ENABLE_BIOS_WINI 1 /* enable BIOS winchester driver */ -#define ENABLE_ESDI_WINI 0 /* enable ESDI winchester driver */ -#define ENABLE_XT_WINI 0 /* enable XT winchester driver */ -#define ENABLE_AHA1540 0 /* enable Adaptec 1540 SCSI driver */ -#define ENABLE_FATFILE 0 /* enable FAT file virtual disk driver */ -#define ENABLE_DOSFILE 0 /* enable DOS file virtual disk driver */ -#define ENABLE_SB16 0 /* enable Soundblaster audio driver */ -#define ENABLE_PCI 1 /* enable PCI device recognition */ - -/* Include or exclude user-level device drivers (and supporting servers). */ -#define ENABLE_PRINTER 0 /* user-level Centronics printer driver */ -#define ENABLE_FLOPPY 0 /* enable floppy disk driver */ -#define ENABLE_AT_WINI 1 /* enable AT winchester driver */ -#define ENABLE_ATAPI 1 /* add ATAPI support to AT driver */ +/* Include or exclude an image of /dev/boot in the boot image. + * Please update the makefile in /usr/src/tools/ as well. + */ +#define ENABLE_BOOTDEV 1 /* DMA_SECTORS may be increased to speed up DMA based drivers. */ #define DMA_SECTORS 1 /* DMA buffer size (must be >= 1) */ diff --git a/kernel/main.c b/kernel/main.c index fd873fe18..9436542cb 100755 --- a/kernel/main.c +++ b/kernel/main.c @@ -139,7 +139,7 @@ PUBLIC void main() alloc_segments(rp); } -#if ENABLE_BOOTDEV +#if ENABLE_BOOTDEV /* Expect an image of the boot device to be loaded into memory as well. * The boot device is the last module that is loaded into memory, and, * for example, can contain the root FS (useful for embedded systems). diff --git a/kernel/table.c b/kernel/table.c index 3f245fce9..077061131 100755 --- a/kernel/table.c +++ b/kernel/table.c @@ -78,12 +78,8 @@ PUBLIC struct boot_image image[] = { { TTY_PROC_NR, 0, SERV_F, 16, 1, 0, SERV_T, SYST_M, "TTY" }, { MEM_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, DRIV_M, "MEMORY" }, { LOG_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, SYST_M, "LOG" }, -#if ENABLE_AT_WINI { AT_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, DRIV_M, "AT_WINI" }, -#endif -#if ENABLE_BIOS_WINI { BIOS_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, SYST_M, "BIOS" }, -#endif { INIT_PROC_NR, 0, USER_F, 8, USER_Q, 0, USER_T, USER_M, "INIT" }, }; diff --git a/servers/fs/dmap.c b/servers/fs/dmap.c index 8d3655d5c..5aed75220 100644 --- a/servers/fs/dmap.c +++ b/servers/fs/dmap.c @@ -14,6 +14,7 @@ #define DT(enable, opcl, io, driver, flags) \ { (enable?(opcl):no_dev), (enable?(io):0), \ (enable?(driver):0), (flags) }, +#define NC(x) (NR_CTRLRS >= (x)) /* The order of the entries here determines the mapping between major device * numbers and tasks. The first entry (major device 0) is not used. The @@ -28,24 +29,24 @@ -------------- -------- ------ ----------- ----- ------ ---- */ struct dmap dmap[NR_DEVICES] = { - DT(1, no_dev, 0, 0, 0) /* 0 = not used */ - DT(1, gen_opcl, gen_io, MEM_PROC_NR, 0) /* 1 = /dev/mem */ - DT(ENABLE_FLOPPY, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /* 2 = /dev/fd0 */ - DT(NR_CTRLRS >= 1, gen_opcl, gen_io, CTRLR(0),DMAP_MUTABLE) /* 3 = /dev/c0 */ - DT(1, tty_opcl, gen_io, TTY_PROC_NR, 0) /* 4 = /dev/tty00 */ - DT(1, ctty_opcl,ctty_io,TTY_PROC_NR, 0) /* 5 = /dev/tty */ - DT(ENABLE_PRINTER, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /* 6 = /dev/lp */ + DT(1, no_dev, 0, 0, 0) /* 0 = not used */ + DT(1, gen_opcl, gen_io, MEM_PROC_NR, 0) /* 1 = /dev/mem */ + DT(0, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /* 2 = /dev/fd0 */ + DT(NC(1), gen_opcl, gen_io, CTRLR(0), DMAP_MUTABLE) /* 3 = /dev/c0 */ + DT(1, tty_opcl, gen_io, TTY_PROC_NR, 0) /* 4 = /dev/tty00 */ + DT(1, ctty_opcl,ctty_io,TTY_PROC_NR, 0) /* 5 = /dev/tty */ + DT(0, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /* 6 = /dev/lp */ #if (MACHINE == IBM_PC) - DT(1, no_dev, 0, 0, DMAP_MUTABLE) /* 7 = /dev/ip */ - DT(NR_CTRLRS >= 2, gen_opcl, gen_io, CTRLR(1),DMAP_MUTABLE) /* 8 = /dev/c1 */ - DT(0, 0, 0, 0, DMAP_MUTABLE) /* 9 = not used */ - DT(NR_CTRLRS >= 3, gen_opcl, gen_io, CTRLR(2),DMAP_MUTABLE) /*10 = /dev/c2 */ - DT(0, 0, 0, 0, DMAP_MUTABLE) /*11 = not used */ - DT(NR_CTRLRS >= 4, gen_opcl, gen_io, CTRLR(3),DMAP_MUTABLE) /*12 = /dev/c3 */ - DT(ENABLE_SB16, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /*13 = /dev/audio */ - DT(ENABLE_SB16, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /*14 = /dev/mixer */ - DT(1, gen_opcl, gen_io, LOG_PROC_NR, 0) /*15 = /dev/klog */ + DT(1, no_dev, 0, 0, DMAP_MUTABLE) /* 7 = /dev/ip */ + DT(NC(2), gen_opcl, gen_io, CTRLR(1), DMAP_MUTABLE) /* 8 = /dev/c1 */ + DT(0, 0, 0, 0, DMAP_MUTABLE) /* 9 = not used */ + DT(NC(3), gen_opcl, gen_io, CTRLR(2), DMAP_MUTABLE) /*10 = /dev/c2 */ + DT(0, 0, 0, 0, DMAP_MUTABLE) /*11 = not used */ + DT(NC(4), gen_opcl, gen_io, CTRLR(3), DMAP_MUTABLE) /*12 = /dev/c3 */ + DT(0, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /*13 = /dev/audio */ + DT(0, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /*14 = /dev/mixer */ + DT(1, gen_opcl, gen_io, LOG_PROC_NR, 0) /*15 = /dev/klog */ #endif /* IBM_PC */ }; @@ -146,7 +147,7 @@ PUBLIC void map_controllers() ctrlr_nr[1] = '0' + c; if ((s = get_mon_param(ctrlr_nr, ctrlr_type, 8)) != OK) { if (s != ESRCH) - printf("FS: warning, couldn't get monitor param: %d\n", s); + panic(__FILE__,"couldn't get monitor param", s); continue; } for (dp = drivertab; @@ -155,10 +156,13 @@ PUBLIC void map_controllers() if ((s=findproc(dp->proc_name, &proc_nr)) == OK) { for (i=0; i< NR_DEVICES; i++) { /* find mapping */ if (dmap[i].dmap_driver == CTRLR(c)) { - if (map_driver(i, proc_nr, STYLE_DEV) == OK) { - printf("FS: controller %s (%s) mapped to %s driver (proc. nr %d)\n", - ctrlr_nr, dp->wini_type, dp->proc_name, dmap[i].dmap_driver); + if ((s=map_driver(i, proc_nr, STYLE_DEV)) != OK) { + panic(__FILE__,"map_driver failed",s); } +#if VERBOSE + printf("FS: controller %s (%s) mapped to %s driver (nr %d)\n", + ctrlr_nr, dp->wini_type, dp->proc_name, dmap[i].dmap_driver); +#endif } } } diff --git a/servers/fs/fs.h b/servers/fs/fs.h index af5c6a48f..544d28c97 100644 --- a/servers/fs/fs.h +++ b/servers/fs/fs.h @@ -5,6 +5,8 @@ #define _MINIX 1 /* tell headers to include MINIX stuff */ #define _SYSTEM 1 /* tell headers that this is the kernel */ +#define VERBOSE 0 /* show messages during initialization? */ + /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ #include /* MUST be second */ diff --git a/servers/fs/main.c b/servers/fs/main.c index 1b8d01ba0..97857db5e 100644 --- a/servers/fs/main.c +++ b/servers/fs/main.c @@ -72,8 +72,6 @@ PUBLIC void main() * currently only in use for select(). Check it. */ fs_expire_timers(m_in.NOTIFY_TIMESTAMP); - } else if (call_nr == DEV_SELECTED) { - printf("Old select device callback received - ignored\n"); } else if ((call_nr & NOTIFY_MESSAGE)) { /* Device notifies us of an event. */ dev_status(&m_in); diff --git a/servers/inet/inet.c b/servers/inet/inet.c index d033a567a..a2bcd4844 100644 --- a/servers/inet/inet.c +++ b/servers/inet/inet.c @@ -149,22 +149,12 @@ PUBLIC void main() } init_rand256(randbits); -#if DEAD_CODE - /* Sign on as a server at all offices in the proper order. */ - if (svrctl(MMSIGNON, (void *) NULL) == -1) { - printf("inet: server signon failed\n"); - exit(1); - } -#endif #ifdef __minix_vmd if (svrctl(SYSSIGNON, (void *) &info) == -1) pause(); /* Our new identity as a server. */ this_proc = info.proc_nr; #else /* Minix 3 */ -#if DEAD_CODE - if (svrctl(SYSSIGNON, (void *) NULL) == -1) pause(); -#endif /* Our new identity as a server. */ if ((this_proc = getprocnr()) < 0) diff --git a/servers/sm/sm.c b/servers/sm/sm.c index 9b520e691..a00484c83 100644 --- a/servers/sm/sm.c +++ b/servers/sm/sm.c @@ -100,9 +100,6 @@ PRIVATE void init_server(void) if (sigaction(SIGTERM, &sa, NULL)<0) panic("SM","sigaction failed", errno); if (sigaction(SIGABRT, &sa, NULL)<0) panic("SM","sigaction failed", errno); if (sigaction(SIGHUP, &sa, NULL)<0) panic("SM","sigaction failed", errno); - - /* Report successfull start. */ - report("SM","system service manager successfully initialized", NO_NUM); } diff --git a/tools/Makefile b/tools/Makefile index 90ab4bfc4..fc1227717 100755 --- a/tools/Makefile +++ b/tools/Makefile @@ -17,7 +17,7 @@ PROGRAMS= ../kernel/kernel \ ../drivers/at_wini/at_wini \ ../drivers/bios_wini/bios_wini \ ../servers/init/init \ -# bootdev.img + bootdev.img usage: @echo " " >&2