0

Is it possible to make CPU work on large persistent storage medium directly without using RAM ? I am fine if performance is low here.

XgigPro
  • 134
  • 1
  • 11
  • Looks like a duplicate of a question on Superuser: https://superuser.com/questions/857465/run-a-computer-without-ram. On any existing architecture, you need at least ROM for some program code, but could use [cache-as-ram mode on x86](https://superuser.com/questions/857465/run-a-computer-without-ram#comment1834964_857485). See also https://electronics.stackexchange.com/questions/16485/can-you-run-an-x86-class-processor-ramless – Peter Cordes Sep 12 '17 at 21:01
  • Of course, if you have your non-volatile storage mapped into physical address space, like [3D XPoint](https://en.wikipedia.org/wiki/3D_XPoint) can be, you can use it *as* RAM even though it's not normal DRAM. Please clarify what you want to ask. – Peter Cordes Sep 12 '17 at 21:02
  • Actually IDK if 3D XPoint is intended to be memory-mapped. I guess it's normally built into SSD-type devices now. Anyway, memory-mapped persistent storage is a thing, and recent instruction-set extensions (like `clflushopt` and `clwb`) are designed to let software make sure things hit non-volatile storage in the right order and/or before doing something else. See https://www.microsoft.com/en-us/research/publication/better-io-through-byte-addressable-persistent-memory/ and https://lwn.net/Articles/674752/ – Peter Cordes Sep 12 '17 at 21:16

1 Answers1

1

You will need to specify the CPU architecture you are interested, most standard architectures (x86, Power, ARM) assume the existence of RAM for their data bus, I am afraid only a custom board for this processors would allow to use something like SSD instead of RAM.

Some numbers comparing RAM vs SSD latencies: https://gist.github.com/jboner/2841832

Also, RAM is there for a reason, to "smooth" access to bigger storage from CPU, have a look at this image (from https://www.reddit.com/r/hardware/comments/2bdnny/dram_vs_pcie_ssd_how_long_before_ram_is_obsolete/)

enter image description here

As side note, it is possible to access persistent storage without CPU involving (although RAM is still needed), see https://www.techopedia.com/definition/2767/direct-memory-access-dma or https://en.wikipedia.org/wiki/Direct_memory_access

  • 1
    Actually x86 can work without RAM; normal BIOSes simply decide to stop booting when they don't detect any RAM. With a custom ROM, you could use no-fill mode to use cache as RAM. https://stackoverflow.com/questions/27699197/cache-as-ram-no-fill-mode-executable-code. I think that would even support DMA, since modern x86 (with memory controller integrated into the CPU) has cache-coherent DMA. Of course, using cache as RAM is not really "working without RAM". – Peter Cordes Sep 12 '17 at 21:04
  • Right, there is CAR (Cache as RAM), please feel free to add a more detailed answer, it might be more correct than mine – Fernando Gonzalez Sanchez Sep 12 '17 at 21:48
  • I'm going to wait until the OP responds to my comments on the question; it's not clear what exactly they're asking for, and if it's already a duplicate of the superuser question. – Peter Cordes Sep 12 '17 at 21:52
  • I will simplify my question here. Let's say I have no cache nor RAM . All I have is just a CPU and a large persistent storage media(say, SSD,HDD or DVD or a pendrive) . So I am looking for the possibility for CPU to run the processes directly from the above said media. Because in all the books I have learnt that CPU needs RAM . – XgigPro Sep 13 '17 at 07:33
  • @VasanthGowda I am not aware of a way to do that. – Fernando Gonzalez Sanchez Sep 13 '17 at 14:10