gberthou / AdvanceOS

Tiny Operating System to emulate GBA on Raspberry Pi
GNU General Public License v3.0
48 stars 2 forks source link

make[1]: /usrgcc: No such file or directory #3

Closed arteze closed 3 years ago

arteze commented 3 years ago

I go back by a new problem.

make[1]: /usrgcc: No such file or directory

~/documentos/programar/c/AdvanceOS-master
make
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c console.c -o obj/console.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c dma.c -o obj/dma.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c errlog.c -o obj/errlog.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c framebuffer.c -o obj/framebuffer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c gba.c -o obj/gba.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c irq.c -o obj/irq.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c mailbox.c -o obj/mailbox.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c main.c -o obj/main.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c mem.c -o obj/mem.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c mmu.c -o obj/mmu.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c timer.c -o obj/timer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c usb.c -o obj/usb.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c utils.c -o obj/utils.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/dma.c -o obj/peripherals/dma.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/lcd.c -o obj/peripherals/lcd.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/peripherals.c -o obj/peripherals/peripherals.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/special.c -o obj/peripherals/special.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/timer.c -o obj/peripherals/timer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/alloc.c -o obj/uspienv/alloc.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/bcm.c -o obj/uspienv/bcm.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/interrupt.c -o obj/uspienv/interrupt.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/logger.c -o obj/uspienv/logger.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/timer.c -o obj/uspienv/timer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/uspienv.c -o obj/uspienv/uspienv.o 
cd uspi/lib && make clean && make
make[1]: Entering directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
rm -f *.o *.a *.elf *.lst *.img *.cir *.map *~ 
make[1]: Leaving directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
make[1]: Entering directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o uspilibrary.o uspilibrary.c
make[1]: /usrgcc: No such file or directory
make[1]: *** [../Rules.mk:51: uspilibrary.o] Error 127
make[1]: Leaving directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
make: *** [makefile:61: uspi/lib/libuspi.a] Error 2
arteze commented 3 years ago

More errors, if remove ARCH parameters (-march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard)... It was not possible to compile with those parameters, then removed them:

/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master
make
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c console.c -o obj/console.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c dma.c -o obj/dma.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c errlog.c -o obj/errlog.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c framebuffer.c -o obj/framebuffer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c gba.c -o obj/gba.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c irq.c -o obj/irq.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c mailbox.c -o obj/mailbox.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c main.c -o obj/main.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c mem.c -o obj/mem.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c mmu.c -o obj/mmu.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c timer.c -o obj/timer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c usb.c -o obj/usb.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c utils.c -o obj/utils.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/dma.c -o obj/peripherals/dma.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/lcd.c -o obj/peripherals/lcd.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/peripherals.c -o obj/peripherals/peripherals.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/special.c -o obj/peripherals/special.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/timer.c -o obj/peripherals/timer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/alloc.c -o obj/uspienv/alloc.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/bcm.c -o obj/uspienv/bcm.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/interrupt.c -o obj/uspienv/interrupt.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/logger.c -o obj/uspienv/logger.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/timer.c -o obj/uspienv/timer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/uspienv.c -o obj/uspienv/uspienv.o 
cd uspi/lib && make clean && make
make[1]: Entering directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
rm -f *.o *.a *.elf *.lst *.img *.cir *.map *~ 
make[1]: Leaving directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
make[1]: Entering directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
/usrgcc  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o uspilibrary.o uspilibrary.c
/usrgcc  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o dwhcidevice.o dwhcidevice.c
dwhcidevice.c: Assembler messages:
dwhcidevice.c:866: Error: no such instruction: `mcr p15,0,%eax,c7,c10,5'
dwhcidevice.c:1246: Error: no such instruction: `mcr p15,0,%eax,c7,c10,5'
dwhcidevice.c:1268: Error: no such instruction: `mcr p15,0,%eax,c7,c10,5'
dwhcidevice.c:347: Error: no such instruction: `mcr p15,0,%r12d,c7,c10,5'
dwhcidevice.c:358: Error: no such instruction: `mcr p15,0,%r12d,c7,c10,5'
dwhcidevice.c:284: Error: no such instruction: `mcr p15,0,%eax,c7,c10,5'
dwhcidevice.c:338: Error: no such instruction: `mcr p15,0,%eax,c7,c10,5'
dwhcidevice.c:975: Error: no such instruction: `mcr p15,0,%eax,c7,c10,5'
dwhcidevice.c:1182: Error: no such instruction: `mcr p15,0,%eax,c7,c10,5'
dwhcidevice.c:1233: Error: no such instruction: `mcr p15,0,%eax,c7,c10,5'
dwhcidevice.c:116: Error: no such instruction: `mcr p15,0,%eax,c7,c10,5'
dwhcidevice.c:180: Error: no such instruction: `mcr p15,0,%eax,c7,c10,5'
make[1]: *** [../Rules.mk:51: dwhcidevice.o] Error 1
make[1]: Leaving directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
make: *** [makefile:61: uspi/lib/libuspi.a] Error 2
arteze commented 3 years ago

