Merge pull request #22 from E-Almqvist/dev

Makefile & updates
pull/25/head
Elias Almqvist 3 years ago committed by GitHub
commit 64eb63df35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .gitignore
  2. 26
      Makefile
  3. 8
      src/bootloader/bios.asm
  4. 6
      src/bootloader/bootloader.asm
  5. 6
      src/bootloader/pm.asm

4
.gitignore vendored

@ -1,3 +1,7 @@
bin/ bin/
*.bin *.bin
*.o *.o
os-image
*.dis
boot/
*.iso

@ -1,16 +1,25 @@
all: os-image all: os-image
run: all run: all
qemu bin/os-image qemu-system-x86_64 os-image
os-image: bin/bootloader.bin bin/kernel.bin grub: eOS.iso
cat $^ > bin/os-image qemu-system-x86_64 eOS.iso
kernel.bin: bin/kernel_entry.o bin/kernel.o eOS.iso : kernel.bin src/grub/grub.cfg
ld -o kernel.bin -Ttext 0x1000 $^ --oformat binary mkdir -p boot/grub
cp $< boot/eOS.bin
cp src/grub/grub.cfg boot/grub/grub.cfg
grub-mkrescue -o eOS.iso ./
os-image: bootloader.bin kernel.bin
cat $^ > os-image
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 : src/kernel/kernel.c
gcc -ffreestanding -c $< -o $@ gcc -fno-pie -m32 -Os -ffreestanding -c $< -o $@
kernel_entry.o : src/kernel/kernel_entry.asm kernel_entry.o : src/kernel/kernel_entry.asm
nasm $< -f elf -o $@ nasm $< -f elf -o $@
@ -19,7 +28,8 @@ bootloader.bin : src/bootloader/bootloader.asm
nasm $< -f bin -o $@ nasm $< -f bin -o $@
clean: clean:
rm -fr bin/*.bin bin/*.dis bin/*.o bin/os-image bin/*.map rm -fr *.bin *.dis *.o os-image *.map boot/ *.iso
kernel.dis : bin/kernel.bin kernel.dis : kernel.bin
ndisasm -b 32 $< > $@ ndisasm -b 32 $< > $@

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

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

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

Loading…
Cancel
Save