cd ftpd && $(MAKE) $@
cd ibm && $(MAKE) $@
cd kermit && $(MAKE) $@
- cd kermit_211 && $(MAKE) $@
+# cd kermit_211 && $(MAKE) $@
cd m4 && $(MAKE) $@
cd make && $(MAKE) $@
cd mined && $(MAKE) $@
#define NODENAME ((unsigned) 0x02)
#define RELEASE ((unsigned) 0x04)
#define VERSION ((unsigned) 0x08)
-#define MACHINE ((unsigned) 0x10)
+#define U_MACHINE ((unsigned) 0x10)
#define ARCH ((unsigned) 0x20)
_PROTOTYPE(int main, (int argc, char **argv ));
for (p = &argv[1][1]; *p; p++) {
switch (*p) {
case 'a': info |= ALL; break;
- case 'm': info |= MACHINE; break;
+ case 'm': info |= U_MACHINE; break;
case 'n': info |= NODENAME; break;
case 'r': info |= RELEASE; break;
case 's': info |= SYSNAME; break;
print(STDOUT_FILENO, " ", (char *) NULL);
print(STDOUT_FILENO, un.version, (char *) NULL);
}
- if ((info & MACHINE) != 0) {
+ if ((info & U_MACHINE) != 0) {
if ((info & (SYSNAME|NODENAME|RELEASE|VERSION)) != 0)
print(STDOUT_FILENO, " ", (char *) NULL);
print(STDOUT_FILENO, un.machine, (char *) NULL);
}
if ((info & ARCH) != 0) {
- if ((info & (SYSNAME|NODENAME|RELEASE|VERSION|MACHINE)) != 0)
+ if ((info & (SYSNAME|NODENAME|RELEASE|VERSION|U_MACHINE)) != 0)
print(STDOUT_FILENO, " ", (char *) NULL);
print(STDOUT_FILENO, un.arch, (char *) NULL);
}
*/
#define ASSERT_STROBE 0x1D /* strobe a character to the interface */
#define NEGATE_STROBE 0x1C /* enable interrupt on interface */
-#define SELECT 0x0C /* select printer bit */
+#define PR_SELECT 0x0C /* select printer bit */
#define INIT_PRINTER 0x08 /* init printer bits */
/* Status bits (in port_base + 2).
sys_outb(port_base + 2, INIT_PRINTER);
tickdelay(1); /* easily satisfies Centronics minimum */
/* was 2 millisecs; now is ~17 millisecs */
- sys_outb(port_base + 2, SELECT);
+ sys_outb(port_base + 2, PR_SELECT);
sys_irqsetpolicy(PRINTER_IRQ, 0, &irq_hook_id);
sys_irqenable(&irq_hook_id);
* when the printer is busy with a previous character, because the
* interrupt status does not affect the printer.
*/
- sys_outb(port_base + 2, SELECT);
+ sys_outb(port_base + 2, PR_SELECT);
sys_irqenable(&irq_hook_id);
return;
}
-#define NCALLS 85 /* number of system calls allowed */
+#define NCALLS 86 /* number of system calls allowed */
#define EXIT 1
#define FORK 2
#define FSTATFS 82 /* to FS */
#define ALLOCMEM 83 /* to PM */
#define FREEMEM 84 /* to PM */
+#define SELECT 85 /* to FS */
/* Minix release and version numbers. */
#define OS_RELEASE "3"
-#define OS_VERSION "0.4"
+#define OS_VERSION "0.5"
/* This file sets configuration parameters for the MINIX kernel, FS, and PM.
* It is divided up into two main sections. The first section contains
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;
typedef struct {
int m_source; /* who sent the message */
mess_6 m_m6;
#endif
mess_7 m_m7;
+ mess_8 m_m8;
} m_u;
} message;
#define m7_p1 m_u.m_m7.m7p1
#define m7_p2 m_u.m_m7.m7p2
+#define m8_i1 m_u.m_m8.m8i1
+#define m8_i2 m_u.m_m8.m8i2
+#define m8_p1 m_u.m_m8.m8p1
+#define m8_p2 m_u.m_m8.m8p2
+#define m8_p3 m_u.m_m8.m8p3
+#define m8_p4 m_u.m_m8.m8p4
+
/*==========================================================================*
* Minix run-time system (IPC). *
/*==========================================================================*
* Minix system library. *
*==========================================================================*/
+_PROTOTYPE( int printf, (const char *fmt, ...) );
+_PROTOTYPE( void kputc, (int c) );
_PROTOTYPE( int _taskcall, (int who, int syscallnr, message *msgptr) );
_PROTOTYPE( int sys_abort, (int how, ...) );
--- /dev/null
+
+#ifndef _SYS_SELECT_H
+#define _SYS_SELECT_H 1
+
+#ifdef _POSIX_SOURCE
+
+#include <time.h>
+#include <sys/types.h>
+#include <limits.h>
+
+/* Use this datatype as basic storage unit in fd_set */
+typedef u32_t _fdsetword;
+
+/* This many bits fit in an fd_set word. */
+#define _FDSETBITSPERWORD (sizeof(_fdsetword)*8)
+
+/* We want to store OPEN_MAX fd bits. */
+#define _FDSETWORDS ((OPEN_MAX+_FDSETBITSPERWORD-1)/_FDSETBITSPERWORD)
+
+/* This means we can store all of OPEN_MAX. */
+#define FD_SETSIZE OPEN_MAX
+
+typedef struct {
+ _fdsetword _fdsetval[_FDSETWORDS];
+} fd_set;
+
+_PROTOTYPE( int select, (int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout) );
+
+_PROTOTYPE( void FD_CLR, (int fd, fd_set *fdset));
+_PROTOTYPE( void FD_ISSET, (int fd, fd_set *fdset));
+_PROTOTYPE( void FD_SET, (int fd, fd_set *fdset));
+_PROTOTYPE( void FD_ZERO, (fd_set *fdset));
+
+#endif /* _POSIX_SOURCE */
+
+#endif /* _SYS_SELECT_H */
+
$(LIBRARY)(_rename.o) \
$(LIBRARY)(_rewinddir.o) \
$(LIBRARY)(_rmdir.o) \
+ $(LIBRARY)(_select.o) \
$(LIBRARY)(_setgid.o) \
$(LIBRARY)(_setsid.o) \
$(LIBRARY)(_setuid.o) \
$(LIBRARY)(_rmdir.o): _rmdir.c
$(CC1) _rmdir.c
+$(LIBRARY)(_select.o): _select.c
+ $(CC1) _select.c
+
$(LIBRARY)(_setgid.o): _setgid.c
$(CC1) _setgid.c
--- /dev/null
+
+#include <lib.h>
+#include <sys/select.h>
+
+PUBLIC int select(int nfds,
+ fd_set *readfds, fd_set *writefds, fd_set *errorfds,
+ struct timeval *timeout)
+{
+ message m;
+
+ m.m8_i1 = nfds;
+ m.m8_p1 = (char *) readfds;
+ m.m8_p2 = (char *) writefds;
+ m.m8_p3 = (char *) errorfds;
+ m.m8_p4 = (char *) timeout;
+
+ return (_syscall(FS, SELECT, &m));
+}
OBJ = main.o open.o read.o write.o pipe.o dmap.o dmp.o \
device.o path.o mount.o link.o super.o inode.o \
cache.o cache2.o filedes.o stadir.o protect.o time.o \
- cmostime.o lock.o misc.o utility.o table.o
+ cmostime.o lock.o misc.o utility.o select.o table.o
# build local binary
all build: $(SERVER)
# dependencies
a= fs.h $h/config.h $s/types.h $h/const.h $h/type.h \
- $i/limits.h $i/errno.h $i/ansi.h $h/syslib.h $h/utils.h \
+ $i/limits.h $i/errno.h $i/ansi.h $h/syslib.h \
const.h type.h proto.h glo.h $s/dir.h
cache.o: $a
_PROTOTYPE( int do_write, (void) );
_PROTOTYPE( struct buf *new_block, (struct inode *rip, off_t position) );
_PROTOTYPE( void zero_block, (struct buf *bp) );
+
+/* select.c */
+_PROTOTYPE( int do_select, (void) );
+
--- /dev/null
+/* Implement entry point to select system call.
+ *
+ * The entry points into this file are
+ * do_select: perform the SELECT system call
+ */
+
+#include "fs.h"
+
+/*===========================================================================*
+ * do_select *
+ *===========================================================================*/
+PUBLIC int do_select(void)
+{
+ return OK;
+}
+
do_fstatfs, /* 82 = fstatfs */
no_sys, /* 83 = memalloc */
no_sys, /* 84 = memfree */
+ do_select, /* 85 = select */
};
/* This should not fail with "array size is negative": */
extern int dummy[sizeof(call_vec) == NCALLS * sizeof(call_vec[0]) ? 1 : -1];
no_sys, /* 82 = fstatfs */
do_allocmem, /* 83 = memalloc */
do_freemem, /* 84 = memfree */
+ no_sys, /* 85 = select */
};
/* This should not fail with "array size is negative": */
extern int dummy[sizeof(call_vec) == NCALLS * sizeof(call_vec[0]) ? 1 : -1];
read dev || exit 1
TMPDISK=/dev/$dev
-echo "Temporary (sub)partition to use for storage in /tmp?"
-echo "It will be mkfsed!"
-echo -n "Device: /dev/"
-read tmpdev || exit 1
-TMPTMPDISK=/dev/$tmpdev
-
if [ -b $TMPDISK ]
then :
else echo "$TMPDISK is not a block device.."
exit 1
fi
-if [ -b $TMPTMPDISK ]
-then :
-else echo "$TMPDISK is not a block device.."
- exit 1
-fi
-
umount $TMPDISK
-umount $TMPTMPDISK
umount $RAM
( cd .. && make clean )
mount $RAM $RELEASEDIR || exit
mkdir -m 755 $RELEASEDIR/usr
mkdir -m 1777 $RELEASEDIR/tmp
-umount $TMPTMPDISK
-mkfs $TMPTMPDISK || exit
-mount $TMPTMPDISK $RELEASEDIR/tmp || exit 1
mkfs -B 1024 $TMPDISK || exit
echo " * mounting $TMPDISK as $RELEASEDIR/usr"
echo " * Chroot build done"
cp issue.install $RELEASEDIR/etc/issue
umount $TMPDISK || exit
-umount $TMPTMPDISK || exit
umount $RAM || exit
cp $RAM $ROOTIMAGE
make programs image