Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
So I've been trying to boot a sample "hello world" kernel with GRUB2 and I've been encountering some issues.
I created the disk image (inside virtualbox) following this: https://wiki.osdev.org/GRUB
I added the kernel image to /mnt/boot and added grub.cfg to /mnt/boot/grub
The message is saying that there is something wrong with your kernel image file (it's too short). With no details of this file it's difficult to know what the problem is, or why.
It would help if you linked to a repository of your source code and the exact instructions that you used.
iansjack wrote:The message is saying that there is something wrong with your kernel image file (it's too short). With no details of this file it's difficult to know what the problem is, or why.
It would help if you linked to a repository of your source code and the exact instructions that you used.
It doesn't contain much - just multiboot stuff and 2 instructions (movl $0xabcdabcd, %eax and hang: jmp hang ) to see if the code's executing or not.
However I don't feel that's what causing the issue though.
iansjack wrote:Well, if you want to keep it secret that's fine.
I hope you manage to find the solution to your problem.
Huh, like I've mentioned there's nothing much except the multiboot header and the 2 instructions. Its just that I didn't feel like it's worth writing it down (as the code is trivial)
Anyways -
EDIT
I managed to solve the problem. The issue was that the executable was a raw binary (--oformat=binary set during linking) instead of an elf executable
Perhaps you can understand now why asked to see what instructions you had used to produce your kernel. Just asking "what's wrong" without showing what you have done is a very difficult question to answer.