New Makefiles for mkdep script.
This commit is contained in:
parent
042c4ac395
commit
5654996c07
13 changed files with 114 additions and 127 deletions
|
@ -13,7 +13,7 @@ usage:
|
|||
@echo "" >&2
|
||||
|
||||
build: all
|
||||
all install clean:
|
||||
all install depend clean:
|
||||
cd ./libdriver && $(MAKE) $@
|
||||
cd ./libpci && $(MAKE) $@
|
||||
cd ./tty && $(MAKE) $@
|
||||
|
|
|
@ -38,18 +38,9 @@ install: /usr/sbin/drivers/$(DRIVER)
|
|||
clean:
|
||||
rm -f $(DRIVER) *.o *.bak
|
||||
|
||||
depend:
|
||||
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
|
||||
|
||||
# dependencies
|
||||
a = $d/drivers.h $b/interrupt.h $b/bios.h \
|
||||
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
|
||||
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
|
||||
$m/syslib.h $s/types.h \
|
||||
$m/utils.h $m/devio.h
|
||||
l = $d/libdriver/driver.h $d/libdriver/driver.c $m/partition.h $m/u64.h
|
||||
|
||||
|
||||
at_wini.o: $a $l
|
||||
|
||||
$(LIBDRIVER): $a $l
|
||||
$(LIBDRIVER): $s/ioc_disk.h
|
||||
# Include generated dependencies.
|
||||
include .depend
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include <ibm/ports.h> /* Well-known ports */
|
||||
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -37,18 +37,9 @@ install: /usr/sbin/drivers/$(DRIVER)
|
|||
clean:
|
||||
rm -f $(DRIVER) *.o *.bak
|
||||
|
||||
depend:
|
||||
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
|
||||
|
||||
# dependencies
|
||||
a = $d/drivers.h $b/interrupt.h $b/bios.h \
|
||||
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
|
||||
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
|
||||
$m/syslib.h $s/types.h \
|
||||
$m/utils.h $m/devio.h
|
||||
l = $d/libdriver/driver.h $d/libdriver/driver.c $m/partition.h $m/u64.h
|
||||
|
||||
|
||||
floppy.o: $a $l
|
||||
|
||||
$(LIBDRIVER): $a $l
|
||||
$(LIBDRIVER): $s/ioc_disk.h
|
||||
# Include generated dependencies.
|
||||
include .depend
|
||||
|
||||
|
|
|
@ -36,12 +36,9 @@ install: /usr/sbin/drivers/$(DRIVER)
|
|||
clean:
|
||||
rm -f *.o *.bak $(DRIVER)
|
||||
|
||||
# Dependencies
|
||||
a = $d/drivers.h $b/interrupt.h $b/bios.h \
|
||||
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
|
||||
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
|
||||
$m/syslib.h $s/types.h \
|
||||
$m/utils.h $m/devio.h
|
||||
depend:
|
||||
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libpci/*.c > .depend
|
||||
|
||||
fxp.o: $a
|
||||
# Include generated dependencies.
|
||||
include .depend
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ b = $i/ibm
|
|||
m = $i/minix
|
||||
|
||||
# Programs, flags, etc.
|
||||
CC = exec cc
|
||||
CC = exec cc
|
||||
CFLAGS = -I$i
|
||||
LDFLAGS = -i
|
||||
LIBS = -lsys -lutils
|
||||
|
@ -22,16 +22,9 @@ all build install: $(OBJECTS)
|
|||
clean:
|
||||
rm -f *.o *.bak
|
||||
|
||||
depend:
|
||||
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
|
||||
|
||||
# Dependencies
|
||||
a = $m/config.h $i/ansi.h $m/type.h $m/com.h $m/callnr.h $s/types.h \
|
||||
$m/const.h $m/syslib.h $m/utils.h \
|
||||
$i/string.h $i/limits.h $i/stddef.h $i/errno.h \
|
||||
$m/partition.h $m/u64.h
|
||||
|
||||
driver.o: driver.h $a
|
||||
driver.o: $s/ioc_disk.h
|
||||
|
||||
drvlib.o: driver.h $a
|
||||
drvlib.o: drvlib.h $b/partition.h
|
||||
# Include generated dependencies.
|
||||
include .depend
|
||||
|
||||
|
|
|
@ -22,14 +22,9 @@ all build install: $(OBJECTS)
|
|||
clean:
|
||||
rm -f *.o *.bak
|
||||
|
||||
depend:
|
||||
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
|
||||
|
||||
# Dependencies
|
||||
a = $m/config.h $i/ansi.h $m/type.h $m/com.h $m/callnr.h $s/types.h \
|
||||
$m/const.h $m/syslib.h $m/utils.h \
|
||||
$i/string.h $i/limits.h $i/stddef.h $i/errno.h \
|
||||
$m/partition.h $m/u64.h
|
||||
|
||||
pci.o: $a
|
||||
pci.o: pci.h
|
||||
pci.o: pci_amd.h pci_intel.h pci_via.h pci_sis.h
|
||||
# Include generated dependencies.
|
||||
include .depend
|
||||
|
||||
|
|
|
@ -39,17 +39,9 @@ clean:
|
|||
rm -f $(DRIVER) *.o *.bak
|
||||
|
||||
|
||||
# dependencies
|
||||
a = $d/drivers.h $b/interrupt.h $b/bios.h \
|
||||
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
|
||||
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
|
||||
$m/syslib.h $s/types.h \
|
||||
$m/utils.h $m/devio.h
|
||||
l = $d/libdriver/driver.h $d/libdriver/driver.c $m/partition.h $m/u64.h
|
||||
depend:
|
||||
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
|
||||
|
||||
|
||||
memory.o: $a $l
|
||||
|
||||
$(LIBDRIVER): $a $l
|
||||
$(LIBDRIVER): $s/ioc_disk.h
|
||||
# Include generated dependencies.
|
||||
include .depend
|
||||
|
||||
|
|
|
@ -21,23 +21,21 @@ OBJ = printer.o
|
|||
all build: $(DRIVER)
|
||||
$(DRIVER): $(OBJ)
|
||||
$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
|
||||
install -S 64w $(DRIVER)
|
||||
# install -S 64w $(DRIVER)
|
||||
|
||||
# install with other drivers
|
||||
install: /usr/sbin/drivers/$(DRIVER)
|
||||
/usr/sbin/drivers/$(DRIVER): $(DRIVER)
|
||||
install -o root -cs $? $@
|
||||
install -o root -c $? $@
|
||||
# install -o root -cs $? $@
|
||||
|
||||
# clean up local files
|
||||
clean:
|
||||
rm -f *.o *.bak $(DRIVER)
|
||||
|
||||
# Dependencies
|
||||
a = $d/drivers.h $b/interrupt.h $b/bios.h \
|
||||
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
|
||||
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
|
||||
$m/syslib.h $s/types.h \
|
||||
$m/utils.h $m/devio.h
|
||||
depend:
|
||||
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
|
||||
|
||||
printer.o: $a
|
||||
# Include generated dependencies.
|
||||
include .depend
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* DEV_CLOSE: does nothing
|
||||
* HARD_INT: interrupt handler has finished current chunk of output
|
||||
* DEV_WRITE: a process wants to write on a terminal
|
||||
* CANCEL: terminate a previous incomplete system call immediately
|
||||
* CANCEL: terminate a previous incomplete system call immediately
|
||||
*
|
||||
* m_type TTY_LINE PROC_NR COUNT ADDRESS
|
||||
* |-------------+---------+---------+---------+---------|
|
||||
|
@ -99,6 +99,8 @@ PRIVATE vir_bytes user_vir; /* address of remainder of user buf */
|
|||
PRIVATE int writing; /* nonzero while write is in progress */
|
||||
PRIVATE int irq_hook_id; /* id of irq hook at kernel */
|
||||
|
||||
extern int errno; /* error number */
|
||||
|
||||
FORWARD _PROTOTYPE( void do_cancel, (message *m_ptr) );
|
||||
FORWARD _PROTOTYPE( void output_done, (void) );
|
||||
FORWARD _PROTOTYPE( void do_write, (message *m_ptr) );
|
||||
|
@ -106,6 +108,25 @@ FORWARD _PROTOTYPE( void prepare_output, (void) );
|
|||
FORWARD _PROTOTYPE( void do_initialize, (void) );
|
||||
FORWARD _PROTOTYPE( void reply, (int code,int replyee,int proc,int status));
|
||||
FORWARD _PROTOTYPE( void do_printer_output, (void) );
|
||||
FORWARD _PROTOTYPE( void signal_handler, (int sig) );
|
||||
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* signal_handler *
|
||||
*===========================================================================*/
|
||||
PRIVATE void signal_handler(sig)
|
||||
int sig; /* signal number */
|
||||
{
|
||||
/* Expect a SIGTERM signal when this server must shutdown. */
|
||||
if (sig == SIGTERM) {
|
||||
printf("Shutting down PRINTER driver\n");
|
||||
exit(0);
|
||||
} else {
|
||||
printf("PRINTER got unknown signal\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* printer_task *
|
||||
|
@ -115,9 +136,18 @@ PUBLIC void main(void)
|
|||
/* Main routine of the printer task. */
|
||||
|
||||
message pr_mess; /* buffer for all incoming messages */
|
||||
|
||||
printf("PRN: user-level printer driver is up and running\n");
|
||||
#if DEAD_CODE
|
||||
struct sigaction sigact;
|
||||
|
||||
/* Install signal handler.*/
|
||||
sigact.sa_handler = signal_handler;
|
||||
sigact.sa_mask = ~0; /* block all other signals */
|
||||
sigact.sa_flags = 0; /* default behaviour */
|
||||
printf("PRINTER calls sigaction()\n");
|
||||
if (sigaction(SIGTERM, &sigact, NULL) != OK)
|
||||
report("PRINTER","warning, sigaction() failed", errno);
|
||||
#endif
|
||||
|
||||
while (TRUE) {
|
||||
receive(ANY, &pr_mess);
|
||||
switch(pr_mess.m_type) {
|
||||
|
|
|
@ -38,17 +38,9 @@ install: /usr/sbin/drivers/$(DRIVER)
|
|||
clean:
|
||||
rm -f $(DRIVER) *.o *.bak
|
||||
|
||||
depend:
|
||||
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libpci/*.c > .depend
|
||||
|
||||
# dependencies
|
||||
a = $d/drivers.h $b/interrupt.h $b/bios.h \
|
||||
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
|
||||
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
|
||||
$m/syslib.h $s/types.h \
|
||||
$m/utils.h $m/devio.h
|
||||
l = $d/libpci/pci.h $d/libpci/pci.c $d/libpci/pci_table.c
|
||||
|
||||
|
||||
rtl8139.o: $a $l
|
||||
|
||||
$(LIBPCI): $a $l
|
||||
# Include generated dependencies.
|
||||
include .depend
|
||||
|
||||
|
|
|
@ -36,20 +36,10 @@ clean:
|
|||
cd keymaps && $(MAKE) -$(MAKEFLAGS) $@
|
||||
rm -f $(DRIVER) *.o *.bak
|
||||
|
||||
|
||||
|
||||
# dependencies
|
||||
a = $d/drivers.h $b/interrupt.h $b/bios.h \
|
||||
$i/ansi.h $i/string.h $i/limits.h $i/stddef.h $i/errno.h \
|
||||
$m/config.h $m/type.h $m/com.h $m/callnr.h $m/const.h $s/types.h \
|
||||
$m/syslib.h $s/types.h \
|
||||
$m/utils.h $m/devio.h
|
||||
|
||||
tty.o: tty.h $a
|
||||
console.o: tty.h $a
|
||||
vidcopy.o: # nothing
|
||||
keyboard.o: tty.h $a
|
||||
rs232.o: tty.h $a $i/termios.h $i/signal.h
|
||||
|
||||
depend:
|
||||
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
|
||||
|
||||
# Include generated dependencies.
|
||||
include .depend
|
||||
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ FORWARD _PROTOTYPE( void reprint, (tty_t *tp) );
|
|||
FORWARD _PROTOTYPE( void dev_ioctl, (tty_t *tp) );
|
||||
FORWARD _PROTOTYPE( void setattr, (tty_t *tp) );
|
||||
FORWARD _PROTOTYPE( void tty_icancel, (tty_t *tp) );
|
||||
FORWARD _PROTOTYPE( void tty_init, (tty_t *tp) );
|
||||
FORWARD _PROTOTYPE( void tty_init, (void) );
|
||||
#if ENABLE_SRCCOMPAT || ENABLE_BINCOMPAT
|
||||
FORWARD _PROTOTYPE( int compat_getp, (tty_t *tp, struct sgttyb *sg) );
|
||||
FORWARD _PROTOTYPE( int compat_getc, (tty_t *tp, struct tchars *sg) );
|
||||
|
@ -160,17 +160,14 @@ PUBLIC void main(void)
|
|||
/* Main routine of the terminal task. */
|
||||
|
||||
message tty_mess; /* buffer for all incoming messages */
|
||||
register tty_t *tp;
|
||||
unsigned line;
|
||||
int s;
|
||||
char *types[] = {"task","driver","server", "user"};
|
||||
register struct proc *rp;
|
||||
register tty_t *tp;
|
||||
|
||||
/* Initialize the terminal lines. */
|
||||
for (tp = FIRST_TTY,s=0; tp < END_TTY; tp++,s++) {
|
||||
tp->tty_index = s;
|
||||
tty_init(tp);
|
||||
}
|
||||
/* Initialize the TTY driver. */
|
||||
tty_init();
|
||||
|
||||
/* Get kernel environment (protected_mode, pc_at and ega are needed). */
|
||||
if (OK != (s=sys_getmachine(&machine))) {
|
||||
|
@ -1432,26 +1429,45 @@ register tty_t *tp;
|
|||
/*==========================================================================*
|
||||
* tty_init *
|
||||
*==========================================================================*/
|
||||
PRIVATE void tty_init(tp)
|
||||
tty_t *tp; /* TTY line to initialize. */
|
||||
PRIVATE void tty_init()
|
||||
{
|
||||
/* Initialize tty structure and call device initialization routines. */
|
||||
|
||||
tmr_inittimer(&tp->tty_tmr);
|
||||
register tty_t *tp;
|
||||
int s;
|
||||
|
||||
tp->tty_intail = tp->tty_inhead = tp->tty_inbuf;
|
||||
tp->tty_min = 1;
|
||||
tp->tty_termios = termios_defaults;
|
||||
tp->tty_icancel = tp->tty_ocancel = tp->tty_ioctl = tp->tty_close =
|
||||
struct sigaction sigact;
|
||||
|
||||
/* Initialize the terminal lines. */
|
||||
for (tp = FIRST_TTY,s=0; tp < END_TTY; tp++,s++) {
|
||||
|
||||
tp->tty_index = s;
|
||||
|
||||
tmr_inittimer(&tp->tty_tmr);
|
||||
|
||||
tp->tty_intail = tp->tty_inhead = tp->tty_inbuf;
|
||||
tp->tty_min = 1;
|
||||
tp->tty_termios = termios_defaults;
|
||||
tp->tty_icancel = tp->tty_ocancel = tp->tty_ioctl = tp->tty_close =
|
||||
tty_devnop;
|
||||
if (tp < tty_addr(NR_CONS)) {
|
||||
scr_init(tp);
|
||||
} else
|
||||
if (tp < tty_addr(NR_CONS+NR_RS_LINES)) {
|
||||
rs_init(tp);
|
||||
} else {
|
||||
pty_init(tp);
|
||||
if (tp < tty_addr(NR_CONS)) {
|
||||
scr_init(tp);
|
||||
} else
|
||||
if (tp < tty_addr(NR_CONS+NR_RS_LINES)) {
|
||||
rs_init(tp);
|
||||
} else {
|
||||
pty_init(tp);
|
||||
}
|
||||
}
|
||||
|
||||
#if DEAD_CODE
|
||||
/* Install signal handler to ignore SIGTERM. */
|
||||
sigact.sa_handler = SIG_IGN;
|
||||
sigact.sa_mask = ~0; /* block all other signals */
|
||||
sigact.sa_flags = 0; /* default behaviour */
|
||||
if (sigaction(SIGTERM, &sigact, NULL) != OK)
|
||||
report("TTY","warning, sigaction() failed", errno);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*==========================================================================*
|
||||
|
|
Loading…
Reference in a new issue