Sun, 16 Apr 2023 22:58:42 +0200
3 files changed,
40 insertions(+),
0 deletions(-)
A
binimg.py
@@ -0,0 +1,38 @@
+import png +import sys +import getopt + +def main(args): + width = 128 + infile = "" + outfile = "" + + opts, args = getopt.getopt(args, "i:w:o:") + for opt, arg in opts: + if opt == '-i': + infile = arg + elif opt == '-o': + outfile = arg + elif opt == '-w': + width = int(arg) + else: + print("ERROR: wrong argument format") + return + + print(width) + print(infile) + print(outfile) + + with open(infile, mode="rb") as f: + bin_data = f.read() + + rows = [] + + while len(bin_data) > 0: + rows = rows + [ bin_data[0:width-1] ] + bin_data = bin_data[width:] + + png.from_array(rows, 'L').save(outfile) + +if __name__ == "__main__": + main(sys.argv[1:])
M
makefile
→
makefile
@@ -83,6 +83,7 @@ > parted $@ set 1 boot on
> dd if=$< of=$@ seek=8 conv=notrunc > dd bs=1 if=$(LOCAL_BUILD)/boot.bin of=$@ count=446 conv=notrunc > dd if=$(LOCAL_BUILD)/boot.bin of=$@ skip=1 seek=1 count=7 conv=notrunc +> python3 binimg.py -w 256 -i $(GLOBAL_BUILD)/cedos.img -o $(GLOBAL_BUILD)/cedos.png > parted $@ print list all # > $(LD) $(OBJECTS) -T link.txt -Map=$(LOG_DIR)/bin_mapfile.txt --oformat binary --nostdlib -o $@