From: nobody Date: Tue, 18 Oct 2005 21:04:10 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create tag 'r3_1_0'. X-Git-Tag: v3.1.0 X-Git-Url: http://zhaoyanbai.com/repos/man.dnssec-revoke.html?a=commitdiff_plain;h=110a025b228568636ec9c2f5fc98ae440e0c063d;p=minix.git This commit was manufactured by cvs2svn to create tag 'r3_1_0'. --- diff --git a/commands/Makefile b/commands/Makefile index d58cdde53..6f59a773f 100755 --- a/commands/Makefile +++ b/commands/Makefile @@ -34,13 +34,10 @@ all: small big install: biginstall smallinstall small:: - -mkdir $(NVIWORK) cd $(GZIP) && CC="$(CC)" /bin/sh ./configure --prefix=/usr/local && $(MAKE) all - cd $(NVI) && make all smallinstall:: small cd $(GZIP) && $(MAKE) install - cd $(NVI) && make install big: cd $(FLEX) && /bin/sh makeme.sh @@ -50,6 +47,8 @@ big: cd $(COREUTILS) && /bin/sh makeme.sh cd $(EMACS) && /bin/sh makeme.sh cd $(PYTHON) && /bin/sh makeme.sh + -mkdir $(NVIWORK) + cd $(NVI) && make all biginstall: big cd $(FLEX) && make install @@ -59,6 +58,7 @@ biginstall: big cd $(LYNX) && make install cd $(EMACS) && make install cd $(COREUTILS) && make install + cd $(NVI) && make install clean:: if [ -f $(FLEX)/Makefile ] ; then cd $(FLEX) && make $@; fi diff --git a/commands/ash/bltin/regexp.c b/commands/ash/bltin/regexp.c index db546d638..cd026ac95 100755 --- a/commands/ash/bltin/regexp.c +++ b/commands/ash/bltin/regexp.c @@ -246,7 +246,7 @@ ccl: p++; } p++; - if (found == negate) + if (found == negate || c == 0) goto bad; break; case RE_LP: diff --git a/commands/scripts/Makefile b/commands/scripts/Makefile index 4c22efc97..fa94a07c0 100755 --- a/commands/scripts/Makefile +++ b/commands/scripts/Makefile @@ -24,7 +24,6 @@ usr: \ /usr/bin/expr \ /usr/bin/false \ /usr/bin/getopts \ - /usr/bin/getpack \ /usr/bin/read \ /usr/bin/test \ /usr/bin/true \ @@ -96,9 +95,6 @@ clean: /usr/bin/easypack: easypack.sh install -m 755 -c -o bin $? $@ -/usr/bin/getpack: getpack.sh - install -m 755 -c -o bin $? $@ - /usr/bin/checkhier: checkhier.sh install -m 755 -c -o bin $? $@ diff --git a/commands/scripts/binsizes.sh b/commands/scripts/binsizes.sh index b37dd83b8..bc6716ddc 100644 --- a/commands/scripts/binsizes.sh +++ b/commands/scripts/binsizes.sh @@ -1,6 +1,6 @@ #!/bin/sh -t=/usr/src/etc/binary_sizes +t=/etc/binary_sizes if [ "$#" -ne 1 ] then echo "Usage: $0 " @@ -11,6 +11,7 @@ if [ "$1" = big ] then t=$t.big fi chmem =250000 /usr/lib/* /usr/lib/i386/* >/dev/null 2>&1 +chmem =600000 /usr/lib/ego/* >/dev/null 2>&1 if [ -f $t ] then cat "$t" | while read line do awk '{ print "chmem =" $2 " " $1 " >/dev/null 2>&1 "}' diff --git a/commands/scripts/getpack.sh b/commands/scripts/getpack.sh deleted file mode 100644 index 12eb50463..000000000 --- a/commands/scripts/getpack.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -if [ $# -ne 1 ] -then echo "Usage: $0 " - exit 1 -fi - -if [ -z "$HOME" ] -then echo "Where is your \$HOME? " - exit 1 -fi - -if [ ! -d "$HOME" ] -then echo "Where is your \$HOME ($HOME) ? " - exit 1 -fi - -tmpdir=$HOME/getpack$$ -tmpfile=package -tmpfiletar=$tmpfile.tar -tmpfiletargz=$tmpfile.tar.gz - -mkdir -m 700 $tmpdir || exit 1 -cd $tmpdir || exit 1 - -urlget "$1" >$tmpfiletargz - -gzip -d $tmpfiletargz || exit 1 -tar xf $tmpfiletar || exit 1 -make && make install && echo "Ok." diff --git a/commands/simple/mkdir.c b/commands/simple/mkdir.c index 9044966a1..d02734676 100755 --- a/commands/simple/mkdir.c +++ b/commands/simple/mkdir.c @@ -192,12 +192,14 @@ char **argv; int makepath(fordir) char *fordir; { - char parent[PATH_MAX + 1], *end; + char parent[PATH_MAX + 1], *end, *last; strcpy(parent, fordir); - if (!(end = strrchr(parent, '/'))) return(0); - *end = '\0'; - if (!parent[0]) return(0); + do { + if (!(end = strrchr(parent, '/'))) return(0); + *end = '\0'; + if (!parent[0] || !strcmp(parent, ".")) return(0); + } while((last = strrchr(parent, '/')) && !strcmp(last+1, ".")); if (!stat(parent, &st)) { if (S_ISDIR(st.st_mode)) return(0); diff --git a/drivers/libpci/pci_table.c b/drivers/libpci/pci_table.c index 08d121022..29e2eca38 100644 --- a/drivers/libpci/pci_table.c +++ b/drivers/libpci/pci_table.c @@ -264,6 +264,7 @@ struct pci_isabridge pci_isabridge[]= { 0x8086, 0x7100, 1, PCI_IB_PIIX, }, /* Intel 82371AB (asw 2004-07-31) */ { 0x8086, 0x7110, 1, PCI_IB_PIIX, }, /* Intel PIIX4 */ { 0x8086, 0x7124, 1, PCI_IB_PIIX, }, /* Intel 82801AA (asw 2004-11-09) */ + { 0x8086, 0x2641, 1, PCI_IB_PIIX, }, { 0x0000, 0x0000, 0, 0, }, }; diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index bf9fc56b2..6cf8e7760 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -285,8 +285,8 @@ PUBLIC void main(void) case DEV_SELECT: do_select(tp, &tty_mess); break; case CANCEL: do_cancel(tp, &tty_mess); break; default: - printf("Warning, TTY got unexpected request %d from %d (open is %d)\n", - tty_mess.m_type, tty_mess.m_source, DEV_OPEN); + printf("Warning, TTY got unexpected request %d from %d\n", + tty_mess.m_type, tty_mess.m_source); tty_reply(TASK_REPLY, tty_mess.m_source, tty_mess.PROC_NR, EINVAL); } @@ -1516,7 +1516,7 @@ PRIVATE void tty_init() tp->tty_minor = RS232_MINOR + s-NR_CONS; } else { pty_init(tp); - tp->tty_minor = s + TTYPX_MINOR + s-(NR_CONS+RS232_MINOR); + tp->tty_minor = s - (NR_CONS+NR_RS_LINES) + TTYPX_MINOR; } } diff --git a/etc/Makefile b/etc/Makefile index 32bb4236b..3630b403b 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,7 +1,7 @@ ETC=/etc/ USRETC=/usr/etc/ -FILES1=fstab group hostname.file inet.conf motd mtab passwd profile protocols rc services termcap ttytab utmp rc.cd +FILES1=fstab group hostname.file inet.conf motd mtab passwd profile protocols rc services termcap ttytab utmp rc.cd binary_sizes binary_sizes.big FILES2=shadow FILES3=daily dhcptags.conf rc @@ -18,8 +18,8 @@ install:: sh mtree.sh mtree/minix.tree @for f in $(FILES3); do if [ -f $(USRETC)/$$f ]; then :; else cp usr/$$f $(USRETC); chmod 755 $(USRETC)/$$f; fi; done @echo "Making devices.." - cd /dev && sh /usr/src/commands/scripts/MAKEDEV.sh null - cd /dev && sh /usr/src/commands/scripts/MAKEDEV.sh std 2>/dev/null + p=`pwd` && cd /dev && sh $$p/../commands/scripts/MAKEDEV.sh null + p=`pwd` && cd /dev && sh $$p/../commands/scripts/MAKEDEV.sh std 2>/dev/null @echo "Making user homedirs.." for u in /usr/ast ~root; do (cd ast && tar cf - .[a-z]* ) | (cd $$u && tar xf - ); done diff --git a/etc/motd b/etc/motd index 87b58b53e..90684d063 100755 --- a/etc/motd +++ b/etc/motd @@ -8,7 +8,8 @@ www.minix3.org to see how you can help. That page also contains additional MINIX 3 software, documentation, and information about the MINIX community. If -you find a bug, please use the "Report a bug" link on that page. +you find a bug, please use the "Report a bug" link on that page, or mail +to . For help with MINIX 3 and discussion about it, please subscribe to the newsgroup: comp.os.minix. diff --git a/etc/mtree/minix.tree b/etc/mtree/minix.tree index 0881ca98c..2f667e08e 100644 --- a/etc/mtree/minix.tree +++ b/etc/mtree/minix.tree @@ -17,8 +17,6 @@ 755 bin operator /usr/bin 755 root operator /usr/etc 755 root operator /home -755 root operator /usr/home -700 bin other /usr/home/bin 755 bin operator /usr/include 755 root operator /usr/lib 755 root operator /usr/lib/advent diff --git a/include/minix/config.h b/include/minix/config.h index 47a1b27d0..a37d243f3 100755 --- a/include/minix/config.h +++ b/include/minix/config.h @@ -3,7 +3,7 @@ /* Minix release and version numbers. */ #define OS_RELEASE "3" -#define OS_VERSION "1" +#define OS_VERSION "1.0" /* This file sets configuration parameters for the MINIX kernel, FS, and PM. * It is divided up into two main sections. The first section contains diff --git a/kernel/clock.c b/kernel/clock.c index 52b1fdfd8..1dafb33b2 100755 --- a/kernel/clock.c +++ b/kernel/clock.c @@ -1,16 +1,17 @@ -/* The file contais the clock task, which handles all time related functions. - * Important events that are handled by the CLOCK include alarm timers and - * (re)scheduling user processes. +/* This file contains the clock task, which handles time related functions. + * Important events that are handled by the CLOCK include setting and + * monitoring alarm timers and deciding when to (re)schedule processes. * The CLOCK offers a direct interface to kernel processes. System services * can access its services through system calls, such as sys_setalarm(). The - * CLOCK task thus is hidden for the outside world. + * CLOCK task thus is hidden from the outside world. * * Changes: + * Oct 08, 2005 reordering and comment editing (A. S. Woodhull) * Mar 18, 2004 clock interface moved to SYSTEM task (Jorrit N. Herder) * Sep 30, 2004 source code documentation updated (Jorrit N. Herder) * Sep 24, 2004 redesigned alarm timers (Jorrit N. Herder) * - * The function do_clocktick() is not triggered by the clock's interrupt + * The function do_clocktick() is triggered by the clock's interrupt * handler when a watchdog timer has expired or a process must be scheduled. * * In addition to the main clock_task() entry point, which starts the main @@ -19,12 +20,11 @@ * get_uptime: get realtime since boot in clock ticks * set_timer: set a watchdog timer (+) * reset_timer: reset a watchdog timer (+) - * calc_elapsed: do timing measurements: get delta ticks and pulses * read_clock: read the counter of channel 0 of the 8253A timer * * (+) The CLOCK task keeps tracks of watchdog timers for the entire kernel. * The watchdog functions of expired timers are executed in do_clocktick(). - * It is crucial that watchdog functions cannot block, or the CLOCK task may + * It is crucial that watchdog functions not block, or the CLOCK task may * be blocked. Do not send() a message when the receiver is not expecting it. * Instead, notify(), which always returns, should be used. */ @@ -40,7 +40,6 @@ FORWARD _PROTOTYPE( int clock_handler, (irq_hook_t *hook) ); FORWARD _PROTOTYPE( int do_clocktick, (message *m_ptr) ); /* Clock parameters. */ -#if (CHIP == INTEL) #define COUNTER_FREQ (2*TIMER_FREQ) /* counter frequency using square wave */ #define LATCH_COUNT 0x00 /* cc00xxxx, c = channel, x = any */ #define SQUARE_WAVE 0x36 /* ccaammmb, a = access, m = mode, b = BCD */ @@ -49,14 +48,9 @@ FORWARD _PROTOTYPE( int do_clocktick, (message *m_ptr) ); #define TIMER_FREQ 1193182L /* clock frequency for timer in PC and AT */ #define CLOCK_ACK_BIT 0x80 /* PS/2 clock interrupt acknowledge bit */ -#endif - -#if (CHIP == M68000) -#define TIMER_FREQ 2457600L /* timer 3 input clock frequency */ -#endif /* The CLOCK's timers queue. The functions in operate on this. - * All system processes possess a single synchronous alarm timer. If other + * Each system process possesses a single synchronous alarm timer. If other * kernel parts want to use additional timers, they must declare their own * persistent (static) timer structure, which can be passed to the clock * via (re)set_timer(). @@ -74,15 +68,14 @@ PRIVATE irq_hook_t clock_hook; /* interrupt handler hook */ *===========================================================================*/ PUBLIC void clock_task() { -/* Main program of clock task. It determines which call this is by looking at - * the message type and dispatches. +/* Main program of clock task. If the call is not HARD_INT it is an error. */ message m; /* message buffer for both input and output */ int result; /* result returned by the handler */ init_clock(); /* initialize clock task */ - /* Main loop of the clock task. Get work, process it, sometimes reply. */ + /* Main loop of the clock task. Get work, process it. Never reply. */ while (TRUE) { /* Go get a message. */ @@ -112,7 +105,7 @@ message *m_ptr; /* pointer to request message */ /* A process used up a full quantum. The interrupt handler stored this * process in 'prev_ptr'. First make sure that the process is not on the * scheduling queues. Then announce the process ready again. Since it has - * no more time left, it will get a new quantum and inserted at the right + * no more time left, it gets a new quantum and is inserted at the right * place in the queues. As a side-effect a new process will be scheduled. */ if (prev_ptr->p_ticks_left <= 0 && priv(prev_ptr)->s_flags & PREEMPTIBLE) { @@ -131,6 +124,33 @@ message *m_ptr; /* pointer to request message */ return(EDONTREPLY); } +/*===========================================================================* + * init_clock * + *===========================================================================*/ +PRIVATE void init_clock() +{ + /* Initialize the CLOCK's interrupt hook. */ + clock_hook.proc_nr = CLOCK; + + /* Initialize channel 0 of the 8253A timer to, e.g., 60 Hz. */ + outb(TIMER_MODE, SQUARE_WAVE); /* set timer to run continuously */ + outb(TIMER0, TIMER_COUNT); /* load timer low byte */ + outb(TIMER0, TIMER_COUNT >> 8); /* load timer high byte */ + put_irq_handler(&clock_hook, CLOCK_IRQ, clock_handler);/* register handler */ + enable_irq(&clock_hook); /* ready for clock interrupts */ +} + +/*===========================================================================* + * clock_stop * + *===========================================================================*/ +PUBLIC void clock_stop() +{ +/* Reset the clock to the BIOS rate. (For rebooting) */ + outb(TIMER_MODE, 0x36); + outb(TIMER0, 0); + outb(TIMER0, 0); +} + /*===========================================================================* * clock_handler * *===========================================================================*/ @@ -234,35 +254,6 @@ struct timer *tp; /* pointer to timer structure */ TMR_NEVER : clock_timers->tmr_exp_time; } -#if (CHIP == INTEL) - -/*===========================================================================* - * init_clock * - *===========================================================================*/ -PRIVATE void init_clock() -{ - /* Initialize the CLOCK's interrupt hook. */ - clock_hook.proc_nr = CLOCK; - - /* Initialize channel 0 of the 8253A timer to, e.g., 60 Hz. */ - outb(TIMER_MODE, SQUARE_WAVE); /* set timer to run continuously */ - outb(TIMER0, TIMER_COUNT); /* load timer low byte */ - outb(TIMER0, TIMER_COUNT >> 8); /* load timer high byte */ - put_irq_handler(&clock_hook, CLOCK_IRQ, clock_handler);/* register handler */ - enable_irq(&clock_hook); /* ready for clock interrupts */ -} - -/*===========================================================================* - * clock_stop * - *===========================================================================*/ -PUBLIC void clock_stop() -{ -/* Reset the clock to the BIOS rate. (For rebooting) */ - outb(TIMER_MODE, 0x36); - outb(TIMER0, 0); - outb(TIMER0, 0); -} - /*===========================================================================* * read_clock * *===========================================================================*/ @@ -281,6 +272,3 @@ PUBLIC unsigned long read_clock() return count; } - -#endif /* (CHIP == INTEL) */ - diff --git a/kernel/klib386.s b/kernel/klib386.s index e258e6644..084fadcee 100755 --- a/kernel/klib386.s +++ b/kernel/klib386.s @@ -564,7 +564,7 @@ _read_tsc: !* read_flags * !*===========================================================================* ! PUBLIC unsigned long read_cpu_flags(void); -! Read the cycle counter of the CPU. Pentium and up. +! Read CPU status flags from C. .align 16 _read_cpu_flags: pushf diff --git a/kernel/main.c b/kernel/main.c index 21d434ad1..e6a6ebc08 100755 --- a/kernel/main.c +++ b/kernel/main.c @@ -59,7 +59,7 @@ PUBLIC void main() ppriv_addr[i] = sp; /* priv ptr from number */ } - /* Set up proc table entries for tasks and servers. The stacks of the + /* Set up proc table entries for processes in boot image. The stacks of the * kernel tasks are initialized to an array in data space. The stacks * of the servers have been added to the data segment by the monitor, so * the stack pointer is set to the end of the data segment. All the @@ -172,8 +172,8 @@ PUBLIC void main() PRIVATE void announce(void) { /* Display the MINIX startup banner. */ - kprintf("MINIX %s.%s.\nCopyright 2006, 1997, 1987 Pearson Education, Inc.\n" - "MINIX 3 Copyright 2006, 1997, 1987 Vrije Universiteit\n", + kprintf("\nMINIX %s.%s. " + "Copyright 2006, Vrije Universiteit, Amsterdam, The Netherlands\n", OS_RELEASE, OS_VERSION); #if (CHIP == INTEL) /* Real mode, or 16/32-bit protected mode? */ @@ -193,7 +193,7 @@ int how; register struct proc *rp; message m; - /* Show debugging dumps on panics. Make sure that the TTY task is still + /* Show debugging dumps on panics. Make sure that the TTY driver is still * available to handle them. This is done with help of a non-blocking send. * We rely on TTY to call sys_abort() when it is done with the dumps. */ diff --git a/kernel/proc.c b/kernel/proc.c index f91e80b17..91228cf4a 100755 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -149,9 +149,9 @@ message *m_ptr; /* pointer to message in the caller's space */ return(ECALLDENIED); /* call denied by ipc mask */ } - if (isemptyn(src_dst) && !shutdown_started) { - kprintf("sys_call: dead dest; %d, %d, %d\n", - function, proc_nr(caller_ptr), src_dst); + if (isemptyn(src_dst)) { + if(!shutdown_started) + kprintf("sys_call: dead dst; %d->%d\n", proc_nr(caller_ptr), src_dst); return(EDEADDST); /* cannot send to the dead */ } } @@ -228,7 +228,7 @@ unsigned flags; /* system call flags */ dst_ptr->p_messbuf); if ((dst_ptr->p_rts_flags &= ~RECEIVING) == 0) enqueue(dst_ptr); } else if ( ! (flags & NON_BLOCKING)) { - /* Destination is not waiting. Block and queue caller. */ + /* Destination is not waiting. Block and dequeue caller. */ caller_ptr->p_messbuf = m_ptr; if (caller_ptr->p_rts_flags == 0) dequeue(caller_ptr); caller_ptr->p_rts_flags |= SENDING; @@ -546,7 +546,7 @@ PRIVATE void pick_proc() int q; /* iterate over queues */ /* Check each of the scheduling queues for ready processes. The number of - * queues is defined in proc.h, and priorities are set in the task table. + * queues is defined in proc.h, and priorities are set in the image table. * The lowest queue contains IDLE, which is always ready. */ for (q=0; q < NR_SCHED_QUEUES; q++) { diff --git a/kernel/system.c b/kernel/system.c index 5019dd94e..5a07486bb 100755 --- a/kernel/system.c +++ b/kernel/system.c @@ -1,10 +1,10 @@ -/* This task handles the interface between the kernel and user-level servers. - * System services can be accessed by doing a system call. System calls are - * transformed into request messages, which are handled by this task. By - * convention, a sys_call() is transformed in a SYS_CALL request message that - * is handled in a function named do_call(). +/* This task provides an interface between the kernel and user-space system + * processes. System services can be accessed by doing a kernel call. Kernel + * calls are transformed into request messages, which are handled by this + * task. By convention, a sys_call() is transformed in a SYS_CALL request + * message that is handled in a function named do_call(). * - * A private call vector is used to map all system calls to the functions that + * A private call vector is used to map all kernel calls to the functions that * handle them. The actual handler functions are contained in separate files * to keep this file clean. The call vector is used in the system task's main * loop to handle all incoming requests. @@ -39,9 +39,9 @@ #include "protect.h" #endif -/* Declaration of the call vector that defines the mapping of system calls +/* Declaration of the call vector that defines the mapping of kernel calls * to handler functions. The vector is initialized in sys_init() with map(), - * which makes sure the system call numbers are ok. No space is allocated, + * which makes sure the kernel call numbers are ok. No space is allocated, * because the dummy is declared extern. If an illegal call is given, the * array size will be negative and this won't compile. */ @@ -117,8 +117,8 @@ PRIVATE void initialize(void) tmr_inittimer(&(sp->s_alarm_timer)); } - /* Initialize the call vector to a safe default handler. Some system calls - * may be disabled or nonexistant. Then explicitely map known calls to their + /* Initialize the call vector to a safe default handler. Some kernel calls + * may be disabled or nonexistant. Then explicitly map known calls to their * handler functions. This is done with a macro that gives a compile error * if an illegal call number is used. The ordering is not important here. */ @@ -280,36 +280,6 @@ int sig_nr; /* signal to be sent, 1 to _NSIG */ } } -/*===========================================================================* - * umap_bios * - *===========================================================================*/ -PUBLIC phys_bytes umap_bios(rp, vir_addr, bytes) -register struct proc *rp; /* pointer to proc table entry for process */ -vir_bytes vir_addr; /* virtual address in BIOS segment */ -vir_bytes bytes; /* # of bytes to be copied */ -{ -/* Calculate the physical memory address at the BIOS. Note: currently, BIOS - * address zero (the first BIOS interrupt vector) is not considered, as an - * error here, but since the physical address will be zero as well, the - * calling function will think an error occurred. This is not a problem, - * since no one uses the first BIOS interrupt vector. - */ - - /* Check all acceptable ranges. */ - if (vir_addr >= BIOS_MEM_BEGIN && vir_addr + bytes <= BIOS_MEM_END) - return (phys_bytes) vir_addr; - else if (vir_addr >= BASE_MEM_TOP && vir_addr + bytes <= UPPER_MEM_END) - return (phys_bytes) vir_addr; - -#if DEAD_CODE /* brutal fix, if the above is too restrictive */ - if (vir_addr >= BIOS_MEM_BEGIN && vir_addr + bytes <= UPPER_MEM_END) - return (phys_bytes) vir_addr; -#endif - - kprintf("Warning, error in umap_bios, virtual address 0x%x\n", vir_addr); - return 0; -} - /*===========================================================================* * umap_local * *===========================================================================*/ @@ -343,7 +313,7 @@ vir_bytes bytes; /* # of bytes to be copied */ seg = (vc < rp->p_memmap[D].mem_vir + rp->p_memmap[D].mem_len ? D : S); #else if (seg != T) - seg = (vc < rp->p_memmap[S].mem_vir ? D : S); + seg = (vc < rp->p_memmap[S].mem_vir ? D : S); #endif if ((vir_addr>>CLICK_SHIFT) >= rp->p_memmap[seg].mem_vir + @@ -390,6 +360,30 @@ vir_bytes bytes; /* # of bytes to be copied */ return(fm->mem_phys + (phys_bytes) vir_addr); } +/*===========================================================================* + * umap_bios * + *===========================================================================*/ +PUBLIC phys_bytes umap_bios(rp, vir_addr, bytes) +register struct proc *rp; /* pointer to proc table entry for process */ +vir_bytes vir_addr; /* virtual address in BIOS segment */ +vir_bytes bytes; /* # of bytes to be copied */ +{ +/* Calculate the physical memory address at the BIOS. Note: currently, BIOS + * address zero (the first BIOS interrupt vector) is not considered as an + * error here, but since the physical address will be zero as well, the + * calling function will think an error occurred. This is not a problem, + * since no one uses the first BIOS interrupt vector. + */ + + /* Check all acceptable ranges. */ + if (vir_addr >= BIOS_MEM_BEGIN && vir_addr + bytes <= BIOS_MEM_END) + return (phys_bytes) vir_addr; + else if (vir_addr >= BASE_MEM_TOP && vir_addr + bytes <= UPPER_MEM_END) + return (phys_bytes) vir_addr; + kprintf("Warning, error in umap_bios, virtual address 0x%x\n", vir_addr); + return 0; +} + /*===========================================================================* * virtual_copy * *===========================================================================*/ diff --git a/kernel/system.h b/kernel/system.h index 64dcad145..b4af92f18 100644 --- a/kernel/system.h +++ b/kernel/system.h @@ -2,7 +2,7 @@ * are undefined to do_unused if the kernel call is not enabled in config.h. * The implementation is contained in src/kernel/system/. * - * The system library allows to access system services by doing a system call. + * The system library allows to access system services by doing a kernel call. * System calls are transformed into request messages to the SYS task that is * responsible for handling the call. By convention, sys_call() is transformed * into a message with type SYS_CALL that is handled in a function do_call(). @@ -11,7 +11,7 @@ * Jul 30, 2005 created SYS_INT86 to support BIOS driver (Philip Homburg) * Jul 13, 2005 created SYS_PRIVCTL to manage services (Jorrit N. Herder) * Jul 09, 2005 updated SYS_KILL to signal services (Jorrit N. Herder) - * Jun 21, 2005 created SYS_NICE for nice(2) system call (Ben J. Gras) + * Jun 21, 2005 created SYS_NICE for nice(2) kernel call (Ben J. Gras) * Jun 21, 2005 created SYS_MEMSET to speed up exec(2) (Ben J. Gras) * Apr 12, 2005 updated SYS_VCOPY for virtual_copy() (Jorrit N. Herder) * Jan 20, 2005 updated SYS_COPY for virtual_copy() (Jorrit N. Herder) diff --git a/kernel/system/do_abort.c b/kernel/system/do_abort.c index 3f9670fb3..a30eb7289 100644 --- a/kernel/system/do_abort.c +++ b/kernel/system/do_abort.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_ABORT * - * The parameters for this system call are: + * The parameters for this kernel call are: * m1_i1: ABRT_HOW (how to abort, possibly fetch monitor params) * m1_i2: ABRT_MON_PROC (proc nr to get monitor params from) * m1_i3: ABRT_MON_LEN (length of monitor params) @@ -19,9 +19,9 @@ PUBLIC int do_abort(m_ptr) message *m_ptr; /* pointer to request message */ { -/* Handle sys_abort. MINIX is unable to continue. This can originate in the - * PM (normal abort or panic) or FS (panic), or TTY (after CTRL-ALT-DEL). - */ + /* Handle sys_abort. MINIX is unable to continue. This can originate in the + * PM (normal abort or panic) or TTY (after CTRL-ALT-DEL). + */ int how = m_ptr->ABRT_HOW; int proc_nr; int length; diff --git a/kernel/system/do_copy.c b/kernel/system/do_copy.c index 5e458978b..9c1431835 100644 --- a/kernel/system/do_copy.c +++ b/kernel/system/do_copy.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_VIRCOPY, SYS_PHYSCOPY * - * The parameters for this system call are: + * The parameters for this kernel call are: * m5_c1: CP_SRC_SPACE source virtual segment * m5_l1: CP_SRC_ADDR source offset within segment * m5_i1: CP_SRC_PROC_NR source process number @@ -24,7 +24,7 @@ register message *m_ptr; /* pointer to request message */ { /* Handle sys_vircopy() and sys_physcopy(). Copy data using virtual or * physical addressing. Although a single handler function is used, there - * are two different system calls so that permissions can be checked. + * are two different kernel calls so that permissions can be checked. */ struct vir_addr vir_addr[2]; /* virtual source and destination address */ phys_bytes bytes; /* number of bytes to copy */ diff --git a/kernel/system/do_devio.c b/kernel/system/do_devio.c index 5d22d63b8..36241523a 100644 --- a/kernel/system/do_devio.c +++ b/kernel/system/do_devio.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_DEVIO * - * The parameters for this system call are: + * The parameters for this kernel call are: * m2_i3: DIO_REQUEST (request input or output) * m2_i1: DIO_TYPE (flag indicating byte, word, or long) * m2_l1: DIO_PORT (port to read/ write) diff --git a/kernel/system/do_endksig.c b/kernel/system/do_endksig.c index 1dca1d432..7e8038649 100644 --- a/kernel/system/do_endksig.c +++ b/kernel/system/do_endksig.c @@ -1,7 +1,7 @@ -/* The system call that is implemented in this file: +/* The kernel call that is implemented in this file: * m_type: SYS_ENDKSIG * - * The parameters for this system call are: + * The parameters for this kernel call are: * m2_i1: SIG_PROC # process for which PM is done */ diff --git a/kernel/system/do_exec.c b/kernel/system/do_exec.c index c322e5206..932d42eca 100644 --- a/kernel/system/do_exec.c +++ b/kernel/system/do_exec.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_EXEC * - * The parameters for this system call are: + * The parameters for this kernel call are: * m1_i1: PR_PROC_NR (process that did exec call) * m1_p1: PR_STACK_PTR (new stack pointer) * m1_p2: PR_NAME_PTR (pointer to program name) diff --git a/kernel/system/do_exit.c b/kernel/system/do_exit.c index c76ecfa9a..f8d6e1d3e 100644 --- a/kernel/system/do_exit.c +++ b/kernel/system/do_exit.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_EXIT * - * The parameters for this system call are: + * The parameters for this kernel call are: * m1_i1: PR_PROC_NR (slot number of exiting process) */ diff --git a/kernel/system/do_fork.c b/kernel/system/do_fork.c index a500da249..ec56cd919 100644 --- a/kernel/system/do_fork.c +++ b/kernel/system/do_fork.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_FORK * - * The parameters for this system call are: + * The parameters for this kernel call are: * m1_i1: PR_PROC_NR (child's process table slot) * m1_i2: PR_PPROC_NR (parent, process that forked) */ diff --git a/kernel/system/do_getinfo.c b/kernel/system/do_getinfo.c index 9159a79d1..f6bed77a3 100644 --- a/kernel/system/do_getinfo.c +++ b/kernel/system/do_getinfo.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_GETINFO * - * The parameters for this system call are: + * The parameters for this kernel call are: * m1_i3: I_REQUEST (what info to get) * m1_p1: I_VAL_PTR (where to put it) * m1_i1: I_VAL_LEN (maximum length expected, optional) diff --git a/kernel/system/do_getksig.c b/kernel/system/do_getksig.c index d20d2f205..1910d7df0 100644 --- a/kernel/system/do_getksig.c +++ b/kernel/system/do_getksig.c @@ -1,7 +1,7 @@ -/* The system call that is implemented in this file: +/* The kernel call that is implemented in this file: * m_type: SYS_GETKSIG * - * The parameters for this system call are: + * The parameters for this kernel call are: * m2_i1: SIG_PROC # process with pending signals * m2_l1: SIG_MAP # bit map with pending signals */ @@ -18,7 +18,7 @@ PUBLIC int do_getksig(m_ptr) message *m_ptr; /* pointer to request message */ { -/* PM is ready to accept signals and repeatedly does a system call to get +/* PM is ready to accept signals and repeatedly does a kernel call to get * one. Find a process with pending signals. If no signals are available, * return NONE in the process number field. * It is not sufficient to ready the process when PM is informed, because diff --git a/kernel/system/do_int86.c b/kernel/system/do_int86.c index 004d4b9ea..36df4ecde 100644 --- a/kernel/system/do_int86.c +++ b/kernel/system/do_int86.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_INT86 * - * The parameters for this system call are: + * The parameters for this kernel call are: * m1_p1: INT86_REG86 */ diff --git a/kernel/system/do_irqctl.c b/kernel/system/do_irqctl.c index 8282d6306..3998e6cf9 100644 --- a/kernel/system/do_irqctl.c +++ b/kernel/system/do_irqctl.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_IRQCTL * - * The parameters for this system call are: + * The parameters for this kernel call are: * m5_c1: IRQ_REQUEST (control operation to perform) * m5_c2: IRQ_VECTOR (irq line that must be controlled) * m5_i1: IRQ_POLICY (irq policy allows reenabling interrupts) diff --git a/kernel/system/do_kill.c b/kernel/system/do_kill.c index 442a0e4e8..9b87a1fe7 100644 --- a/kernel/system/do_kill.c +++ b/kernel/system/do_kill.c @@ -1,7 +1,7 @@ -/* The system call that is implemented in this file: +/* The kernel call that is implemented in this file: * m_type: SYS_KILL * - * The parameters for this system call are: + * The parameters for this kernel call are: * m2_i1: SIG_PROC # process to signal/ pending * m2_i2: SIG_NUMBER # signal number to send to process */ diff --git a/kernel/system/do_memset.c b/kernel/system/do_memset.c index eafaf2898..a6f88f606 100644 --- a/kernel/system/do_memset.c +++ b/kernel/system/do_memset.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_MEMSET * - * The parameters for this system call are: + * The parameters for this kernel call are: * m2_p1: MEM_PTR (virtual address) * m2_l1: MEM_COUNT (returns physical address) * m2_l2: MEM_PATTERN (size of datastructure) diff --git a/kernel/system/do_newmap.c b/kernel/system/do_newmap.c index 330c33bc5..f99f65dec 100644 --- a/kernel/system/do_newmap.c +++ b/kernel/system/do_newmap.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_NEWMAP * - * The parameters for this system call are: + * The parameters for this kernel call are: * m1_i1: PR_PROC_NR (install new map for this process) * m1_p1: PR_MEM_PTR (pointer to the new memory map) */ diff --git a/kernel/system/do_nice.c b/kernel/system/do_nice.c index c879f7e97..cb0ad6692 100644 --- a/kernel/system/do_nice.c +++ b/kernel/system/do_nice.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_NICE * - * The parameters for this system call are: + * The parameters for this kernel call are: * m1_i1: PR_PROC_NR process number to change priority * m1_i2: PR_PRIORITY the new priority */ diff --git a/kernel/system/do_privctl.c b/kernel/system/do_privctl.c index bfd06a445..b87619278 100644 --- a/kernel/system/do_privctl.c +++ b/kernel/system/do_privctl.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_PRIVCTL * - * The parameters for this system call are: + * The parameters for this kernel call are: * m1_i1: PR_PROC_NR (process number of caller) */ diff --git a/kernel/system/do_sdevio.c b/kernel/system/do_sdevio.c index 976db7f97..831a18b87 100644 --- a/kernel/system/do_sdevio.c +++ b/kernel/system/do_sdevio.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_SDEVIO * - * The parameters for this system call are: + * The parameters for this kernel call are: * m2_i3: DIO_REQUEST (request input or output) * m2_i1: DIO_TYPE (flag indicating byte, word, or long) * m2_l1: DIO_PORT (port to read/ write) diff --git a/kernel/system/do_segctl.c b/kernel/system/do_segctl.c index b9f6f0017..b6bdd00f4 100644 --- a/kernel/system/do_segctl.c +++ b/kernel/system/do_segctl.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_SEGCTL * - * The parameters for this system call are: + * The parameters for this kernel call are: * m4_l3: SEG_PHYS (physical base address) * m4_l4: SEG_SIZE (size of segment) * m4_l1: SEG_SELECT (return segment selector here) diff --git a/kernel/system/do_setalarm.c b/kernel/system/do_setalarm.c index 85a456874..a20d32383 100644 --- a/kernel/system/do_setalarm.c +++ b/kernel/system/do_setalarm.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_SETALARM * - * The parameters for this system call are: + * The parameters for this kernel call are: * m2_l1: ALRM_EXP_TIME (alarm's expiration time) * m2_i2: ALRM_ABS_TIME (expiration time is absolute?) * m2_l1: ALRM_TIME_LEFT (return seconds left of previous) diff --git a/kernel/system/do_sigreturn.c b/kernel/system/do_sigreturn.c index 9b8bed414..a821d3b3c 100644 --- a/kernel/system/do_sigreturn.c +++ b/kernel/system/do_sigreturn.c @@ -1,7 +1,7 @@ -/* The system call that is implemented in this file: +/* The kernel call that is implemented in this file: * m_type: SYS_SIGRETURN * - * The parameters for this system call are: + * The parameters for this kernel call are: * m2_i1: SIG_PROC # process returning from handler * m2_p1: SIG_CTXT_PTR # pointer to sigcontext structure * diff --git a/kernel/system/do_sigsend.c b/kernel/system/do_sigsend.c index f37048388..712152712 100644 --- a/kernel/system/do_sigsend.c +++ b/kernel/system/do_sigsend.c @@ -1,7 +1,7 @@ -/* The system call that is implemented in this file: +/* The kernel call that is implemented in this file: * m_type: SYS_SIGSEND * - * The parameters for this system call are: + * The parameters for this kernel call are: * m2_i1: SIG_PROC # process to call signal handler * m2_p1: SIG_CTXT_PTR # pointer to sigcontext structure * m2_i3: SIG_FLAGS # flags for S_SIGRETURN call diff --git a/kernel/system/do_times.c b/kernel/system/do_times.c index bbd925bcc..53b9bec24 100644 --- a/kernel/system/do_times.c +++ b/kernel/system/do_times.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_TIMES * - * The parameters for this system call are: + * The parameters for this kernel call are: * m4_l1: T_PROC_NR (get info for this process) * m4_l1: T_USER_TIME (return values ...) * m4_l2: T_SYSTEM_TIME @@ -22,7 +22,7 @@ register message *m_ptr; /* pointer to request message */ register struct proc *rp; int proc_nr; - /* Insert the times needed by the SYS_TIMES system call in the message. + /* Insert the times needed by the SYS_TIMES kernel call in the message. * The clock's interrupt handler may run to update the user or system time * while in this code, but that cannot do any harm. */ diff --git a/kernel/system/do_trace.c b/kernel/system/do_trace.c index 7b7328a07..0e62842eb 100644 --- a/kernel/system/do_trace.c +++ b/kernel/system/do_trace.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_TRACE * - * The parameters for this system call are: + * The parameters for this kernel call are: * m2_i1: CTL_PROC_NR process that is traced * m2_i2: CTL_REQUEST trace request * m2_l1: CTL_ADDRESS address at traced process' space diff --git a/kernel/system/do_umap.c b/kernel/system/do_umap.c index 79956e19f..04c981e72 100644 --- a/kernel/system/do_umap.c +++ b/kernel/system/do_umap.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_UMAP * - * The parameters for this system call are: + * The parameters for this kernel call are: * m5_i1: CP_SRC_PROC_NR (process number) * m5_c1: CP_SRC_SPACE (segment where address is: T, D, or S) * m5_l1: CP_SRC_ADDR (virtual address) diff --git a/kernel/system/do_unused.c b/kernel/system/do_unused.c index 61bfba040..4e2b0001b 100644 --- a/kernel/system/do_unused.c +++ b/kernel/system/do_unused.c @@ -1,4 +1,4 @@ -/* This file provides a catch-all handler for unused system calls. A system +/* This file provides a catch-all handler for unused kernel calls. A kernel * call may be unused when it is not defined or when it is disabled in the * kernel's configuration. */ diff --git a/kernel/system/do_vcopy.c b/kernel/system/do_vcopy.c index 47260cfc5..8db9e9526 100644 --- a/kernel/system/do_vcopy.c +++ b/kernel/system/do_vcopy.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_VIRVCOPY, SYS_PHYSVCOPY * - * The parameters for this system call are: + * The parameters for this kernel call are: * m1_i3: VCP_VEC_SIZE size of copy request vector * m1_p1: VCP_VEC_ADDR address of vector at caller * m1_i2: VCP_NR_OK number of successfull copies @@ -23,7 +23,7 @@ register message *m_ptr; /* pointer to request message */ { /* Handle sys_virvcopy() and sys_physvcopy() that pass a vector with copy * requests. Although a single handler function is used, there are two - * different system calls so that permissions can be checked. + * different kernel calls so that permissions can be checked. */ int nr_req; int caller_pid; diff --git a/kernel/system/do_vdevio.c b/kernel/system/do_vdevio.c index f79fbff47..54a5d65f2 100644 --- a/kernel/system/do_vdevio.c +++ b/kernel/system/do_vdevio.c @@ -1,7 +1,7 @@ -/* The system call implemented in this file: +/* The kernel call implemented in this file: * m_type: SYS_VDEVIO * - * The parameters for this system call are: + * The parameters for this kernel call are: * m2_i3: DIO_REQUEST (request input or output) * m2_i1: DIO_TYPE (flag indicating byte, word, or long) * m2_p1: DIO_VEC_ADDR (pointer to port/ value pairs) diff --git a/kernel/table.c b/kernel/table.c index 0f55f32b2..1996debe5 100755 --- a/kernel/table.c +++ b/kernel/table.c @@ -73,7 +73,7 @@ PUBLIC char *t_stack[TOT_STACK_SPACE / sizeof(char *)]; /* Define kernel calls that processes are allowed to make. This is not looking * very nice, but we need to define the access rights on a per call basis. - * Note that the system services manager has all bits on, because it should + * Note that the reincarnation server has all bits on, because it should * be allowed to distribute rights to services that it starts. */ #define c(n) (1 << ((n)-KERNEL_CALL)) diff --git a/kernel/utility.c b/kernel/utility.c index fe7ee3607..cff07830e 100755 --- a/kernel/utility.c +++ b/kernel/utility.c @@ -127,7 +127,7 @@ PRIVATE void kputc(c) int c; /* character to append */ { /* Accumulate a single character for a kernel message. Send a notification - * the to output driver if an END_OF_KMESS is encountered. + * to the output driver if an END_OF_KMESS is encountered. */ if (c != END_OF_KMESS) { kmess.km_buf[kmess.km_next] = c; /* put normal char in buffer */ diff --git a/tools/mkboot b/tools/mkboot index 63196b22d..ff25c2490 100755 --- a/tools/mkboot +++ b/tools/mkboot @@ -70,6 +70,7 @@ hdboot) if [ -z "$revision" ] then + target="${version}" revision=0 elif [ -f $rootdir/boot/image/$target ] then @@ -80,8 +81,8 @@ hdboot) exit 0 fi revision=`expr $revision + 1` + target="${version}r${revision}" fi - target="${version}r${revision}" set -- `ls -t $rootdir/boot/image` diff --git a/tools/release.sh b/tools/release.sh index 3bfbe6a65..2c20ba6c6 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -66,12 +66,13 @@ BS=4096 HDEMU=0 COPY=0 +CVSTAG=HEAD -while getopts "chaq?" c +while getopts "r:ch?" c do case "$c" in \?) - echo "Usage: $0 [-a] [-c] [-h]" >&2 + echo "Usage: $0 [-c] [-h] [-r ]" >&2 exit 1 ;; h) @@ -83,9 +84,14 @@ do echo " * Copying, not CVS" COPY=1 ;; + r) + CVSTAG=$OPTARG + ;; esac done +echo "CVS tag: $OPTARG" + ISO=${ISO}.iso ISOGZ=${ISO}.gz echo "Making $ISOGZ" @@ -167,7 +173,7 @@ chmod -R u+w $RELEASEDIR/usr/lib if [ "$COPY" -ne 1 ] then echo " * Doing new cvs export" - ( cd $RELEASEDIR/usr && mkdir src && cvs export -rHEAD src ) + ( cd $RELEASEDIR/usr && mkdir src && cvs export -r$CVSTAG src ) else ( cd .. && make clean ) srcdir=/usr/src diff --git a/tools/release/cd/README.TXT b/tools/release/cd/README.TXT index a2fab14cf..f83176750 100644 --- a/tools/release/cd/README.TXT +++ b/tools/release/cd/README.TXT @@ -6,8 +6,8 @@ Operating Systems Design and Implementation, 3rd Edition by Andrew S. Tanenbaum and Albert S. Woodhull Text ISBN: 0-13-142938-8 CD ISBN: 0-13-142987-6 - Copyright 2006, 1997, 1987 Pearson Education, Inc. - MINIX 3 Copyright 2006, 1997, 1987 Vrije Universiteit + MINIX 3 Copyright 2006, 1997, 1987, Vrije Universiteit, Amsterdam, The Netherlands + CD-ROM Copyright 2006, 1997, 1987, Pearson Education, Inc., Upper Saddle River, NJ All rights reserved. ------------------------------------------------------------------------ @@ -63,7 +63,9 @@ This CD contains: - LISTING.PS Appendix B in PostScript - LISTING.PDF Appendix B in PDF - INDEX.TXT Index of files - + - BOOKSRC.TGZ gzipped UNIX tar file of the files listed in the book + plus modified Makefiles and additional files to + compile the book subset of Minix. There are also many invisible files used for installing MINIX 3.