Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Can code damage hardware?

Name: Anonymous 2011-12-15 11:41

Can random code damage your hardware when run in Real Mode? If yes, give some examples how. What happens when the ACPI tables are overwritten? Is it possible to disable the CPU fan through code, and have the CPU overheat and break, or does the BIOS have moron-proof failsafes incase someone would do that?

Name: Anonymous 2011-12-16 16:12

>>39
If you think about it, his main loop is like the non-interrupt-driven shit used in 0% of computers because interrupts are better.

By the way, C for a microcontroller? I lol'd.

Name: Anonymous 2011-12-16 16:19

>>36
class Minecraft {

public static void main(String args[]) {
  displayHipsterQuipMenu();
  while(1) {
     pollDevices();
     miningLogic();
     moveNPCs();
     updateInventory();
     updateDisplay();
  }
}

}

Name: Anonymous 2011-12-16 16:23

>>41
Because everything microcontrollers are used for must respond instantly.

I use polling when I can, too. It is much easier conceptually when you don't need anything but soft time.

Name: Anonymous 2011-12-16 16:58

>>36
How the hell do you think microprocessor realtime cooperative multitasking works?

Except it must be more complex, since, first, you have IO interrupts that still have to be processed asynchronously, second, if you are doing the entire displaying manually, you have to do that asynchronously in the timer interrupt(s), third, you might have long-running tasks which would require wasting a lot of cycles to check if it's not the time to yield to achieve necessary responsiveness. Not to mention being really, really careful about that, too careful than is acceptable for life-critical applications.

>>39
By the way, C for a microcontroller? I lol'd.
Moron.

Name: Anonymous 2011-12-16 17:28

>>33
Why not split the specialized tasks among two or more microcontrollers with a serial protocol like I2C to communicate between them, seems it would be a lot easier to debug... The chips can be tested as components and inter-chip debugging just involves listening to the serial stream, and processes sending each other messages is about 1/5 Erlang, everyone likes Erlang.

>>28
The Therac-25 basically was the earlier Therac without hardware interlocks, the same architecture and software was used and probably expanded. The first one, Therac 6 was actually just an X-ray machine with a computer tacked on for convenience, and some of the assembler source was ported over to the Therac 20. The homemade scheduler and multitasker for all we know might have been only intended for a responsive user interface since it might have been coded in 1970.

Name: Anonymous 2011-12-16 20:51

>>45
without hardware interlocks
I NEVER trust in EXPERT PROGRAMMERS.

Name: Anonymous 2011-12-16 23:39

>>16
It wasn't a snowstorm, it was a CRT storm. Twelve miles deep both ways.

>>24
It took me entirely too long to read that sentence.

>>37
That's not always true. I've had hardware that performed better when it was polled for activity rather than interrupt-driven. This was not in the past 20 years mind you, but interrupts aren't always more efficient. I don't think they're even much more efficient on average.

Name: Anonymous 2011-12-17 1:29

>>44
>Moron.
YHBT, ``faggot''.

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2011-12-17 5:17

>>33
I actually have. MCS-48/51, 65xx, PIC, AVR, etc.


/* THERAC-25 Improved Control Software */
#include "therac25hw.h"

/* Assume hardware is in a "safe" state after reset,
  i.e. the beam is turned off. */
reset_vec() {
 if(hwReadResetStatus()&RS_WATCHDOG) {
  put_msg("Unexpected reset by watchdog. %d dosed before reset.",
   hwReadDoseCounter()); /* assume dose counter persists across soft resets */
 }
 for(;;) { /* main loop */
  struct treatment_params tp;
  int c;
  if(!hwPatientPresent()) {
   put_msg("PC LOAD PATIENT");
   wait_any_key();
  }
  while((c=get_key())!=KEY_START) {
   /* do stuff with UI here, changes tp appropriately */
   hwResetWatchdog();
  }
  put_msg("Are you sure you want to dose?");
  if((c=get_key())==KEY_START) {
   /* initialize the hardware and DOES NOT RETURN until
      after everything is setup correctly */
   hwInitialize(&tp);
   hwDoseCounterReset();
   put_msg("Dosing started. Press any key to abort.");
   hwStartDosing(); /* HEKTIK DOSING! */
   while(!hwKeyBufferNonEmpty() && hwPatientPresent()
         && tp.dose < hwReadDoseCounter())
    hwWatchDogReset(); /* if the CPU hangs, the watchdog will reset it and stop dosing */
   hwStopDosing();
   if(!hwPatientPresent())
    put_msg("Patient escaped!");
   else
    put_msg("Dosing %s after %d of %d units",
     hwKeyBufferNonEmpty() ? "aborted" : "finished",
     hwReadDoseCounter(), tp.dose);
  }
 }
}

Name: Anonymous 2011-12-17 5:32

well i think there was an instruction called something-and-catch-fire, which was a joke about some intel instructions that could be set on a loop and just overheat the processor, it should be long fixed by now

Name: Anonymous 2011-12-17 7:29

>>49
Looks like the master process in a multitasking environment.

Name: Anonymous 2011-12-17 7:51

>>45
Message passing for IPC was invented for Erlang.

Name: Anonymous 2011-12-17 8:45

put_msg("PC LOAD ANUS");
__asm {
    ihbt eax
    haltncf
}

Name: Anonymous 2011-12-17 9:38

LOAD MY ANUS

Name: Anonymous 2011-12-17 9:41

Can hardware damage code?

Name: Anonymous 2011-12-17 15:22

found this thread very interesting, kudos

Name: Anonymous 2011-12-17 15:29

>>55
Damaged brain produces damaged code.

Name: Anonymous 2011-12-17 16:37

>>57
Damaged code is filled only with bugs.

Name: Anonymous 2011-12-17 16:37

Can programming damage my anus?

Name: Anonymous 2011-12-17 17:24

Can autism damage social skills?

Name: Anonymous 2011-12-17 17:25

DAMAGE MY ANUS

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2011-12-18 4:45

>>51
No, that is intended to be the only code the CPU will ever run. I even named it reset_vec() instead of main() to show that it's the first thing run starting from reset.

>>50
F00F bug? HCF bus test on the 6800?

Name: Anonymous 2011-12-18 7:37

>>7
Back to writing shitty Cyberpunk, please Neal

Name: Anonymous 2011-12-18 8:43

When your wetware has been damaged by larger than capacity Touhou data you seek the dolphin.

Name: Anonymous 2011-12-18 13:52

More Chobits, less 2hu.

Name: Anonymous 2011-12-18 16:11

Name: Anonymous 2011-12-19 3:12

>>50
which was a joke about some IBM S/360 instructions
FTFY
That joke was around before Intel even existed.

Name: Anonymous 2011-12-19 3:21

Code can damage hardware. The firmware that controls the batteries in the exploding iPhones and MacBook Pros malfunctioned and overheated the battery. According to Mac hacker Charlie Miller, these batteries can be hacked remotely, causing the computers to overheat and possibly catch on fire/explode.
It just works.™

Name: Anonymous 2011-12-19 5:59

>>68
They must have forgotten to implement HACF in the CPU, so people had to resort to such hacks.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List