- Get deep understanding of INTEL 8086 architecture
- Build a micro OS kernel including
- FAT12 Filesystem support
- Process Management (PM) with Multi-Task support
- System call support
- Understanding BOOT procedure of 8086 system (FLOPPY only!)
- Creating DEV environment -- QEMU, an emulator that can provides virtual environments of 80386, x86_64, ARM, MIPS, SPARC, etc.
- Getting familar with INTEL 8086 ISA
- Read INTEL 8086 Manual
- Download & Install NASM
- Read NASM's manual
- Understanding FAT12 specifications
- Create a virtual floppy image (boot.img, source: boot.nasm)
- Build a bootloader of our future OS
- Understanding the limit of floppy boot: code size limit of 512B
- BootLoader construction process:
- Search KERNEL.BIN in RootDirSectors
- Read File Allocation Table (FAT) for details
- Loading KERNEL.BIN using BIOS INT (0x13)
- Transfer control to KERNEL.BIN
- Build KERNEL.BIN
-
Download Bruce's C Compiler (bcc)
bcc -0 -ansi -c source.c -0: generating 8086 (16bit) code -ansi: support ANSI C -c: compile only ld86 -d -M source.o -o source.bin -d: generate flat binary file -M: print organization -o: target file
See manuals for details of bcc, as86, ld86.
-
Build a simple process management system
- Task scheduling subsystem (supporting multiprocesses)
- A basic IPC subsystem (PV operators && resources)
-
Write a simple SHELL process dealing with I/O
TIPS: Library functions (e.g. strcmp) can be linked to target image
-
- Install QEMU & BCC (including bcc, as86 and ld86)
- make
- Put os.bin to boot.img (e.g. under Linux).
- mkdir /mnt/floppy/
- mount -o loop boot.img /mnt/floppy/
- cp os.bin /mnt/floppy/
- umount /mnt/floppy/
- qemu -fda boot.img