Something's not ok with Pascal Bare Bones
Posted: Tue Sep 08, 2015 7:11 pm
I've successfully compiled and ran the Bare Bones tutorial, but as my favourite programming language is pascal, I tought I would continue with the pascal barebones.
I found some now-dead pascal operating systems scattered around the internet, wrote some ideas down, but currently I'm stuck, because I cannot link the compiled stuff listed in the Pascal Bare Bones wiki article.
Please advise me, what should I do. The files are created and compiled exactly as the Pascal Bare Bones tutorial said.
Thanks in advance!
EDIT: I found the solution to this problem, but I've found the next one. I have to use "nasm -f elf64" insted of "nasm -f elf" but for some reason when I boot the iso, grub loads successfully, but it says to my shiny new os that it is not multiboot compliant. Maybe GRUB cannot load the kernel.obj file as it is elf64 too?
I found some now-dead pascal operating systems scattered around the internet, wrote some ideas down, but currently I'm stuck, because I cannot link the compiled stuff listed in the Pascal Bare Bones wiki article.
Code: Select all
[major@localhost Build 2]$ ld --gc-sections -s -Tlinker.script -o kernel.obj stub.o kernel.o multiboot.o system.o console.o
ld: i386 architecture of input file `stub.o' is incompatible with i386:x86-64 output
[major@localhost Build 2]$ file stub.o
stub.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
[major@localhost Build 2]$
[major@localhost Build 2]$ which i386-elf-ld
/home/major/opt/cross/bin/i386-elf-ld
[major@localhost Build 2]$ i386-elf-ld --gc-sections -s -Tlinker.script -o kernel.obj stub.o kernel.o multiboot.o system.o console.o
kernel.o: file not recognized: File format not recognized
[major@localhost Build 2]$
[major@localhost Build 2]$ file kernel.o
kernel.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
[major@localhost Build 2]$ x86_64-elf-ld --gc-sections -s -Tlinker.script -o kernel.obj stub.o kernel.o multiboot.o system.o console.o
x86_64-elf-ld: i386 architecture of input file `stub.o' is incompatible with i386:x86-64 output
[major@localhost Build 2]$
Thanks in advance!
EDIT: I found the solution to this problem, but I've found the next one. I have to use "nasm -f elf64" insted of "nasm -f elf" but for some reason when I boot the iso, grub loads successfully, but it says to my shiny new os that it is not multiboot compliant. Maybe GRUB cannot load the kernel.obj file as it is elf64 too?