From: Philip Homburg Date: Wed, 15 Mar 2006 14:28:05 +0000 (+0000) Subject: Use assembler instead of C for the ramdisk. The assembler requires less X-Git-Tag: v3.1.2a~229 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/processing.js?a=commitdiff_plain;h=7fecfd3740cbb07bdba476ae141aa29073ea1d38;p=minix.git Use assembler instead of C for the ramdisk. The assembler requires less memory. --- diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile index 3b4bfb063..e5d8ed687 100644 --- a/drivers/memory/Makefile +++ b/drivers/memory/Makefile @@ -16,7 +16,13 @@ CFLAGS = -I$i LDFLAGS = -i LIBS = -lsys -lsysutil -OBJ = memory.o imgrd.o +# imgrd_s.s is the ACK assembler version of the ramdisk. For more portability, +# use the C version imgrd.c. However, the C compiler takes too much memory +# compiling imgrd.c. +IMGRD=imgrd_s.o +#IMGRD=imgrd.c + +OBJ = memory.o $(IMGRD) LIBDRIVER = $d/libdriver/driver.o @@ -28,13 +34,13 @@ $(DRIVER): ramdisk_image $(OBJ) $(LIBDRIVER) install -S 8k $(DRIVER) imgrd.o: ramdisk/image.c +imgrd_s.o: ramdisk/image.s $(LIBDRIVER): cd $d/libdriver && $(MAKE) ramdisk_image: cd ramdisk && make - binsizes big # install with other drivers install: /usr/sbin/$(DRIVER) diff --git a/drivers/memory/imgrd_s.s b/drivers/memory/imgrd_s.s new file mode 100644 index 000000000..08e4e030f --- /dev/null +++ b/drivers/memory/imgrd_s.s @@ -0,0 +1,15 @@ +# +.sect .text; .sect .rom; .sect .data + +! export symbols +.define _imgrd, _imgrd_size + +.sect .data +_imgrd: +0: +#include "ramdisk/image.s" +1: + +! Use local labels to compute the size of _imgrd. +_imgrd_size: + .data4 [1b] - [0b] diff --git a/drivers/memory/ramdisk/Makefile b/drivers/memory/ramdisk/Makefile index c33446014..815eae33c 100644 --- a/drivers/memory/ramdisk/Makefile +++ b/drivers/memory/ramdisk/Makefile @@ -3,7 +3,7 @@ PROGRAMS=at_wini bios_wini cdprobe dev2name floppy loadramdisk newroot \ pci sh service sysenv -all: image.c +all: image.c image.s clean: rm -f $(PROGRAMS) bintoc image image.c @@ -11,6 +11,9 @@ clean: image.c: bintoc image ./bintoc -o $@ image +image.s: image.c + sed < image.c > $@ 's/^/.data1 /;s/,$$//' || { rm -f $@; false; } + # Note for cross compilation: this executable has to be compiled for the # host system bintoc: bintoc.c