summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-11-25 01:40:50 +0100
committerMichal Idziorek <m.i@gmx.at>2014-11-25 01:40:50 +0100
commitbad8fa17adf4d9609343fe86feabe05188023bc1 (patch)
treed9298a6bc2c6f0a3880ba2dbd3dda662f00e098c /Makefile
parent7230b118e3a8f6b25bc2d525999b815c30490c81 (diff)
memory and buildsys improvements
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 6 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index e33c0fb..3469bce 100644
--- a/Makefile
+++ b/Makefile
@@ -23,9 +23,6 @@ FOOLOS_VDI=FoolOS.vdi
#take care to set this properly!
USB_STICK=/dev/sdf
-#here our kernel will be loaded by the bootloader.
-KERNEL_START=0x100000
-
#use our cross compiler
CC=i686-foolos-gcc
@@ -122,29 +119,19 @@ $(CLEANDIRS):
# the kernel_entry.o needs to be FIRST!!
$(BIN_KERNEL): $(KERNEL_ENTRY) $(ASM_OBJECTS) $(OBJECTS)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ -Wl,-Ttext,$(KERNEL_START),--oformat,binary $^
-
-
-
-######## generate empty image ~25MB ###############
-
-$(IMG_FILLUP):
- dd if=/dev/zero of=$(IMG_FILLUP) bs=512 count=50000
-
+ $(CC) $(CFLAGS) $(LDFLAGS) -T linker.ld -o $@ $^
############ assembling of final image ############
# master boot record, kernel binary and fool-font
-$(FOOLOS): $(IMG_FILLUP) $(BIN_KERNEL) $(SUBDIRS)
- cp $(IMG_FILLUP) $@
+$(FOOLOS): $(BIN_KERNEL) $(SUBDIRS)
dd if=$(BIN_MBR) of=$@ bs=512 seek=0 conv=notrunc
dd if=$(BIN_STAGE2) of=$@ bs=512 seek=1 conv=notrunc
- dd if=kernel.bin of=$@ bs=512 seek=10 conv=notrunc #will end up at 0x100000 in ram (this is what the booloader starts loading secotr: 10)
- #data starts at 0x168000
- dd if=$(BIN_MP) of=$@ bs=512 seek=842 conv=notrunc
- dd if=$(BIN_FOOLFONT) of=$@ bs=512 seek=843 conv=notrunc
- dd if=$(IMG_USERSPACE) of=$@ bs=512 seek=2894 conv=notrunc
+ # kernel will start at 0x100000 in ram (this is what the booloader starts loading secotr: 10)
+ dd if=$(BIN_KERNEL) of=$@ bs=512 seek=10 conv=notrunc # kernel can be about 128KB (incl bss)
+ # the data will starts at 0x120000 in ram
+ dd if=$(IMG_USERSPACE) of=$@ bs=512 seek=266 conv=notrunc
############ virtual machines stuff ############
@@ -161,15 +148,12 @@ run: all
newrun: clean run
-
############ create bootable usb image ############
stick: $(FOOLOS)
cat $< > $(USB_STICK) && sync
xxd $(USB_STICK) | head -n 50
-
-
############ cleanup ############
clean: $(CLEANDIRS)