Author Topic: Using an x86 pc as an obese microcontroller?  (Read 12708 times)

0 Members and 1 Guest are viewing this topic.

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Using an x86 pc as an obese microcontroller?
« Reply #25 on: March 08, 2016, 01:15:15 am »
Quote
But once you start using the BIOS, it adds to the issue of "difficult to make it deterministic"
Ideally, you don't use the BIOS *except* to set up the cpu and chipset.   The trick is finding the settings (and/or things you can do programatically) that get it completely out-of-the-way after your "bare metal" code starts.

(As a would-be bare-metal PC programmer, I have about zero interest in reading the EEPROMs on the memory DIMMS and setting up the chipset for the correct timings/etc.  As one example.)
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2616
  • Country: 00
    • My random blog.
Re: Using an x86 pc as an obese microcontroller?
« Reply #26 on: March 08, 2016, 01:31:12 am »
Quote
But once you start using the BIOS, it adds to the issue of "difficult to make it deterministic"
Ideally, you don't use the BIOS *except* to set up the cpu and chipset.   The trick is finding the settings (and/or things you can do programatically) that get it completely out-of-the-way after your "bare metal" code starts.

(As a would-be bare-metal PC programmer, I have about zero interest in reading the EEPROMs on the memory DIMMS and setting up the chipset for the correct timings/etc.  As one example.)

except you cant because this is pc
interrupts, exceptions, bios takes over a lot of stuff and runs in the background constantly
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: Using an x86 pc as an obese microcontroller?
« Reply #27 on: March 08, 2016, 02:10:49 am »

Quote
But once you start using the BIOS, it adds to the issue of "difficult to make it deterministic"
Ideally, you don't use the BIOS *except* to set up the cpu and chipset.   The trick is finding the settings (and/or things you can do programatically) that get it completely out-of-the-way after your "bare metal" code starts.

(As a would-be bare-metal PC programmer, I have about zero interest in reading the EEPROMs on the memory DIMMS and setting up the chipset for the correct timings/etc.  As one example.)

except you cant because this is pc
interrupts, exceptions, bios takes over a lot of stuff and runs in the background constantly

Not true. You can hook into all that stuff in your own code. Do you think Windows really relies on the BIOS to handle I/O, keyboard input, interrupt management, etc.?! Hell no! Once your PC boots, that's pretty much it for the BIOS these days. No reason you couldn't do the same in your own code.
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2616
  • Country: 00
    • My random blog.
Re: Using an x86 pc as an obese microcontroller?
« Reply #28 on: March 08, 2016, 04:52:24 am »
except you cant because this is pc
interrupts, exceptions, bios takes over a lot of stuff and runs in the background constantly

Not true. You can hook into all that stuff in your own code. Do you think Windows really relies on the BIOS to handle I/O, keyboard input, interrupt management, etc.?! Hell no! Once your PC boots, that's pretty much it for the BIOS these days. No reason you couldn't do the same in your own code.

are you suggesting someone should use windows as a software base for his "pc microcontroller"? :))) or write his own os from scratch? with exceptions, scheduling, memory management and hookers?
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3442
  • Country: us
Re: Using an x86 pc as an obese microcontroller?
« Reply #29 on: March 08, 2016, 07:40:53 am »
except you cant because this is pc
interrupts, exceptions, bios takes over a lot of stuff and runs in the background constantly

Not true. You can hook into all that stuff in your own code. Do you think Windows really relies on the BIOS to handle I/O, keyboard input, interrupt management, etc.?! Hell no! Once your PC boots, that's pretty much it for the BIOS these days. No reason you couldn't do the same in your own code.

are you suggesting someone should use windows as a software base for his "pc microcontroller"? :))) or write his own os from scratch? with exceptions, scheduling, memory management and hookers?

That brings us back to the question earlier - why use the PC as MCU at all.

Without Linux or Windows or some such, the PC is rather useless.  You have to rewrite every damn driver and software - down to a UART driver, keyboard driver, and a VGA/CGA driver of some sort.  The convenience that came with the PC, like plugging in a USB Cam and it works, just wont be there.  All you get with the PC-MCU is just a larger hunk of iron.

If one "gives up" and just load Windows to run the PC as a giant MCU, you better hope that the "fire detection" routine isn't the one running when Windows decides it needs an auto-update.

Future news story: "The investigation of the rocket explosion found: when the rocket was about to do the 0.3 second burn to slow down for re-entry, Windows decides to phone home via the satellite link for the latest auto update...  The rocket did burn up due to delays, but investigation also shows the update was successful and Windows was absolutely up to date with the latest patches before the rocket hits ground."
 

Offline botcrusherTopic starter

  • Regular Contributor
  • *
  • Posts: 192
  • Country: ca
Re: Using an x86 pc as an obese microcontroller?
« Reply #30 on: March 08, 2016, 10:38:09 pm »


If one "gives up" and just load Windows to run the PC as a giant MCU, you better hope that the "fire detection" routine isn't the one running when Windows decides it needs an auto-update.

Future news story: "The investigation of the rocket explosion found: when the rocket was about to do the 0.3 second burn to slow down for re-entry, Windows decides to phone home via the satellite link for the latest auto update...  The rocket did burn up due to delays, but investigation also shows the update was successful and Windows was absolutely up to date with the latest patches before the rocket hits ground."

