49 lines
812 B
C
49 lines
812 B
C
#include <types.h>
|
|
|
|
#include "gdt.h"
|
|
#include "idt.h"
|
|
#include "pic_controler.h"
|
|
#include "serial.h"
|
|
#include "debug.h"
|
|
#include "tss.h"
|
|
#include "launch_process.h"
|
|
#include "elf.h"
|
|
|
|
extern char _binary_a_out_start[];
|
|
extern char _binary_a_out_end[];
|
|
extern char _binary_a_out_size[];
|
|
|
|
void main(void)
|
|
{
|
|
DEBUG_INFO("Entering Main Function");
|
|
|
|
char *data_start = &_binary_a_out_start;
|
|
char *data_end = _binary_a_out_end;
|
|
size_t data_size = (size_t)_binary_a_out_size;
|
|
|
|
load_elf(data_start);
|
|
|
|
launch_process(0x28, 0x30000, 0x20, 0x18, 0x20);
|
|
|
|
for (;;)
|
|
{
|
|
DEBUG_INFO("Waiting for an interrupt");
|
|
asm volatile ("hlt");
|
|
}
|
|
}
|
|
|
|
void kernel_main(void)
|
|
{
|
|
init_serial();
|
|
|
|
DEBUG_INFO("Starting kernel");
|
|
|
|
init_gdt();
|
|
init_idt();
|
|
pic_init();
|
|
make_page();
|
|
asm volatile ("sti");
|
|
|
|
main();
|
|
}
|