Amateur OS Kernel Outline



        Amateur OS kernel must meet certain needs, both
    for regular programs and for DSP programs. This page
    is an outline of those services and some of the ways
    they can be meet.

    CONTROL EXECUTION of PROGRAMS
        FUNCTIONS:
            EXEC(program);
                Sets up memory, loads program, turns
                control to program.
            SUSPEND(program);
                Suspends execution of program,saves registers
                and waits.
            CONTINUE(program);
                Restores registers and continues running
                the program.
            DESTORY(program);
                Stop execution of program, take care of any
                data storage and return memory to pool.
    MEMORY MANAGEMENT
        FUNCTIONS:
            GETMEMORYAMOUNT();
                Determine the amount of memory in the system.
            SETMEMORYBLOCK();
                Setup memory blocks.
                    First block 64k     system
                    Second block 128k   program
                    Third block 128k    program
                    Fourth block 128k   program
                    Fifth block 128k    program
                    Sixth block 64k     system
                        Due to DSP's need for speed, programs will
                    most likely be written in Assembler or C. So
                    128k should be enough room for a nice DSP program.
                    Services might include a way to join 2 blocks for
                    larger programs.
            SETMEMORYREGISTERS();
                    Set the extra registers.
                        FS = 0xB8000    Video memory text mode
                        GS =            Ramdisk and DMA dump
            CHECKFREEBLOCK();
                    Check the block table to see if a block is free.
            SETDMA();
                    Setup DMA for moves from the sound card to memory.
    FILE SYSTEM MANAGEMENT
        FUNCTIONS:
            READFILE();
                Read a file into memory
            WRITEFILE();
                Write a file from memory to disk
            CREATEFILE();
                Create a file and return a handle
            OPENFILE();
                Open a file and return a handle
            CLOSEFILE();
                Close a file and return status
            CREATERAMDISK();
                Create a ramdisk for program storage.
                1 meg, simple 64k block directory.
                File may span more than one block.
                Some blocks may be split smaller for
                small utility programs.
            COPYFLOPPY();
                Copy the contents of the floppy to
                the ramdisk.
            COPYVOLITAL();
                Copy saved files back to the floppy.
                Could be hooked to an interrupt to
                save at a pre set interval. Files will
                be written back on system start up.
                Certain blocks in the ramdisk would have
                to be set aside for saved files only.
    PERIPLEAL DEVICE MANAGEMENT
        MONITOR
            FUNCTIONS:
                INT 0X22

        KEYBOARD

        MOUSE

        FLOPPY

        HARDDISK

        SOUND CARD

        PRINTER PORT

        SERIAL PORT

    DSP MANAGEMENT
        FUNCTIONS:
            DETECTSOUNDCARD();
                Detect the sound card. And make sure it
                will operate like a Sound Blaster 16.
            SETSOUNDCARD();
                Setup the sound card for sample rate.
            SET_SOUND_CARD_DMA();
                Setup the sound card for a DMA move to
                memory.
            SET_DSP_BUFFER();
                Setup the buffer for the DSP.
    TASK SCHEDULING MANAGEMENT
        FUNCTIONS:
            SET_TASK_SCHEDULING();
                Setup one of the following scheduling
                if needed.
                    PRE-EMPTIVE        Foreground process gets
                                      the most time.
                    TIME SLICED       Each process gets a slice
                                      of time set by the user.
                    ROUND-ROBION      Each process gets the same
                                      amount of time.
    INTERRUPT MANAGEMENT
        FUNCTIONS:
            See INT.HTM

    TIMER MANAGEMENT
        FUNCTIONS:
 

    If you have a comment or question, please feel free
    to send me an Email.