x86 Bare Metal Examples: Minimal operating systems, learn x86 system programming
github.com
github.com
While it is essentially impossible to truly understand every aspect of todays platforms I think that one can build a lot of intuition about how things work by studying how transaction routing is handled in the platform, e.g. how the uncore and chipset routes TLPs (whether it's raw PCIe or packets essentially wrapped by other interconnect protocols like IF/HyperTransport/DMI/QPI/etc) through the system with various base address registers and decoding windows. This gives way to understanding how modern MSI interrupts and DMA works as well. While I understand that truly going into things like PCI configuration, ACPI, UEFI, chipset interfaces on bus 0, modern booting, DMA and interrupt remapping, DRAM, register locking and security, security processors, power management, various types of runtime firmware, etc is a a many-years-long exercise I think that the core ideas don't need to be spread around all over the place for one to get familiarity with the ideas and patterns that underpin our PCs.
I think that a general conceptual overview on which one can hang more detailed knowledge acquired by reading specs is needed with the amount of complexity that exists today. There are some really good resources that I've collected over the years but there is still something missing. Maybe I or someone else will get around to it some day.
Regarding your linked post:
For corporate users legacy methods of booting /are/ a security threat. Firmware attacks are a real threat for enterprises. Having IBVs all hand roll things like the S3 boot script or communication with SMM (not using standardized com buffers) is not wise. Secure boot combined with modern security features like using DRTM to remove firmware from the trusted computing base are important and should not be discounted because it's not an 40 year old interface. The PC platform is historically extremely insecure and there is a ton of work still to be done to effectively provide the primitives needed to secure the platform against determined attackers.
If you want to have a USB stack in SMM owning your USB controller to emulate port 60h with IO SMI traps that's fine but it's not a reason to hold the platform back.
https://sites.google.com/site/pinczakko/system-address-map-i...
https://www.youtube.com/playlist?list=PLBTQvUDSl81dTG_5Uk2my...
http://xillybus.com/tutorials/pci-express-tlp-pcie-primer-tu...
http://xillybus.com/tutorials/pci-express-tlp-pcie-primer-tu...
https://www.amazon.com/Quick-Boot-Pete-Dice/dp/1501515381/
https://opensecuritytraining.info/IntroBIOS.html
https://acpica.org/sites/acpica/files/asl_tutorial_v20190625...
And of course the MindShare books.
- https://news.ycombinator.com/item?id=19428700
-no segmentation, flat address space
-better interrupt handling
-better system call
-more registers
etc.
Also we found that Qemu or other Virtualization technology may cover up some of the hardware issues. Eg. Beside, that every hardware device (keyboard, usb, display, disk etc.) will have some simplified behavior, if you emulate an ARM cpu on x86_64 host, than the cache coherency will totally messed up on real hardware.I'm also looking forward to digging into this. It looks really neat and I have been interested in baremetal programming recently. Hopefully this coming weekend will be free enough to indulge!