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.
All these things I'm doing in Debian x64. I've tried to use linker scripts and elf64 configuration when building object file, but it doesn't work. I guess the problem is in the code of bootloader. But where?
I found something the same here: http://forum.osdev.org/viewtopic.php?f=1&t=14507, but i don't understand clearly what is exactly wrong.
Thank you very much.
All these things I'm doing in Debian x64. I've tried to use linker scripts and elf64 configuration when building object file, but it doesn't work. I guess the problem is in the code of bootloader. But where?
I found something the same here: http://forum.osdev.org/viewtopic.php?f=1&t=14507, but i don't understand clearly what is exactly wrong.
Thank you very much.
Did you set the ORG or are you not using NASM? Cause if your writing a Bootloader, if I am mistaken you should add:
BITS 16
org 0x7C00
jmp 0x0000:start
start:
jmp start
times 510 - ($ - $$) db 0
db 55h
db 0AAh
I've personally never used GCC so I wouldn't know. But remove "jmp 0x0000:start" your telling the CPU to use Code Segment 0x0000. Just do "jmp start" then try that.
BITS 16
org 0x7C00
start:
jmp start
times 510 - ($ - $$) db 0
db 55h
db 0AAh
The same error.
Ok well I took that and compiled it using a build script I wrote and booted it in Bochs with no problem. What does your build script look like? Cause your code is spot on.
Mine looks like this:
nasm -f bin Bootloader.asm -o boot.bin
dd conv=notrunc if=boot.bin of=bin/boot.flp
Ok try removing "status=noxfer". Now "pflash"? I don't know Qemu 100% but boot.img is a floppy image, so make sure you load it as one. If that doesn't work try getting Bochs, and then using this configuration
Ok, what was wrong is using -pflash... I just replaced it with -fda and the program worked. Some time ago using floppy cosed: "PC system firmware (pflash) must be a multiple of 0x1000". Solved. I sould be more careful. Thank you.
Last edited by leonid on Wed Dec 25, 2013 3:47 pm, edited 1 time in total.
leonid wrote:Ok, what was wrong is using -pflash... I just replaced it with -fda and the program works. Some time ago using floppy cosed: "PC system firmware (pflash) must be a multiple of 0x1000". Solved. I sould be more careful. Thank you.
I thought pflash might have been the issue. Your very welcome.
pflash was the obvious error because it's not listed in the wiki examples. Which makes me wonder where you got the idea from in the first place.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]