GitOS
Operating system exercise
|
#include "kernel.h"
#include <bootloaders/gitboot/GitBoot.hpp>
#include <drivers/ps2mouse/PS2Mouse.hpp>
#include <bootloaders/multiboot2/Multiboot.hpp>
#include <common/assert.h>
#include "drivers/graphics/graphics.hpp"
#include "drivers/graphics/vbe/vbe_graphics.hpp"
#include "drivers/graphics/text_mode/text_mode.hpp"
#include "syscall/syscall.hpp"
#include <stdint.h>
#include <stdarg.h>
#include "idt/idt.h"
#include "drivers/serial/serial.h"
#include "drivers/pic/pic.h"
#include "memory/heap/kheap.h"
#include "memory/memory.h"
#include "common/string.h"
#include "memory/paging/paging.h"
#include "drivers/disk/disk.h"
#include "fs/file.h"
#include "fs/fat16/fat16.h"
#include "gdt/gdt.h"
#include "task/tss.h"
#include "task/task.h"
#include "task/process.h"
#include "drivers/ps2keyboard/ps2keyboard.h"
Functions | |
int | atexit (void(*)()) |
void * | operator new (size_t size) |
void * | operator new[] (size_t size) |
void | operator delete (void *p) |
void | operator delete[] (void *p) |
void | print_interrupt_frame (struct interrupt_frame *frame) |
void | timer_interrupt (int int_no, struct interrupt_frame *frame) |
Temporary PIC Timer interrupt handler. | |
void | kernel_exception (int int_no, struct interrupt_frame *frame) |
void | kernel_page () |
void | kernel_main (uint32_t magic, void *info_ptr) |
Kernel C entry point. | |
void | kernel_panic (const char *fmt,...) |
(Temporary) Prints kernel_message and halts the kernel. | |
void | kernel_halt () |
void | kprintf (const char *fmt,...) |
Prints to kernel debug channels. Max length of processed message is 1024 characters. | |
void | __cxa_pure_virtual () |
Variables | |
struct tss | tss |
struct gdt | gdt_real [TOTAL_GDT_SEGMENTS] |
struct gdt_structured | gdt_structured [TOTAL_GDT_SEGMENTS] |
void __cxa_pure_virtual | ( | ) |
References kernel_panic().
int atexit | ( | void(*)() | ) |
void kernel_exception | ( | int | int_no, |
struct interrupt_frame * | frame | ||
) |
References COM1, interrupt_frame::cs, ebp, interrupt_frame::ebp, process::filename, Graphics::GREY, idt_InterruptLayoutString, ksprintf(), Graphics::LIGHT_RED, memset(), print_interrupt_frame(), Graphics::print_string(), process_current(), process_terminate(), ser_PrintString(), Graphics::set_text_color(), task_current(), task_return(), and task_switch().
void kernel_halt | ( | ) |
void kernel_main | ( | uint32_t | magic, |
void * | info_ptr | ||
) |
Kernel C entry point.
References process::argc, process::argv, assert, base_address, Graphics::clear_screen(), COM1, disk_search_and_init(), tss::esp0, fat16_init_filesystem(), fs_init(), fs_insert_filesystem(), gdt_load(), gdt_read(), gdt_real, gdt_structured_to_gdt(), Bootloader::get_heap_base_address(), Bootloader::get_heap_size(), Graphics::GREY, idt_Init(), idt_Load(), idt_SetDescriptor(), idt_SetHandler(), GitBoot::init(), Multiboot::init(), PS2Mouse::instance(), KERNEL_DATA_SELECTOR, kernel_exception(), kernel_panic(), kheap_init(), kprintf(), length_in_bytes, magic, memset(), PAGING_ACCESS_FROM_ALL, paging_enable(), PAGING_IS_PRESENT, PAGING_IS_WRITEABLE, paging_new_directory(), paging_switch(), pic_Remap(), pic_SetHz(), process_load_switch(), ps2keyboard_setup(), ser_Init(), Graphics::set_text_color(), tss::ss0, gdt_descriptor::start_address, syscall_init(), syscall_wrapper(), task_run_first_ever_task(), Bootloader::the(), VBEGraphics::the(), timer_interrupt(), TOTAL_GDT_SEGMENTS, and tss_load().
void kernel_page | ( | ) |
References kernel_registers(), and paging_switch().
void kernel_panic | ( | const char * | fmt, |
... | |||
) |
(Temporary) Prints kernel_message and halts the kernel.
fmt | Reason of the panic |
... | Arguments |
References COM1, kernel_halt(), kvsprintf(), Graphics::LIGHT_RED, memset(), Graphics::print_string_color(), and ser_PrintString().
void kprintf | ( | const char * | fmt, |
... | |||
) |
Prints to kernel debug channels. Max length of processed message is 1024 characters.
fmt | Message to format and print. |
... | Arguments |
References COM1, kvsprintf(), memset(), and ser_PrintString().
void operator delete | ( | void * | p | ) |
References kfree().
void operator delete[] | ( | void * | p | ) |
References kfree().
void print_interrupt_frame | ( | struct interrupt_frame * | frame | ) |
References COM1, interrupt_frame::cs, interrupt_frame::eax, interrupt_frame::ebp, interrupt_frame::ebx, interrupt_frame::ecx, interrupt_frame::edi, interrupt_frame::edx, interrupt_frame::error_code, interrupt_frame::esi, interrupt_frame::esp, interrupt_frame::flags, Graphics::GREY, interrupt_frame::ip, ksprintf(), memset(), Graphics::print_string_color(), ser_PrintString(), and interrupt_frame::ss.
void timer_interrupt | ( | int | int_no, |
struct interrupt_frame * | frame | ||
) |
Temporary PIC Timer interrupt handler.
frame | Interrupt frame |
References pic_EOI(), task_current(), task_get_next(), task_return(), and task_switch().
struct gdt gdt_real[TOTAL_GDT_SEGMENTS] |