#include <kernel.h>
#include <platform.h>
#include <proc.h>
#include <queue.h>
#include <semaphore.h>
#include <memory.h>
#include <clock.h>
#include <device.h>
#include <stdio.h>
#include <string.h>
#include <mips.h>
#include <gpio.h>
Go to the source code of this file.
Functions | |
void | _start (void) |
void | main (void) |
void | xdone (void) |
local | platforminit (void) |
local | sysinit (void) |
int | nulluser () |
Variables | |
void * | end |
struct pentry | proctab [NPROC] |
struct sentry | semtab [NSEM] |
queue | readylist |
struct memblock | freelist |
ushort | numproc |
ushort | currpid |
void * | minheap |
ulong | cpuid |
struct platform | platform |
Definition in file initialize.c.
void _start | ( | void | ) |
The system begins intializing after the C environment has been established. After intialization, the null process remains always in a ready (PRREADY) or running (PRCURR) state.
void main | ( | void | ) |
Referenced by nulluser().
int nulluser | ( | void | ) |
Intializes the system and becomes the null process. This is where the system begins after the C environment has been established. Interrupts are initially DISABLED, and must eventually be enabled explicitly. This routine turns itself into the null process after initialization. Because the null process must always remain ready to run, it cannot execute code that might cause it to be suspended, wait for a semaphore, or put to sleep, or exit. In particular, it must not do I/O unless it uses kprintf for synchronous output.
Definition at line 64 of file initialize.c.
References _start(), CONSOLE, cpuid, create(), enable(), end, INITPRIO, INITSTK, kprintf(), KSEG0_BASE, main(), minheap, nonempty, NULL, numproc, open(), platforminit(), ready(), readylist, resched(), RESCHED_NO, SERIAL0, sysinit(), and xdone().
local platforminit | ( | void | ) |
Determines and stores all platform specific information.
Definition at line 202 of file initialize.c.
References cpuid, KSEG0_BASE, MAXADDR_DEFAULT, MAXADDR_WRT350N, MAXADDR_WRT54G, MAXADDR_WRT54GL, OK, PRID_REV, PRID_REV_WRT350N, PRID_REV_WRT54G, PRID_REV_WRT54GL, strncpy(), SYSERR, TIME_BASE_FREQ_DEFAULT, TIME_BASE_FREQ_WRT350N, TIME_BASE_FREQ_WRT54G, TIME_BASE_FREQ_WRT54GL, UART_DLL_WRT350N, UART_DLL_WRT54G, and UART_DLL_WRT54GL.
Referenced by nulluser().
local sysinit | ( | void | ) |
Intializes all XINU data structures and devices.
Definition at line 134 of file initialize.c.
References clockinit(), sentry::count, currpid, devtab, end, freelist, GPIO_CTRL_LED_ON, GPIO_LED_CISCOWHT, dentry::init, isbaddev, memblock::length, minheap, pentry::name, NDEVS, newqueue(), memblock::next, NPROC, NSEM, NULL, NULLPROC, numproc, OK, PRCURR, PRFREE, pentry::prio, proctab, sentry::queue, readylist, roundmb, semtab, SFREE, sentry::state, pentry::state, pentry::stkbase, pentry::stklen, pentry::stkptr, strncpy(), and truncew.
Referenced by nulluser().
void xdone | ( | void | ) |
Print system completion message as last process exits.
Definition at line 18 of file xdone.c.
Referenced by nulluser().
void* end |
head of free memory list
Definition at line 42 of file initialize.c.
Referenced by freemem(), getmem(), sysinit(), and xsh_memstat().
void* minheap |
bottom of heap
Definition at line 49 of file initialize.c.
Referenced by freemem(), nulluser(), and sysinit().
currently active processes
Definition at line 45 of file initialize.c.
Referenced by create(), kill(), nulluser(), and sysinit().
Definition at line 52 of file initialize.c.
Definition at line 39 of file initialize.c.
Referenced by create(), kill(), newpid(), ready(), receive(), resched(), send(), sleep(), sysinit(), test_checkProcState(), wait(), xsh_memstat(), and xsh_ps().
Definition at line 41 of file initialize.c.
Referenced by nulluser(), ready(), resched(), and sysinit().
Definition at line 40 of file initialize.c.
Referenced by allocsem(), freesem(), kill(), newsem(), scount(), signal(), signaln(), sysinit(), test_checkSemCount(), test_deltaQueue(), test_procQueue(), and wait().