I just realized that you had to create symbolic links, I put the ARCH as originally.

ln -sfv /usr/bin/arm-none-eabi-gcc /usrgcc
ln -sfv /usr/bin/arm-none-eabi-gcc-ar /usrar

But now another error appears:

/usr/bin/arm-none-eabi-ar: uspilibrary.o: No such file or directory

/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master
make
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c console.c -o obj/console.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c dma.c -o obj/dma.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c errlog.c -o obj/errlog.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c framebuffer.c -o obj/framebuffer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c gba.c -o obj/gba.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c irq.c -o obj/irq.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c mailbox.c -o obj/mailbox.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c main.c -o obj/main.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c mem.c -o obj/mem.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c mmu.c -o obj/mmu.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c timer.c -o obj/timer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c usb.c -o obj/usb.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c utils.c -o obj/utils.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/dma.c -o obj/peripherals/dma.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/lcd.c -o obj/peripherals/lcd.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/peripherals.c -o obj/peripherals/peripherals.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/special.c -o obj/peripherals/special.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c peripherals/timer.c -o obj/peripherals/timer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/alloc.c -o obj/uspienv/alloc.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/bcm.c -o obj/uspienv/bcm.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/interrupt.c -o obj/uspienv/interrupt.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/logger.c -o obj/uspienv/logger.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/timer.c -o obj/uspienv/timer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/uspienv.c -o obj/uspienv/uspienv.o 
cd uspi/lib && make clean && make
make[1]: Entering directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
rm -f *.o *.a *.elf *.lst *.img *.cir *.map *~ 
make[1]: Leaving directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
make[1]: Entering directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o uspilibrary.o uspilibrary.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o dwhcidevice.o dwhcidevice.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o dwhciregister.o dwhciregister.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o dwhcixferstagedata.o dwhcixferstagedata.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o usbconfigparser.o usbconfigparser.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o usbdevice.o usbdevice.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o usbdevicefactory.o usbdevicefactory.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o usbendpoint.o usbendpoint.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o usbrequest.o usbrequest.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o usbstandardhub.o usbstandardhub.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o devicenameservice.o devicenameservice.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o macaddress.o macaddress.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o smsc951x.o smsc951x.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o string.o string.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o util.o util.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o usbmassdevice.o usbmassdevice.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o dwhciframeschednper.o dwhciframeschednper.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o dwhciframeschedper.o dwhciframeschedper.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o keymap.o keymap.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o usbkeyboard.o usbkeyboard.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o dwhcirootport.o dwhcirootport.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o usbmouse.o usbmouse.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o dwhciframeschednsplit.o dwhciframeschednsplit.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o usbgamepad.o usbgamepad.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o synchronize.o synchronize.c
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o usbstring.o usbstring.c
rm -f libuspi.a
/usrar cr libuspi.a uspilibrary.o dwhcidevice.o dwhciregister.o dwhcixferstagedata.o usbconfigparser.o usbdevice.o usbdevicefactory.o usbendpoint.o usbrequest.o usbstandardhub.o devicenameservice.o macaddress.o smsc951x.o string.o util.o usbmassdevice.o dwhciframeschednper.o dwhciframeschedper.o keymap.o usbkeyboard.o dwhcirootport.o usbmouse.o dwhciframeschednsplit.o usbgamepad.o synchronize.o usbstring.o
/usr/bin/arm-none-eabi-ar: uspilibrary.o: No such file or directory
make[1]: *** [Makefile:32: libuspi.a] Error 1
make[1]: Leaving directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
make: *** [makefile:61: uspi/lib/libuspi.a] Error 2
gberthou commented 3 years ago

Hey again, As far as your first message is concerned, there is no such thing as /usrgcc in this repo. That issue seems to be related to your compiler and how you installed it. Please do create an issue only if you are sure that the problem arises from the repo.

For the second error message, actually you only have to remove the -mfloat-abi=hard flag, from makefile and from uspi/Rules.mk as you already noticed. The other two flags indicate to the compiler which instruction set to choose, because we want the binary to work on a specific architecture (here, RPI B+). If we wanted to compile for another ARM target, let's say the RPI3, we would have to change those flags, like in my other repo dedicated to RPI3. My point is that you don't want to omit the -march, -mcpu, etc flags otherwise your compiler doesn't know what to do.

It seems that my version of arm-none-eabi-gcc in 2016 did support the hardware floating point unit of the arm1176jzf-s, or at least did not complain about it, but for some reason I don't know it's not the case any longer. I don't remember, after five years, whether or not the code uses floating point operations, so I don't know if removing the flag would alter the runtime behavior, but at least it compiles..

gberthou commented 3 years ago

I suggest that you try to have a closer look at your compiler install and symbolic links. I don't know your distro nor your packages and how you installed them, but I never encountered the error and neither usrgcc nor usrar appear in the project.

I cloned the repo, and to make it fully compile I had to :

arteze commented 3 years ago

Now I have another problem ... it appears that is missing sys/types.h, but the file /usr/include/sys/types.h exists.

