
Program the PIT and APIC Timer for Timekeeping
Program the 8253 PIT for a periodic tick, then calibrate the local APIC timer against it and run a 1000 Hz tick, with a tick counter and a sleep function.
Tag
24 posts

Program the 8253 PIT for a periodic tick, then calibrate the local APIC timer against it and run a 1000 Hz tick, with a tick counter and a sleep function.

Write a PS/2 keyboard driver for a hobby kernel: the 8042 ports, scancode set 1, make and break codes, the 0xE0 prefix, shift and caps lock, and a ring buffer.

Remap the two 8259 PICs away from the CPU exception vectors, mask and unmask IRQ lines, send the end-of-interrupt and detect spurious IRQ 7 and IRQ 15.

Build your own x86 GDT in C: descriptor layout, kernel and user segments, a TSS slot, lgdt and segment register reloads, and the 64-bit changes.

Segmentation and paging both translate x86 addresses. See what each does, why 64-bit mode keeps only FS and GS bases, and which to use for protection.

Privilege rings on x86 and exception levels on ARM split code into trust levels the hardware enforces, so a user program cannot touch kernel memory or devices.

Compare Linux system calls on x86-64, ARM64 and RISC-V: the trap instruction, number register, argument registers and the same hello program in each.

Move a NASM boot sector into 32-bit protected mode, set up a flat GDT and a stack, then call a freestanding C function that writes to VGA text memory.

Choose between legacy BIOS and UEFI for a hobby OS by comparing the CPU mode at entry, boot media, memory map, graphics and tooling, with a decision table.

Decode the 512-byte master boot record field by field, from 446 bytes of boot code to four 16-byte partition entries and the 0xAA55 signature, with xxd output.

Print strings and hex values in 16-bit real mode with BIOS int 0x10, using teletype function 0x0E and write-string function 0x13, in reusable NASM routines.

Boot a 512-byte boot sector in QEMU 9 with a raw drive option, then attach GDB to the emulated CPU to break at 0x7C00 and step real-mode instructions.