2024-09-06 19:44:40 -04:00
|
|
|
#include "kprintf.h"
|
2024-09-07 06:11:38 -04:00
|
|
|
#include "terminal.h"
|
2024-09-06 19:44:40 -04:00
|
|
|
|
2024-09-06 17:36:07 -04:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.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
|
|
|
|
|
|
|
|
/* This tutorial will only work for the 32-bit ix86 targets. */
|
|
|
|
#if !defined(__i386__)
|
|
|
|
#error "This tutorial needs to be compiled with a ix86-elf compiler"
|
|
|
|
#endif
|
|
|
|
|
2024-09-07 06:11:38 -04:00
|
|
|
void kernel_main(void)
|
|
|
|
{
|
|
|
|
/* Initialize terminal interface */
|
|
|
|
terminal_initialize();
|
2024-09-06 17:36:07 -04:00
|
|
|
|
2024-09-07 06:11:38 -04:00
|
|
|
/* Newline support is left as an exercise. */
|
2024-09-09 12:00:17 -04:00
|
|
|
for (int i = 100; i; i--)
|
2024-09-07 08:35:52 -04:00
|
|
|
kprintf(0, "%d\n", i);
|
2024-09-09 12:00:17 -04:00
|
|
|
void initGdt();
|
2024-09-07 23:03:50 -04:00
|
|
|
kprintf(0, "mange ta mere avec ton argument a kprintf fdp\n");
|
2024-09-07 08:37:47 -04:00
|
|
|
while (true)
|
|
|
|
terminal_getkey();
|
2024-09-06 17:36:07 -04:00
|
|
|
}
|