small compile fixes; initial select() stubs; release.sh script doesn't

need /tmp any more since 16MB root device; increase to 3.0.5 to make new
CD with working FXP driver. (not tagged 3.0.5 yet as at driver bios-copy
workaround hasn't been done.)
This commit is contained in:
Ben Gras 2005-06-06 11:40:32 +00:00
parent 9392dde997
commit e44e9ad261
16 changed files with 105 additions and 29 deletions

View file

@ -29,7 +29,7 @@ all install clean:
cd ftpd && $(MAKE) $@ cd ftpd && $(MAKE) $@
cd ibm && $(MAKE) $@ cd ibm && $(MAKE) $@
cd kermit && $(MAKE) $@ cd kermit && $(MAKE) $@
cd kermit_211 && $(MAKE) $@ # cd kermit_211 && $(MAKE) $@
cd m4 && $(MAKE) $@ cd m4 && $(MAKE) $@
cd make && $(MAKE) $@ cd make && $(MAKE) $@
cd mined && $(MAKE) $@ cd mined && $(MAKE) $@

View file

@ -24,7 +24,7 @@
#define NODENAME ((unsigned) 0x02) #define NODENAME ((unsigned) 0x02)
#define RELEASE ((unsigned) 0x04) #define RELEASE ((unsigned) 0x04)
#define VERSION ((unsigned) 0x08) #define VERSION ((unsigned) 0x08)
#define MACHINE ((unsigned) 0x10) #define U_MACHINE ((unsigned) 0x10)
#define ARCH ((unsigned) 0x20) #define ARCH ((unsigned) 0x20)
_PROTOTYPE(int main, (int argc, char **argv )); _PROTOTYPE(int main, (int argc, char **argv ));
@ -75,7 +75,7 @@ char **argv;
for (p = &argv[1][1]; *p; p++) { for (p = &argv[1][1]; *p; p++) {
switch (*p) { switch (*p) {
case 'a': info |= ALL; break; case 'a': info |= ALL; break;
case 'm': info |= MACHINE; break; case 'm': info |= U_MACHINE; break;
case 'n': info |= NODENAME; break; case 'n': info |= NODENAME; break;
case 'r': info |= RELEASE; break; case 'r': info |= RELEASE; break;
case 's': info |= SYSNAME; break; case 's': info |= SYSNAME; break;
@ -113,13 +113,13 @@ char **argv;
print(STDOUT_FILENO, " ", (char *) NULL); print(STDOUT_FILENO, " ", (char *) NULL);
print(STDOUT_FILENO, un.version, (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) if ((info & (SYSNAME|NODENAME|RELEASE|VERSION)) != 0)
print(STDOUT_FILENO, " ", (char *) NULL); print(STDOUT_FILENO, " ", (char *) NULL);
print(STDOUT_FILENO, un.machine, (char *) NULL); print(STDOUT_FILENO, un.machine, (char *) NULL);
} }
if ((info & ARCH) != 0) { 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, " ", (char *) NULL);
print(STDOUT_FILENO, un.arch, (char *) NULL); print(STDOUT_FILENO, un.arch, (char *) NULL);
} }

View file

@ -55,7 +55,7 @@
*/ */
#define ASSERT_STROBE 0x1D /* strobe a character to the interface */ #define ASSERT_STROBE 0x1D /* strobe a character to the interface */
#define NEGATE_STROBE 0x1C /* enable interrupt on 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 */ #define INIT_PRINTER 0x08 /* init printer bits */
/* Status bits (in port_base + 2). /* Status bits (in port_base + 2).
@ -285,7 +285,7 @@ PRIVATE void do_initialize()
sys_outb(port_base + 2, INIT_PRINTER); sys_outb(port_base + 2, INIT_PRINTER);
tickdelay(1); /* easily satisfies Centronics minimum */ tickdelay(1); /* easily satisfies Centronics minimum */
/* was 2 millisecs; now is ~17 millisecs */ /* 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_irqsetpolicy(PRINTER_IRQ, 0, &irq_hook_id);
sys_irqenable(&irq_hook_id); sys_irqenable(&irq_hook_id);
@ -332,7 +332,7 @@ PRIVATE void do_printer_output()
* when the printer is busy with a previous character, because the * when the printer is busy with a previous character, because the
* interrupt status does not affect the printer. * 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); sys_irqenable(&irq_hook_id);
return; return;
} }

View file

@ -1,4 +1,4 @@
#define NCALLS 85 /* number of system calls allowed */ #define NCALLS 86 /* number of system calls allowed */
#define EXIT 1 #define EXIT 1
#define FORK 2 #define FORK 2
@ -73,3 +73,4 @@
#define FSTATFS 82 /* to FS */ #define FSTATFS 82 /* to FS */
#define ALLOCMEM 83 /* to PM */ #define ALLOCMEM 83 /* to PM */
#define FREEMEM 84 /* to PM */ #define FREEMEM 84 /* to PM */
#define SELECT 85 /* to FS */

View file

@ -3,7 +3,7 @@
/* Minix release and version numbers. */ /* Minix release and version numbers. */
#define OS_RELEASE "3" #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. /* This file sets configuration parameters for the MINIX kernel, FS, and PM.
* It is divided up into two main sections. The first section contains * It is divided up into two main sections. The first section contains

View file

@ -19,6 +19,7 @@ typedef struct {short m5c1, m5c2; int m5i1, m5i2; long m5l1, m5l2, m5l3;}mess_5;
typedef struct {int m6i1, m6i2, m6i3; long m6l1; char *m6c1;} mess_6; typedef struct {int m6i1, m6i2, m6i3; long m6l1; char *m6c1;} mess_6;
#endif #endif
typedef struct {int m7i1, m7i2, m7i3, m7i4; char *m7p1, *m7p2;} mess_7; 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 { typedef struct {
int m_source; /* who sent the message */ int m_source; /* who sent the message */
@ -33,6 +34,7 @@ typedef struct {
mess_6 m_m6; mess_6 m_m6;
#endif #endif
mess_7 m_m7; mess_7 m_m7;
mess_8 m_m8;
} m_u; } m_u;
} message; } message;
@ -85,6 +87,13 @@ typedef struct {
#define m7_p1 m_u.m_m7.m7p1 #define m7_p1 m_u.m_m7.m7p1
#define m7_p2 m_u.m_m7.m7p2 #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 run-time system (IPC). *

View file

@ -34,6 +34,8 @@
/*==========================================================================* /*==========================================================================*
* Minix system library. * * 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 _taskcall, (int who, int syscallnr, message *msgptr) );
_PROTOTYPE( int sys_abort, (int how, ...) ); _PROTOTYPE( int sys_abort, (int how, ...) );

37
include/sys/select.h Executable file
View file

@ -0,0 +1,37 @@
#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 */

View file

@ -64,6 +64,7 @@ OBJECTS = \
$(LIBRARY)(_rename.o) \ $(LIBRARY)(_rename.o) \
$(LIBRARY)(_rewinddir.o) \ $(LIBRARY)(_rewinddir.o) \
$(LIBRARY)(_rmdir.o) \ $(LIBRARY)(_rmdir.o) \
$(LIBRARY)(_select.o) \
$(LIBRARY)(_setgid.o) \ $(LIBRARY)(_setgid.o) \
$(LIBRARY)(_setsid.o) \ $(LIBRARY)(_setsid.o) \
$(LIBRARY)(_setuid.o) \ $(LIBRARY)(_setuid.o) \
@ -270,6 +271,9 @@ $(LIBRARY)(_rewinddir.o): _rewinddir.c
$(LIBRARY)(_rmdir.o): _rmdir.c $(LIBRARY)(_rmdir.o): _rmdir.c
$(CC1) _rmdir.c $(CC1) _rmdir.c
$(LIBRARY)(_select.o): _select.c
$(CC1) _select.c
$(LIBRARY)(_setgid.o): _setgid.c $(LIBRARY)(_setgid.o): _setgid.c
$(CC1) _setgid.c $(CC1) _setgid.c

18
lib/posix/_select.c Executable file
View file

@ -0,0 +1,18 @@
#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));
}

View file

@ -16,7 +16,7 @@ LIBS = -lsys -lutils
OBJ = main.o open.o read.o write.o pipe.o dmap.o dmp.o \ 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 \ device.o path.o mount.o link.o super.o inode.o \
cache.o cache2.o filedes.o stadir.o protect.o time.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 # build local binary
all build: $(SERVER) all build: $(SERVER)
@ -35,7 +35,7 @@ clean:
# dependencies # dependencies
a= fs.h $h/config.h $s/types.h $h/const.h $h/type.h \ 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 const.h type.h proto.h glo.h $s/dir.h
cache.o: $a cache.o: $a

View file

@ -171,3 +171,7 @@ _PROTOTYPE( void clear_zone, (struct inode *rip, off_t pos, int flag) );
_PROTOTYPE( int do_write, (void) ); _PROTOTYPE( int do_write, (void) );
_PROTOTYPE( struct buf *new_block, (struct inode *rip, off_t position) ); _PROTOTYPE( struct buf *new_block, (struct inode *rip, off_t position) );
_PROTOTYPE( void zero_block, (struct buf *bp) ); _PROTOTYPE( void zero_block, (struct buf *bp) );
/* select.c */
_PROTOTYPE( int do_select, (void) );

16
servers/fs/select.c Normal file
View file

@ -0,0 +1,16 @@
/* 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;
}

View file

@ -102,6 +102,7 @@ PUBLIC _PROTOTYPE (int (*call_vec[]), (void) ) = {
do_fstatfs, /* 82 = fstatfs */ do_fstatfs, /* 82 = fstatfs */
no_sys, /* 83 = memalloc */ no_sys, /* 83 = memalloc */
no_sys, /* 84 = memfree */ no_sys, /* 84 = memfree */
do_select, /* 85 = select */
}; };
/* This should not fail with "array size is negative": */ /* This should not fail with "array size is negative": */
extern int dummy[sizeof(call_vec) == NCALLS * sizeof(call_vec[0]) ? 1 : -1]; extern int dummy[sizeof(call_vec) == NCALLS * sizeof(call_vec[0]) ? 1 : -1];

