Can a real mode program which can write to arbitrary memory areas, damage hardware? Not included in this scenario are interrupt calls or other things that can be done in real mode - just pure writing to memory.
This page shows a memory map of x86 systems, and I see stuff like BIOS data area; so I fear that writing to this area might do persistent changes to the BIOS, or at least change the BIOS settings to unexpected values. The are probably more things that can be destroyed.
I often read that hardware access in real mode can destroy hardware; but they do not explain the circumstances which have to be made.
Since I am only asking about writing access without invoking interrupts, my main question is, if changes to the memory can do persistent changes; and if yes, which and why?
Assuming modern 80x86 hardware; things that won't cause persistent changes and/or damage include:
changing anything that is reset when the computer is reset; including all contents of RAM, caches, the CPU's micro-code, etc.
writing to the area that legacy ROMs are copied to RAM (the area from 0x000C0000 to 0x000FFFFF). Note that this is actually RAM, but set to "ignore writes" in the memory controller after POST.
writing to the area that actually contains the firmware (the "n MiB" area that ends at 0xFFFFFFFF).
Things that will cause "temporarily persistent changes" (that can be fixed) include:
writing trash to CMOS registers; which is no worse than getting a flat CMOS battery on older systems and is likely to result in a "CMOS settings not valid" error (due to a checksum mismatch) next time you boot; and can be fixed via. firmware's configuration utility at boot.
trashing data on storage devices (hard disks, USB flash, etc). Can be fixed by restoring from backup and/or reinstalling software.
Things that might cause unfixable persistent changes include:
writing to firmware's flash. This typically (but not always) involves an intricate sequence just to unlock it, followed by "guessing" a correct encryption key and/or digital signature. Note that this is very difficult if you're deliberately trying to do it, and almost impossible by accident.
writing to a device's flash ROM (if it has any), which might include hard disk's internal controller, printers, etc. This typically (but not always) involves protections to prevent it. Note that this also almost impossible to do by accident.
Things that might cause actual physical damage include:
repeatedly smashing floppy drive heads against their stop (e.g. by seeking to "cylinder 99" that doesn't exist for maybe several hours) in an attempt to reduce the life expectancy of the floppy drive.
attempting to use high resolution video modes on some extremely old "VGA only CRT" monitors (which can't handle the higher frequencies and blow up). Note that blowing these ancient monitors up is about the only thing they're good for.
attempting to set an unsupported video mode (e.g. with higher than sane refresh rate) on some cheap and nasty (and rare) laptops; where its possible to boil the liquid in the liquid crystal display.
Note that most of the things above either require the use of protected mode or long mode (and can't work in real mode), or involve IO ports in some way (not just memory writes).