Changeset 04bc5d9 in rtems


Ignore:
Timestamp:
09/21/98 00:23:02 (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
c610a1f3
Parents:
30ba752
Message:

Update from Erik Ivanenko <erik.ivanenko@…> to bring the
i386ex bsp up to date.

1) A 'hlt' instruction is coded in case of a return from boot_card in

start.s.

Location:
c/src/lib/libbsp/i386/i386ex
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/i386ex/clock/ckinit.c

    r30ba752 r04bc5d9  
    2020 *  $Id$
    2121 */
     22#define TMR0      0xF040
     23#define TMR1      0xF041
     24#define TMR2      0xF042
     25#define TMRCON    0xF043
     26#define TMRCFG    0xF834
    2227
    2328#include <bsp.h>
     
    5964void ClockOff(const rtems_irq_connect_data* unused)
    6065{
    61      /* should do something here */;
     66  /* should do something here */;
     67  outport_byte  ( TMRCFG , 0x80 );
    6268}
    6369
    6470void ClockOn(const rtems_irq_connect_data* unused)
    6571{
    66 /*  The following is already set up in interns.s ->
    67     ( This is test code only... production code will move the
    68       TMRCFG stuff here )
    69 */
    70 #define TMR0      0xF040
    71 #define TMR1      0xF041
    72 #define TMR2      0xF042
    73 #define TMRCON    0xF043
    74 #define TMRCFG    0xF834
    75        
    7672  outport_byte  ( TMRCFG , 0x80 );
    7773
     
    142138        rtems_fatal_error_occurred(1);
    143139      }
     140#ifdef DEBUG
     141      else
     142        printk("Clock installed AGAIN\n");
     143#endif
    144144    }
    145145 
     
    150150void Clock_exit()
    151151{
     152  ClockOff(&clockIrqData); 
    152153  pc386_remove_rtems_irq_handler (&clockIrqData);
    153154}
  • c/src/lib/libbsp/i386/i386ex/include/bsp.h

    r30ba752 r04bc5d9  
    4646#define MUST_WAIT_FOR_INTERRUTPT 0
    4747
    48 #define Install_tm27_vector( handler ) set_vector( (handler), 0x90, 1 )
    4948
     49#define Install_tm27_vector(handler) \
     50{ \
     51  rtems_isr_entry dummy; \
     52  rtems_interrupt_catch(handler, 0x90, &dummy); \
     53}
    5054#define Cause_tm27_intr()              asm volatile( "int $0x90" : : );
    5155
  • c/src/lib/libbsp/i386/i386ex/start/start.s

    r30ba752 r04bc5d9  
    2828 *
    2929 *  $Id$
     30
     31       
     32changes:       
     33    SetExRegByte(ICW3S  , 0x02 ) # MUST be 0x02 according to intel
     34    SetExRegByte(ICW3M  , 0x04 ) # IR2 is cascaded internally: was 0x02 => IR1 is cascaded
     35       
    3036 */
    3137
     
    3945 */                     
    4046
    41         EXTERN (main)              /* exits to bspstart   */
     47#define NEXT_GAS
     48       
     49        EXTERN (boot_card)         /* exits to bspstart   */
    4250        EXTERN (stack_start)       /* defined in startup/linkcmds */
    43        
    44         .section .idt
    45 
     51        EXTERN (Clock_exit)
     52
     53        PUBLIC (Interrupt_descriptor_table)
     54        PUBLIC ( SYM(IDTR) )
     55        PUBLIC( SYM(_initInternalRegisters) )
     56       
    4657BEGIN_DATA
    47         PUBLIC (Interrupt_descriptor_table)
    48         PUBLIC(SYM(IDTR) )
    49 SYM(IDTR):      DESC3( SYM(IDT), 0x188 );
    50 SYM (Interrupt_descriptor_table):
    51 SYM(IDT):       
    52 SYM(GATE_DIVIDE_ERROR):         INTERRUPT_GATE( DIVIDE_ERROR  );
    53 SYM(GATE_DEBUG_EXCEPTION):      INTERRUPT_GATE( DEBUG_EXCEPTION   );
    54 SYM(GATE_NMI_INTERRUPT):        INTERRUPT_GATE( NMI_INTERRUPT );
    55 SYM(GATE_BREAKPOINT):           INTERRUPT_GATE( BREAKPOINT );
    56 SYM(GATE_INTO_OVERFLOW ):       INTERRUPT_GATE( INTO_OVERFLOW );
    57 SYM(GATE_BOUND_EXCEEDED ):      INTERRUPT_GATE( BOUND_EXCEEDED );
    58 SYM(GATE_INVALID_OPCODE ):      INTERRUPT_GATE( INVALID_OPCODE );
    59 SYM(GATE_COPRO_NA ):            INTERRUPT_GATE( COPRO_NA );
    60 SYM(GATE_DOUBLE_FAULT ):        INTERRUPT_GATE( DOUBLE_FAULT );
    61 SYM(GATE_COPRO_SEG_OVERRUN ):   INTERRUPT_GATE( COPRO_SEG_OVERRUN );
    62 SYM(GATE_INVALID_TSS ):         INTERRUPT_GATE( INVALID_TSS );
    63 SYM(GATE_SEGMENT_NOT_PRESENT ): INTERRUPT_GATE( SEGMENT_NOT_PRESENT );
    64 SYM(GATE_STACK_FAULT ):         INTERRUPT_GATE( STACK_FAULT );
    65 SYM(GATE_GPF ):                 INTERRUPT_GATE( GPF         );
    66 SYM(GATE_PAGE_FAULT ):          INTERRUPT_GATE( PAGE_FAULT  );
    67 SYM(GATE_RESERVED_1 ):          INTERRUPT_GATE( RESERVED    );
    68 SYM(GATE_COPRO_ERROR ):         INTERRUPT_GATE( COPRO_ERROR );
    69 SYM(GATE_RESERVED_17):          INTERRUPT_GATE( RESERVED_17 );
    70 SYM(GATE_RESERVED_18):          INTERRUPT_GATE( RESERVED_18 );
    71 SYM(GATE_RESERVED_19):          INTERRUPT_GATE( RESERVED_19 );
    72 SYM(GATE_RESERVED_20):          INTERRUPT_GATE( RESERVED_20 );
    73 SYM(GATE_RESERVED_21):          INTERRUPT_GATE( RESERVED_21 );
    74 SYM(GATE_RESERVED_22):          INTERRUPT_GATE( RESERVED_22 );
    75 SYM(GATE_RESERVED_23):          INTERRUPT_GATE( RESERVED_23 );
    76 SYM(GATE_RESERVED_24):          INTERRUPT_GATE( RESERVED_24 );
    77 SYM(GATE_RESERVED_25):          INTERRUPT_GATE( RESERVED_25 );
    78 SYM(GATE_RESERVED_26):          INTERRUPT_GATE( RESERVED_26 );
    79 SYM(GATE_RESERVED_27):          INTERRUPT_GATE( RESERVED_27 );
    80 SYM(GATE_RESERVED_28):          INTERRUPT_GATE( RESERVED_28 );
    81 SYM(GATE_RESERVED_29):          INTERRUPT_GATE( RESERVED_29 );
    82 SYM(GATE_RESERVED_30):          INTERRUPT_GATE( RESERVED_30 );
    83 SYM(GATE_RESERVED_31):          INTERRUPT_GATE( RESERVED_31 );
    84          
    85 SYM ( GATE_TIMINT0):                    INTERRUPT_GATE( TIMINT0 );
    86 SYM ( GATE_MASTER_IR2 ):                INTERRUPT_GATE( MASTER_IR2 );
    87 SYM ( GATE_SIOINT1    ):                INTERRUPT_GATE( SIOINT1    );
    88 SYM ( GATE_SIOINT2    ):                INTERRUPT_GATE( SIOINT2 );
    89 SYM ( GATE_DMAINT     ):                INTERRUPT_GATE( DMAINT    );
    90 SYM ( GATE_UNUSED_IR5 ):                INTERRUPT_GATE( UNUSED_IR5);
    91 SYM ( GATE_UNUSED_IR6 ):                INTERRUPT_GATE( UNUSED_IR6);
    92 SYM ( GATE_UNUSED_IR7 ):                INTERRUPT_GATE( UNUSED_IR7);
    93 SYM ( GATE_SLAVE_IR0  ):                INTERRUPT_GATE( SLAVE_IR0 );
    94 SYM ( GATE_SLAVE_IR1  ):                INTERRUPT_GATE( SLAVE_IR1 );
    95 SYM ( GATE_SLAVE_IR2  ):                INTERRUPT_GATE( SLAVE_IR2 );
    96 SYM ( GATE_SLAVE_IR3  ):                INTERRUPT_GATE( SLAVE_IR3 );
    97 SYM ( GATE_SLAVE_IR4  ):                INTERRUPT_GATE( SLAVE_IR4 );
    98 SYM ( GATE_SLAVE_IR5  ):                INTERRUPT_GATE( SLAVE_IR5 );
    99 SYM ( GATE_SLAVE_IR6  ):                INTERRUPT_GATE( SLAVE_IR6 );
    100 SYM ( GATE_SLAVE_IR7  ):                INTERRUPT_GATE( SLAVE_IR7 );
     58SYM(IDTR):      DESC3( SYM(Interrupt_descriptor_table), 0x07ff );
     59       
     60SYM(Interrupt_descriptor_table):   /* Now in data section */
     61        .rept 256
     62        .word 0,0,0,0
     63        .endr
     64
    10165END_DATA       
    10266       
    103         .section        .gdt
    10467BEGIN_DATA
    105                 PUBLIC (_Global_descriptor_table)
    106                
     68/*      .section        .gdt */
     69         PUBLIC (_Global_descriptor_table)
     70                       
    10771SYM(GDTR):      DESC3( GDT_TABLE, 0x1f ); # one less than the size
    10872SYM (_Global_descriptor_table):
    109 SYM(GDT):       
    11073SYM(GDT_TABLE): DESC2(0,0,0,0,0,0);
    11174SYM(GDT_ALIAS): DESC2(32,0x1000,0x0,0x93,0,0x0);
     
    12285*/
    12386       
    124         .section        .ints
    125        
    126 SYM(INTERRUPT_HANDLERS):       
    127 SYM(DIVIDE_ERROR):              jmp SYM(DIVIDE_ERROR)   
    128 SYM(DEBUG_EXCEPTION):           jmp SYM(DEBUG_EXCEPTION)       
    129 SYM(NMI_INTERRUPT):             jmp SYM(NMI_INTERRUPT) 
    130 SYM(BREAKPOINT):                jmp SYM(BREAKPOINT)     
    131 SYM(INTO_OVERFLOW):             jmp SYM(INTO_OVERFLOW) 
    132 SYM(BOUND_EXCEEDED):            jmp SYM(BOUND_EXCEEDED)
    133 SYM(INVALID_OPCODE):            jmp SYM(INVALID_OPCODE)
    134 SYM(COPRO_NA):                  jmp SYM(COPRO_NA)       
    135 SYM(DOUBLE_FAULT):              jmp SYM(DOUBLE_FAULT)   
    136 SYM(COPRO_SEG_OVERRUN):         jmp SYM(COPRO_SEG_OVERRUN)
    137 SYM(INVALID_TSS):               jmp SYM(INVALID_TSS)
    138 SYM(RESERVED):                  JMP SYM(RESERVED)       
    139 SYM(COPRO_ERROR):               JMP SYM(COPRO_ERROR)   
    140 SYM(PAGE_FAULT):                JMP SYM(PAGE_FAULT)     
    141 SYM(GPF):                       JMP SYM(GPF)   
    142 SYM(STACK_FAULT):               JMP SYM(STACK_FAULT)
    143 SYM(SEGMENT_NOT_PRESENT):       jmp SYM(SEGMENT_NOT_PRESENT)
    144 SYM(RESERVED_17):               jmp SYM(RESERVED_17)   
    145 SYM(RESERVED_18):               jmp SYM(RESERVED_18)   
    146 SYM(RESERVED_19):               jmp SYM(RESERVED_19)   
    147 SYM(RESERVED_20):               jmp SYM(RESERVED_20)   
    148 SYM(RESERVED_21):               jmp SYM(RESERVED_21)   
    149 SYM(RESERVED_22):               jmp SYM(RESERVED_22)   
    150 SYM(RESERVED_23):               jmp SYM(RESERVED_23)   
    151 SYM(RESERVED_24):               jmp SYM(RESERVED_24)   
    152 SYM(RESERVED_25):               jmp SYM(RESERVED_25)   
    153 SYM(RESERVED_26):               jmp SYM(RESERVED_26)   
    154 SYM(RESERVED_27):               jmp SYM(RESERVED_27)   
    155 SYM(RESERVED_28):               jmp SYM(RESERVED_28)   
    156 SYM(RESERVED_29):               jmp SYM(RESERVED_29)   
    157 SYM(RESERVED_30):               jmp SYM(RESERVED_30)   
    158 SYM(RESERVED_31):               jmp SYM(RESERVED_31)   
    159 SYM(TIMINT0):                   nop; iret
    160 SYM(MASTER_IR2):                jmp SYM(MASTER_IR2)
    161 SYM(SIOINT1):                   jmp SYM(SIOINT1)
    162 SYM(SIOINT2):                   jmp SYM(SIOINT2)
    163 SYM(DMAINT):                    jmp SYM(DMAINT)
    164 SYM(UNUSED_IR5):                jmp SYM(UNUSED_IR5)
    165 SYM(UNUSED_IR6):                JMP SYM(UNUSED_IR6)
    166 SYM(UNUSED_IR7):                JMP SYM(UNUSED_IR7)
    167 SYM(SLAVE_IR0):                 JMP SYM(SLAVE_IR0)
    168 SYM(SLAVE_IR1):                 JMP SYM(SLAVE_IR1)
    169 SYM(SLAVE_IR2):                 nop; iret
    170 SYM(SLAVE_IR3):                 JMP SYM(SLAVE_IR3)
    171 SYM(SLAVE_IR4):                 JMP SYM(SLAVE_IR4)
    172 SYM(SLAVE_IR5):                 JMP SYM(SLAVE_IR5)
    173 SYM(SLAVE_IR6):                 JMP SYM(SLAVE_IR6)
    174 SYM(SLAVE_IR7):                 JMP SYM(SLAVE_IR7)
    175        
    176         PUBLIC( SYM(_initInternalRegisters) )
    177 
    178        
     87
    17988        .section .reset                       
    18089
    18190                PUBLIC ( SYM(reset) )
    182 SYM(reset):
    183         .code16
     91SYM(reset):     
    18492        nop
    18593        cli
    186 #ifdef NEXT_GAS
    187         addr32
    188 #endif 
    18994        jmp     SYM(_initInternalRegisters) /* different section in this file */
    19095        .code32                             /* in case this section moves     */
     
    19499        nop
    195100        nop
    196                
     101
     102       
     103       
    197104        .section .initial
    198 
     105       
    199106/*
    200107 * Enable access to peripheral register at expanded I/O addresses
     
    220127        outb    al      , dx
    221128
    222 SYM(Watchdog):         
    223         SetExRegByte( WDTSTATUS, 0x01 ) # disable watchdog timer
     129SYM(Watchdog):
     130        movw    $WDTSTATUS      , dx    # address the WDT status port
     131        inb     dx              , al    # get the WDT status
     132        orb     $0x01           , al    # set the CLKDIS bit
     133        outb    al              , dx    # disable the clock to the WDT
    224134
    225135/*
     
    409319        SetExRegByte(ICW1S  , 0x11 ) # EDGE TRIGGERED
    410320        SetExRegByte(ICW2S  , 0x28 ) # Slave base vector after Master
    411         SetExRegByte(ICW3S  , 0x04 ) # ( was 0x02! )slave cascaded to IR2 on master
     321        SetExRegByte(ICW3S  , 0x02 ) # slave cascaded to IR2 on master
    412322        SetExRegByte(ICW4S  , 0x01 ) # must be 0x01
    413323
    414324        SetExRegByte(ICW1M  , 0x11 ) # edge triggered
    415         SetExRegByte(ICW2M  , 0x20 )  # base vector starts at byte 32
    416         SetExRegByte(ICW3M  , 0x02 ) # IR2 is cascaded internally
     325        SetExRegByte(ICW2M  , 0x20 ) # base vector starts at byte 32
     326        SetExRegByte(ICW3M  , 0x04) # IR2 is cascaded internally
    417327        SetExRegByte(ICW4M  , 0x01 ) # idem
    418328       
    419329        SetExRegByte(OCW1M  , 0xde ) # IR0  only = 0xfe.  for IR5 and IR0 active use 0xde
    420330        SetExRegByte(INTCFG , 0x00 )
     331       
     332        movw    $0xFFFB, SYM(i8259s_cache) /* set up same values in cache */
    421333       
    422334SYM(SetCS4):   
     
    431343        SetExRegWord(UCSMSKH, 0x03F7)   
    432344        SetExRegWord(UCSMSKL, 0xFC01)     # configure upper chip select
    433                        
    434 SYM(xfer_idt):
    435         movw $ _ram_idt_offset  , di
    436         movw $ _ram_idt_segment , cx   
    437         mov     cx, es
     345
     346/******************************************************
     347* The GDT must be in RAM since it must be writeable,
     348* So, move the whole data section down.
     349********************************************************/
    438350               
    439         movw $ _rom_idt_offset   , si
    440         movw $ _rom_idt_segment  , ax
    441         mov   ax                 , ds
    442                
    443         movw $ _idt_size , cx
    444        
    445         repne
    446         movsb
    447        
    448 SYM(xfer_ints):
    449                        
    450         movw $ _ram_ints_offset   , di 
    451         movw $ _ram_ints_segment  , ax
    452         mov  ax                   , es
    453        
    454         movw $ _rom_ints_offset , si
    455         movw $ _rom_ints_segment, ax
    456         mov  ax                 , ds
    457 
    458         movw $ _ints_size       , cx
    459        
    460         repne
    461         movsb
    462        
    463 SYM(lidt):
    464         movw $ _ram_idt_offset  ,   di
    465         movw $ 0x0              ,   si
    466 
    467         movw $ _ram_idt_segment ,   ax
    468 
    469         mov  ax                 , ds
    470         lidt    _ram_idt_offset
    471 SYM(xfer_gdt):         
     351/* SYM(xfer_gdt):               
    472352        movw $ _ram_gdt_offset  , di
    473353        movw $ _ram_gdt_segment , cx
     
    481361        repne
    482362        movsb
     363*/
     364
     365        movw $ _ram_data_offset , di
     366        movw $ _ram_data_segment, cx
     367        mov  cx                 , es
     368
     369        movw $ _data_size       , cx
     370        movw $ _rom_data_segment, ax
     371        movw $ _rom_data_offset , si
     372        mov  ax                 , ds
     373       
     374        repne
     375        movsb
    483376       
    484377/*****************************
     
    487380 ****************************/
    488381       
    489         movw $ _ram_gdt_segment, ax
    490         mov    ax              , ds
     382/*      movw $ _ram_gdt_segment, ax */
     383
    491384#ifdef NEXT_GAS
    492385        data32
    493386        addr32
    494387#endif 
    495         lgdt    _ram_gdt_offset     #  location of GDT
     388/*        lgdt  _ram_gdt_offset     #  location of GDT */
     389
     390        lgdt SYM(GDTR) #  location of GDT
    496391
    497392       
    498393SYM(SetUCS):           
    499         SetExRegWord(UCSADL, 0x0704)      # now 512K starting at 0x3f80000.     
     394        SetExRegWord(UCSADL, 0x0702)      # now 512K starting at 0x3f80000.     
    500395        SetExRegWord(UCSADH, 0x03f8)
    501396        SetExRegWord(UCSMSKH, 0x0007)   
     
    514409 *********************/
    515410
    516         ljmpl $ GDT_CODE_PTR , $  SYM(_copy_data) # sets the code selector
     411/*      ljmpl $ GDT_CODE_PTR , $  SYM(_copy_data) # sets the code selector*/
     412        ljmpl $ GDT_CODE_PTR , $  SYM(_load_segment_registers) # sets the code selector
     413       
    517414/*
    518415 * Copy the data section down to RAM
    519416 */
    520 SYM(_copy_data):
     417/*SYM(_copy_data): */
     418SYM(_load_segment_registers):   
    521419        .code32
    522420        pLOAD_SEGMENT( GDT_DATA_PTR, fs)
     
    526424        pLOAD_SEGMENT( GDT_DATA_PTR, es)
    527425       
    528         movl            $ SYM(_data_start)      , edi # ram destination
     426/*      movl            $ SYM(_data_start)      , edi # ram destination
    529427        movl            $ SYM(_rom_data_start)  , esi # rom data source
    530         movl            $ SYM(_edata)           , ecx # end of data section
    531         subl            $ SYM(_data_start)      , ecx # length of data section
    532                                                       # es, ds preloaded
     428        movl            $ SYM(_data_size)       , ecx # amount to move
    533429        repne                                         # while ecx != 0
    534430        movsb                                         #   move a byte   
    535 
     431*/
    536432/*
    537433 *  Set up the stack
    538434 */
     435
     436SYM(lidtr):
     437        lidt    SYM(IDTR)
    539438
    540439SYM (_establish_stack):
    541440        movl    $end, eax               # stack starts right after bss
    542 /*      movl    eax, stack_start        # save for brk() routine */
    543441        movl    $stack_origin, esp      # this is the high starting address
    544442        movl    $stack_origin, ebp
     
    563461        pushl   $0                       # argv
    564462        pushl   $0                       # argc
    565         call    SYM (main)               # does not return
     463        call SYM(boot_card)
    566464        addl    $12,esp
    567 
    568 BEGIN_DATA_DCL
    569 
    570 /*        .align  2
    571         PUBLIC (start_frame)
    572 SYM (start_frame):
    573         .long 0 
    574 */
    575 /*        PUBLIC (stack_start)
    576 SYM (stack_start):
    577         .long  0
    578 */
    579 
    580 END_DATA_DCL
     465       
     466        hlt
    581467
    582468END
     469
  • c/src/lib/libbsp/i386/i386ex/startup/bspstart.c

    r30ba752 r04bc5d9  
    2121 *  $Id$
    2222 */
     23
     24void bsp_clean_up(void);
    2325
    2426#include <bsp.h>
     
    8082    bsp_libc_init((void *) heap_start, heap_size, 0);
    8183
     84
    8285#ifdef RTEMS_DEBUG
    8386    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
     
    9396void bsp_start( void )
    9497{
    95   /*
    96    *  we do not use the pretasking_hook.
     98     /*
     99    *  we do not use the pretasking_hook.
    97100   */
    98101
     
    101104  Cpu_table.interrupt_table_segment = get_ds();
    102105  Cpu_table.interrupt_table_offset = (void *)Interrupt_descriptor_table;
    103   Cpu_table.interrupt_stack_size = 4096;  /* STACK_MINIMUM_SIZE */
     106  Cpu_table.interrupt_stack_size = 8192;  /* changed Sept 14 STACK_MINIMUM_SIZE */
    104107
    105108#if defined(RTEMS_POSIX_API)
     
    107110#endif
    108111
    109   BSP_Configuration.work_space_start = (void *)
     112  /* BSP_Configuration.work_space_size += 128 * RTEMS_MINIMUM_STACK_SIZE; */
     113
     114    BSP_Configuration.work_space_start = (void *)
    110115     RAM_END - BSP_Configuration.work_space_size;
     116#ifdef DEBUG 
     117  printk("workspace size = 0x%x\nstart = 0x%x, RAM_END = 0x%x\n",BSP_Configuration.work_space_size,  BSP_Configuration.work_space_start, RAM_END );
     118#endif
    111119
    112120  /*
     
    120128  rtems_irq_mngt_init();
    121129}
     130void bsp_clean_up(void) {
     131  printk("bsp_cleanup called\n");
     132}
  • c/src/lib/libbsp/i386/i386ex/startup/linkcmds

    r30ba752 r04bc5d9  
    1212 *
    1313 *  $Id$
     14 *
     15 * Memory layout:
     16 *
     17 * 0x3f80000 -> 0x3ff0000 : text section
     18 * 0x3ff0000 -> 0x3ff0028 : global descriptor table in ROM
     19 * 0x3ff0028 -> 0x3fff000 : data section ( copied by start.s to RAM )
     20 * 0x3fff000 -> 0x3fffff0 : initial section ( init 386ex, goto protected mode, copy ROM-RAM )
     21 * 0x3fffff0 -> 0x4000000 : reset section ( jmp to initial only )
    1422 */
    15 
    1623
    1724        ENTRY(reset) ;
     
    1926{
    2027
    21 /*******************************************************************************
    22  * Interrupts section:
    23  *
    24  *  This section defines the layout of the interrupts in ROM ( VMA ) as well as their
    25  *  location in RAM (LMA). The _rom_ and _ram_ variables are used in start.s
    26  *  in order for the code to move the interrupt vector tables from ROM to RAM
    27  *  while still running in real-mode.  The tables are moved from ROM, as the IDT
    28  *  is initialized with only 16-bit offsets for the interrupt handlers.
    29  *  This is purely an implementation issue.  If you prefer the interrupt handlers
    30  *  to be resident in flash, then you must provide the code to create the interrupt
    31  *  gates with full 32bit offsets.  The code in the current start.s does NOT support
    32  *  interrupts in ROM by merely redefining their location.
    33  ******************************************************************************/
    34         _rom_ints            = 0x3ff0000;    /* was 0x3fb0000 */
    35         _rom_ints_segment    = 0xF000 ;
    36         _rom_ints_offset     = 0x0000 ;
    37 
    38         _ram_ints_segment    = 0x0000 ;   
    39         _ram_ints_offset     = 0x0100 ;
    40 
    41 
    42         .ints _ram_ints_offset :
    43         AT ( _rom_ints )
    44         {
    45         _sints = .;
    46         *(.ints);
    47         _eints = ALIGN (0x010);
    48         }       
    49 
    50         _ints_size     = _eints - _sints ;       
    51 /**************************************************************************************
    52  * GDT section:
    53  *
    54  * This section defines the locations of the GDT in ROM as well as in RAM.  The _rom_ and
    55  * _ram_ variables are used by start.s to copy the GDT from ROM to RAM when still in
    56  * real-mode.  The move from ROM to RAM is made as a writeable GDT is required for the
    57  * jump to protected mode to be successful.
    58  **************************************************************************************/
    59 
    60         _rom_gdt           = _rom_ints + _ints_size;
    61         _rom_gdt_segment   = 0xF000;
    62         _rom_gdt_offset    = _rom_ints_offset + _ints_size;
    63 
    64         _ram_gdt_segment   = 0x0000 ;
    65         _ram_gdt_offset    = _ram_ints_offset + _ints_size;
    66 
    67         .gdt  _ram_gdt_offset  :
    68         AT ( _rom_gdt )
    69         {
    70         _sgdt = .;
    71         *(.gdt);
    72         _egdt = ALIGN (0x10);
    73         }
    74         _gdt_size      = _egdt - _sgdt;
    75 
    76 /*****************************************************************************************
    77  * IDT section:
    78  *
    79  * This section defines the locations of the IDT in ROM as well as in RAM.  The _rom_ and
    80  * _ram_ variables are used by start.s to copy the IDT from ROM to RAM when still in real-mode.
    81  * The move from ROM to RAM is required to enable RTEMS to hook the interrupts, however,
    82  * this move could be made when in protected mode.
    83  ****************************************************************************************/
    84 
    85         _rom_idt                = _rom_gdt + _gdt_size ;
    86         _rom_idt_segment        = 0xF000 ;
    87         _rom_idt_offset         = _rom_gdt_offset + _gdt_size ;
    88 
    89         _ram_idt_segment        = 0x0000 ;
    90         _ram_idt_offset         = _ram_gdt_offset + _gdt_size ;
    91 
    92         .idt _ram_idt_offset :
    93         AT ( _rom_idt )
    94         {
    95         _sidt = .;
    96         *(.idt);
    97         _eidt = ALIGN (0x10);
    98         }
    99         _idt_size               = _eidt - _sidt;
    100 
    10128/****************************************************************************************
    10229 * data section:
    10330 *
    10431 * This section defines the locations of the data section in ROM as well as in RAM. 
    105  * start.s copies the data section to RAM when in protected mode.
     32 * start.s copies the data section to RAM in real mode.  This is done PRIOR to the lgdt
     33 * instruction since the data section contains the Global_descriptor_table and GDTR.
    10634 ***********************************************************************************/
    10735
    108         _rom_data_start = _rom_idt + _idt_size ;
     36        _rom_data_start = 0x3ff0000;
     37
     38        _rom_data_segment   = 0xF000;
     39        _rom_data_offset    = 0x0;
     40
     41        _ram_data_segment   = 0x0000 ;
     42        _ram_data_offset    = 0x0;
     43        _ram_data_location  = _ram_data_segment * 16 + _ram_data_offset;
    10944
    11045        .data  :
    111         AT ( _rom_data_start )  
     46        AT ( _rom_data_start )
    11247        {
    11348        _sdata = .;
    11449        *(.data);
    115         _edata = ALIGN( 0x10 ) ;
     50        _edata = .;
    11651        }
    11752        _data_start       = ADDR(.data) ;
     
    12459 * The bss section is the last section in RAM. 
    12560 *************************************************************************************/
     61        _edata = ALIGN( 0x10 ); 
    12662        .bss :
    12763        {
     
    14480 * are complete.
    14581 *************************************************************************************/
    146         stack_size  = 0x1000 ;
     82        stack_size  = 0x8000 ;
    14783        stack_origin = end + stack_size ;
    14884        heap_bottom  = stack_origin + 4 ; 
     
    187123 * This section is defined after the data section.  It must be in the top 64K of memory
    188124 * to enable the initial short jmp from the reset section while still in real-mode. It
    189  * contains ALL initialization and data movement directives.
     125 * initializes the i386ex, moves the gdt from ROM to RAM,loads the gdt,
     126 * jumps to protected mode, copies the data section from ROM to RAM and loads the idt.
    190127 ******************************************************************************************/
    191128
     
    196133
    197134/*******************************************************************************************
    198  * reset section:
     135 * board reset section:
    199136 *
    200137 * This section contains the short jmp from the reset section to the initial section.  It is
     
    202139 ******************************************************************************************/
    203140
    204         .reset          0x3fffff0:
     141        .reset 0x3fffff0:
    205142        {
    206143        *(.reset);
Note: See TracChangeset for help on using the changeset viewer.