Compare commits

...

39 Commits
main ... R3.1.0

Author SHA1 Message Date
Ben Gras
d6da91f5b5 minix3.org 2005-10-18 21:04:10 +00:00
Ben Gras
5f39576ab5 Update readme to say booksrc.tgz is .tar.gz 2005-10-18 20:14:40 +00:00
Ben Gras
2ba4855676 New README; renamed SYSTEM.TAR 2005-10-18 19:36:43 +00:00
Ben Gras
b187c96cc4 Bugfix by Joren 2005-10-18 19:30:45 +00:00
Ben Gras
a4a88aa585 Mention bug reporting. 2005-10-18 19:29:27 +00:00
Ben Gras
97c1d38f73 Latest listing etc. files + addition of SYSTEM.TAR 2005-10-18 15:21:25 +00:00
Ben Gras
81c9a2a959 Take nvi out of the small compile list. 2005-10-16 20:14:40 +00:00
Ben Gras
932584447a Getpack -> easypack 2005-10-14 19:11:44 +00:00
Ben Gras
4358a8373f Install images withour revision files as e.g. '3.1.0' 2005-10-14 17:38:08 +00:00
Ben Gras
5903f48153 extra isa bridge 2005-10-14 15:16:27 +00:00
Ben Gras
55b902ad63 Don't put /usr/gnu/bin in the default path. 2005-10-14 14:55:22 +00:00
Ben Gras
b74b0116b4 Al's polishings of comments and order 2005-10-14 14:45:50 +00:00
Ben Gras
1951b93161 Call book version 3.1.0 instead of 3.1 2005-10-14 14:38:28 +00:00
Ben Gras
975e5cec41 Al's system -> kernel call rename 2005-10-14 09:14:49 +00:00
Ben Gras
aa1a6bf82a Al's system call -> kernel call changes 2005-10-14 08:50:02 +00:00
Ben Gras
013db76a09 .. but working 2005-10-13 17:09:46 +00:00
Ben Gras
9a7edf7751 Book version gets to use -r too 2005-10-13 17:01:52 +00:00
Ben Gras
8547f38014 Comment fix - no abort in filesystem. 2005-10-13 09:42:48 +00:00
Ben Gras
bea7974ebb Get out silly debug message 2005-10-13 08:49:17 +00:00
Ben Gras
12c79e53f1 Minor number for pty nodes computed wrongly 2005-10-11 17:05:43 +00:00
Ben Gras
8d46259c7d Added /usr/gnu/bin to $PATH as last search step 2005-10-10 14:43:27 +00:00
Ben Gras
d6e43b28e5 fix 2005-10-10 09:03:22 +00:00
Ben Gras
1f497fe707 Make mkdir -p "a/./b" work (with ".") 2005-10-10 09:02:47 +00:00
Ben Gras
bd5afd235a Al's new clock.c (cosmetic rearrangement) 2005-10-09 19:52:27 +00:00
Ben Gras
739028d5d6 *** empty log message *** 2005-10-07 14:00:29 +00:00
Ben Gras
fff6f5aead Make binsizes work if src isn't in /etc/src. Also include
/usr/lib/ego/* files.
2005-10-07 13:50:43 +00:00
Ben Gras
7a1a558edd Comment corrections from Al 2005-10-07 13:23:39 +00:00
Ben Gras
75aff6dce4 Make (book) etc Makefile work if source tree isn't called /usr/src 2005-10-06 15:30:08 +00:00
Ben Gras
71e3054219 Don't make /usr/home any more for the book either 2005-10-06 15:28:48 +00:00
Ben Gras
5e5d2f16b9 Fix bug introduced by suppressing error message of dead destinations
during shutdown
2005-10-06 12:06:27 +00:00
Ben Gras
1ef8d537ca Corrected correction of clock's 2005-10-06 10:20:57 +00:00
Ben Gras
d0729a277e Missing newline 2005-10-06 09:41:27 +00:00
Ben Gras
e0a49448f7 Semidefinitive copyright statement. 2005-10-06 09:37:31 +00:00
Ben Gras
675bbd6040 Al's comment fixes 2005-10-05 08:21:16 +00:00
Ben Gras
7e67da41a3 Al's comment bug. 2005-10-04 08:29:25 +00:00
Ben Gras
0c2206646a Fixed wrong comment 2005-10-04 08:27:33 +00:00
Ben Gras
d5ddeb8155 Al's comment fixes. 2005-10-03 14:24:11 +00:00
Ben Gras
793efc6719 Al's omment fixes. 2005-10-02 19:00:17 +00:00
Ben Gras
3e3230fc79 Add option to script to make releases from cvs tags/branches. 2005-09-29 13:03:42 +00:00
50 changed files with 185 additions and 225 deletions

View File

@ -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

View File

@ -246,7 +246,7 @@ ccl:
p++;
}
p++;
if (found == negate)
if (found == negate || c == 0)
goto bad;
break;
case RE_LP:

View File

@ -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 $? $@

View File

@ -1,6 +1,6 @@
#!/bin/sh
t=/usr/src/etc/binary_sizes
t=/etc/binary_sizes
if [ "$#" -ne 1 ]
then echo "Usage: $0 <big|normal>"
@ -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 "}'

View File

@ -1,30 +0,0 @@
#!/bin/sh
if [ $# -ne 1 ]
then echo "Usage: $0 <url>"
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."

View File

@ -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);

View File

@ -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, },
};

View File

@ -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;
}
}

View File

@ -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

View File

@ -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 <bugs@minix3.org>.
For help with MINIX 3 and discussion about it, please subscribe to the
newsgroup: comp.os.minix.

View File

@ -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

View File

@ -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

View File

@ -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 <timers.h> 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) */

View File

@ -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

View File

@ -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.
*/

View File

@ -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++) {

View File

@ -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 *
*===========================================================================*/

View File

@ -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)

View File

@ -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;

View File

@ -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 */

View File

@ -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)

View File

@ -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
*/

View File

@ -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)

View File

@ -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)
*/

View File

@ -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)
*/

View File

@ -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)

View File

@ -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

View File

@ -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
*/

View File

@ -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)

View File

@ -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
*/

View File

@ -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)

View File

@ -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)
*/

View File

@ -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
*/

View File

@ -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)
*/

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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
*

View File

@ -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

View File

@ -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.
*/

View File

@ -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

View File

@ -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)

View File

@ -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.
*/

View File

@ -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;

View File

@ -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)

View File

@ -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))

View File

@ -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 */

View File

@ -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`

View File

@ -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 <tag>]" >&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

View File

@ -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.