diff --git a/boot/Makefile b/boot/Makefile index 41ce878..233d6a1 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -10,7 +10,7 @@ OBJS += $(ESRCS:.c=.o) include $(SDIR)/Makefile.inc -CFLAGS += -no-pie +CFLAGS += -no-pie -g CPPFLAGS += -DLOADADDR=$(LOADADDR) -DLINKADDR=$(LINKADDR) -DBOOTMAGIC=$(BOOTMAGIC) -DBOOTSTACKOFF=$(BOOTSTACKOFF) CPPFLAGS += -I $(SDIR) LDFLAGS += -s -Ttext=$(LINKADDR) -T ld.script --no-omagic -M diff --git a/btld_conf.h b/btld_conf.h index 1f2a34e..004353e 100644 --- a/btld_conf.h +++ b/btld_conf.h @@ -1,3 +1,6 @@ +#define elem(x) ((int)(sizeof(x)/sizeof((x)[0]))) +#define nil ((void*)0) + #define FAT16_MAX (0x40000) #define DOSPTYP_UNUSED 0x00 #define DOSPTYP_FAT16 0x06 @@ -9,4 +12,9 @@ #define BOOT_MAGIC 0xf1abde3f #define DOSMBR_SIGNATURE_OFF 0x1fe -#define PARTSZ 16 \ No newline at end of file +#define PARTSZ 16 + +#define u8 unsigned char +#define u16 unsigned short +#define u32 unsigned int +#define u64 unsigned long long \ No newline at end of file diff --git a/installboot/Makefile b/installboot/Makefile index ce1d9e7..87491f0 100644 --- a/installboot/Makefile +++ b/installboot/Makefile @@ -6,12 +6,12 @@ SRCS = installboot.c OBJS = installboot.o CFLAGS = -g -Wall -Werror -CPPFLAGS = -I $(SDIR) +CPPFLAGS = -I $(SDIR) ${PROG}: $(OBJS) $(CC) $(CFLAGS) -o $(BDIR)/$(PROG) $(OBJS) -$(OBJS): $(SDIR)/u.h $(SDIR)/btld_conf.h $(SDIR)/btld_disk.h elf32.h +$(OBJS): $(SDIR)/btld_conf.h $(SDIR)/btld_disk.h elf32.h clean: rm -rf $(PROG) $(OBJS) diff --git a/installboot/installboot.c b/installboot/installboot.c index 5f635a9..a48f520 100644 --- a/installboot/installboot.c +++ b/installboot/installboot.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "btld_conf.h" #include "btld_disk.h" #include "elf32.h" diff --git a/installmbr/Makefile b/installmbr/Makefile index 84e608a..73e79a4 100644 --- a/installmbr/Makefile +++ b/installmbr/Makefile @@ -11,7 +11,7 @@ CPPFLAGS = -I $(SDIR) ${PROG}: $(OBJS) $(CC) $(CFLAGS) -o $(BDIR)/$(PROG) $(OBJS) -$(OBJS): $(SDIR)/u.h $(SDIR)/btld_conf.h $(SDIR)/btld_disk.h +$(OBJS): $(SDIR)/btld_conf.h $(SDIR)/btld_disk.h clean: rm -f $(PROG) $(OBJS) diff --git a/installmbr/installmbr.c b/installmbr/installmbr.c index 40c5c15..80ac61f 100644 --- a/installmbr/installmbr.c +++ b/installmbr/installmbr.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "btld_conf.h" #include "btld_disk.h"