2024-05-25 19:20:33 +03:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "tty.h"
|
|
|
|
#include "gdt.h"
|
|
|
|
#include "idt.h"
|
|
|
|
#include "timer.h"
|
|
|
|
#include "sys.h"
|
|
|
|
#include "interrupts.h"
|
|
|
|
#include "keyboard.h"
|
|
|
|
#include "shell.h"
|
|
|
|
#include "user_space.h"
|
|
|
|
#include "syscall.h"
|
2024-05-25 23:17:10 +03:00
|
|
|
#include "rtc.h"
|
2024-05-25 19:20:33 +03:00
|
|
|
|
|
|
|
void kernel_main(void)
|
|
|
|
{
|
2024-05-25 23:17:10 +03:00
|
|
|
terminal_initialize();
|
2024-05-25 19:20:33 +03:00
|
|
|
gdt_install();
|
|
|
|
|
|
|
|
idt_install();
|
|
|
|
isr_install();
|
|
|
|
irq_install();
|
|
|
|
|
|
|
|
timer_install();
|
|
|
|
keyboard_install();
|
|
|
|
|
2024-05-25 23:17:10 +03:00
|
|
|
rtc_init();
|
|
|
|
|
2024-05-25 19:20:33 +03:00
|
|
|
syscall_init();
|
|
|
|
enter_user_space();
|
|
|
|
}
|
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
|
|
|
for (int i = 1; i < 4; i++)
|
|
|
|
{
|
|
|
|
terminal_printf("&cTest &7%d\n", i);
|
2024-05-25 23:17:10 +03:00
|
|
|
delay(200);
|
2024-05-25 19:20:33 +03:00
|
|
|
}
|
|
|
|
terminal_clear();
|
|
|
|
|
|
|
|
terminal_printf("Welcome to &cDeadOS&7.\n");
|
|
|
|
terminal_printf("You are now in user space.\n");
|
|
|
|
terminal_printf("Type 'help' for a list of available commands.\n");
|
|
|
|
|
|
|
|
shell_init();
|
|
|
|
}
|