LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   How hard is it to make a circuit that will load RAM from SD/SDHC? (https://www.linuxquestions.org/questions/linux-hardware-18/how-hard-is-it-to-make-a-circuit-that-will-load-ram-from-sd-sdhc-940961/)

Skaperen 04-21-2012 01:12 AM

How hard is it to make a circuit that will load RAM from SD/SDHC?
 
I am wondering how hard it would be to make a HARDWARE circuit that can sequentially read certain sectors from an SD/SDHC card and load them into RAM. I am wondering why we still make PC motherboards with soldered on Flash, instead of a removable micro-SDHC card. My though is the BIOS firmware could be loaded this way when powering on. This would remove the risks in reflashing BIOS, since the micro-SDHC card can be verified as correctly loaded in advance of it being placed into active use, and swapped back out if things don't work.

onebuck 04-21-2012 09:22 AM

Member response
 
Hi,

System security! Prevent someone from hi-jacking or hacking a secure system with the on-board BIOS. Look at Android and other tablet devices that are jail broken if you desire this type of personal system.

pan64 04-21-2012 09:29 AM

not to speak about the speed...

Skaperen 04-21-2012 06:03 PM

Quote:

Originally Posted by pan64 (Post 4659233)
not to speak about the speed...

How much firmware is there that needs to be loaded?

Skaperen 04-21-2012 06:07 PM

Quote:

Originally Posted by onebuck (Post 4659227)
Hi,

System security! Prevent someone from hi-jacking or hacking a secure system with the on-board BIOS. Look at Android and other tablet devices that are jail broken if you desire this type of personal system.

If they are jail broken, that doesn't bother me at all :cool:

I'm thinking in terms of the risks that exist when doing reflashing. If the flash process gets interrupted, or the new image does not work, with a micro-SD card, it would be easy to avoid a bricked board.

Yeah, I can imagine some corporation not wanting to do that for their "be in control of the user experience" device.

pan64 04-22-2012 09:51 AM

http://lennartb.home.xs4all.nl/bootloaders/node3.html
http://computer.howstuffworks.com/bios.htm
the original bios runs from the flash, firmware is not copied to the main ram (ok, parts of it can be copied).
I do not know how much of that bios is now used by the OS, but long time ago that code was used (interrupt handlers) for example by msdos. Using a sdhc for this looks not trivial.
Anyway, you can try to update a bios and you will see the size of the firmware is a few MBs or less.

onebuck 04-22-2012 11:04 AM

Member response
 
Hi,

Quote:

Originally Posted by Skaperen (Post 4659457)
If they are jail broken, that doesn't bother me at all :cool:

I'm thinking in terms of the risks that exist when doing reflashing. If the flash process gets interrupted, or the new image does not work, with a micro-SD card, it would be easy to avoid a bricked board.

Yeah, I can imagine some corporation not wanting to do that for their "be in control of the user experience" device.

I did not mean it is bad to have the ability to 'jail break' but that it was an example of the discussed use of 'flash' SDHC device on a Android type system.

jefro 04-22-2012 05:09 PM

Electrically Erasable Programmable read only memory is not the same as a CF or any other common flash memory.

Companies that make motherboards do so that the very slightest of profit margins. They would not spend the amount of money to make a zif or quad package socket.

Don't just flash a bios for any reason other than the exact errata stated in the change exactly matches what symptoms you have. Every ID 10 T on the planet seems to flash bios's for no reason.

Today most bios's have a failsafe way to fix even botched loads.

Skaperen 04-22-2012 05:35 PM

Quote:

Originally Posted by jefro (Post 4660159)
Electrically Erasable Programmable read only memory is not the same as a CF or any other common flash memory.

Companies that make motherboards do so that the very slightest of profit margins. They would not spend the amount of money to make a zif or quad package socket.

Don't just flash a bios for any reason other than the exact errata stated in the change exactly matches what symptoms you have. Every ID 10 T on the planet seems to flash bios's for no reason.

Today most bios's have a failsafe way to fix even botched loads.

I've never seen one of those failsafe ways documented. Can you describe in general how that would be done? Assume the user has another computer, but don't assume they have a JTAG device or such (not sure if there's even a JTAG port on a PC board).

And yes, I do understand that a the flash on a PC would be read from directly from a CPU memory access at it's address range. I know that flash DRIVE emulations are not that. That's why I suggested the idea that would make simple flash drive interfaces like SD cards work ... by reading them sequentially into RAM, and then running the BIOS from that RAM location, instead of directly from the flash memory chip.

The purpose was to make it easy to change. But I guess companies would rather save the few pennies difference that might mean, and have more people buy more boards to replace the ones they brick while flashing.

Skaperen 04-22-2012 05:41 PM

Quote:

Originally Posted by pan64 (Post 4659895)
http://lennartb.home.xs4all.nl/bootloaders/node3.html
http://computer.howstuffworks.com/bios.htm
the original bios runs from the flash, firmware is not copied to the main ram (ok, parts of it can be copied).
I do not know how much of that bios is now used by the OS, but long time ago that code was used (interrupt handlers) for example by msdos. Using a sdhc for this looks not trivial.
Anyway, you can try to update a bios and you will see the size of the firmware is a few MBs or less.

I'm not suggesting to do something different than running BIOS. I'm suggesting that instead of having the BIOS in a soldered-on memory chip like EEPROM used to be (though EEPROM could have sockets, too ... never seen that in Flash chips) ... eliminate that chip altogether and use a new chip that can issue the appropriate hard coded SD commands to load BIOS from an SD card into RAM, then run the BIOS there. Another option is a very tiny minimal firmware to do that (hopefully, with only one basic task of reading BIOS from an SD card at a pre-configured device address, it would be less likely to need updating than a full BIOS ... which today is far more complex than an OS was just a decade or so ago, and so very vulnerable to programmer oopses).

TobiSGD 04-22-2012 06:10 PM

Quote:

Originally Posted by Skaperen (Post 4660180)
I've never seen one of those failsafe ways documented. Can you describe in general how that would be done? Assume the user has another computer, but don't assume they have a JTAG device or such (not sure if there's even a JTAG port on a PC board).

At first, there are mainboards that can re-flash themselves from a second BIOS chip, like Gigabytes DualBIOS. Also, ASUS boards are able to reflash themselves if you put in the CD that came with the mainboard.
If you have a second mainboard of the same type re-flashing is as simple as that. Start the second board and go to the in-built flash-tool (or start a DOS if it one of those rare boards without such a tool), then pull out the BIOS chip and plug in the one with the defective data on it (I have not seen one general purpose mainboard for years where the BIOS chip is soldered in, they all come socketed) and re-flash it. Done.

In general, flashing the BIOS is a work that should only be done when the following circumstances apply:
- You really need to flash the BIOS (like jefro already stated)
- If you try to improve the compatibility for your CPU or RAM with a newer BIOS version (except bugfixing the only valid reason, IMHO) then don't use those components for the flashing. Use components that are known to work.
- You know that your system in general is in a known-well state (no faulty RAMS, no overclockingm ...).
- The medium that contains the new BIOS is checked for errors (md5sum of the BIOS for example).
- You have a reliable power source.

If you are not able to make sure any of these circumstances can be fulfilled by you it may be more trouble free and less error prone to just visit a local store and let them do it.

Skaperen 04-22-2012 10:47 PM

Quote:

Originally Posted by TobiSGD (Post 4660197)
At first, there are mainboards that can re-flash themselves from a second BIOS chip, like Gigabytes DualBIOS. Also, ASUS boards are able to reflash themselves if you put in the CD that came with the mainboard.

So the DualBIOS knows which one to run when powering on? If it lets you write the flash it is NOT using, and then lets you TRY it without committing to it, and only commit to it if it is running, that would work. Or a hardware switch to select which as long as you don't ruin both.

As for the ASUS, I wonder how that works if the BIOS is dead. What would know how to read a new flash image from the CD if there's no BIOS and no OS?

Quote:

Originally Posted by TobiSGD (Post 4660197)
If you have a second mainboard of the same type re-flashing is as simple as that. Start the second board and go to the in-built flash-tool (or start a DOS if it one of those rare boards without such a tool), then pull out the BIOS chip and plug in the one with the defective data on it (I have not seen one general purpose mainboard for years where the BIOS chip is soldered in, they all come socketed) and re-flash it. Done.

Actually, I haven't looked for about 2-3 years. But last I did, the flash was soldered on.

My interest is NOT in how to do the initial flashing right, but how to fix it when something went wrong ... even if it was a virus/trojan that attacks the BIOS flash. This is one reason I thought about SD card, because it has a read-only switch.

TobiSGD 04-23-2012 03:32 AM

Quote:

Originally Posted by Skaperen (Post 4660333)
So the DualBIOS knows which one to run when powering on? If it lets you write the flash it is NOT using, and then lets you TRY it without committing to it, and only commit to it if it is running, that would work. Or a hardware switch to select which as long as you don't ruin both.

You can only overwrite one of the BIOSes. It will everytime when the system starts look if that BIOS is correct (which can be done with a simple checksum). If not it will use the contents of the second BIOS to overwrite the first. The second BIOS is never altered. That also means, when the board automatically is re-flashed it will have the same BIOS version as when delivered.

Quote:

As for the ASUS, I wonder how that works if the BIOS is dead. What would know how to read a new flash image from the CD if there's no BIOS and no OS?
That is not really hard, you just need a small routine that checks the BIOS and if it is not correct that routine looks for a CD where a BIOS file with a specific name is in the root directory and uses that to flash the EEPROM.

Skaperen 04-23-2012 10:19 AM

Quote:

Originally Posted by TobiSGD (Post 4660498)
You can only overwrite one of the BIOSes. It will everytime when the system starts look if that BIOS is correct (which can be done with a simple checksum). If not it will use the contents of the second BIOS to overwrite the first. The second BIOS is never altered. That also means, when the board automatically is re-flashed it will have the same BIOS version as when delivered.

That is not really hard, you just need a small routine that checks the BIOS and if it is not correct that routine looks for a CD where a BIOS file with a specific name is in the root directory and uses that to flash the EEPROM.

And where does this small routine get loaded from? Can't be the OS. Can't be the BIOS. Maybe some separate firmware that could be the future home of the SD card reader?

TobiSGD 04-23-2012 01:59 PM

Modern mainboards ha BIOS chips that can contain up to 16MB, while the BIOS software itself is mostly 4 or 8MB. So there is enough storage for such routines. Even if not, that should not be so difficult to implement.
As stated above, I don't think that your idea will be implemented for cost reasons, simple as that.


All times are GMT -5. The time now is 10:01 AM.