X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Ftour.texi;h=e9ba008f89ef9a15843dac2875e423b3f1ceefb7;hb=51fe56156dc541c9fa74e0eb72e7cca1ddcec685;hp=ae9e74ebc177ee3c0cf28258a5d6d01e038d9faa;hpb=36088b8cdcd561b472b60ae5e9cf7a5fde9132b9;p=pintos-anon diff --git a/doc/tour.texi b/doc/tour.texi index ae9e74e..e9ba008 100644 --- a/doc/tour.texi +++ b/doc/tour.texi @@ -173,7 +173,8 @@ and @func{syscall_init}. Now that interrupts are set up, we can start preemptively scheduling threads with @func{thread_start}, which also enables interrupts. Interrupt-driven serial port I/O is also possible now, so we use -@func{serial_init_queue} to switch to that mode. +@func{serial_init_queue} to switch to that mode. Finally, +@func{timer_calibrate} calibrates the timer for accurate short delays. If the filesystem is compiled in, as it will be in project 2 and later, we now initialize the disks with @func{disk_init}, then the @@ -204,7 +205,7 @@ threads to continue running. @end menu @node struct thread -@subsection @struct{thread} +@subsection @code{struct thread} The main Pintos data structure for threads is @struct{thread}, declared in @file{threads/thread.h}. @struct{thread} has these @@ -283,6 +284,7 @@ memory. The rest of the page is used for the thread's stack, which grows downward from the end of the page. It looks like this: @example +@group 4 kB +---------------------------------+ | kernel stack | | | | @@ -304,6 +306,7 @@ grows downward from the end of the page. It looks like this: | name | | status | 0 kB +---------------------------------+ +@end group @end example The upshot of this is twofold. First, @struct{thread} must not be @@ -346,8 +349,8 @@ called early in Pintos initialization. Called by @func{main} to start the scheduler. Creates the idle thread, that is, the thread that is scheduled when no other thread is ready. Then enables interrupts, which enables the scheduler because -processes are rescheduled in the return path from the timer -interrupt. FIXME +processes are rescheduled on return from the timer interrupt, using +@func{intr_yield_on_return} (@pxref{External Interrupt Handling}). @end deftypefun @deftypefun void thread_create (const char *@var{name}, int @var{priority}, thread_func *@var{func}, void *@var{aux})