Secure OS Lab
Cyber Lab S23 - Week 2
Announcements
Meet the Team
Daniel Yang
Secure OS Project Lead
Michelle Zhao
Officer
Victoria Choi
Officer
Benson Liu
Co-President
Aaron Yoo
Mentor & SWE @ Apple
You
MVP
✨Social Engineering Time ✨
Timeline
Part 1: (Guided) Developing the Bootloader & Kernel
Part 2: Design Your Own Feature
Logistics
Get Code
What is a Kernel?
Part I. But first, 32-bit Protected Mode
Why switch from 16-bit real mode (RM) to 32-bit protected mode (PM)?
Things to Take Note Of
Obj I. print_string_pm()
The Global Descriptor Table (GDT)
GDT Segment Descriptors
GDT Descriptor
The Switch from RM to PM
Obj 2: Demonstrating the switch in boot-sect.asm
Part II. The Kernel
The Kernel and Bootloader
C Compilation
Linkers
Cross Compilation
xcode-select -- install
$ brew tap ArmMbed/homebrew-formulae
$ brew install arm-none-eabi-gcc
configure build system and compile code
Writing our Kernel
Compile this into raw binary
$gcc -ffreestanding -c kernel.c -o kernel.o
$ld -o kernel.bin -Ttext 0x1000 kernel.o --oformat binary
Bootstrap Kernel
cat boot-sect.bin kernel.bin > os-image
Loading Kernel
load_kernel:
set-up parameters so we load the first 15 sectors (excluding the boot sector) from the boot disk to kernel offset address
Finding Way into Kernel
Resources
Check out our linktree: