Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kernel Bare Bones] Hard Disk load disk error Qemu. #278

Open
Nabir14 opened this issue Aug 5, 2024 · 2 comments
Open

[Kernel Bare Bones] Hard Disk load disk error Qemu. #278

Nabir14 opened this issue Aug 5, 2024 · 2 comments

Comments

@Nabir14
Copy link

Nabir14 commented Aug 5, 2024

I followed everything step by step to 13 Kernel Bare Bones where I encountered a problem.

While running os-image.bin in Qemu it says:
Booting From Hard Disk...
Boot Failed: Cannot boot from hard disk

Running it with -hda instead of -fda my bootloader throws the error Disk Error with Hex 0x0c80.

Also it gives this warning while linking kernel.o and kernel_entrypoint.o:

/usr/local/i386elfgcc/bin/i386-elf-ld: warning: cannot find entry symbol _start; defaulting to 00001000

Same code. How to fix?

@blingo77
Copy link

blingo77 commented Aug 7, 2024

make sure that the kernel offset is 0x1000 in bootsect.asm and that you are loading 2 into the dh register before calling disk_load.

also running qemu-system-x86_64 -fda os-image.bin works pretty well for me.

The warning that you are getting that it's defaulting to 00001000 is just the kernel offset specified in bootsect.asm. Which is where the kernel will be found in memory. So this warning is nothing to worry about and will not cause any trouble when linking all your files together.

hopefully this helps

@Nabir14
Copy link
Author

Nabir14 commented Aug 8, 2024

make sure that the kernel offset is 0x1000 in bootsect.asm and that you are loading 2 into the dh register before calling disk_load.

also running qemu-system-x86_64 -fda os-image.bin works pretty well for me.

The warning that you are getting that it's defaulting to 00001000 is just the kernel offset specified in bootsect.asm. Which is where the kernel will be found in memory. So this warning is nothing to worry about and will not cause any trouble when linking all your files together.

hopefully this helps

It didn't work. I mean everything you said is correct and in my code they are too. The problem is it can't load the disk so if I use -fda it loads from floppy disk (since it can't load from hard disk) but I want it to load from hard disk so I use -hda and it returns error code 0x0c80. My disk.asm is alright.

Why don't you check my source code and see if I am doing anything wrong.
https://github.com/Nabir14/AmpereOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants