rosco_m68k - toolchain

rosco_m68k - toolchain.

back to main rosco_m68k page.

work log

2022-06-12: vm4 - to build cpm68, you need to have the rosco_m68k repo at the same level, like this

tingo@kg-vm4:~/work/68k-projects/rosco-m68k$ l
./  ../  cpm68k/  rosco_m68k/

and you need to do a build in software first, like so

cd rosco_m68k/
cd code/
cd software/
make

then go to cpm68k and do a 'make' there, it should be like this

tingo@kg-vm4:~/work/68k-projects/rosco-m68k/cpm68k$ make
make -C bios 
make[1]: Entering directory '/zs/work/68k-projects/rosco-m68k/cpm68k/bios'
m68k-elf-as -m68000 --defsym _GNU_=1 --defsym _CPM_=0 -alms -a=obj/bios.lst -o obj/bios.o bios.s
m68k-elf-as -m68000 --defsym _GNU_=1 --defsym _CPM_=0 -alms -a=obj/buffer.lst -o obj/buffer.o buffer.s
m68k-elf-ld -T bios.lnk obj/bios.o obj/buffer.o -Map obj/bios.map -o obj/bios.srec
srec_cat obj/bios.srec -fill 0x00 -over obj/bios.srec -header="CP/M-68K rosco_m68k BIOS V0.1" -o target/bios.srec
srec_info target/bios.srec
Format: Motorola S-Record
Header: "CP/M-68K rosco_m68k BIOS V0.1"
Execution Start Address: 0001B000
Data:   01B000 - 01F747
m68k-elf-objcopy -I srec -O binary target/bios.srec target/bios.sr.bin
m68k-elf-as -m68000 --defsym _GNU_=1 --defsym _CPM_=0 -alms -a=obj/ldbios.lst -o obj/ldbios.o ldbios.s
cat cpm_defs.s ldbios.s | sed -e 's/\.include\s*"\(.*\)"/include(`\1'"'"')/' \
       | m4 \
       | sed -e 's/^\*.*//' -e 's/^\(.*\)=\s*\(.*\)/\1 equ \2/' -e 's/.global/globl/' \
       | sed -e 's/.word/DC.W/' -e 's/.byte/DC.B/' -e 's/.long/DC.L/' -e 's/\%D/D/g' \
       | sed -e 's/\%A/A/g' -e 's/\%SP/SP/' -e 's/\%FP/FP/' -e 's/\.ascii/DC.B/' \
       | sed -e 's/0[xX]/$/g' -e 's/\.ifne/ifne/' -e 's/\.endif/endc/' > target/ldbios.s
unix2dos target/ldbios.s
unix2dos: converting file target/ldbios.s to DOS format...
cat cpm_defs.s bios.s | sed -e 's/\.include\s*"\(.*\)"/include(`\1'"'"')/' \
       | m4 \
       | sed -e 's/^\*.*//' -e 's/^\(.*\)=\s*\(.*\)/\1 equ \2/' -e 's/.global/globl/' \
       | sed -e 's/.word/DC.W/' -e 's/.byte/DC.B/' -e 's/.long/DC.L/' -e 's/\%D/D/g' \
       | sed -e 's/\%A/A/g' -e 's/\%SP/SP/' -e 's/\%FP/FP/' -e 's/\.ascii/DC.B/' \
       | sed -e 's/0[xX]/$/g' -e 's/\.ifne/ifne/' -e 's/\.endif/endc/' > target/bios.s
unix2dos target/bios.s
unix2dos: converting file target/bios.s to DOS format...
cat cpm_defs.s buffer.s | sed -e 's/\.include\s*"\(.*\)"/include(`\1'"'"')/' \
       | m4 \
       | sed -e 's/^\*.*//' -e 's/^\(.*\)=\s*\(.*\)/\1 equ \2/' -e 's/.global/globl/' \
       | sed -e 's/.word/DC.W/' -e 's/.byte/DC.B/' -e 's/.long/DC.L/' -e 's/\%D/D/g' \
       | sed -e 's/\%A/A/g' -e 's/\%SP/SP/' -e 's/\%FP/FP/' -e 's/\.ascii/DC.B/' \
       | sed -e 's/0[xX]/$/g' -e 's/\.ifne/ifne/' -e 's/\.endif/endc/' > target/buffer.s
