Previous Home Next


Initialization

Initial startup

The first code executed in the NetBSD kernel is low-level startup code provided as part of the board-specific software. This code is specified by the SYSTEM_FIRST_OBJ and SYSTEM_FIRST_SFILE defines in the Makefile fragment mk.vx115_vep (discussed in the section on configuration); the source file is vx115_vep_start.S in this project.

This assembly file is responsible for setting up the system so initial kernel execution can take place. It performs the following operations.
The initial MMU mapping is really just to allow the kernel to start executing from its relocated location in RAM, before it sets up its real page tables in the init_arm( ) routine, and to allow it to access peripherals during configuration.

Machine startup

The file vx115_vep_machdep.c provides platform-specific initialization. This file defines several functions and data structures: an initarm( ) function that performs basic system initialization, a cpu_reboot( ) function that restarts the system on reboot, and a pmap_devmap structure that defines the peripheral virtual-to-physical memory mapping. Fortunately, the vast majority of these functions are common across platforms, so existing code can be used with minor modifications. The vx115_vep_machdep.c file was based on the smdk2800_machdep.c source, and used the cpu_reboot function verbatim and the  initarm function with minor changes.

struct pmap_devmap vx115_vep_devmap[ ]

initarm( )

The initarm( ) function provides basic machine setup. It's called during initialization from arch/arm/arm32/locore.S, before the kernel main( ) function is called in kern/init_main.c. The initialization performed in this function is as follows.

consinit( )

The consinit( ) function is used to initialize the serial console just sufficiently to allow console messages to be printed. Further initialization of the serial interface is deferred to the autoconfig process.




Previous Home Next


Comments/questions: jsevy@cs.drexel.edu