HALICERY

free-time coding, hardware dev, articles

Top
Home 8042 Blogs About
Home Bare Metal

Last modified: Mon Jul 6 08:24:53 UTC+0200 2026 © A. Tarpai


Bare metal hardware engineering: PC embedded

Building up a system on bare metal hardware is a great, great interest of mine!

It is programming, testing, bugging pure hardware without any OS, libraries or APIs. Everything is written from scratch: the boot loader, all I/O interrupt handling, the whole multitask kernel, graphics, image decoders, everything.

It starts with getting/buying old PC parts, reading tons of datasheets, schematics, tweeking registers, modding boards and making cables.

Why PC?

Well, that's what I have:

Even with a simple mobo we get plenty of hardware to deal with: lots of I/O ports, serial, parallel, network, USB, floppy controller, PCI-controller. PCI is minimal to program PCI graphics- and video cards, another chapter and great interest of mine.

How to start? PC boot

The BIOS ("firmware") does most of the setup of the mobo, the hard work, after RESET. Then it searches for boot devices..

Floppy boot

BIOS loads the 512 byte boot sector in the first 64K at linear address 7C00, still in real mode and jumps to 0000:7C00.

PXE boot

PXE BIOS loads the DHCP boot file from network in the first 64K at linear address 7C00, still in real mode and jumps to 0000:7C00.

This is the earliest where our code starts: at 7C00 in RM. Disable interrupts and start building up..

General PC architecture

There are tons of excellent web sites on PC architecture.

One way to understand PC architecture: is the IBM PC from 1981.

The CPU

Built around the 8088 16-bit CPU. The 8-bit external bus version of the 8086. Lots of 8-bit peripherial chips were used available in those days. It was a cool 16-bit CPU with on-chip segment registers for address space extension to 1MB, separate code/data/stack supporting modularization: a mini virtual-memory system. We are in 1979..

After that just history, compatibility, history, compatibility.

The IBM PC-AT is an even better starting point, but it's harder to understand without the original IBM PC. Built around the 80286 16-bit CPU, which had the Protected Mode. Haunting us since then..

The chipset

Today's PC-s incorporated almost everything in the chipset from these 3 major IBM PC-s – and lot more:

For proper programming eg. the South Bridge, what components and why are they there and how the hardware evolved is only understandable by researching old IBM TechRef stuff.