Just lol.
I'd probably run linux on it, make a python script to communicate via the sound interface. maybe use some other interface, don't say serial, that's just too easy.
If i don't find a better use for it, i have a mini-ITX rig with a modern pentium (G3258) that i could use.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Using an x86 pc as an obese microcontroller?
« Reply #31 on: March 09, 2016, 12:28:00 am »
Quote
why use the PC as MCU at all
a PC makes for a wonderfully inexpensive development environment for any x86 bare-metal product you might have been planning (which is not quite the same thing.)
For every complication that the BIOS causes, it also provides some nice little features (like: initializing video hardware so that you have a "debug display" that can be used just by poking bytes off into a known memory location.)  (A lot of x86 bare-metal products will end up buying a BIOS from someone anyway, for that low level initialization that you can't find out how to do without heavy legal agreements with intel.)
 

Offline rolycat

  • Super Contributor
  • ***
  • Posts: 1101
  • Country: gb
Re: Using an x86 pc as an obese microcontroller?
« Reply #32 on: March 09, 2016, 12:46:57 am »
Quote
why use the PC as MCU at all
a PC makes for a wonderfully inexpensive development environment for any x86 bare-metal product you might have been planning (which is not quite the same thing.)

Unless you need x86 compatibility for hysterical raisins, why would anyone plan such a product today?
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2045
  • Country: us
Re: Using an x86 pc as an obese microcontroller?
« Reply #33 on: March 09, 2016, 01:49:09 pm »
Not to mention that the P4 is some of the worst performance / Watt ever shipped by Intel. Modern hardware might cost a few bucks now (but it's so cheap nowadays, who cares?), and will definitely save money via lower power consumption, probably already after a few months of 24/7 operation.
I know, i know. I have to deal with explaining why my school board's "free" government hand me downs are a terrible solution.
You haven't seen slow until you witness 25 pentium 4s trying to log into windows 7.
well, at least it's got hyper threading?  :-//

Actually Intel is sick enough to market x86 microcontrollers... Google Quark D1000/D2000 or Quark SE.
To be frankly, it is quite power efficient -- my Arduino 101 (based on QUark SE -- a 32MHz x86, a 32MHz DSP, 6 axis MEMS and BLE) runs comparably to just any other Arduino boards.

Wasn't there a big issue with the intel boards actually being incredibly slow when used as an arduino?

While you can use those old boards, its not really worth it anymore.  They take up a lot of space, produce a lot more heat and use a lot more power then a raspberry pi or beaglebone.  I cleaned out most of my old PC's and replaced them with Pi's and used some old cell phone changers and microsd cards lying around from upgrading those.
But the advantage to using a P4 is that i have a virtually endless supply! They decommissioned a bunch of the really old Pentium 4 towers (beige, built when p4s were actually considered "fast")

I'm aware the heat to perfomance is beyond terrible, but would you rather i used pentium D boards?
for those who don't know, a pentium D is two pentium 4 chips forced onto the same die, the thermal output is terrifying.

Windows 10 is actually faster then 7 if you're willing to switch.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Using an x86 pc as an obese microcontroller?
« Reply #34 on: March 09, 2016, 08:13:43 pm »
Quote
why would anyone plan such a product [x86 bare metal machine] today?
Well, x86 cpus are about the fastest OTS general purpose CPUs you can get.  Probably several of the fastest.  Sure, a multicore 2GHz ARM has much better total MIPS/Watt, but sometimes you'd rather have a single-core 4GHz blazing away at more than one operation/cycle.
(or did you mean "why bare metal, when you could run linux or whatever and implement your product code as a device driver or something, and get all that support infrastructure for free?"  That's a tougher question.)
(also, the resources put into x86 compilers are quite substantial.)
 

Offline botcrusherTopic starter

  • Regular Contributor
  • *
  • Posts: 192
  • Country: ca
Re: Using an x86 pc as an obese microcontroller?
« Reply #35 on: March 09, 2016, 11:26:21 pm »
for those who don't know, a pentium D is two pentium 4 chips forced onto the same die, the thermal output is terrifying.

Actually PD is not 2 cores on one die. It is 2 single core dice on the same package. Intel later did this on Core 2 Q6600 family (2 dual core E6600 on the same package), then Arrandale (one separate MCP/GPU), then Haswell and Broadwell (128MB L4 eDRAM on selected models).

Yes sorry my bad, package not die.

Thermal output is still really bad though at a blistering 130W :P
Still has nothing on amd's 5Ghz 8 core...
 

Offline ahayes

  • Newbie
  • Posts: 1
  • Country: us
Re: Using an x86 pc as an obese microcontroller?
« Reply #36 on: March 16, 2016, 08:45:05 am »
If they have a parallel port you can use it as a crappy GPIO header.  If you have soundblaster cards at your disposal you can use the game/midi port as a crappy A2D input.  You might even get semi-deterministic behavior with FreeDOS and whatever C compiler you can find for it.

You'd probably spend more money powering the thing over the course of its use than you would on an arduino clone so keep that in mind. 
 

Offline cio74

  • Regular Contributor
  • *
  • Posts: 173
  • Country: gb
Re: Using an x86 pc as an obese microcontroller?
« Reply #37 on: March 18, 2016, 07:27:21 pm »
If you want real time data processing you can run DOS on it and write your own code to deal with ISA/PCI cards, parallel port, serial port and whatever else you've got in there.

I would rule out both Linux and Windows since both are not real time operating systems. That only if you care about precise timing otherwise they are fine.

On the benefits of running a Pentium over a MCU, lots of free compilers, excellent debuggers with no requirement to buy expensive trace probes, tons of documentation, easily expandable and upgradable to faster machines, if you feel so.

So yes, I would definitely consider them, just power it up, deploy a DOS version and a free C, Pascal, ASM compiler and you're good to go.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf