How to read from SATA HDD (AHCI) on low level?

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.
FusT
Member
Member
Posts: 91
Joined: Wed Sep 19, 2012 3:43 am
Location: The Netherlands

Re: How to read from SATA HDD (AHCI) on low level?

Post by FusT »

I'm amazed by the amount of people coming to this forum because they copy/pasted some random sh*t code and then expect us to spoon-feed them the information they need (or worse, (re)write code for them).
What has happened to learning things on your own?
Yes, you'll make mistakes but you will learn from them.
Don't expect there to be a library/default implementation for anything, read specification/documentation and write it all yourself. It's the only way to truly understand what you're doing.
natiiix
Member
Member
Posts: 44
Joined: Thu Mar 23, 2017 5:21 pm

Re: How to read from SATA HDD (AHCI) on low level?

Post by natiiix »

FusT wrote:I'm amazed by the amount of people coming to this forum because they copy/pasted some random sh*t code and then expect us to spoon-feed them the information they need (or worse, (re)write code for them).
What has happened to learning things on your own?
Yes, you'll make mistakes but you will learn from them.
Don't expect there to be a library/default implementation for anything, read specification/documentation and write it all yourself. It's the only way to truly understand what you're doing.
You clearly don't get the point. Why is there code on the Wiki if it doesn't work? What's the point of that?
Obviously everyone understands that to read from a hard drive you're supposed to give it the sector to read from and where is it supposed to be read. And even that would be a lot easier to understand from a verbal description rather than that piece of code which simply can't be made to work.
Anyways, copy-pasting has always been the most efficient way to do programming.
MollenOS
Member
Member
Posts: 202
Joined: Wed Oct 26, 2011 12:00 pm

Re: How to read from SATA HDD (AHCI) on low level?

Post by MollenOS »

natiiix wrote: You clearly don't get the point. Why is there code on the Wiki if it doesn't work? What's the point of that?
Obviously everyone understands that to read from a hard drive you're supposed to give it the sector to read from and where is it supposed to be read. And even that would be a lot easier to understand from a verbal description rather than that piece of code which simply can't be made to work.
Anyways, copy-pasting has always been the most efficient way to do programming.
You have been a very well-disguised troll, touché
natiiix
Member
Member
Posts: 44
Joined: Thu Mar 23, 2017 5:21 pm

Re: How to read from SATA HDD (AHCI) on low level?

Post by natiiix »

MollenOS wrote:You have been a very well-disguised troll, touché
It's literally the first rule of programming. If it can be copied from somewhere, then that's the way to do it. Re-inventing is stupid and generally doesn't lead to be a better solution
MollenOS
Member
Member
Posts: 202
Joined: Wed Oct 26, 2011 12:00 pm

Re: How to read from SATA HDD (AHCI) on low level?

Post by MollenOS »

natiiix wrote:
MollenOS wrote:You have been a very well-disguised troll, touché
It's literally the first rule of programming. If it can be copied from somewhere, then that's the way to do it. Re-inventing is stupid and generally doesn't lead to be a better solution
If you literally mean that, any form for real programming, any form for OS development is not for you and never will be. To me it sounds like you don't even know the basics of programming, which makes sense if you've built your knowledge from google+stackoverflow copy-pasting. Maybe you should reconsider your career, it doesn't really sound like you have any interest in coding in general. Can i ask why you even went into programming in the first place? Bored?
natiiix
Member
Member
Posts: 44
Joined: Thu Mar 23, 2017 5:21 pm

Re: How to read from SATA HDD (AHCI) on low level?

Post by natiiix »

MollenOS wrote:Can i ask why you even went into programming in the first place? Bored?
Of course. You're asking as if there were another reason to start programming.
I don't really want to be a programmer, it's not particularly interesting, I just don't have better things to do.
MollenOS
Member
Member
Posts: 202
Joined: Wed Oct 26, 2011 12:00 pm

Re: How to read from SATA HDD (AHCI) on low level?

Post by MollenOS »

