Chapter 3: Low-Level Engineering & OS Design

3.1 Breaking the Abstraction

Most developers work with high-level languages like Python or JavaScript. [cite: 2026-03-03] But as an Architect, we go deeper. [cite: 2026-03-03] We communicate directly with the CPU using Assembly Language. [cite: 2026-03-03]

3.2 The Magic of 512 Bytes (The Bootloader)

When a computer starts, it looks for the first sector of the disk. [cite: 2026-01-14] If it finds the "Magic Number" 0xAA55 at the end of the first 512 bytes, it treats it as a bootloader. [cite: 2026-01-14]

[org 0x7c00] ; Start address in memory mov ah, 0x0e ; BIOS teletype mode mov al, '7' ; Print character '7' int 0x10 mov al, '3' ; Print character '3' int 0x10 jmp $ ; Infinite loop times 510-($-$$) db 0 ; Fill rest with zero dw 0xaa55 ; Boot signature
Architect's Note: In Termux, we use nasm to compile this assembly code into a raw binary file that can be executed by an emulator like QEMU. [cite: 2026-03-03]

3.3 Compiling on Android

Run these commands to build your first bootable image:

pkg install nasm nasm -f bin boot.asm -o boot.bin

This boot.bin is the physical manifestation of your code—a bare-metal program that runs without an operating system. [cite: 2026-01-14, 2026-03-03]


← Back to Archives