News for hackers. Stuff that matters.
Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @02:42PM (#30277417)
I have issues with the section "Microcontroller vs Microprocessor: Differences"

Microprocessors are just the CPU, usually with the system bus wired out. Microcontrollers are combined systems, which include a processor and usually some kind of firmware storage and RAM. You can usually differentiate them by whether their pins are address/data lines or gpio-like.

> microprocessors have a memory management unit

The 8086 didn't. Having an MMU seems unrelated to the MCU/MPU distinction...

At least, this was my knowledge until now. Is this like "crypto" where the meaning changed while i was not paying attention?

Re:So you want to build an embedded Linux system? (2020) by foxfluff on Wednesday February 09, 2022 @03:16PM (#30277856)
It's a pointless distinction by and large.

Microcontrollers may or may not have storage for firmware. Requiring an off-chip flash is nothing new. Microcontrollers have SRAM, but so do processors. That's where the firmware runs before it gets the DRAM running. Microcontrollers may include a bunch of peripherals, but so do processors. Especially so if you refer to SoCs as processors, like the article here does. And SoCs stir it up further: they have tons of peripherals, and we also have SoCs with on-package DRAM. Discrete SRAM chips exist too, I figured there must be microcontrollers that can use them (but I haven't actually looked).

Yes, the terminology has evolved.

Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @03:38PM (#30278161)
The distinction used to be "Whether the bus is exposed externally".

> Microcontrollers have SRAM, but so do processors. That's where the firmware runs before it gets the DRAM running.

Which microprocessor architecture does this?

Re:So you want to build an embedded Linux system? (2020) by joezydeco on Wednesday February 09, 2022 @05:15PM (#30279301)
NXP LPC is a big one. Most of the families have an external memory controller (EMC) block that can drive an external DRAM at a small multiple of the system clock frequency. The EMC init happens in the secondary boot, usually loaded from the small on-board flash or an offboard EEPROM.

I regularly use the 1788 + a meg or two of DRAM to hold an LCD framebuffer. The LPC has a really nice interconnect between EMC and the internal LCD controller block and will drive the display all on its own (with a hardware cursor) once it is initialized.

Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @05:27PM (#30279451)
Duckduckgo, "NXP LPC", sidebar, quote from wikipedia:

> LPC is a family of 32-bit microcontroller integrated circuits by NXP Semiconductors.

Not a microprocessor. You are the second guy to pull this on me. Do people even read what i write? Did i write unclearly?

Re:So you want to build an embedded Linux system? (2020) by joezydeco on Wednesday February 09, 2022 @05:36PM (#30279576)
Perhaps you're just outdated. Nobody ships a core alone on a chip anymore. That died with the 68000 or ARM7TDMI.
Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @05:38PM (#30279603)
x86 is a classic microprocessor architecture. I'm confident it is not outdated yet, as im using a fairly modern x86 desktop right now at the moment. RAM and chipset are separate from the processor.
Re:So you want to build an embedded Linux system? (2020) by detaro on Wednesday February 09, 2022 @05:50PM (#30279794)
> x86 desktop right now at the moment. RAM and chipset

"chipset" is very different than a traditional microprocessor chipset though on that. E.g. you don't have an exposed system bus outside the CPU, but rather specialized interfaces. (And ARM systems have evolved the same way over their history)

Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @05:53PM (#30279825)
What about the slots i plug my RAM sticks into? Do they not count because it goes over the north bridge?
Re:So you want to build an embedded Linux system? (2020) by detaro on Wednesday February 09, 2022 @06:05PM (#30279983)
Modern x86 CPUs integrate the DRAM controller directly (e.g. with Intel ever since Nehalem, ~2008) and not over a bus through the northbridge. From that point on I wouldn't count it if you insist on a strict definition, no - it's roughly the same as if you put a socket between a current higher-end ARM chip with external memory and the connected DRAM chips. Chipset is relegated to dealing with I/O to peripherals mostly - and nowadays the CPUs also provide PCIe lanes directly, with the chipset often adding a few more, often slower ones.

Traditional microprocessors are getting really rare, even though pretty much all the modern architectures started as them, and thus some use the term more widely. Some vendors use the differentiation between microcontrollers and application processors now, which also isn't a 100% clear line and explicit crossover models existing, but more useful today and avoids the fights over "what's a microprocessor today". (where "application processor" ~ "can reasonably run a full OS like Linux"). But that's also often limited to discussion in embedded use cases again, e.g. I don't know if they'd call a standard desktop CPU that or insist on some arbitrary level of "embeddedness"... Not that standard desktop CPUs don't end up embedded, but that's another discussion entirely.

Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @06:27PM (#30280252)
This is a useful explanation.

For the article, i don't want to leave it standing as it is. Redefining "Microprocessors" as "having an MMU" is making communication about these topics very unpleasant, especially when its about Retrocomputing. Same pains as i ranted about in https://news.ycombinator.com/item?id=30278936 .

Re:So you want to build an embedded Linux system? (2020) by joezydeco on Wednesday February 09, 2022 @05:41PM (#30279648)
Then maybe the hackers using x86 boards in their 'embedded Linux systems' can chime in.
Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @05:47PM (#30279762)
Perfect, as i own a RDC 3210 board. Here is someone else with the same board + pictures: https://forum.archive.openwrt.org/viewtopic.php?id=19168

It has a x86 Microprocessor architecture, but it is not IBM PC compatible because it does not has an BIOS, instead using a more embedded-style RedBoot setup.

Maybe you should do a quick web search before talking shit.

Re:So you want to build an embedded Linux system? (2020) by AlotOfReading on Wednesday February 09, 2022 @04:31PM (#30278799)
Most of them? Pretty much every ARM board supports an SRAM boot stage, for example. If you're using U-Boot, it's pretty likely that there's a SPL running out of SRAM somewhere in there.
Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @04:36PM (#30278888)
ARM is a microcontroller architecture.
Re:So you want to build an embedded Linux system? (2020) by spfzero on Wednesday February 09, 2022 @06:22PM (#30280193)
If you look at two examples, they may have the same "architecture", but on one, more of the architectural blocks are on-chip, and on the other, less. I don't think what is on or off the chip really changes the architecture, though it would probably change the performance, and the pin boundaries do drive other system considerations. But otherwise, the architecture is the architecture, or am I looking at it wrong?
Re:So you want to build an embedded Linux system? (2020) by AlotOfReading on Wednesday February 09, 2022 @04:50PM (#30279034)
1) This is a distinction without a difference.

2) SRAM is almost always on the die, not external. Here's a die shot of a random STM32 (cortex M): [1]. The SRAM is quite obvious.

[1] https://s.zeptobars.com/GD32F103CBT6-Si-HD.jpg

Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @04:58PM (#30279130)
It is a meaningful distinction. A microprocessor architecture would require support chips, like a south- and north bridge, plus RAM in additional chips.

x86 being the classic example. Here [1] is an example of a microprocessor board, you can see the MX support chips on both sides of the CPU. As you can see, the RAM (and the most of the address space-mapped things) is not on-chip. The bus is wired across the PCB.

[1] https://upload.wikimedia.org/wikipedia/commons/d/de/386DX40_...

Re:So you want to build an embedded Linux system? (2020) by AlotOfReading on Wednesday February 09, 2022 @05:59PM (#30279916)
Even x86 has on-die SRAM that can be used in boot. It's better known as L1, L2, and L3, but you can configure Intel's FSP to make it usable for boot code with the so-called cache-as-RAM feature. The technical details are different than e.g. ARM because it's cache rather than properly addressable memory, but the general idea is the same.

All the RAM you see on the motherboard is DRAM. It's a totally separate thing and happens to be what the FSP initializes after it loads stuff into SRAM.

Re:So you want to build an embedded Linux system? (2020) by R0b0t1 on Wednesday February 09, 2022 @04:38PM (#30278910)
These words are used interchangeably, you need to specify exactly. The main distinction is does it have a MMU or not.
Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @04:41PM (#30278936)
"VPN" evolved to mean proxying service, now people are denying that my tinc setup is a VPN.

"Emulation" evolved to mean virtual machine, now people are denying that wine or xterm are emulators.

"Operating System" evolved to require virtual memory and paging, now people are denying that MS-DOS was an operating system.

"Microprocessor" evolved to mean computing chips with MMU, im waiting for people to deny that the 8086 was an microprocessor because it does not have an MMU.

The infinite shitcycle of people improvising language instead of researching.

Re:So you want to build an embedded Linux system? (2020) by anthk on Wednesday February 09, 2022 @05:11PM (#30279245)
Wine is not an emulator, it's a PE loader and a Win32 API for Unix. And XTerm is more like a terminal simulator.
Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @05:19PM (#30279345)
Wine actually IS an emulator, just not the kind of emulator you think of. While wine is not an virtual machine, it literally emulates the win32 api.

https://web.archive.org/web/20150928042254/http://wiki.wineh...

I mentioned the shift of meaning to "virtual machine" in the post you replied to, please read it more carefully.

Emulation and Simulation are different in some regard: emulation is only imitating some aspect of a thing, while simulation imitates a thing by using (usually physical) models.

xterm is a VTxxx emulator, and VT simulator does look like this: https://www.pcjs.org/machines/dec/vt100/

Re:So you want to build an embedded Linux system? (2020) by monocasa on Wednesday February 09, 2022 @05:47PM (#30279753)
I'd argue that wine is a bit of a stretch considering that we're on the third implemention of win32 in Microsoft land as well (DOS/win32s, Win95, NT/Win32k). At that point win32 is a concept already abstracted away from a specific implementation

I totally agree with your main point though that emulation is a broader topic than is generally thought.

Re:So you want to build an embedded Linux system? (2020) by anthk on Wednesday February 09, 2022 @07:09PM (#30280692)
Then Windows NT is emulating Win32.

Also, back in the day emulators emulated the CPU for sure, while an API implementation wasn't never called "emulation". Ever.

Re:So you want to build an embedded Linux system? (2020) by blueflow on Thursday February 10, 2022 @03:48AM (#30283769)
xterm calls itself an emulator in the manpage right now.
Re:So you want to build an embedded Linux system? (2020) by jlokier on Wednesday February 09, 2022 @06:43PM (#30280459)
Modern x86 does this.

The BIOS starts running on the x86's internal SRAM.

https://stackoverflow.com/questions/63159663/how-does-bios-i...

Re:So you want to build an embedded Linux system? (2020) by rasz on Wednesday February 09, 2022 @07:41PM (#30280953)
Not exactly. Cache as Ram is used for stack/temp storage until proper ram is initialized. Code itself runs from flash until optional bios caching is turned on in the chipset.
Re:So you want to build an embedded Linux system? (2020) by monocasa on Wednesday February 09, 2022 @05:40PM (#30279640)
Just about any with cache will let you pin last level cache to assist boot up.

I've done this with PowerPC cores that no one would call microcontrollers.

Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @06:11PM (#30280064)
I respect you for writing the first substantiable conter in this whole thread. Signal-Noise ratio isn't good for me today.
Re:So you want to build an embedded Linux system? (2020) by foxfluff on Wednesday February 09, 2022 @06:27PM (#30280255)
If you want some reading about boot flow, see e.g.

https://www.coreboot.org/images/2/23/Apollolake_SoC.pdf

https://blogs.coreboot.org/blog/2019/07/17/gsoc-how-to-run-c...

https://9esec.io/blog/open-source-cache-as-ram-with-intel-bo...

The TLDR is that you need to get DRAM running before you can use it (e.g. by poking at DRAM controller's registers until it knows how to talk to your stick of RAM reliably and at a comfortable speed). Until then, you're stuck with SRAM. On ARM SoCs and Intel Apollo Lake, you use addressable SRAM. On most other x86 systems you use cache as RAM. Cache is just SRAM though, and the only difference between ARM and typical x86's case is that the latter doesn't let you directly address it.

You can find examples of DDR DRAM configuration in u-boot sources, and presumably in coreboot too.

Re:So you want to build an embedded Linux system? (2020) by foxfluff on Wednesday February 09, 2022 @06:19PM (#30280168)
> Which microprocessor architecture does this?

As far as I know, all of them. It's possible that there are historical systems where DRAM configuration is fixed, but I wouldn't know about it. Any modern system requires rather complicated configuration to get the DRAM going.

Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @06:38PM (#30280390)
Counterexample: The IBM PC was a microprocessor system which does not do it - the BIOS runs from ROM only and sets up the DMA controller for the refreshes. No DRAM, no RAM used.

Excluding the caches, this is how x86 functioned for quite a while, i don't know until when.

Microprocessors don't require internal RAM to bootstrap, because they expose their bus and its simple to map a ROM to the starting address, which can be executed from directly.

Re:So you want to build an embedded Linux system? (2020) by marcan_42 on Wednesday February 09, 2022 @09:33PM (#30281777)
> Which microprocessor architecture does this?

All of them. They have to. Sometimes the trick is using cache as RAM. Some Intel CPUs do early memory init this way, for example.

You need some memory somewhere to run the complex DRAM init procedure.

Re:So you want to build an embedded Linux system? (2020) by foxfluff on Wednesday February 09, 2022 @06:37PM (#30280376)
> The distinction used to be "Whether the bus is exposed externally".

Which bus is "the bus"? SoCs and microcontrollers alike expose a bunch of different buses.

Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @06:38PM (#30280397)
https://en.wikipedia.org/wiki/System_bus

I'm assuming Naumann arch, with instructions and data on a single bus.

Re:So you want to build an embedded Linux system? (2020) by foxfluff on Wednesday February 09, 2022 @06:45PM (#30280485)
Ok, right, that really has a legacy smell to it. If you can find the pinout for a modern Intel CPU, it has dedicated pins from DRAM controller to the DDR. It's not on some external "all-purpose" bus. Whatever bus you might have is internal to the CPU. Same thing on any modern ARM SoC with DDR support.
Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @06:59PM (#30280610)
Even if you dont work with it anymore and call it legacy, its still a real thing, and its a bad idea to re-use the word to mean something else.
Re:So you want to build an embedded Linux system? (2020) by foxfluff on Wednesday February 09, 2022 @07:15PM (#30280740)
The question is then, should we start calling modern Intel CPUs microcontrollers? That's bound to cause even more confusion.

If anything, the things people today refer to as microcontrollers have more to do with your legacy microprocessor than they have with a high end CPU or SoC.

What's the right term to use?

Re:So you want to build an embedded Linux system? (2020) by blueflow on Thursday February 10, 2022 @03:49AM (#30283781)
At least don't redefine "Microprocessor" in a way that it does not include the 8086, the one that made the it popular. Its nonsensical.
Re:So you want to build an embedded Linux system? (2020) by thrashh on Wednesday February 09, 2022 @03:53PM (#30278331)
It’s such a blurry line now because with so many vendors, you can find everything on a spectrum these days
Re:So you want to build an embedded Linux system? (2020) by jaydcarlson on Thursday February 10, 2022 @01:06AM (#30282935)
The problem is that by your definition, every processor manufactured in the last 30 years should actually be called a "microcontroller"

Microprocessors going back to the Intel 486 have more on-chip RAM than many microcontrollers sold today have. CPUs have built-in firmware ROM for loading boot code. Also, CPUs haven't had a system bus with address/data pins for like 30 years β€” somewhat ironically, the only chips that have that are microcontrollers. Northbridges haven't existed for 15 years, and southbridges are basically just PCIe-to-USB/SATA/Ethernet/I2C adapters. And many mobile CPUs that Intel and AMD make have on-chip I2C, SPI, UART, GPIO peripherals.

In my article, I'm trying to differentiate between processors that can run a modern multiuser operating system like Linux and microcontrollers that runs bare-metal code, since that's a question I get asked a ton. After carefully considering all the options, the MMU seemed like the most obvious place to draw the line. Every CPU in the last 40 years (since the Intel 286) has had an MMU, while no microcontroller ever made has had one. I'm not sure why that seems so unreasonable to you.

Re:So you want to build an embedded Linux system? (2020) by blueflow on Thursday February 10, 2022 @03:43AM (#30283743)
It is unreasonable because you redefine "Microprocessor" in a way that the 8086, the one that made the word popular, isn't one anymore.

Surely odd, but tolerable. But what is worse that people will read your article, think the MMU is what makes a microprocessor. And upon hearing that the 8086 has no MMU, they will deny that it is a microprocessor. Which would be a logical conclusion from your article.

I listed some other words here that suffer from similar issues https://news.ycombinator.com/item?id=30278936

Re:So you want to build an embedded Linux system? (2020) by marcan_42 on Wednesday February 09, 2022 @09:44PM (#30281844)
Microprocessors in the traditional sense no longer exist. All modern microprocessors are actually SoCs (yes, even Intel ones at least to a partial extent). And all microcontrollers are SoCs by strict definition, but we don't usually call them that.

So really the more practical terminology difference should be SoC vs. microcontroller.

Re:So you want to build an embedded Linux system? (2020) by phlipski on Thursday February 10, 2022 @11:09AM (#30288205)
Agreed. To add to that - I think what Jay was trying to highlight is the difference between chips that can generally run Linux (which generally requires an MMU) and those that run an RTOS. Is this an exact line of demarcation with no blurry edges? No. But it seems to work for me. Maybe a better way to think of this is - does the system have external DRAM (if so run linux) or not - if so run RTOS.

Our of curiosity - does anyone still sell a (by strict definition) a true "micro-processor"?

Re:So you want to build an embedded Linux system? (2020) by marcan_42 on Thursday February 10, 2022 @12:58PM (#30290014)
The most recently sold micro-processors used in a mass market product that come to mind are the CPUs of the Wii/PS3/Xbox 360 era consoles (in particular the PPC750CL in the Wii is a pure CPU). The Wii U then glued three of those together into a three-core die, so if you're willing to consider just the CPU die and not the entire MCM, that one was also a pure CPU.

Digi-Key still shows the 750CL in stock, but it's obviously an obsolete product at this point.

Re:So you want to build an embedded Linux system? (2020) by Terry_Roll on Wednesday February 09, 2022 @04:12PM (#30278541)
There is no global standard of definitions, what you might be seeing is the difference in the educational system in different parts of the world.

We know definitions change over time because slang words come and go and someone's vocabulary can be used to identify people online or identify their knowledge.

Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @04:49PM (#30279021)
Whatever, but if someone of the "Distinction Criteria is existence of MMU" crowd comes and claims the 8086 is not a microprocessor, because it doesn't have an MMU (which would be a logical conclusion from the article). i'll probably not be respectful.
Re:So you want to build an embedded Linux system? (2020) by marcan_42 on Wednesday February 09, 2022 @09:39PM (#30281814)
The clearest distinction today is the lack of an MMU. That's just a useful metric to go by that neatly divides SoCs into "things intended to run bare metal/RTOS code" and "things intended to run Linux", that are two different product groups with significant differences.

Obviously this wasn't always the case, e.g. a good 15+ years ago I put ucLinux on an old ISP router I had lying around for fun, and it was an ARM946 without an MMU. But that class of device no longer exists today for all practical purposes, and so it's easy to use the existence of an MMU to decide what to call them.

The 8086 may have been a microprocessor, and so was the 80186, but you know where you find 80186 cores today? Microcontrollers. Specifically, some video processing chip manufacturers (e.g. stuff that goes into monitors and DP-HDMI adapters) seem to like using V186 cores still.

Re:So you want to build an embedded Linux system? (2020) by Terry_Roll on Wednesday February 09, 2022 @06:47PM (#30280507)
Well these are a couple of online definitions: MicroController - a control device which incorporates a microprocessor. MicroProcessor - an integrated circuit that contains all the functions of a central processing unit of a computer.

The problem with these definitions is a control device and computer are two different things, so I wonder if he is applying an engineer's perspective/definition to the 8086 even though many know the 8086 were used in the early computers. This is a bit like arguing whether a microprocessor is a microprocessor because of the inclusion or exclusion of one or more instruction sets, ie a basic intel cpu with a minimum instruction set or a xeon intel cpu with a much more extensive number of instruction sets.

Or are you picking up on an AI masquerading as a blogger and have highlighted something an AI wouldnt pick up on from online technical resources?

Re:So you want to build an embedded Linux system? (2020) by seniorivn on Wednesday February 09, 2022 @02:56PM (#30277590)
a lot of people have been calling desktop computers "processors", does it mean that the meaning of the word has changed?
Re:So you want to build an embedded Linux system? (2020) by blueflow on Wednesday February 09, 2022 @03:00PM (#30277638)
because thats correct for most x86-compatible computers, x86 is or was the dominant desktop architecture.