~/Desktop/documentos/programar/c/AdvanceOS-master
make
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c console.c -o obj/console.o 
In file included from console.c:1:
console.h:4:10: fatal error: sys/types.h: No such file or directory
    4 | #include <sys/types.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make: *** [makefile:41: obj/console.o] Error 1

If I see the file, it exists:

~/Desktop/documentos/programar/c/AdvanceOS-master
cat /usr/include/x86_64-linux-gnu/sys/types.h
/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, see
   <https://www.gnu.org/licenses/>.  */

/*
 *  POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
 */

#ifndef _SYS_TYPES_H
#define _SYS_TYPES_H    1

#include <features.h>

__BEGIN_DECLS

#include <bits/types.h>

#ifdef  __USE_MISC
# ifndef __u_char_defined
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
#  define __u_char_defined
# endif
typedef __loff_t loff_t;
#endif

#ifndef __ino_t_defined
# ifndef __USE_FILE_OFFSET64
typedef __ino_t ino_t;
# else
typedef __ino64_t ino_t;
# endif
# define __ino_t_defined
#endif
#if defined __USE_LARGEFILE64 && !defined __ino64_t_defined
typedef __ino64_t ino64_t;
# define __ino64_t_defined
#endif

#ifndef __dev_t_defined
typedef __dev_t dev_t;
# define __dev_t_defined
#endif

#ifndef __gid_t_defined
typedef __gid_t gid_t;
# define __gid_t_defined
#endif

#ifndef __mode_t_defined
typedef __mode_t mode_t;
# define __mode_t_defined
#endif

#ifndef __nlink_t_defined
typedef __nlink_t nlink_t;
# define __nlink_t_defined
#endif

#ifndef __uid_t_defined
typedef __uid_t uid_t;
# define __uid_t_defined
#endif

#ifndef __off_t_defined
# ifndef __USE_FILE_OFFSET64
typedef __off_t off_t;
# else
typedef __off64_t off_t;
# endif
# define __off_t_defined
#endif
#if defined __USE_LARGEFILE64 && !defined __off64_t_defined
typedef __off64_t off64_t;
# define __off64_t_defined
#endif

#ifndef __pid_t_defined
typedef __pid_t pid_t;
# define __pid_t_defined
#endif

#if (defined __USE_XOPEN || defined __USE_XOPEN2K8) \
    && !defined __id_t_defined
typedef __id_t id_t;
# define __id_t_defined
#endif

#ifndef __ssize_t_defined
typedef __ssize_t ssize_t;
# define __ssize_t_defined
#endif

#ifdef  __USE_MISC
# ifndef __daddr_t_defined
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
#  define __daddr_t_defined
# endif
#endif

#if (defined __USE_MISC || defined __USE_XOPEN) && !defined __key_t_defined
typedef __key_t key_t;
# define __key_t_defined
#endif

#if defined __USE_XOPEN || defined __USE_XOPEN2K8
# include <bits/types/clock_t.h>
#endif
#include <bits/types/clockid_t.h>
#include <bits/types/time_t.h>
#include <bits/types/timer_t.h>

#ifdef __USE_XOPEN
# ifndef __useconds_t_defined
typedef __useconds_t useconds_t;
#  define __useconds_t_defined
# endif
# ifndef __suseconds_t_defined
typedef __suseconds_t suseconds_t;
#  define __suseconds_t_defined
# endif
#endif

#define __need_size_t
#include <stddef.h>

#ifdef __USE_MISC
/* Old compatibility names for C types.  */
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
#endif

/* These size-specific names are used by some of the inet code.  */

#include <bits/stdint-intn.h>

/* These were defined by ISO C without the first `_'.  */
typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;

#if __GNUC_PREREQ (2, 7)
typedef int register_t __attribute__ ((__mode__ (__word__)));
#else
typedef int register_t;
#endif

/* Some code from BIND tests this macro to see if the types above are
   defined.  */
#define __BIT_TYPES_DEFINED__   1

#ifdef  __USE_MISC
/* In BSD <sys/types.h> is expected to define BYTE_ORDER.  */
# include <endian.h>

/* It also defines `fd_set' and the FD_* macros for `select'.  */
# include <sys/select.h>
#endif /* Use misc.  */

#if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) \
    && !defined __blksize_t_defined
typedef __blksize_t blksize_t;
# define __blksize_t_defined
#endif

/* Types from the Large File Support interface.  */
#ifndef __USE_FILE_OFFSET64
# ifndef __blkcnt_t_defined
typedef __blkcnt_t blkcnt_t;     /* Type to count number of disk blocks.  */
#  define __blkcnt_t_defined
# endif
# ifndef __fsblkcnt_t_defined
typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks.  */
#  define __fsblkcnt_t_defined
# endif
# ifndef __fsfilcnt_t_defined
typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes.  */
#  define __fsfilcnt_t_defined
# endif
#else
# ifndef __blkcnt_t_defined
typedef __blkcnt64_t blkcnt_t;     /* Type to count number of disk blocks.  */
#  define __blkcnt_t_defined
# endif
# ifndef __fsblkcnt_t_defined
typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks.  */
#  define __fsblkcnt_t_defined
# endif
# ifndef __fsfilcnt_t_defined
typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes.  */
#  define __fsfilcnt_t_defined
# endif
#endif

