File structure fix & Makefile refactoring

pull/25/head
E. Almqvist 3 years ago
parent bd1d276a97
commit c35a1bc083
  1. 12
      Makefile
  2. 1
      TODO.md
  3. 7
      bootloader/bios.asm
  4. 0
      bootloader/bios/convert.asm
  5. 0
      bootloader/bios/disk.asm
  6. 0
      bootloader/bios/print.asm
  7. 6
      bootloader/bootloader.asm
  8. 0
      bootloader/equ/ascii.asm
  9. 0
      bootloader/equ/bios.asm
  10. 0
      bootloader/equ/vga.asm
  11. 6
      bootloader/pm.asm
  12. 0
      bootloader/pm/gdt.asm
  13. 0
      bootloader/pm/vga/print.asm
  14. 0
      grub/grub.cfg
  15. 0
      kernel/kernel.c
  16. 0
      kernel/kernel_entry.asm
  17. 0
      kernel/lib/vga.c
  18. 7
      src/bootloader/bios.asm

@ -1,3 +1,5 @@
C_SOURCES = $(wildcard kernel/*.c drivers/*.c)
all: os-image
run: all
@ -8,10 +10,10 @@ drun: clean run
grub: eOS.iso
qemu-system-x86_64 eOS.iso
eOS.iso : kernel.bin src/grub/grub.cfg
eOS.iso : kernel.bin grub/grub.cfg
mkdir -p boot/grub
cp $< boot/eOS.bin
cp src/grub/grub.cfg boot/grub/grub.cfg
cp grub/grub.cfg boot/grub/grub.cfg
grub-mkrescue -o eOS.iso ./
os-image: bootloader.bin kernel.bin
@ -20,13 +22,13 @@ os-image: bootloader.bin kernel.bin
kernel.bin: kernel_entry.o kernel.o
gcc -o kernel.bin $^ -Wl,--oformat=binary -ffreestanding -nostdlib -shared -Ttext 0x1000 -m32
kernel.o : src/kernel/kernel.c
kernel.o : kernel/kernel.c
gcc -fno-pie -m32 -Os -ffreestanding -c $< -o $@
kernel_entry.o : src/kernel/kernel_entry.asm
kernel_entry.o : kernel/kernel_entry.asm
nasm $< -f elf -o $@
bootloader.bin : src/bootloader/bootloader.asm
bootloader.bin : bootloader/bootloader.asm
nasm $< -f bin -o $@
clean:

@ -1,5 +1,6 @@
# TO DO
- Refactor Makefile
- Refactor file structure
- Finish the book!
- Multiboot support (for grub etc)
- VGA Library (Graphics)

@ -0,0 +1,7 @@
; EQUs
%include "bootloader/equ/bios.asm"
; SRs
%include "bootloader/bios/convert.asm"
%include "bootloader/bios/print.asm"
%include "bootloader/bios/disk.asm"

@ -20,9 +20,9 @@
jmp $ ; inf loop
%include "src/bootloader/equ/ascii.asm"
%include "src/bootloader/bios.asm"
%include "src/bootloader/pm.asm"
%include "bootloader/equ/ascii.asm"
%include "bootloader/bios.asm"
%include "bootloader/pm.asm"
BEGIN_PM:
; Inform of mode switch

@ -1,9 +1,9 @@
; Utils
%include "src/bootloader/equ/vga.asm"
%include "src/bootloader/pm/vga/print.asm"
%include "bootloader/equ/vga.asm"
%include "bootloader/pm/vga/print.asm"
; GDT & switching to PM
%include "src/bootloader/pm/gdt.asm" ; GDT defined here
%include "bootloader/pm/gdt.asm" ; GDT defined here
; Switching to PM
[bits 16]

@ -1,7 +0,0 @@
; EQUs
%include "src/bootloader/equ/bios.asm"
; SRs
%include "src/bootloader/bios/convert.asm"
%include "src/bootloader/bios/print.asm"
%include "src/bootloader/bios/disk.asm"
Loading…
Cancel
Save