;   coreload.inc, Copyright (c) 1997-1998 by Lukas Ruf,
;   Swiss Federal Institute of Technology,
;   Computer Engineering and Networks Laboratory.
;
;   TOPSY -- A Teachable Operating System.
;            Implementation of a tiny and simple
;            micro kernel for teaching purposes.
;
;   For further information, please visit http://www.tik.ee.ethz.ch/~topsy
;
;   This software is provided under the terms of the GNU General Public Licence.
;   A full copy of the GNU GPL is provided in the file COPYING found in the 
;   development root of Topsy.
;
;       This copyright notice supercedes all originally or previously used 
;       copyrights being used within the source code.
;       
;       Author: Lukas Ruf, lr@lpr.ch



;Topsy i386                                               Lukas Ruf, August 1997
;-------------------------------------------------------------------------------
;Constant.H - Global constants
        ;////
        ;// Initial Boot Stack
        ;////
        STACKSEG        EQU     0x1E00 ; (SS) (Stack grows downwards to zero)
        STACKTOP        EQU     0x1FFF ; (SP)

        GDTSEG          EQU     0x0000 ; Form GDT_BASE in PM
        GDTOFS          EQU     0x1000 ; 

        CR              EQU     0x0D
        LF              EQU     0x0A


        ;////
        ;//GDT_BASE Address
        ;////
        GDT_BASE        EQU         0x1000      ;2nd Page
        ; GDT_SIZE        EQU     GDTxSIZE        ;created in creategdt.inc

        ;////
        ;//IDT_BASE Address
        ;////
                             ;256x8-1=2047
        IDT_SIZE        EQU       0x0007FF       
        IDT_BASE        EQU     0x00010000

        PDT_SIZE        EQU       0x000FFF
        PDT_BASE        EQU     0x00011000

        PET_SIZE        EQU       0x000FFF
        PET_BASE        EQU     0x00012000

        VID_SIZE        EQU       0x000FBF
        VID_BASE        EQU     0x000B8000

        OSC_SIZE        EQU       0x07FFFF
        OSC_BASE        EQU     0x00020000

        cOSKern_Begin   EQU     0x00020090      ; GNU Kernel Start Location
        gOSCode_Sel     EQU          1*8
        gOSData_Sel     EQU          2*8

        OSD_SIZE        EQU       0x07FFFF
        OSD_BASE        EQU     0x00020000

        MEM_SIZE        EQU       0x0FFFFF
        MEM_BASE        EQU     0x00000000

        ;////
        ;// Bit 0  in CR0 to set Protected Mode
        ;////
        PM_ENABLE       EQU     1

        ;////
        ;// Bit 31 in CR0 to set Page Mode Addressing
        ;////
        PG_ENABLE       EQU     %10000000000000000000000000000000

        ;////
        ;// Ausgabe-Adresse Text (VGA: 0xB8000, Monochrom:0xB0000)
        ;////
        SCR_BASE        EQU     0x0B8000

        ;// Load Values
        BOOTSEG           EQU   0x00000
        BOOTOFS           EQU   0x07C00

        BOOT_HEAD         EQU   0x00000
        BOOT_TRACK        EQU   0x00000
        BOOT_SECTOR       EQU   0x00001


        LOADSEG           EQU   0x01000
        LOADOFS           EQU   0x00000

        LOAD_HEAD         EQU   0x00000
        LOAD_TRACK        EQU   0x00001
        LOAD_SECTOR       EQU   0x00001


        KERNSEG           EQU   0x02000
        KERNOFS           EQU   0x00000

        KERN_HEAD         EQU   0x00000
        KERN_TRACK        EQU   0x00002
        KERN_SECTOR       EQU   0x00001


        DRIVSEG           EQU   0x04000
        DRIVOFS           EQU   0x00000

        DRIV_HEAD         EQU   0x00000
        DRIV_TRACK        EQU   0x00009
        DRIV_SECTOR       EQU   0x00001


        ; /* LR 000726 */
        USERSEG           EQU   0x09000     ; /* changed from 0x06000 */
        USEROFS           EQU   0x00000

        USER_HEAD         EQU   0x00000
        USER_TRACK        EQU   0x00010
        USER_SECTOR       EQU   0x00001

        ; /* Topsyheader */
        ORG_MARKER        EQU   0x00010
        ORG_TRACKS        EQU   0x00070

