How does everything get started?

The VR Juggler system is started separately from the actually application. To load the system, a boot loader process instantiates the kernel and gives it a new thread to start running. The kernel then initializes the system and waits for an application to be handed to it or for configuration data is passed to it.

Example 1. Kernel Startup

...
// Start the kernel
vjKernel* kernel = vjKernel::instance();
kernel->start();
.
.
.
// Instantiate application. Set application
wandApp* application = new wandApp(kernel);
kernel->setApplication(application);
...

An application is given to the kernel at a later time through the kernel interface. Once the kernel has an application, it begins executing application methods within the kernel execution frame. The application can be given to the kernel as a dynamic object or as an object allocate in the kernel boot loader code. In the case that object is allocate in the loader, a common main() function (see Example 1) can hold both the kernel start code and the code to give the kernel the application.