unix2dos target/buffer.s
unix2dos: converting file target/buffer.s to DOS format...
make[1]: Leaving directory '/zs/work/68k-projects/rosco-m68k/cpm68k/bios'
make -C cpmfs 
make[1]: Entering directory '/zs/work/68k-projects/rosco-m68k/cpm68k/cpmfs'
cat cpm_1_3/DISK8/CPM15000.SR | sed -e 's/S12304606000/S12304606200/' | sed -e 's/00010000F5/00010000F3/' > target/cpm15000.sr
cat target/cpm15000.sr | sed -n '/\x1a/q;p' | grep -v "^S9" | srec_cat ../bios/target/bios.srec - -header "CP/M-68K rosco_m68k BIOS V0.1" -execution-start-address=0x15000 > target/boot15k.sr
srec_cat: standard input: 1: warning: no header record
srec_cat: standard input: 655: warning: no execution start address record
m68k-elf-objcopy -I srec -O binary target/boot15k.sr target/boot15k.sr.bin
unix2dos target/boot15k.sr
unix2dos: converting file target/boot15k.sr to DOS format...
/bin/bash ./cmds/formatPartitionedImage.sh target/disk1.img 1
Partition size: 4194304 bytes
Disk size:      4194304 bytes

Formatting a 1 partition image -> target/disk1.img
1+0 records in
1+0 records out
4194304 bytes (4.2 MB, 4.0 MiB) copied, 0.0206695 s, 203 MB/s
unix2dos: converting file /tmp/label.txt to DOS format...
/bin/bash ./cmds/copyDisks.sh target/disk1.img 1 cpm_1_3
Copying cpm_1_3/DISK1 to partition 0
/bin/bash ./cmds/installSystem.sh target/disk1.img target/boot15k.sr
Copying boot15k.sr to target/disk1.img, partition 0
/bin/bash ./cmds/copyFiles.sh target/disk1.img 4mb-hd-0 ../boot/m68000/target/boot.bin
Copying ../boot/m68000/target/boot.bin to target/disk1.img, definition 4mb-hd-0
cpmcp: can not open ../boot/m68000/target/boot.bin: No such file or directory
make[1]: Leaving directory '/zs/work/68k-projects/rosco-m68k/cpm68k/cpmfs'
make -C boot 
make[1]: Entering directory '/zs/work/68k-projects/rosco-m68k/cpm68k/boot'
vasmm68k_mot -Felf -m68010 -quiet -Lnf -DROSCO_M68K -L obj/kmain.lst -o obj/kmain.o kmain.asm
#cp ../../rosco_m68k/code/software/libs/build/lib/ld/serial/hugerom_rosco_m68k_program.ld obj/rosco.ld
#cat obj/rosco.ld | sed -e 's/^ram.*/ram = 0x00014F38;/' > obj/boot.ld # HACK do we need to change ram size
m68k-elf-ld -T ../../rosco_m68k/code/software/libs/build/lib/ld/serial/hugerom_rosco_m68k_program.ld -L ../../rosco_m68k/code/software/libs/build/lib --gc-sections --oformat=elf32-m68k -L/home/linuxbrew/.linuxbrew/Cellar/gcc-cross-m68k@11/11.2.0/lib/gcc/m68k-elf/11.2.0/m68000/ -L/home/linuxbrew/.linuxbrew/Cellar/gcc-cross-m68k@11/11.2.0/lib/gcc/m68k-elf/11.2.0/../../../../m68k-elf/lib/m68k-elf/11.2.0/m68000/ -L/home/linuxbrew/.linuxbrew/Cellar/gcc-cross-m68k@11/11.2.0/lib/gcc/m68k-elf/11.2.0/../../../../m68k-elf/lib/m68000/ obj/kmain.o -lrosco_m68k -lsdfat -lstart_serial -lgcc -o obj/boot.elf
m68k-elf-nm --numeric-sort obj/boot.elf > obj/boot.sym
m68k-elf-size obj/boot.elf
   text    data     bss     dec     hex filename
  61556       0   14340   75896   12878 obj/boot.elf
chmod a-x obj/boot.elf
m68k-elf-objcopy -O binary obj/boot.elf target/boot.bin
make[1]: Leaving directory '/zs/work/68k-projects/rosco-m68k/cpm68k/boot'

2022-06-11: vm4 - installing toolchain on a Debian machine. First, install curl, cpmtools and srecord via apt. curl is used to install Homebrew, cpmtools and srecord is used as tools in the build process. Next, install homebrew

tingo@kg-vm4:~$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

and follow the instructions to add it to ~/.profile, PATH etc.

eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

is useful. Next, install the toolchain

tingo@kg-vm4:~$ brew install binutils-cross-m68k
tingo@kg-vm4:~$ brew install vasm-m68k
tingo@kg-vm4:~$ brew install gcc-cross-m68k@11

that's it.