View file

@ -101,6 +101,7 @@ _PROTOTYPE (int (*call_vec[NCALLS]), (void) ) = {
no_sys, /* 82 = fstatfs */ no_sys, /* 82 = fstatfs */
do_allocmem, /* 83 = memalloc */ do_allocmem, /* 83 = memalloc */
do_freemem, /* 84 = memfree */ do_freemem, /* 84 = memfree */
no_sys, /* 85 = select */
}; };
/* This should not fail with "array size is negative": */ /* This should not fail with "array size is negative": */
extern int dummy[sizeof(call_vec) == NCALLS * sizeof(call_vec[0]) ? 1 : -1]; extern int dummy[sizeof(call_vec) == NCALLS * sizeof(call_vec[0]) ? 1 : -1];

View file

@ -21,26 +21,13 @@ echo -n "Device: /dev/"
read dev || exit 1 read dev || exit 1
TMPDISK=/dev/$dev 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 ] if [ -b $TMPDISK ]
then : then :
else echo "$TMPDISK is not a block device.." else echo "$TMPDISK is not a block device.."
exit 1 exit 1
fi fi
if [ -b $TMPTMPDISK ]
then :
else echo "$TMPDISK is not a block device.."
exit 1
fi
umount $TMPDISK umount $TMPDISK
umount $TMPTMPDISK
umount $RAM umount $RAM
( cd .. && make clean ) ( cd .. && make clean )
@ -51,9 +38,6 @@ echo " * mounting $RAM as $RELEASEDIR"
mount $RAM $RELEASEDIR || exit mount $RAM $RELEASEDIR || exit
mkdir -m 755 $RELEASEDIR/usr mkdir -m 755 $RELEASEDIR/usr
mkdir -m 1777 $RELEASEDIR/tmp mkdir -m 1777 $RELEASEDIR/tmp
umount $TMPTMPDISK
mkfs $TMPTMPDISK || exit
mount $TMPTMPDISK $RELEASEDIR/tmp || exit 1
mkfs -B 1024 $TMPDISK || exit mkfs -B 1024 $TMPDISK || exit
echo " * mounting $TMPDISK as $RELEASEDIR/usr" echo " * mounting $TMPDISK as $RELEASEDIR/usr"
@ -69,7 +53,6 @@ chroot $RELEASEDIR '/bin/sh -x /usr/src/tools/chrootmake.sh' || exit 1
echo " * Chroot build done" echo " * Chroot build done"
cp issue.install $RELEASEDIR/etc/issue cp issue.install $RELEASEDIR/etc/issue
umount $TMPDISK || exit umount $TMPDISK || exit
umount $TMPTMPDISK || exit
umount $RAM || exit umount $RAM || exit
cp $RAM $ROOTIMAGE cp $RAM $ROOTIMAGE
make programs image make programs image