#ifdef __USE_LARGEFILE64
typedef __blkcnt64_t blkcnt64_t;     /* Type to count number of disk blocks. */
typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks.  */
typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes.  */
#endif

/* Now add the thread types.  */
#if defined __USE_POSIX199506 || defined __USE_UNIX98
# include <bits/pthreadtypes.h>
#endif

__END_DECLS

#endif /* sys/types.h */

¿Something will be missing?

arteze commented 3 years ago

I was able to solve that, but now another error jumps:

framebuffer.h:10:5: error: unknown type name 'uint32_t'

~/Desktop/documentos/programar/c/AdvanceOS-master
make
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c console.c -o obj/console.o 
In file included from console.h:6,
                 from console.c:1:
framebuffer.h:10:5: error: unknown type name 'uint32_t'
   10 |     uint32_t *ptr;
      |     ^~~~~~~~
framebuffer.h:11:5: error: unknown type name 'uint32_t'
   11 |     uint32_t width;
      |     ^~~~~~~~
framebuffer.h:12:5: error: unknown type name 'uint32_t'
   12 |     uint32_t height;
      |     ^~~~~~~~
framebuffer.h:13:5: error: unknown type name 'uint32_t'
   13 |     uint32_t pitch;
      |     ^~~~~~~~
framebuffer.h:18:23: error: unknown type name 'uint32_t'; did you mean 'u_int32_t'?
   18 | struct FBInfo *FBInit(uint32_t width, uint32_t height);
      |                       ^~~~~~~~
      |                       u_int32_t
framebuffer.h:18:39: error: unknown type name 'uint32_t'; did you mean 'u_int32_t'?
   18 | struct FBInfo *FBInit(uint32_t width, uint32_t height);
      |                                       ^~~~~~~~
      |                                       u_int32_t
framebuffer.h:19:17: error: unknown type name 'uint32_t'; did you mean 'u_int32_t'?
   19 | void FBPutColor(uint32_t x, uint32_t y, uint32_t color);
      |                 ^~~~~~~~
      |                 u_int32_t
framebuffer.h:19:29: error: unknown type name 'uint32_t'; did you mean 'u_int32_t'?
   19 | void FBPutColor(uint32_t x, uint32_t y, uint32_t color);
      |                             ^~~~~~~~
      |                             u_int32_t
framebuffer.h:19:41: error: unknown type name 'uint32_t'; did you mean 'u_int32_t'?
   19 | void FBPutColor(uint32_t x, uint32_t y, uint32_t color);
      |                                         ^~~~~~~~
      |                                         u_int32_t
In file included from console.c:1:
console.h:8:19: error: unknown type name 'uint32_t'; did you mean 'u_int32_t'?
    8 | void ConsolePrint(uint32_t px, uint32_t py, const char *str);
      |                   ^~~~~~~~
      |                   u_int32_t
console.h:8:32: error: unknown type name 'uint32_t'; did you mean 'u_int32_t'?
    8 | void ConsolePrint(uint32_t px, uint32_t py, const char *str);
      |                                ^~~~~~~~
      |                                u_int32_t
console.h:9:22: error: unknown type name 'uint32_t'; did you mean 'u_int32_t'?
    9 | void ConsolePrintHex(uint32_t px, uint32_t py, uint32_t x);
      |                      ^~~~~~~~
      |                      u_int32_t
console.h:9:35: error: unknown type name 'uint32_t'; did you mean 'u_int32_t'?
    9 | void ConsolePrintHex(uint32_t px, uint32_t py, uint32_t x);
      |                                   ^~~~~~~~
      |                                   u_int32_t
console.h:9:48: error: unknown type name 'uint32_t'; did you mean 'u_int32_t'?
    9 | void ConsolePrintHex(uint32_t px, uint32_t py, uint32_t x);
      |                                                ^~~~~~~~
      |                                                u_int32_t
In file included from console.c:2:
linker.h:4:10: fatal error: sys/types.h: No such file or directory
    4 | #include <sys/types.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make: *** [makefile:41: obj/console.o] Error 1
arteze commented 3 years ago

Again I could solve it, but now it is missing peripherals/keypad.h:

arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c gba.c -o obj/gba.o 
gba.c:7:10: fatal error: peripherals/keypad.h: No such file or directory
    7 | #include "peripherals/keypad.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [makefile:41: obj/gba.o] Error 1
arteze commented 3 years ago

I think I found it, It is one of these two files?

arteze commented 3 years ago

I have chosen the second and I have more errors:

arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c gba.c -o obj/gba.o 
gba.c: In function 'GBARun':
gba.c:115:5: error: implicit declaration of function 'KeypadInit' [-Werror=implicit-function-declaration]
  115 |     KeypadInit();
      |     ^~~~~~~~~~
