diff --git a/Makefile b/Makefile index f9710f7..8c41ab1 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ INCLUDEDIR := include KSRC := $(wildcard kernel/*.asm kernel/*.c) KOBJ := $(addprefix $(BUILDDIR)/, \ - $(notdir \ - $(patsubst %.asm,%.o, $(patsubst %.c,%.o, $(KSRC))))) + $(notdir \ + $(patsubst %.asm,%.o, $(patsubst %.c,%.o, $(KSRC))))) KIMG := kernel.bin ISO := Hazel.iso @@ -27,6 +27,7 @@ $(BUILDDIR)/%.o: */%.c kernel: $(BUILDDIR)/$(KIMG) $(BUILDDIR)/$(ISO): kernel + rm -f $(BUILDDIR)/$(ISO) cp $(BUILDDIR)/$(KIMG) boot/$(KIMG) grub-mkrescue -o $(BUILDDIR)/$(ISO) . iso: $(BUILDDIR)/$(ISO) @@ -34,4 +35,4 @@ iso: $(BUILDDIR)/$(ISO) qemu: iso qemu-system-i386 $(QEMUFLAGS) clean: - rm build/* boot/*.bin + rm -f build/* boot/*.bin diff --git a/include/kernel/kernel.h b/include/kernel/kernel.h index 77d2237..263199f 100644 --- a/include/kernel/kernel.h +++ b/include/kernel/kernel.h @@ -5,6 +5,7 @@ #include #define cpu_relax asm volatile ("pause" ::) +#define CHECK_FLAG(x, n) (x & (1<flags & (1<<6))) goto halt; - if (!(info->flags & (1<<12))) goto halt; + if (!CHECK_FLAG(info->flags, 6)) goto halt; // Memory map + if (!CHECK_FLAG(info->flags, 12)) goto halt; // VBE data ctx.mem_map = (multiboot_memory_map_t *)info->memmapaddress; ctx.mem_map_len = info->memmaplength; - if (serial_port_init(COM1)) - ctx.log_method = LOG_COM1; + if (serial_port_init(COM1)) ctx.log_method = LOG_COM1; LOG("Kernel log being sent to COM1\n"); halt: