view kernel/src/kernel.c3 @ 393:6ae782a085e0

Added init program
author Windel Bouwman
date Sat, 17 May 2014 21:17:40 +0200
parents 6df89163e114
children
line wrap: on
line source

module kernel;

import memory;
import process;
import scheduler;
import arch;
import io;

// Globals:
var process.process_t* init_proc;


// Main entry point of the kernel:
function void start()
{
    io.println("Welcome to lcfos!");
    arch.init();

    process.init();
    memory.init();

    init_proc = process.Create();

    // TODO: copy content into process??
    // Create a second process:
    process.Create();

    io.print2("init address ", cast<int>(init_proc));

    //scheduler:queue(proc);
    io.println("Kernel finished");
    panic();
}

// Called in total stress:
function void panic()
{
    arch.halt();
}