Zeal8bit / Zeal-8-bit-OS

An Operating System for Z80 computers, written in assembly
Apache License 2.0
573 stars 53 forks source link

Building for TRS is failing #20

Closed shivas closed 9 months ago

shivas commented 9 months ago

With default config:


Building packer
make[1]: Entering directory '/mnt/d/Projects/Zeal-8-bit-OS/packer'
gcc pack.c -o pack -std=c99 -W
make[1]: Leaving directory '/mnt/d/Projects/Zeal-8-bit-OS/packer'
Executing pre commands...
Compiling for TRS-80!
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild target/trs80/linker.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/rst_vectors.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/boot.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/drivers.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/strutils.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/disks.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/vfs.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/time.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/log.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/syscalls_nommu.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/loader_nommu.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/fs/rawtable.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/fs/zealfs.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild target/trs80/video.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -obuild/os.bin -b -m -s build/target/trs80/linker.o build/kernel/rst_vectors.o build/kernel/boot.o build/kernel/drivers.o build/kernel/strutils.o build/kernel/disks.o build/kernel/vfs.o build/kernel/time.o build/kernel/log.o build/kernel/syscalls_nommu.o build/kernel/loader_nommu.o build/kernel/fs/rawtable.o build/kernel/fs/zealfs.o build/target/trs80/video.o
kernel/vfs.asm:164: error: undefined symbol: zos_sys_remap_bc_page_2
  ^---- zos_sys_remap_bc_page_2
kernel/vfs.asm:311: error: undefined symbol: zos_sys_remap_de_page_2
  ^---- zos_sys_remap_de_page_2
kernel/vfs.asm:356: error: undefined symbol: zos_sys_remap_de_page_2
  ^---- zos_sys_remap_de_page_2
kernel/vfs.asm:449: error: undefined symbol: zos_sys_remap_de_page_2
  ^---- zos_sys_remap_de_page_2
kernel/vfs.asm:490: error: undefined symbol: zos_sys_remap_user_pages
  ^---- zos_sys_remap_user_pages
kernel/vfs.asm:622: error: undefined symbol: zos_sys_remap_de_page_2
  ^---- zos_sys_remap_de_page_2
kernel/vfs.asm:719: error: undefined symbol: zos_sys_remap_de_page_2
  ^---- zos_sys_remap_de_page_2
kernel/vfs.asm:749: error: undefined symbol: zos_sys_remap_de_page_2
  ^---- zos_sys_remap_de_page_2
kernel/vfs.asm:847: error: undefined symbol: zos_sys_remap_de_page_2
  ^---- zos_sys_remap_de_page_2
kernel/vfs.asm:975: error: undefined symbol: zos_sys_remap_de_page_2
  ^---- zos_sys_remap_de_page_2
kernel/time.asm:217: error: undefined symbol: zos_sys_remap_de_page_2
  ^---- zos_sys_remap_de_page_2
make: *** [Makefile:92: all] Error 1```
Zeal8bit commented 9 months ago

@shivas Did you use the menuconfig to set the target to TRS-80 ? The routines related to the MMU, zos_sys_remap_bc_page_2 for example, must not be compiled when TRS-80 target is selected since it doesn't have a virtual memory mapper. In fact, the macro CONFIG_KERNEL_TARGET_HAS_MMU should not be compiled.

Check your os.conf, the line CONFIG_KERNEL_TARGET_HAS_MMU = y must not be present. If it is, remove it. Again, if you use the menuconfig, this option should not be enabled for the TRS-80.

shivas commented 9 months ago

Thats the point, I run make clean make menuconfig, change target to TRS-80 save, I get file:

 CONFIG_CPU_FREQ=10000000
CONFIG_TARGET="trs80"
# CONFIG_TARGET_ZEAL_8_BIT is not set
CONFIG_TARGET_TRS_80=y
# CONFIG_TARGET_AGON_LIGHT is not set

#
# TRS-80 Configuration
#
# end of TRS-80 Configuration

#
# Kernel configuration
#
# CONFIG_KERNEL_REPRODUCIBLE_BUILD is not set
CONFIG_KERNEL_STACK_ADDR=0xFFFF
CONFIG_KERNEL_RAM_START=0xC000
# CONFIG_KERNEL_COLDBOOT_HOOK is not set
# CONFIG_KERNEL_EXIT_HOOK is not set
CONFIG_KERNEL_MAX_LOADED_DRIVERS=16
CONFIG_KERNEL_MAX_OPENED_DEVICES=16
CONFIG_KERNEL_MAX_OPENED_FILES=16
CONFIG_KERNEL_PATH_MAX=128
CONFIG_KERNEL_INIT_EXECUTABLE="A:/init.bin"
CONFIG_KERNEL_INIT_EXECUTABLE_ADDR=0x4000
CONFIG_KERNEL_LOG_SUPPORT_ANSI_COLOR=y
CONFIG_KERNEL_ENABLE_ZEALFS_SUPPORT=y
# end of Kernel configuration

and then it still attempts to compile somehow?

shivas commented 9 months ago
Building packer
make[1]: Entering directory '/mnt/d/Projects/Zeal-8-bit-OS/packer'
gcc pack.c -o pack -std=c99 -W
make[1]: Leaving directory '/mnt/d/Projects/Zeal-8-bit-OS/packer'
Executing pre commands...
Compiling for TRS-80!
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild target/trs80/linker.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/rst_vectors.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/boot.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/drivers.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/strutils.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/disks.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/vfs.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/time.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/log.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/syscalls_nommu.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/loader_nommu.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/fs/rawtable.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild kernel/fs/zealfs.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -Itarget/trs80/./ -Itarget/trs80/./include -Obuild target/trs80/video.asm
/usr/local/bin/z88dk-z80asm -Iinclude/ -obuild/os.bin -b -m -s build/target/trs80/linker.o build/kernel/rst_vectors.o build/kernel/boot.o build/kernel/drivers.o build/kernel/strutils.o build/kernel/disks.o build/kernel/vfs.o build/kernel/time.o build/kernel/log.o build/kernel/syscalls_nommu.o build/kernel/loader_nommu.o build/kernel/fs/rawtable.o build/kernel/fs/zealfs.o build/target/trs80/video.o
OS binary: build/os.bin
Executing post commands...
RAM used by kernel: 784 bytes

ok, so issue was osconfig.asm file that was there from some previous builds I guess