background image

Vol. 3A 9-17

PROCESSOR MANAGEMENT AND INITIALIZATION

Example 9-1.  STARTUP.ASM

MS-DOS* 5.0(045-N) 386(TM) MACRO ASSEMBLER STARTUP  09:44:51 08/19/92 PAGE 1

MS-DOS 5.0(045-N) 386(TM) MACRO ASSEMBLER V4.0, ASSEMBLY OF MODULE STARTUP

OBJECT MODULE PLACED IN startup.obj

ASSEMBLER INVOKED BY: f:\386tools\ASM386.EXE startup.a58 pw (132 )

LINE     SOURCE

   1      NAME    STARTUP

   2  

   3  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

   4  ;

   5  ;   ASSUMPTIONS:

   6  ;

   7  ;     1.  The bottom 64K of memory is ram, and can be used for

   8  ;         scratch space by this module.

   9  ;

  10  ;     2.  The system has sufficient free usable ram to copy the

  11  ;         initial GDT, IDT, and TSS

  12  ;

  13  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  14  

  15  ; configuration data - must match with build definition

  16  

  17  CS_BASE       EQU     0FFFF0000H

  18  

  19   ; CS_BASE is the linear address of the segment STARTUP_CODE

  20   ; - this is specified in the build language file

  21  

  22  RAM_START     EQU     400H

  23  

  24  ; RAM_START  is the start of free, usable ram in the linear

  25  ; memory  space.   The GDT,  IDT, and  initial TSS  will be

  26  ; copied above this space, and a small data segment will be

  27  ; discarded at  this linear  address.   The 32-bit  word at

  28  ; RAM_START will contain  the linear  address of  the first

  29  ; free byte above the copied tables - this may be useful if

  30  ; a memory manager is used.

  31  

  32  TSS_INDEX    EQU     10

  33  

  34  ; TSS_INDEX is the  index of the  TSS of the  first task to

  35  ; run after startup

  36  

  37  

  38   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  39  

  40  ; ------------------------- STRUCTURES and EQU ---------------

  41  ; structures for system data

  42  

  43  ; TSS structure

  44  TASK_STATE  STRUC

  45      link

DW ?