Commit 345c6bc4 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

New method of linking live filesystem

Downsize live filesystem to 256 MB
parent 44f776f6
Subproject commit 1f81866afafd5a3830c078c0ad8921b5316c0248
Subproject commit d6b9768dc3e9cd967df0acf3eafb10d02c9f0ba6
build/filesystem.bin: filesystem.toml build/kernel
-$(FUMOUNT) build/filesystem/ || true
rm -rf $@ $@.partial build/filesystem/
dd if=/dev/zero of=$@.partial bs=1048576 count=512
dd if=/dev/zero of=$@.partial bs=1048576 count=256
cargo run --manifest-path redoxfs/Cargo.toml --release --bin redoxfs-mkfs $@.partial
mkdir -p build/filesystem/
cargo build --manifest-path redoxfs/Cargo.toml --release --bin redoxfs
......
......@@ -6,11 +6,18 @@ else
cd kernel && xargo rustc --lib --target $(KTARGET) --release -- -C soft-float --emit link=../$@
endif
build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* build/initfs.tag build/filesystem.bin
cd kernel && FILESYSTEM="$(PWD)/build/filesystem.bin" xargo rustc --lib --features live --target $(KTARGET) --release -- -C soft-float --emit link=../$@
build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* build/initfs.tag
cd kernel && xargo rustc --lib --features live --target $(KTARGET) --release -- -C soft-float --emit link=../$@
build/kernel: build/libkernel.a kernel/linkers/$(ARCH).ld
$(LD) --gc-sections -z max-page-size=0x1000 -T kernel/linkers/$(ARCH).ld -o $@ $<
build/kernel: kernel/linkers/$(ARCH).ld build/libkernel.a
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel.a
build/kernel_live: build/libkernel_live.a kernel/linkers/$(ARCH).ld
$(LD) --gc-sections -z max-page-size=0x1000 -T kernel/linkers/$(ARCH).ld -o $@ $<
build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_live.a build/live.o
build/live.o: build/filesystem.bin
#TODO: More general use of $(ARCH)
objcopy -I binary -O elf64-x86-64 -B i386:x86-64 $< $@ \
--redefine-sym _binary_build_filesystem_bin_start=__live_start \
--redefine-sym _binary_build_filesystem_bin_end=__live_end \
--redefine-sym _binary_build_filesystem_bin_size=__live_size
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment