view kernel/src/kernel.c3 @ 365:98ff43cfdd36

Nasty bug in adr instruction
author Windel Bouwman
date Wed, 19 Mar 2014 22:32:04 +0100
parents c49459768aaa
children 577ed7fb3fe4
line wrap: on
line source

module kernel;

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

var int G;

function void do()
{
    G = G + 1;
    io.print2("G = ", G);
}

// Main entry point of the kernel:
function void start()
{
    G = 0;
    arch.init();

    io.println("Welcome to lcfos!");

    do();
    do();
    do();
    io.println("Welcome 2!");
    do();
    do();

    io.print_int(0x1337);
    io.print_int(cast<int>(&G));
    //io.print2("Test: ", 0x13);

    var int a;
    for (a = 0; a < 2; a = a + 1)
    {
      io.print2("a = ", a);
    }

    io.print2("PFR0 = ", arch.pfr0());
    io.print2("PFR1 = ", arch.pfr1());
    io.print2("MMFR0 = ", arch.mmfr0());
    // io.print2("MPUIR = ", arch.mpuir());

    // process.init();
    //memory:init();

    //Process proc = new process:Process();

    //scheduler:queue(proc);
    while(true) {}
}

function void panic()
{
    arch.halt();
}