示例#1
0
extern C int kernel_main()
{
    // Initialize heap at 3MB offset
    // TODO: fix this
    Kernel::heap( MegaByte(3),
                  MegaByte(1) );

    // Start kernel debug serial console
    // TODO: can I re-use the user-land driver here somehow????
    IntelSerial *serial = new IntelSerial(0x3f8);
    serial->setMinimumLogLevel(Log::Notice);

    // TODO: put this in the boot.S, or maybe hide it in the support library? maybe a _run_main() or something.
    constructors();

    // Kernel memory range (first 4MB, includes 1MB heap)
    Memory::Range kernelRange;
    kernelRange.phys = 0;
    kernelRange.size = MegaByte(4);

    // RAM physical range for this core (SplitAllocator lower memory).
    Memory::Range ramRange;
    ramRange.phys = 0;
    ramRange.size = (multibootInfo.memUpper * 1024) + MegaByte(1);

    // Create and run the kernel
    IntelKernel *kernel = new IntelKernel(kernelRange, ramRange);
    return kernel->run();
}
示例#2
0
void IntelKernel::clocktick(CPUState *state, ulong param)
{
    IntelKernel *kern = (IntelKernel *) Kernel::instance;

    kern->enableIRQ(kern->m_pit.getInterruptVector(), true);
    kern->getProcessManager()->schedule();
}
示例#3
0
void IntelKernel::clocktick(CPUState *state, ulong param)
{
    IntelKernel *kern = (IntelKernel *) Kernel::instance;
    Size irq = kern->m_timer->getInterrupt();

#warning not working for APIC timer, because the timer IRQ is out of range on the PIC
    kern->enableIRQ(irq, true);

#warning TODO: tmp hack for APIC timer end-of-interrupt
    if (irq == kern->m_apic.getInterrupt())
        kern->m_apic.clear(irq);

    kern->m_timer->tick();
    kern->getProcessManager()->schedule();
}
示例#4
0
extern C int kernel_main(CoreInfo *info)
{
    // Initialize heap at 3MB offset
    // TODO: fix this
    Kernel::heap( MegaByte(3),
                  MegaByte(1) );

    // Start kernel debug serial console
    // TODO: can I re-use the user-land driver here somehow????
    if (info->coreId == 0)
    {
        IntelSerial *serial = new IntelSerial(0x3f8);
        serial->setMinimumLogLevel(Log::Notice);
    }

    // TODO: put this in the boot.S, or maybe hide it in the support library? maybe a _run_main() or something.
    constructors();

    // Create and run the kernel
    IntelKernel *kernel = new IntelKernel(info);
    return kernel->run();
}