Terminal program for MailStation devices
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Build: Add a dumb script to relink with segments packed

I can't figure out how to do this with SDCC directly, so make a
script that links everything together, then reads the msterm.map
file generated and gets the sizes of each segment, then links
msterm.ihx again with the proper --code-loc and --data-loc values to
not waste any bytes.

+78 -11
+10 -11
Makefile
··· 36 36 @exit 1 37 37 .endif 38 38 39 - # added to $BASE_ADDR, must be far enough to hold _HEADER code in crt0 40 - CODE_OFF= 0x100 41 - 42 - # subtracted from the end of the flash/ram page to hold data 43 - DATA_SIZE= 4800 44 - 45 39 46 40 all: msterm.bin 47 41 ··· 97 91 font/spleen-5x8.inc: font/spleen-5x8.hex 98 92 ruby $(SRCDIR)/tools/hexfont2inc.rb $> > $(SRCDIR)/${.TARGET} 99 93 94 + # link 95 + 100 96 msterm.ihx: crt0.rel isr.rel putchar.rel getchar.rel lpt.rel modem.rel \ 101 97 main.rel mslib.rel csi.rel settings.rel wifi.rel 102 - $(SDCC) --no-std-crt0 \ 103 - --code-loc `ruby -e 'print ${BASE_ADDR} + ${CODE_OFF}'` \ 104 - --data-loc `ruby -e 'print ${BASE_ADDR} + 0x4000 - ${DATA_SIZE}'` \ 105 - -o ${.TARGET} $> 98 + @SDCC="$(SDCC) --no-std-crt0" TARGET="$(.TARGET)" \ 99 + BASE_ADDR="$(BASE_ADDR)" CODE_OFF="$(CODE_OFF)" \ 100 + ruby $(SRCDIR)/tools/relink_packed.rb $> 101 + 102 + # convert to binary 106 103 107 104 msterm.bin: msterm.ihx 108 105 objcopy -Iihex -Obinary $> $@ ··· 112 109 exit 1; \ 113 110 fi 114 111 112 + # helpers 113 + 115 114 disasm: msterm.bin 116 115 z80dasm -al -g ${BASE_ADDR} $> > msterm.dasm 117 116 118 117 upload: all 119 - sudo ../../mailstation-tools/obj/sendload -p 0x4000 msterm.bin 118 + ../../WiFiStation/host/sendload /dev/cuaU0 msterm.bin