/* * Copyright 2010 Stefan Lankes, Chair for Operating Systems, * RWTH Aachen University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file is part of MetalSVM. */ #include #include #include #include #include #include #include #include #include void* STDCALL foo(void* arg) { int i; if (!arg) return NULL; for(i=0; i<5; i++) { kputs((char*) arg); sleep(1); } return NULL; } int main(void) { tid_t id1, id2; system_init(); irq_init(); koutput_init(); timer_init(); keyboard_init(); mmu_init(); multitasking_init(); irq_enable(); kprintf("Here is MetalSVM %s\n", METALSVM_VERSION); detect_cpu_frequency(); kprintf("Processor frequency: %d MHz\n", get_cpu_frequency()/1000000); kprintf("Kernel size: %u KBytes\n", atomic_size_read(&total_usage)/1024); timer_set_frequency(TIMER_FREQ); create_kernel_task(&id1, foo, "Hello from foo1\n", 8192); create_kernel_task(&id2, foo, "Hello from foo2\n", 0); current_task->idle = 1; schedule(); while(1) { NOP8; } return 0; }