Hello there!!
I have reached the point with my OS where I am interested in making an HDD/ATA driver so I can read from the disk. I know there is a tutorial on here for that, but my issue is that it is for x86 (32 bits), whereas my kernel is written for x86_64. My question is this: are there any good tutorials/resources/examples of an HDD driver for x86_64 that I could use?
You can find the code for my kernel here if it matters: https://gitlab.com/monarrk/untrust
Thank you,
Skylar Bleed
ATA/HDD driver for x86_64
Re: ATA/HDD driver for x86_64
It is all exactly the same for 32 and 64 bits.
-
- Member
- Posts: 148
- Joined: Sun Aug 23, 2020 4:35 pm
Re: ATA/HDD driver for x86_64
You're probably going to want to have a look at >>AHCI<< if you're developing for x86_64.
Technically you could use IDE mode even in x86_64 (it looks like you have some code for that), but it's pretty old and practically all x86_64 computers have support for AHCI.
I've got some AHCI code in my OS (written in C though). However, my AHCI code isn't up to spec and I sort of just hacked it together.
I'd recommend taking a look at other people's OSes and see how they manage AHCI.
This took me a while to figure out, but to add an AHCI disk in QEMU:
Good luck!
Technically you could use IDE mode even in x86_64 (it looks like you have some code for that), but it's pretty old and practically all x86_64 computers have support for AHCI.
I've got some AHCI code in my OS (written in C though). However, my AHCI code isn't up to spec and I sort of just hacked it together.
I'd recommend taking a look at other people's OSes and see how they manage AHCI.
This took me a while to figure out, but to add an AHCI disk in QEMU:
Code: Select all
qemu-system-x86_64 -device ahci,id=ahci -drive file=hard_disk_image_here.img,id=disk,if=none,format=raw -device ide-hd,drive=disk,bus=ahci.0 [other options...]
My OS: TritiumOS
https://github.com/foliagecanine/tritium-os
void warranty(laptop_t laptop) { if (laptop.broken) return laptop; }
I don't get it: Why's the warranty void?
https://github.com/foliagecanine/tritium-os
void warranty(laptop_t laptop) { if (laptop.broken) return laptop; }
I don't get it: Why's the warranty void?
Re: ATA/HDD driver for x86_64
thank you! I will look at using ahci