mirror of
https://github.com/gbowne1/ClassicOS.git
synced 2025-06-06 00:41:28 -07:00
add the last of the files and some basic stubs for most of the empty files from last commit
This commit is contained in:
parent
799f744f47
commit
512bd49ff7
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"files.associations": {
|
||||
".fantomasignore": "ignore",
|
||||
"stddef.h": "c"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
#include "debug.h"
|
||||
|
||||
void debug_print(const char *str) {
|
||||
// Implementation for printing debug messages
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
|
||||
void debug_print(const char *str);
|
||||
|
||||
#endif // DEBUG_H
|
@ -0,0 +1,5 @@
|
||||
#include "fs.h"
|
||||
|
||||
void fs_init() {
|
||||
// Filesystem initialization code
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
#ifndef FS_H
|
||||
#define FS_H
|
||||
|
||||
void fs_init();
|
||||
|
||||
#endif // FS_H
|
@ -0,0 +1,6 @@
|
||||
#include "heap.h"
|
||||
|
||||
void *heap_alloc(size_t size) {
|
||||
// Heap allocation code
|
||||
return NULL;
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
#ifndef HEAP_H
|
||||
#define HEAP_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
void *heap_alloc(size_t size);
|
||||
|
||||
#endif // HEAP_H
|
@ -0,0 +1,5 @@
|
||||
#include "irq.h"
|
||||
|
||||
void irq_init() {
|
||||
// IRQ initialization code
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
#ifndef IRQ_H
|
||||
#define IRQ_H
|
||||
|
||||
void irq_init();
|
||||
|
||||
#endif // IRQ_H
|
@ -4,6 +4,8 @@
|
||||
[GLOBAL isr20, isr21, isr22, isr23, isr24, isr25, isr26, isr27, isr28, isr29]
|
||||
[GLOBAL isr30, isr31, isr_default]
|
||||
|
||||
[EXTERN isr_handler]
|
||||
|
||||
%macro ISR_NOERR 1
|
||||
isr%1:
|
||||
cli
|
||||
|
@ -14,7 +14,7 @@ static const char scancode_map[128] = {
|
||||
'9', '0', '-', '=', '\b', '\t', 'q', 'w', 'e', 'r', // 0x0A - 0x13
|
||||
't', 'y', 'z', 'u', 'i', 'o', 'p', '[', ']', '\n', // 0x14 - 0x1D
|
||||
0, 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', // 0x1E - 0x27
|
||||
';', '\'', '`', 0, '\\', 'y', 'x', 'c', 'v', 'b', // 0x28 - 0x31
|
||||
';', '\'', '`', 0, '\\', 'x', 'c', 'v', 'b', // 0x28 - 0x31
|
||||
'n', 'm', ',', '.', '/', 0, '*', 0, ' ', 0, // 0x32 - 0x3B
|
||||
// rest can be filled as needed
|
||||
};
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "idt.h"
|
||||
#include "paging.h"
|
||||
#include "memmap.h"
|
||||
#include "gdt.h"
|
||||
|
||||
#define LPT1 0x378
|
||||
|
||||
@ -23,6 +24,10 @@ void kmain(void) {
|
||||
|
||||
lpt_write('L'); // Send 'L' to LPT1 to test
|
||||
|
||||
terminal_write("Initializing GDT...\n");
|
||||
gdt_init();
|
||||
serial_write("GDT initialized.\n");
|
||||
|
||||
terminal_write("Initializing IDT...\n");
|
||||
idt_init();
|
||||
serial_write("IDT initialized.\n");
|
||||
|
31
kernel/linker.ld
Normal file
31
kernel/linker.ld
Normal file
@ -0,0 +1,31 @@
|
||||
ENTRY(_start)
|
||||
|
||||
SECTIONS {
|
||||
. = 1M;
|
||||
|
||||
.multiboot : {
|
||||
*(.multiboot)
|
||||
}
|
||||
|
||||
.text : {
|
||||
*(.text)
|
||||
}
|
||||
|
||||
.rodata : {
|
||||
*(.rodata)
|
||||
}
|
||||
|
||||
.data : {
|
||||
*(.data)
|
||||
}
|
||||
|
||||
.bss : {
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
|
||||
. = ALIGN(4096);
|
||||
__stack_top = .;
|
||||
. += 128K;
|
||||
__stack_bottom = .;
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
#include "paging.h"
|
||||
#include "io.h"
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
page_directory_entry_t *page_directory = (page_directory_entry_t *)0x100000;
|
||||
page_table_entry_t *page_table = (page_table_entry_t *)0x101000;
|
||||
|
@ -39,6 +39,7 @@ typedef struct {
|
||||
|
||||
extern page_directory_entry_t *page_directory;
|
||||
extern page_table_entry_t *page_table;
|
||||
extern page_table_entry_t *heap_page_table;
|
||||
|
||||
void paging_init(void);
|
||||
void set_page_directory(page_directory_entry_t *dir);
|
||||
|
5
kernel/panic.c
Normal file
5
kernel/panic.c
Normal file
@ -0,0 +1,5 @@
|
||||
#include "panic.h"
|
||||
|
||||
void panic(const char *message) {
|
||||
// Panic handling code
|
||||
}
|
6
kernel/panic.h
Normal file
6
kernel/panic.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef PANIC_H
|
||||
#define PANIC_H
|
||||
|
||||
void panic(const char *message);
|
||||
|
||||
#endif // PANIC_H
|
5
kernel/scheduler.c
Normal file
5
kernel/scheduler.c
Normal file
@ -0,0 +1,5 @@
|
||||
#include "scheduler.h"
|
||||
|
||||
void scheduler_init() {
|
||||
// Scheduler initialization code
|
||||
}
|
6
kernel/scheduler.h
Normal file
6
kernel/scheduler.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef SCHEDULER_H
|
||||
#define SCHEDULER_H
|
||||
|
||||
void scheduler_init();
|
||||
|
||||
#endif // SCHEDULER_H
|
@ -0,0 +1,5 @@
|
||||
#include "syscalls.h"
|
||||
|
||||
void syscall_handler() {
|
||||
// Syscall handling code
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
#ifndef SYSCALLS_H
|
||||
#define SYSCALLS_H
|
||||
|
||||
void syscall_handler();
|
||||
|
||||
#endif // SYSCALLS_H
|
@ -8,5 +8,6 @@ void terminal_putchar(char c);
|
||||
void terminal_write(const char *str);
|
||||
void terminal_setcolor(uint8_t color);
|
||||
void terminal_clear(void);
|
||||
void update_cursor(void);
|
||||
|
||||
#endif
|
||||
|
@ -0,0 +1,5 @@
|
||||
#include "threading.h"
|
||||
|
||||
void threading_init() {
|
||||
// Threading initialization code
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
#ifndef THREADING_H
|
||||
#define THREADING_H
|
||||
|
||||
void threading_init();
|
||||
|
||||
#endif // THREADING_H
|
5
kernel/utils.c
Normal file
5
kernel/utils.c
Normal file
@ -0,0 +1,5 @@
|
||||
#include "utils.h"
|
||||
|
||||
void util_function() {
|
||||
// Utility function code
|
||||
}
|
6
kernel/utils.h
Normal file
6
kernel/utils.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
void util_function();
|
||||
|
||||
#endif // UTILS_H
|
Loading…
x
Reference in New Issue
Block a user