ld mi zacalo hlasit segmentation fault, takze bych se chtel zeptat, jestli existuje nejaka alternativa, nebo jestli delam neco spatne..
#!/bin/bash
#####
C="gcc"
A="nasm -f aout"
OBJ="video.o ports.o str.o mem.o idt.o isr.o isr_a.o irq.o irq_a.o kb.o timer.o"
$C -c src/video.c -o video.o
$C -c src/ports.c -o ports.o
$C -c src/str.c -o str.o
$C -c src/mem.c -o mem.o
$C -c src/idt.c -o idt.o
$C -c src/isr.c -o isr.o
$A -o isr_a.o src/isr.asm
$C -c src/irq.c -o irq.o
$A -o irq_a.o src/irq.asm
$C -c src/kb.c -o kb.o
$C -c src/timer.c -o timer.o
#####
nasm bootsect.asm -o bootsect.bin -f bin
$C -c main.c -o main.o
ld -e main -Ttext 0x1000 -o kernel.o main.o $OBJ
objcopy -R .note -R .comment -S -O binary kernel.o kernel.bin
nasm image.asm -o kernel
dd if=/dev/zero of=game.img count=2880
sudo losetup /dev/loop0 game.img
sudo dd if=kernel of=/dev/loop0
sudo losetup -d /dev/loop0
rm -f *.o
rm -f *.bin
Z toho mi vyleze neco takoveho:
zelenac@zelenac:~/Programming/Projects/Snake$ ./build
./build: line 26: 19025 Segmentation fault (core dumped) ld -e main -Ttext 0x1000 -o kernel.o main.o $OBJ
objcopy: 'kernel.o': No such file
image.asm:4: error: `incbin': unable to open file `kernel.bin'
2880+0 records in
2880+0 records out
1474560 bytes (1.5 MB) copied, 0.0576375 seconds, 25.6 MB/s
dd: opening `kernel': No such file or directory