GitOS
Loading...
Searching...
No Matches
kernel.cpp File Reference
#include "kernel.h"
#include <common/assert.h>
#include <bootloaders/gitboot/GitBoot.hpp>
#include <bootloaders/multiboot2/Multiboot.hpp>
#include <drivers/ps2mouse/PS2Mouse.hpp>
#include "drivers/graphics/graphics.hpp"
#include "drivers/graphics/text_mode/text_mode.hpp"
#include "drivers/graphics/vbe/vbe_graphics.hpp"
#include "syscall/syscall.hpp"
#include <stdarg.h>
#include <stdint.h>
#include "common/string.h"
#include "drivers/disk/disk.h"
#include "drivers/pic/pic.h"
#include "drivers/ps2keyboard/ps2keyboard.h"
#include "drivers/serial/serial.h"
#include "fs/fat16/fat16.h"
#include "fs/file.h"
#include "gdt/gdt.h"
#include "idt/idt.h"
#include "memory/heap/kheap.h"
#include "memory/memory.h"
#include "memory/paging/paging.h"
#include "task/process.h"
#include "task/task.h"
#include "task/tss.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]

Function Documentation

◆ __cxa_pure_virtual()

void __cxa_pure_virtual ( )

References kernel_panic().

◆ atexit()

int atexit ( void(*  )())

◆ kernel_exception()

◆ kernel_halt()

void kernel_halt ( )

◆ kernel_main()

◆ kernel_page()

void kernel_page ( )

◆ kernel_panic()

void kernel_panic ( const char * fmt,
... )

(Temporary) Prints kernel_message and halts the kernel.

Parameters
fmtReason of the panic
...Arguments

References COM1, kernel_halt(), kvsprintf(), Graphics::LIGHT_RED, memset(), and ser_PrintString().

◆ kprintf()

void kprintf ( const char * fmt,
... )

Prints to kernel debug channels. Max length of processed message is 1024 characters.

Parameters
fmtMessage to format and print.
...Arguments

References COM1, kvsprintf(), memset(), and ser_PrintString().

◆ operator delete()

void operator delete ( void * p)

References kfree().

◆ operator delete[]()

void operator delete[] ( void * p)

References kfree().

◆ operator new()

void * operator new ( size_t size)

References kzalloc(), and size.

◆ operator new[]()

void * operator new[] ( size_t size)

References kzalloc(), and size.

◆ print_interrupt_frame()

◆ timer_interrupt()

void timer_interrupt ( int int_no,
struct interrupt_frame * frame )

Temporary PIC Timer interrupt handler.

Parameters
frameInterrupt frame

References pic_EOI(), task_current(), task_get_next(), task_return(), and task_switch().

Variable Documentation

◆ gdt_real

struct gdt gdt_real[TOTAL_GDT_SEGMENTS]

◆ gdt_structured

struct gdt_structured gdt_structured[TOTAL_GDT_SEGMENTS]
Initial value:
= {
{ .base = 0x00, .limit = 0x00, .type = 0x00 },
{ .base = 0x00, .limit = 0xFFFFFFFF, .type = 0x9A },
{ .base = 0x00, .limit = 0xFFFFFFFF, .type = 0x92 },
{ .base = 0x00, .limit = 0xFFFFFFFF, .type = 0xF8 },
{ .base = 0x00, .limit = 0xFFFFFFFF, .type = 0xF2 },
{ .base = (uint32_t)&tss, .limit = sizeof(tss), .type = 0xE9 },
}
uint16_t limit
Definition idt.h:0
struct tss tss
Definition kernel.cpp:68

◆ tss

struct tss tss