#include #include #include #include #include #include #include #include /* Check if the compiler thinks you are targeting the wrong operating system. */ #if defined(__linux__) #error "You are not using a cross-compiler, you will most certainly run into trouble" #endif uint8_t program[] = { 0xcd, 0x80, // int $0x80 0xb9, 0x02, 0x00, 0x00, 0x00, // mov $0, %ecx 0xff, 0xe1, // jmp *%ecx }; // uint8_t data[] = "Hello From Userspace\n"; uint8_t data[] = {}; void irq0(); void kernel_main(void) { /* Initialize terminal interface */ terminal_initialize(); terminal_writestring("Hello from Kernelspace\n"); idt_init(); init_pic(); heap_init(); setup_tasks(); setup_paging(); terminal_writestring("Woaw\n"); asm("cli"); run_program(program, sizeof(program), data, sizeof(data)); asm("sti"); asm("int $0x20"); int i = 0; while (true) { i += 1; if (i == 1 << 16) { asm("int $0x80"); i = 0; } } }