aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2024-09-30 11:08:46 -0400
committerClyne Sullivan <clyne@bitgloo.com>2024-09-30 11:08:46 -0400
commit19d9a04e36e7fb96eebe89e24311408460c29a70 (patch)
tree4d5f5ba595d5a5e2b59ce7b102c06b77c7be7721
parent85c8fd05f1a0c0224882c4fafa60003d3ef56cf3 (diff)
reorganize files
-rw-r--r--.gitignore3
-rw-r--r--Makefile44
-rw-r--r--src/acpi.cpp (renamed from acpi.cpp)0
-rw-r--r--src/acpi.hpp (renamed from acpi.hpp)0
-rw-r--r--src/ata.cpp (renamed from ata.cpp)0
-rw-r--r--src/ata.hpp (renamed from ata.hpp)0
-rw-r--r--src/boot.cpp (renamed from boot.cpp)0
-rw-r--r--src/circularbuffer.hpp (renamed from circularbuffer.hpp)0
-rw-r--r--src/gdt.cpp (renamed from gdt.cpp)0
-rw-r--r--src/gdt.hpp (renamed from gdt.hpp)0
-rw-r--r--src/idt.cpp (renamed from idt.cpp)0
-rw-r--r--src/idt.hpp (renamed from idt.hpp)0
-rw-r--r--src/kernel.cpp (renamed from kernel.cpp)0
-rw-r--r--src/keyboard.cpp (renamed from keyboard.cpp)0
-rw-r--r--src/keyboard.hpp (renamed from keyboard.hpp)0
-rw-r--r--src/memmove.cpp (renamed from memmove.cpp)0
-rw-r--r--src/memory.cpp (renamed from memory.cpp)0
-rw-r--r--src/memory.hpp (renamed from memory.hpp)0
-rw-r--r--src/multiboot.cpp (renamed from multiboot.cpp)0
-rw-r--r--src/multiboot.hpp (renamed from multiboot.hpp)0
-rw-r--r--src/pic.cpp (renamed from pic.cpp)0
-rw-r--r--src/pic.hpp (renamed from pic.hpp)0
-rw-r--r--src/pit.cpp (renamed from pit.cpp)0
-rw-r--r--src/pit.hpp (renamed from pit.hpp)0
-rw-r--r--src/portio.hpp (renamed from portio.hpp)0
-rw-r--r--src/tasking.cpp (renamed from tasking.cpp)0
-rw-r--r--src/tasking.hpp (renamed from tasking.hpp)0
-rw-r--r--src/textoutput.hpp (renamed from textoutput.hpp)0
-rw-r--r--src/vgaterminal.cpp (renamed from vgaterminal.cpp)0
-rw-r--r--src/vgaterminal.hpp (renamed from vgaterminal.hpp)0
30 files changed, 19 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
index 540202a..afda4de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
-*.bin
*.iso
-*.o
*.sw*
iso/boot/*.bin
+out
diff --git a/Makefile b/Makefile
index 728ead6..2484913 100644
--- a/Makefile
+++ b/Makefile
@@ -2,43 +2,35 @@ CXXFLAGS := -m32 -ggdb -g3 -O1 -fno-pic -fno-rtti -fno-exceptions -std=c++23 \
-Wall -Wextra -pedantic -Werror
LDFLAGS := $(CXXFLAGS) -T link.ld -static -nostdlib -fno-use-cxa-atexit
-CXXFILES := acpi.cpp \
- ata.cpp \
- boot.cpp \
- gdt.cpp \
- idt.cpp \
- keyboard.cpp \
- memmove.cpp \
- memory.cpp \
- multiboot.cpp \
- pic.cpp \
- pit.cpp \
- tasking.cpp \
- vgaterminal.cpp \
- kernel.cpp
-
-OBJS := $(subst .cpp,.o,$(CXXFILES))
-
-all: myos.iso
-
-myos.iso: myos.bin iso/boot/grub/grub.cfg
+CXXFILES := $(wildcard src/*.cpp)
+
+PROJECT := myos
+PRJISO := $(PROJECT).iso
+PRJBIN := $(PROJECT).bin
+OBJS := $(patsubst src/%.cpp,out/%.o,$(CXXFILES))
+
+all: $(PRJISO)
+
+$(PRJISO): iso/boot/$(PRJBIN) iso/boot/grub/grub.cfg
@echo " ISO " $@
- @cp myos.bin iso/boot/
- @grub-mkrescue -o myos.iso iso/
+ @grub-mkrescue -o $@ iso/
-myos.bin: $(OBJS) link.ld
+iso/boot/$(PRJBIN): $(OBJS) link.ld
@echo " LD " $@
@g++ $(LDFLAGS) -o $@ $(OBJS)
-%.o: %.cpp
+out/:
+ @mkdir out
+
+out/%.o: src/%.cpp
@echo " CXX " $<
@g++ $(CXXFLAGS) -c $< -o $@
clean:
@echo " CLEAN"
- @rm -f $(OBJS) myos.bin myos.iso
+ @rm -f $(OBJS) $(PRJBIN) $(PRJISO)
run: myos.iso
@echo " QEMU"
- @qemu-system-i386 -drive file=$<,index=2,media=cdrom -monitor stdio -no-reboot -s -S #-d int
+ @qemu-system-i386 -drive file=$<,index=2,media=cdrom -monitor stdio -no-reboot #-s -S #-d int
diff --git a/acpi.cpp b/src/acpi.cpp
index b74a7dc..b74a7dc 100644
--- a/acpi.cpp
+++ b/src/acpi.cpp
diff --git a/acpi.hpp b/src/acpi.hpp
index 8154b81..8154b81 100644
--- a/acpi.hpp
+++ b/src/acpi.hpp
diff --git a/ata.cpp b/src/ata.cpp
index e69de29..e69de29 100644
--- a/ata.cpp
+++ b/src/ata.cpp
diff --git a/ata.hpp b/src/ata.hpp
index 5394c31..5394c31 100644
--- a/ata.hpp
+++ b/src/ata.hpp
diff --git a/boot.cpp b/src/boot.cpp
index 6b1da6a..6b1da6a 100644
--- a/boot.cpp
+++ b/src/boot.cpp
diff --git a/circularbuffer.hpp b/src/circularbuffer.hpp
index 64a9e48..64a9e48 100644
--- a/circularbuffer.hpp
+++ b/src/circularbuffer.hpp
diff --git a/gdt.cpp b/src/gdt.cpp
index 24d974b..24d974b 100644
--- a/gdt.cpp
+++ b/src/gdt.cpp
diff --git a/gdt.hpp b/src/gdt.hpp
index de5e8fc..de5e8fc 100644
--- a/gdt.hpp
+++ b/src/gdt.hpp
diff --git a/idt.cpp b/src/idt.cpp
index 5380c9e..5380c9e 100644
--- a/idt.cpp
+++ b/src/idt.cpp
diff --git a/idt.hpp b/src/idt.hpp
index c5e7e47..c5e7e47 100644
--- a/idt.hpp
+++ b/src/idt.hpp
diff --git a/kernel.cpp b/src/kernel.cpp
index ae3f153..ae3f153 100644
--- a/kernel.cpp
+++ b/src/kernel.cpp
diff --git a/keyboard.cpp b/src/keyboard.cpp
index 48dad02..48dad02 100644
--- a/keyboard.cpp
+++ b/src/keyboard.cpp
diff --git a/keyboard.hpp b/src/keyboard.hpp
index 694ff89..694ff89 100644
--- a/keyboard.hpp
+++ b/src/keyboard.hpp
diff --git a/memmove.cpp b/src/memmove.cpp
index 06e37df..06e37df 100644
--- a/memmove.cpp
+++ b/src/memmove.cpp
diff --git a/memory.cpp b/src/memory.cpp
index 108c240..108c240 100644
--- a/memory.cpp
+++ b/src/memory.cpp
diff --git a/memory.hpp b/src/memory.hpp
index 0467bf6..0467bf6 100644
--- a/memory.hpp
+++ b/src/memory.hpp
diff --git a/multiboot.cpp b/src/multiboot.cpp
index 46c505b..46c505b 100644
--- a/multiboot.cpp
+++ b/src/multiboot.cpp
diff --git a/multiboot.hpp b/src/multiboot.hpp
index 9916850..9916850 100644
--- a/multiboot.hpp
+++ b/src/multiboot.hpp
diff --git a/pic.cpp b/src/pic.cpp
index 437f384..437f384 100644
--- a/pic.cpp
+++ b/src/pic.cpp
diff --git a/pic.hpp b/src/pic.hpp
index 17abd55..17abd55 100644
--- a/pic.hpp
+++ b/src/pic.hpp
diff --git a/pit.cpp b/src/pit.cpp
index 964522b..964522b 100644
--- a/pit.cpp
+++ b/src/pit.cpp
diff --git a/pit.hpp b/src/pit.hpp
index 55bcde9..55bcde9 100644
--- a/pit.hpp
+++ b/src/pit.hpp
diff --git a/portio.hpp b/src/portio.hpp
index 7636c14..7636c14 100644
--- a/portio.hpp
+++ b/src/portio.hpp
diff --git a/tasking.cpp b/src/tasking.cpp
index 1b78011..1b78011 100644
--- a/tasking.cpp
+++ b/src/tasking.cpp
diff --git a/tasking.hpp b/src/tasking.hpp
index 64a738e..64a738e 100644
--- a/tasking.hpp
+++ b/src/tasking.hpp
diff --git a/textoutput.hpp b/src/textoutput.hpp
index 7ef12fa..7ef12fa 100644
--- a/textoutput.hpp
+++ b/src/textoutput.hpp
diff --git a/vgaterminal.cpp b/src/vgaterminal.cpp
index 5f86081..5f86081 100644
--- a/vgaterminal.cpp
+++ b/src/vgaterminal.cpp
diff --git a/vgaterminal.hpp b/src/vgaterminal.hpp
index 9f8d5f3..9f8d5f3 100644
--- a/vgaterminal.hpp
+++ b/src/vgaterminal.hpp