directory structure organization because it was about time to do it
This commit is contained in:
parent
91af4dc590
commit
5303b1e59c
14
Makefile
14
Makefile
|
@ -4,6 +4,7 @@ CC = $(TARGET)-gcc
|
|||
STRIP = $(TARGET)-strip
|
||||
NASM = nasm
|
||||
QEMU = qemu-system-i386
|
||||
MKDIR_P = mkdir -p
|
||||
|
||||
CFLAGS += -std=gnu18 -ffreestanding -O2 -Wall -Wextra -mgeneral-regs-only
|
||||
LDFLAGS += -ffreestanding -O2 -nostdlib -lgcc
|
||||
|
@ -12,19 +13,24 @@ NASMFLAGS += -felf32
|
|||
BIN = sysroot/boot/hhhos.bin
|
||||
ISO = build/HhhOS.iso
|
||||
|
||||
OBJS = build/boot.o build/kernel.o build/string.o build/terminal.o build/idt.o \
|
||||
build/isr.o build/util.o build/device.o build/keyboard.o build/pic.o
|
||||
DIRS = build build/boot build/std build/drivers build/drivers/terminal build/drivers/idt build/drivers/device build/drivers/keyboard build/drivers/pic
|
||||
|
||||
OBJS = build/boot/boot.o build/boot/kernel.o build/std/string.o build/drivers/terminal/terminal.o build/drivers/idt/idt.o \
|
||||
build/drivers/idt/isr.o build/std/util.o build/drivers/device/device.o build/drivers/keyboard/keyboard.o build/drivers/pic/pic.o
|
||||
|
||||
ARCHDIR = arch/$(ARCH)/
|
||||
|
||||
.PHONY: all run clean build
|
||||
|
||||
all: $(BIN)
|
||||
dirs:
|
||||
${MKDIR_P} ${DIRS}
|
||||
|
||||
all: dirs $(BIN)
|
||||
|
||||
run: $(ISO)
|
||||
$(QEMU) -cdrom $(ISO)
|
||||
|
||||
$(ISO): $(BIN)
|
||||
$(ISO): dirs $(BIN)
|
||||
grub-mkrescue -o $(ISO) sysroot
|
||||
|
||||
$(BIN): $(OBJS)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <isr.h>
|
||||
#include <keyboard.h>
|
||||
#include <pic.h>
|
||||
#include <device.h>
|
||||
#include <drivers/idt/isr.h>
|
||||
#include <drivers/keyboard/keyboard.h>
|
||||
#include <drivers/pic/pic.h>
|
||||
#include <drivers/device/device.h>
|
||||
|
||||
/* Check if the compiler thinks you are targeting the wrong operating system. */
|
||||
#if defined(__linux__)
|
|
@ -1,4 +1,4 @@
|
|||
#include <device.h>
|
||||
#include <drivers/device/device.h>
|
||||
|
||||
int _device_index = 0;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#include <idt.h>
|
||||
#include <terminal.h>
|
||||
#include <drivers/idt/idt.h>
|
||||
#include <drivers/terminal/terminal.h>
|
||||
|
||||
struct idt_entry idt[256];
|
||||
static unsigned long idt_address;
|
|
@ -1,5 +1,5 @@
|
|||
#include <isr.h>
|
||||
#include <terminal.h>
|
||||
#include <drivers/idt/isr.h>
|
||||
#include <drivers/terminal/terminal.h>
|
||||
|
||||
__attribute__((interrupt)) static void isr0(struct interrupt_frame* frame) {
|
||||
terminal_writeline("Division By Zero");
|
|
@ -1,7 +1,7 @@
|
|||
#include <pic.h>
|
||||
#include <keyboard.h>
|
||||
#include <stdbool.h>
|
||||
#include <device.h>
|
||||
#include <drivers/pic/pic.h>
|
||||
#include <drivers/keyboard/keyboard.h>
|
||||
#include <drivers/device/device.h>
|
||||
|
||||
unsigned char kbdus[128] = {
|
||||
0, 27, '1', '2', '3', '4', '5', '6', '7', '8', /* 9 */
|
|
@ -1,4 +1,4 @@
|
|||
#include <pic.h>
|
||||
#include <drivers/pic/pic.h>
|
||||
|
||||
static uint8_t pic1_mask = 0xff;
|
||||
static uint8_t pic2_mask = 0xff;
|
|
@ -1,4 +1,4 @@
|
|||
#include <terminal.h>
|
||||
#include <drivers/terminal/terminal.h>
|
||||
|
||||
size_t terminal_row;
|
||||
size_t terminal_column;
|
|
@ -1,4 +1,4 @@
|
|||
#include <string.h>
|
||||
#include <std/string.h>
|
||||
|
||||
int memcmp(const void* aptr, const void* bptr, size_t size) {
|
||||
const unsigned char* a = (const unsigned char*) aptr;
|
|
@ -1,4 +1,4 @@
|
|||
#include <util.h>
|
||||
#include <std/util.h>
|
||||
|
||||
void* malloc(size_t amount) {
|
||||
char variable[amount];
|
|
@ -2,7 +2,7 @@
|
|||
#define _IDT_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include <util.h>
|
||||
#include <std/util.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _ISR_H
|
||||
#define _ISR_H 1
|
||||
|
||||
#include <idt.h>
|
||||
#include <drivers/idt/idt.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef _KEYBOARD_H
|
||||
#define _KEYBOARD_H 1
|
||||
|
||||
#include <terminal.h>
|
||||
#include <util.h>
|
||||
#include <string.h>
|
||||
#include <isr.h>
|
||||
#include <drivers/idt/isr.h>
|
||||
#include <drivers/terminal/terminal.h>
|
||||
#include <std/util.h>
|
||||
#include <std/string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _PIC_H
|
||||
#define _PIC_H 1
|
||||
|
||||
#include <inline.h>
|
||||
#include <std/inline.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <inline.h>
|
||||
#include <std/string.h>
|
||||
#include <std/inline.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
Loading…
Reference in a new issue