Use assembler instead of C for the ramdisk. The assembler requires less

memory.
This commit is contained in:
Philip Homburg 2006-03-15 14:28:05 +00:00
parent 36fa006cec
commit 7fecfd3740
3 changed files with 27 additions and 3 deletions

View file

@ -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)

15
drivers/memory/imgrd_s.s Normal file
View file

@ -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]

View file

@ -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