I'm a fourth-year EE student and I have just recently started to dive a bit deeper into trying to understand how microcontrollers work at a low level when it comes to running code and performing its operations. I think I have a decent grasp on this subject with MCUs, but I am not nearly as confident when it comes to systems that utilize a Single Board Computer (SBC) such as the raspberry pi or beagle bone.
With a microcontroller based on an ARM-cortex-M, I think I understand the process of writing the code which is converted into assembly instructions for that specific processor and then finally converted to the binary file which is written to the flash memory on the MCU. Whenever the processor runs, a bootloader basically tells the actual core where to look for additional instructions to run. It then proceeds to run through the program and the program can interface with all of the various peripherals that are attached to the chip.
With an SBC, I'm just not quite sure where to start. Take the raspberry pi 4 B for example. I know it has a chip based on the ARM-Cortex-A series which includes a MMU, which is apparently very important for the features that an OS needs such as memory virtualization. But when I go to write a program that will then execute on the hardware, to me, it just seems like it executes on the OS, and I don't know what is actually going on in the hardware. I know that the whole point of the OS is to abstract away this hardware implementation, but I've done some initial reading and it just hasn't made too much sense yet. I've started looking into learning about the Linux kernel but I'm not sure if that's where I need to be spending my time learning. The first step that I've always taken when working with SBCs is to install Linux and that is a bunch of abstraction that I want to dig deeper into to actually know what is going on.
A couple of questions that have propped up in my research that I am still unclear on are:
What is the difference between a microcontroller and a microprocessor? Is it just the external chips needed to support a microprocessor?
Would it be possible to program the raspberry pi easily in a bare metal fashion to perform a hello world led blinky?
Am I taking steps in the right direction by trying to learn about what a kernel does and how it is programmed or am I better off starting somewhere else to approach this topic?
I think that most of where my questions come from are the result of me being unfamiliar with operating systems since I am not a CompE, but I would appreciate guidance and some answers on this topic and what the best way to approach this beast is.