Skip to content

aegiryy/fryy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

------------------------------------------------------------------------
OVERVIEW:

This PROJECT has two purposes: 
    (1) get deep understanding of INTEL 8086 architecture
    (2) build a micro OS kernel including 
        a) FAT12 Filesystem support
        b) Process Management (PM) with Multi-Task support
        c) basic memory management, which can also be included in PM
------------------------------------------------------------------------


------------------------------------------------------------------------
ROADMAP:

(1) Understanding BOOT procedure of 8086 system (FLOPPY only!)
    a)  Creating DEV environment -- QEMU (http://qemu.org), an emulator 
        that can provides virtual environments of 80386, x86_64, ARM, 
        MIPS, SPARC, etc.
(2) Getting familar with INTEL 8086 ISA 
    a)  Read INTEL 8086 Manual
    b)  Download & Install NASM (http://www.nasm.us/pub/nasm/releasebuilds/2.09.04/)
    c)  Read NASM's manual (http://www.nasm.us/xdoc/2.09.04/nasmdoc.pdf)
(3) Understanding FAT12 specifications
    a)  Create a virtual floppy image (boot.img, source: boot.nasm)
(4) Build a bootloader of our future OS
    a)  Understanding the limit of floppy boot: code size limit of 512B
    b)  BootLoader construction process:
            * Search OS.BIN in RootDirSectors
            * Read File Allocation Table (FAT) for details
            * Loading OS.BIN using BIOS INT (0x13)
            * Transfer control to OS.BIN
(5) Build OS.BIN (see source file os.nasm)
    a)  Download Bruce's C Compiler (bcc)
        HOWTO: Using BCC to generate flat binary file
            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.
    b)  Build a simple process management system
            * Task scheduling subsystem (supporting multiprocesses)
            * A basic IPC subsystem (PV operators && resources)
    c)  Write a simple SHELL process dealing with I/O
        TIPS: Library functions (e.g. strcmp) can be linked to target image
------------------------------------------------------------------------

------------------------------------------------------------------------
HOW TO RUN IT?

(1) Install QEMU & BCC Suite (including bcc, as86 and ld86)
(2) make
(3) Put os.bin to boot.img (e.g. under Linux).
    a)  mkdir /mnt/floppy/
    b)  mount -o loop boot.img /mnt/floppy/
    c)  cp os.bin /mnt/floppy/  
    d)  umount /mnt/floppy/
(4) qemu -fda boot.img
------------------------------------------------------------------------

About

A tiny operating system running on 8086

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published