-2

Does it go first in ram then to software? Or does some programs like Windows explorer have "VIP" permission cause they are child of OS, for direct access?

EDIT

Does it possible to make kernel, to have sofisticated instruction to give access directly to USB drive, to OSystem, and OSystem, that feature to provide for himself's programs like Windows Explorer?

fixer1234
  • 27,486
  • Short answer: yes. Long answer: The data from the disk has to be read and interpreted before it can be displayed on the screen. It has to be stored in RAM as part of this process. – DavidPostill Jan 22 '16 at 18:50
  • What exactly is "child of OS" in this context? If you are asking if Windows Explorer, is special, it is just a normal process just like every other process. that runs. – Ramhound Jan 22 '16 at 18:54
  • From same manufacturer – Stefan Eftan Jan 22 '16 at 18:55
  • In this context, do you happen to mean, a system or kernel process? – Ramhound Jan 22 '16 at 18:56
  • i mean system, but now i notice that i missed kernel in process... But if wehave Software premission to ask System to ask kernel to give direct access to usb, that doesn't possible or for securty reasons not suitably? – Stefan Eftan Jan 22 '16 at 19:01
  • 1
    What? Your last comment is confusing. You can edit your question to clarify what your question is exactly. – Ramhound Jan 22 '16 at 19:05
  • It is a non-trivial task to write an Windows explorer replacement, you can indeed replace the shell, with a third-party application. There are many third-party Windows shell applications that exist. You will just lose all Windows Explorer features by doing so. – Ramhound Jan 22 '16 at 19:19
  • @Ramhound you can also program a windows explorer replacement and just use the explorer API's to make it behave the same as explorer, just using your own appearance and add features you want, such as a tabbed interface, etc. – LPChip Jan 22 '16 at 19:21
  • I think the technical term for direct access to the hardware layer is/was real mode. More likely, the OP is looking for direct drive access or raw disk access – Yorik Jan 22 '16 at 19:46

2 Answers2

-1

It doesn't matter what manufacturer the program is vs the manufacturer of the hardware. When files are read they are read through RAM and accessed from there.

The reason for this behavior is because RAM is so much faster than a direct read from the device. If data is only read once, reading it directly from the device would be faster, but as soon as one small fraction of all the data is being read twice, RAM already outperforms. For that reason, it is a calculated action to always read through RAM.

However, drivers can access a device directly, and for certain actions, this is how it is being done, such as format etc. But then we are no longer talking about reading from the drive.

So long answer short, it has been designed to be read through RAM so caching cane speed up tremendously.

EDIT: But... is it possible for a programmer to program it so that the file is directly read from the device, skipping RAM all together? Yes, if they program the driver part too and access the device on a hardware level. This, however, is a very difficult task to do, and in order to make it actually faster than what the system already offers is so hard (prone to bugs, crashes, etc) that its just not worth the trouble, and for that reason, its not being done.

LPChip
  • 61,264
  • @Ramhound true. For the question I didn't think going into this specific detail would be required, but it is indeed what caching is about, and if a program needs a file twice, or several small sections of a file twice etc, accessing it through RAM outperforms. For example, reading a graphics bitmap to show an icon on a toolbar in the interface, which can be one bitmap in a collection file. – LPChip Jan 22 '16 at 19:11
  • Nice answer, but what if it is large file? – Stefan Eftan Jan 22 '16 at 19:14
  • @StefanEftan I've edited my post adding a section that adresses your question. Basically it would be so low-end programming, a programmer will not do it because the costs outweight the gains. – LPChip Jan 22 '16 at 19:17
  • 1
    While I know this is meant to be a more high-level discussion, it is important to understand that nothing happens in a computer without it being in memory. (CPU) processor registers are memory. – Yorik Jan 22 '16 at 19:51
  • Your edit is inaccurate. – sawdust Jan 22 '16 at 21:53
  • @sawdust no, you're mistaken. if I'd program a program that interfaces with hardware as a driver does, and control the hardware directly to perform certain tasks, I could skip the copy to RAM part. Of course, the program itself would not actually know what data its accessing, but it could in theory perform a direct stream copy simply mimicking the raw data from one location to another. RAM does not have to be involved for that. I agree it is one of those rare circumstances where this is actually applicable. – LPChip Jan 22 '16 at 22:30
  • " I could skip the copy to RAM part" -- And do what with the incoming data? I described a no-RAM device-to-device copy in this answer, but the the OP is asking about an application/utility program accessing a device. That is not the same as a copy operation. Hence your claim of a no-RAM read for an application or utility program is bogus. – sawdust Jan 23 '16 at 07:09
-1

Is data from a usb device stored in ram while getting same ( etc explorer listing items )?

Yes, data read from peripherals are placed in the computer's main memory, aka RAM. That is simply the way that computers work. The data has to be buffered in memory for programs to use that data.

Does it go first in ram then to software?

Data does not "go" to software.
Once the data has been read from a peripheral device into the computer's memory, then the software can process that data (in memory).

Or does some programs like Windows explorer have "VIP" permission cause they are child of OS, for direct access?

Windows Explorer, even though it is a program that is bundled with the OS, has no special privileges than any other program.
Certainly no application program could circumvent how the computer has to read data from a peripheral device.

Does it possible to make kernel, to have sofisticated instruction to give access directly to USB drive...

Computers are designed to process data in memory.
There simply is no mechanism for "access directly" the data stored in a peripheral device.
The computer "reads" the peripheral device by sending a "read command" to the device. The device is expected to respond to the command by providing the (block of) data. That data then has to be read into the computer's memory.
That is how digital computers are designed to work.

sawdust
  • 17,804