How exactly does it read from the hard drive? I Googled for some time, but couldn't find any solid answers. I read somewhere that it wraps platform specific methods, but I'm not sure about the source.
I'm asking out of curiosity, not because I'm reinventing the wheel:)
At the most basic level computer are all 0's and 1's which translate loosely to those transistors on-off on the mother board. Long long time ago before even assembly language was invented, "programming" was mechanical http://en.wikipedia.org/wiki/Charles_Babbage
Then as time evolves, mechanical turn to assembly which code against an instruction set that translate to the underlying "mechanical parts". And I think the code is printed on punched cards ? Feed into computer to process ? Then the code becomes printed on text file later on.
Then as time evolves again, assembly give way to higher level programming language like C which form a layer on top more human readable so programmers can program against that which in turn go to assembly which in turn to computer processing.
I hope my understanding is correct but that is how I view. Abstraction layer by layer is happening to computer programming throughout the years. How will it be 50 years down the road? We program using our brain to think? :P
So hand coded assembly is used to connect/read from the hard drive (or any other memory device)? Is this done through some asm instructions not directly available in higher level languages?
C++ streams actually do their I/O through an underlying streambuf. The streambuf's get and put methods are those pieces of code that are actually pre-compiled for the platform.
Underneath, the compiler writer will use either the standard C file routines (which use the native platform file I/O routines) or the native platform file I/O routines directly.