natiiix wrote:
MollenOS wrote:Can i ask why you even went into programming in the first place? Bored?
Of course. You're asking as if there were another reason to start programming.
I don't really want to be a programmer, it's not particularly interesting, I just don't have better things to do.
I'm sorry, but my personal opinion is you should give up OS development. OS development requires a lot of motivation and interest, and first of all curiosity, and it requires a hell of a lot of discipline. There is no way around that. You've gotten into programming for the wrong reasons, and if you don't have the interest, you don't go and try to code one of the most complex things you can do in programming. It's not easy, and we re-invent the wheel all the time in effort to do it better or just do it in our own way for our own enjoyment.
natiiix
Member
Member
Posts: 44
Joined: Thu Mar 23, 2017 5:21 pm

Re: How to read from SATA HDD (AHCI) on low level?

Post by natiiix »

MollenOS wrote:I'm sorry, but my personal opinion is you should give up OS development. OS development requires a lot of motivation and interest, and first of all curiosity, and it requires a hell of a lot of discipline. There is no way around that. You've gotten into programming for the wrong reasons, and if you don't have the interest, you don't go and try to code one of the most complex things you can do in programming. It's not easy, and we re-invent the wheel all the time in effort to do it better or just do it in our own way for our own enjoyment.
Cool, it's important to have an opinion. It's also important not to take things you do for fun too seriously.
User avatar
MichaelFarthing
Member
Member
Posts: 167
Joined: Thu Mar 10, 2016 7:35 am
Location: Lancaster, England, Disunited Kingdom

Re: How to read from SATA HDD (AHCI) on low level?

Post by MichaelFarthing »

MollenOS wrote:You have been a very well-disguised troll, touché
MollenOS: Is your other hobby going to the zoo to feed the animals? :-)
MollenOS
Member
Member
Posts: 202
Joined: Wed Oct 26, 2011 12:00 pm

Re: How to read from SATA HDD (AHCI) on low level?

Post by MollenOS »

MichaelFarthing wrote:
MollenOS wrote:You have been a very well-disguised troll, touché
MollenOS: Is your other hobby going to the zoo to feed the animals? :-)
Don't we all do that from time to time? :p
FusT
Member
Member
Posts: 91
Joined: Wed Sep 19, 2012 3:43 am
Location: The Netherlands

Re: How to read from SATA HDD (AHCI) on low level?

Post by FusT »

natiiix wrote:I don't really want to be a programmer, it's not particularly interesting, I just don't have better things to do.
This just keeps getting better and better :mrgreen: .
So you're saying that because you're bored you're going to take up something you have absolutely zero interest in. Genius.
User avatar
MichaelFarthing
Member
Member
Posts: 167
Joined: Thu Mar 10, 2016 7:35 am
Location: Lancaster, England, Disunited Kingdom

Re: How to read from SATA HDD (AHCI) on low level?

Post by MichaelFarthing »

MollenOS wrote:Don't we all do that from time to time? :p
Touché aussi
kzinti
Member
Member
Posts: 898
Joined: Mon Feb 02, 2015 7:11 pm

Re: How to read from SATA HDD (AHCI) on low level?

Post by kzinti »

I agree, he's a troll. A clever one.
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: How to read from SATA HDD (AHCI) on low level?

Post by Octacone »

natiiix wrote:I don't really want to be a programmer, it's not particularly interesting, I just don't have better things to do.
Early April Fools'?
Let me see: a random persons that doesn't want to be a programmer, walks into an operating system development forum, wanting to do stuff, not by himself, just because he doesn't want to do any of those, because he is bored... What the hell?!

You can't just expect that things will work randomly. If you want to read from your hard drive, you MUST understand how it works, how you access the information, how much of that information you get per each read, what standards you want to use, how those standards work, raw reading or a file system... Hard work is how you do it. Take yourself some time, READ the documentation, TRY TO UNDERSTAND the documentation. This is not an easy topic, you should start with something easier. Try ATA PIO mode. If you didn't want to be a programmer then why did you come in here? Did you read: http://wiki.osdev.org/Required_Knowledge - http://wiki.osdev.org/Beginner_Mistakes
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
natiiix
Member
Member
Posts: 44
Joined: Thu Mar 23, 2017 5:21 pm

Re: How to read from SATA HDD (AHCI) on low level?

Post by natiiix »

Guess what, it wasn't that difficult after all!

Image
Post Reply