Page 1 of 1

How to get QEMU to recognize hard drive

Posted: Mon Nov 12, 2018 2:49 pm
by nlobo
Hi!
I'm currently working on an x86 OS and have most of the very basics such as GDT, IDT, console output, keyboard input and a physical memory manager. I would like to start working on reading and writing to disk. However, I have not been able to get grub to recognize the harddrive. I started by following the bare bones tutorial which uses grub to create an iso file and uses qemu to start the os from this file as a cdrom. I've tried adding an additional virtual harddrive when booting qemu and also tried loading grub into a virtual harddrive but I have not been successful with either of these approaches. Can anyone tell me a better way to load the operating system using qemu such that it also can recognize a virtual harddrive? Any reading suggestions would also help.
Thanks!

Re: How to get QEMU to recognize hard drive

Posted: Mon Nov 12, 2018 3:17 pm
by eryjus
If your host is Linux, take a look here. https://github.com/eryjus/century-os/bl ... efile#L113 I'm not sure how well it would translate to cygwin if you are using that.

It took me a while to sort this out to be robust enough to include in make, including setting up sudo to allow password-less commands. You could of course move all this to a shell script.