gba.c:116:5: error: implicit declaration of function 'KeypadReset' [-Werror=implicit-function-declaration]
  116 |     KeypadReset();
      |     ^~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [makefile:41: obj/gba.o] Error 1
arteze commented 3 years ago

Now I tried with this code:

Errors:

arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c gba.c -o obj/gba.o 
In file included from gba.c:7:
peripherals/keypad.h:42:5: error: unknown type name 'u16'
   42 |     u16 key_push_cnt;
      |     ^~~
peripherals/keypad.h:43:5: error: unknown type name 'u32'
   43 |     u32 key_push_time;      // time = cnt * scan-period
      |     ^~~
peripherals/keypad.h:51:5: error: unknown type name 'u8'
   51 |     u8 read_idx, write_idx;
      |     ^~
peripherals/keypad.h:53:5: error: unknown type name 'u16'
   53 |     u16 key_scan_period;
      |     ^~~
peripherals/keypad.h:54:5: error: unknown type name 'u16'
   54 |     u16 key_scan_cnt;
      |     ^~~
peripherals/keypad.h:59:24: error: unknown type name 'u16'
   59 | extern void KeypadInit(u16 scan_period);
      |                        ^~~
peripherals/keypad.h:62:8: error: unknown type name '_bool'
   62 | extern _bool KeypadGetValue(KeyPushT *key_push);
      |        ^~~~~
gba.c: In function 'GBARun':
gba.c:115:5: error: implicit declaration of function 'KeypadInit' [-Werror=implicit-function-declaration]
  115 |     KeypadInit();
      |     ^~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [makefile:41: obj/gba.o] Error 1
arteze commented 3 years ago

I put some include in keypad.h and I have been able to overcome the problem a little.

#include "/usr/include/stdbool.h"
#include "/usr/include/asm-generic/int-ll64.h"

What happens now is another error:

arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/timer.c -o obj/uspienv/timer.o 
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c uspienv/uspienv.c -o obj/uspienv/uspienv.o 
cd uspi/lib && make clean && make
make[1]: Entering directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
rm -f *.o *.a *.elf *.lst *.img *.cir *.map *~ 
make[1]: Leaving directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
make[1]: Entering directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
/usrgcc -march=armv6j -mtune=arm1176jzf-s -mfloat-abi=hard  -Wall -Wno-psabi -fsigned-char -fno-builtin -nostdinc -nostdlib -std=gnu99 -undef -DRASPPI=1 -I ../include -O -DCOMPILE_USPI -DNDEBUG -c -o uspilibrary.o uspilibrary.c
uspilibrary.c: In function 'USPiInitialize':
uspilibrary.c:56:1: sorry, unimplemented: Thumb-1 hard-float VFP ABI
   56 | {
      | ^
make[1]: *** [../Rules.mk:51: uspilibrary.o] Error 1
make[1]: Leaving directory '/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master/uspi/lib'
make: *** [makefile:61: uspi/lib/libuspi.a] Error 2

uspilibrary.c:56:1

/*55*/ int USPiInitialize (void)
/*56*/ {
/*57*/  USPiStaticInit();
/*58*/ 
/*59*/  assert (s_pLibrary == 0);
/*60*/  s_pLibrary = (TUSPiLibrary *) malloc (sizeof (TUSPiLibrary));
/*61*/  assert (s_pLibrary != 0);
/*62*/ 
/*63*/  DeviceNameService (&s_pLibrary->NameService);
/*64*/  DWHCIDevice (&s_pLibrary->DWHCI);
/*65*/  s_pLibrary->pEth0 = 0;
/*66*/ 
/*67*/  if (!DWHCIDeviceInitialize (&s_pLibrary->DWHCI))
/*68*/  {
/*69*/      LogWrite (FromUSPi, LOG_ERROR, "Cannot initialize USB host controller interface");
arteze commented 3 years ago

I resolved it by editing uspi/Rules.mk on the line 46, including -marm.

-DCOMPILE_USPI -DNDEBUG -marm

Now I have another error:

/usr/bin/arm-none-eabi-ld: cannot find -lc

arm-none-eabi-gcc -nostartfiles -mfloat-abi=hard obj/bios.o obj/font.o obj/handlers.o obj/rom.o obj/swifunctions.o obj/vector.o obj/console.o obj/dma.o obj/errlog.o obj/framebuffer.o obj/gba.o obj/irq.o obj/mailbox.o obj/main.o obj/mem.o obj/mmu.o obj/timer.o obj/usb.o obj/utils.o obj/peripherals/dma.o obj/peripherals/keypad.o obj/peripherals/lcd.o obj/peripherals/peripherals.o obj/peripherals/special.o obj/peripherals/timer.o obj/uspienv/delayloop.o obj/uspienv/alloc.o obj/uspienv/bcm.o obj/uspienv/interrupt.o obj/uspienv/logger.o obj/uspienv/timer.o obj/uspienv/uspienv.o -o kernel.elf -L"uspi/lib"  -luspi -T ldscript.l
/usr/bin/arm-none-eabi-ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: *** [makefile:44: default] Error 1
arteze commented 3 years ago

I was able to solve that part, first I made a reinstallation of arm-none-eabi-gcc-cs.

Then I saw that the executable was empty, I had to make a symbolic link:

cd /usr/bin
ln -svf arm-none-eabi-gcc-11.1.0 arm-none-eabi-gcc

But now I have another error more:

/initrd/mnt/dev_save/Lsave-n/root/documentos/programar/c/AdvanceOS-master
make
arm-none-eabi-gcc -nostartfiles -mfloat-abi=hard obj/bios.o obj/font.o obj/handlers.o obj/rom.o obj/swifunctions.o obj/vector.o obj/console.o obj/dma.o obj/errlog.o obj/framebuffer.o obj/gba.o obj/irq.o obj/mailbox.o obj/main.o obj/mem.o obj/mmu.o obj/timer.o obj/usb.o obj/utils.o obj/peripherals/dma.o obj/peripherals/keypad.o obj/peripherals/lcd.o obj/peripherals/peripherals.o obj/peripherals/special.o obj/peripherals/timer.o obj/uspienv/delayloop.o obj/uspienv/alloc.o obj/uspienv/bcm.o obj/uspienv/interrupt.o obj/uspienv/logger.o obj/uspienv/timer.o obj/uspienv/uspienv.o -o kernel.elf -L"uspi/lib"  -luspi -T ldscript.l
ld: obj/handlers.o: relocations in generic ELF (EM: 40)
ld: obj/handlers.o: error adding symbols: file in wrong format
make: *** [makefile:44: default] Error 1
arteze commented 3 years ago

Now I did make clean, and another error appears:

arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c gba.c -o obj/gba.o 
arm-none-eabi-gcc: fatal error: cannot execute 'cc1': execvp: No such file or directory
compilation terminated.
make: *** [makefile:41: obj/gba.o] Error 1

But if I change arm-none-eabi-gcc to gcc, the error is different:

gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -nostartfiles -ffreestanding -O3 -I"uspi/include"  -c gba.c -o obj/gba.o 
gba.c: In function 'GBACallIRQ':
gba.c:153:5: error: unknown register name 'lr' in 'asm'
  153 |     __asm__ volatile("mov lr, pc\n"
      |     ^~~~~~~
make: *** [makefile:41: obj/gba.o] Error 1
arteze commented 3 years ago

This time it does not work either make clean:

makefile:44: update target 'default' due to: ldscript.l obj/bios.o obj/font.o obj/handlers.o obj/rom.o obj/swifunctions.o obj/vector.o obj/console.o obj/dma.o obj/errlog.o obj/framebuffer.o obj/gba.o obj/irq.o obj/mailbox.o obj/main.o obj/mem.o obj/mmu.o obj/timer.o obj/usb.o obj/utils.o obj/peripherals/dma.o obj/peripherals/keypad.o obj/peripherals/lcd.o obj/peripherals/peripherals.o obj/peripherals/special.o obj/peripherals/timer.o obj/uspienv/delayloop.o obj/uspienv/alloc.o obj/uspienv/bcm.o obj/uspienv/interrupt.o obj/uspienv/logger.o obj/uspienv/timer.o obj/uspienv/uspienv.o uspi/lib/libuspi.a
gcc -nostartfiles obj/bios.o obj/font.o obj/handlers.o obj/rom.o obj/swifunctions.o obj/vector.o obj/console.o obj/dma.o obj/errlog.o obj/framebuffer.o obj/gba.o obj/irq.o obj/mailbox.o obj/main.o obj/mem.o obj/mmu.o obj/timer.o obj/usb.o obj/utils.o obj/peripherals/dma.o obj/peripherals/keypad.o obj/peripherals/lcd.o obj/peripherals/peripherals.o obj/peripherals/special.o obj/peripherals/timer.o obj/uspienv/delayloop.o obj/uspienv/alloc.o obj/uspienv/bcm.o obj/uspienv/interrupt.o obj/uspienv/logger.o obj/uspienv/timer.o obj/uspienv/uspienv.o -o kernel.elf -L"uspi/lib"  -luspi -T ldscript.l
/usr/bin/ld: obj/handlers.o: relocations in generic ELF (EM: 40)
/usr/bin/ld: obj/handlers.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
make: *** [makefile:44: default] Error 1
gberthou commented 3 years ago

Hello,

Now I have another problem ... it appears that is missing sys/types.h, but the file /usr/include/sys/types.h exists.

But if I change arm-none-eabi-gcc to gcc, the error is different:

You must understand that you're compiling from a desktop computer to a RPI target. You're hence cross-compiling. This means that you have - at least - two compilers on your distro:

  1. gcc which compiles binaries compatible with your coding machine.
  2. arm-none-eabi-gcc which compiles binaries for ARM-based targets, such as a RPI.

Both compilers use different libs and headers. They are not located in the same folder and they should not be mixed. You should really pay attention to what you're doing on your machine and whether what you're doing matches your intentions.

Again I could solve it, but now it is missing peripherals/keypad.h:

As I said in your other issue #2 ,

Later on, you might encounter a missing keypad, referenced in gba.c. Unfortunately, it seems that I forgot to add the keypad-related files and I no longer have them. However it is possible to comment out the #include statement, as well as the two calls to the keypad-related functions inside GBARun.

I created the keypad-related files myself five years ago and I have those no longer. The remaining explanations are inside the paragraph I quoted. Please also pay attention to what you're told, that's the whole point of opening the issues.

I was able to solve that part, first I made a reinstallation of arm-none-eabi-gcc-cs.

Ok I don't know about arm-none-eabi-gcc-cs. Does your distro have an arm-none-eabi-gcc package instead? If so, try to use it (uninstall arm-none-eabi-gcc-cs first unless you really have to use it for some reason). For example, I'm running an ArchLinux with arm-none-eabi-gcc 11.1.0-1. I "just" have to clone the repo, remove the -mfloat-abi=hard flag and comment out the keypad references in gba.c to be able to compile.

I agree that it does not compile out-of-the-box yet, but I soon as I have time to test it on real hardware, I'll commit my changes.

arteze commented 3 years ago

I'm getting this error:

/AdvanceOS
make
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -mthumb-interwork -O3 -I"uspi/include"  -c console.c -o obj/console.o 
Assembler messages:
Fatal error: invalid -march= option: `armv4t'
make: *** [makefile:42: obj/console.o] Error 1

If I do not allocate any architecture, it is assigned armv4t automatically... Any architecture that I assign does not work.

Right now I have the makefile:

ARM=arm-none-eabi
BIN=kernel

OBJDIR=obj
DISASDIR=disas

USPI_LIBFILE=uspi/lib/libuspi.a

# Please set LIBDIR and INCDIR accordingly to your file organization
LIBDIR=-L"uspi/lib" 
INCDIR=-I"uspi/include" 

LIBS_USPI=-luspi

CFLAGS=-g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -mthumb-interwork -O3
#CFLAGS=-g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard

ASFLAGS=

LDFLAGS=-nostartfiles -mfloat-abi=hard

DEFINES=

CFILES=$(wildcard *.c) $(wildcard peripherals/*.c)
ASFILES=$(wildcard *.s)

CFILES_USPI=$(wildcard uspienv/*.c)
ASFILES_USPI=$(wildcard uspienv/*.s)

LDSCRIPT=ldscript.l

OBJS=$(patsubst %.s,$(OBJDIR)/%.o,$(ASFILES))
OBJS+=$(patsubst %.c,$(OBJDIR)/%.o,$(CFILES))

OBJS_USPI=$(patsubst %.s,$(OBJDIR)/%.o,$(ASFILES_USPI))
OBJS_USPI+=$(patsubst %.c,$(OBJDIR)/%.o,$(CFILES_USPI))

$(OBJDIR)/%.o : %.s
    $(ARM)-as $(ASFLAGS) $< -o $@

$(OBJDIR)/%.o : %.c
    $(ARM)-gcc $(CFLAGS) $(INCDIR) -c $< -o $@ $(DEFINES)

default: $(LDSCRIPT) $(OBJS) $(OBJS_USPI) $(USPI_LIBFILE)
    $(ARM)-gcc $(LDFLAGS) $(OBJS) $(OBJS_USPI) -o $(BIN).elf $(LIBDIR) $(LIBS_USPI) -T ldscript.l
    $(ARM)-objcopy $(BIN).elf -O binary $(BIN).img
    $(ARM)-objdump -D $(BIN).elf > $(DISASDIR)/$(BIN)

qemu-compatible: $(LDSCRIPT) $(OBJS)
    $(ARM)-gcc $(LDFLAGS) $(OBJS) -o $(BIN).elf $(LIBDIR) -T ldscript.l
    $(ARM)-objcopy $(BIN).elf -O binary $(BIN).img
    $(ARM)-objdump -D $(BIN).elf > $(DISASDIR)/$(BIN)

build:
    mkdir -p $(OBJDIR) $(DISASDIR) $(OBJDIR)/peripherals $(OBJDIR)/uspienv

clean:
    rm -f $(OBJS) $(OBJS_USPI) $(USPI_LIBFILE)

$(USPI_LIBFILE):
    cd uspi/lib && make clean && make
arteze commented 3 years ago

If assigned the original flags I have the following error:

CFLAGS=-g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard

make
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -mfloat-abi=hard -I"uspi/include"  -c console.c -o obj/console.o 
cc1: error: '-mfloat-abi=hard': selected architecture lacks an FPU
make: *** [makefile:42: obj/console.o] Error 1
gberthou commented 3 years ago

Hi,

Have you tried removing -mfloat-abi=hard only and leaving the other flags intact? If so, what is the error with that configuration, including -march=armv6z -marm?

gberthou commented 3 years ago

Good news! I restored an old RPI B+ and made the necessary changes to compile with arm-none-eabi-gcc 11.1.0-1, without the keypad feature. Now you just have to pull the newest commit and to fix your compiler. Have fun!

arteze commented 3 years ago

If I leave everything original but without -march=armv6z -marm, I get the error that architecture armv6z It is invalid.

CFLAGS=-g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3

/AdvanceOS
make
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3 -I"uspi/include"  -c console.c -o obj/console.o 
Assembler messages:
Fatal error: invalid -march= option: `armv6z'
make: *** [makefile:42: obj/console.o] Error 1

ok, I'm going to download the new commit.

arteze commented 3 years ago

I think it would be fine that the folder exists in the repository obj, or that this folder creates it makefile, that way you do not have to create it manually.

arteze commented 3 years ago

I have cloned the repository again, I get this error sys/types.h: No such file or directory, ¿How do I include ARM files in this case, without mixing them with the normal GCC?

/AdvanceOS
make
arm-none-eabi-as -march=armv6z bios.s -o obj/bios.o
arm-none-eabi-as -march=armv6z font.s -o obj/font.o
arm-none-eabi-as -march=armv6z handlers.s -o obj/handlers.o
arm-none-eabi-as -march=armv6z rom.s -o obj/rom.o
arm-none-eabi-as -march=armv6z swifunctions.s -o obj/swifunctions.o
arm-none-eabi-as -march=armv6z vector.s -o obj/vector.o
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3  -I"uspi/include"  -c console.c -o obj/console.o 
In file included from console.c:1:
console.h:4:10: fatal error: sys/types.h: No such file or directory
    4 | #include <sys/types.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make: *** [makefile:41: obj/console.o] Error 1
gberthou commented 3 years ago

I think it would be fine that the folder exists in the repository obj, or that this folder creates it makefile, that way you do not have to create it manually.

One cannot add an empty folder to a git repository. Some use an empty placeholder file inside the folder to force git to create the folder though. If you read the README file, you'll see that make build does create the folder, you don't have to manually create it. (Just read the README file)

I have cloned the repository again, I get this error sys/types.h: No such file or directory, ¿How do I include ARM files in this case, without mixing them with the normal GCC?

Actually that header file wasn't necessary, I pushed a better version using the appropriate stdint.h and stddef.h when needed. Thanks for your feedback!

arteze commented 3 years ago

I have removed <sys/types.h> from console.h, framebuffer.h, linker.h, and I added <stdint.h> in framebuffer.h and <stddef.h> in linker.h... After that I get the following error:

/AdvanceOS
make
arm-none-eabi-gcc -g -Wall -Wextra -Werror -pedantic -fomit-frame-pointer -fno-stack-limit -mno-apcs-frame -nostartfiles -ffreestanding -march=armv6z -marm -mthumb-interwork -O3  -I"uspi/include"  -c console.c -o obj/console.o 
Assembler messages:
Fatal error: invalid -march= option: `armv6z'
make: *** [makefile:41: obj/console.o] Error 1
gberthou commented 3 years ago

You could simply have pulled today's commits, for there are other files that are impacted. Anyway, this doesn't change the fact that your compiler doesn't recognize armv6z. Well, I know nothing about your compiler arm-none-eabi-gcc-cs and I already suggested that you try arm-none-eabi-gcc instead, so It's up to you now. I could guess and tell you to try your luck with armv6 instead of armv6z but hey, if you want info about your compiler, please read the documentation of that compiler.

arteze commented 3 years ago

If I change it to armv6 It still does not work, it also seems that it does not recognize any architecture.

¿How complicated would it be to translate the entire project for compatibility with x86_64?

gberthou commented 3 years ago

The RPI B+ has, among others, an ARM11-based processor [1]. ARM11 processors are... ARM processors, not x86_64. This specific processor family supports ARMv6, ARMv6T2, ARMv6Z and ARMv6K microarchitectures [2]. So we basically have no choice, if we're to target RPI B+. More recent RPIs use newer, yet still ARM-based processors. Those processors also support aarch64 but it's still not x86_64.

This very repo is a challenge to myself, a proof-of-concept based on the principle you can read in the README:

GBA has an ARM7TDMI processor and the processor of Raspberry Pi is ARM1176JZF-S. The ARM7 instruction sets (ARM and thumb) are compatible with the ARM11 ones. Hence no instruction decoding is required to simulate the instructions sets.

The whole point of this project is to directly run GBA roms without instruction decoding nor instruction set conversion. So, by design, it cannot run on x86_64. It's designed for ARM and only makes sense for ARM, for one cannot simply run a GBA rom on their desktop computer. Maybe there'll be more ARM-based desktop computers in the future but that's another topic.

If you really want to stick to x86_64, i.e., to simulate the rom on your computer, then at some point you'll either have to decode rom's instructions or to translate the rom to fit x86_64 instruction sets.

Also, you might appreciate to read issue #1 that clearly states that this project is far from operational - if we temporarily consider that being operational means running commercial roms. The issue also complements my motivations with respect to why I started this and why I designed it like this. Long story short, you won't be able to run any commercial game with the current state of the project. If your goal is only to run GBA games, actual emulators will do a better job. For instance, if we want to stick to RPI, there's RetroPie. And of course there are many more GBA emulators out there, even for x86_64.

What I'm trying to say is that if you're not interested in understanding processor and console architectures, you won't be satisfied by this.