os/kernel/kernel.c

59 lines
922 B
C
Raw Normal View History

2024-07-11 08:56:52 +02:00
#include <kernel/tty.h>
#include <kernel/idt.h>
#include <debugging.h>
#include <kernel/elf.h>
/* 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
2024-07-11 08:56:52 +02:00
uint8_t program[] = {
/* 0xcd,
0x80,
0xc6,
0x05,
0x00,
0x80,
0x0b,
0x00,
0x62,
0xeb,
0xfe, */
/* 0x90,
0xe9,
0xfa,
0x7f,
0x7b,
0xf8, */
/* 0x90,
0xeb,
0xfd, */
0x6a,
0x69,
0xeb,
0xfc,
};
2024-07-11 08:56:52 +02:00
void kernel_main(void)
{
/* Initialize terminal interface */
// terminal_initialize();
idt_init();
2024-07-11 08:56:52 +02:00
run_program(program, 15);
/*
char buf[100];
2024-07-11 08:56:52 +02:00
while (true) {
asm("mov %0, %%edx" :: "r" (buf));
asm("int $0x81");
terminal_writestring("newline");
terminal_putchar('\n');
2024-07-11 08:56:52 +02:00
}
*/
2024-07-11 08:56:52 +02:00
}