Changeset 04bc5d9 in rtems
- Timestamp:
- 09/21/98 00:23:02 (25 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- c610a1f3
- Parents:
- 30ba752
- 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 20 20 * $Id$ 21 21 */ 22 #define TMR0 0xF040 23 #define TMR1 0xF041 24 #define TMR2 0xF042 25 #define TMRCON 0xF043 26 #define TMRCFG 0xF834 22 27 23 28 #include <bsp.h> … … 59 64 void ClockOff(const rtems_irq_connect_data* unused) 60 65 { 61 /* should do something here */; 66 /* should do something here */; 67 outport_byte ( TMRCFG , 0x80 ); 62 68 } 63 69 64 70 void ClockOn(const rtems_irq_connect_data* unused) 65 71 { 66 /* The following is already set up in interns.s ->67 ( This is test code only... production code will move the68 TMRCFG stuff here )69 */70 #define TMR0 0xF04071 #define TMR1 0xF04172 #define TMR2 0xF04273 #define TMRCON 0xF04374 #define TMRCFG 0xF83475 76 72 outport_byte ( TMRCFG , 0x80 ); 77 73 … … 142 138 rtems_fatal_error_occurred(1); 143 139 } 140 #ifdef DEBUG 141 else 142 printk("Clock installed AGAIN\n"); 143 #endif 144 144 } 145 145 … … 150 150 void Clock_exit() 151 151 { 152 ClockOff(&clockIrqData); 152 153 pc386_remove_rtems_irq_handler (&clockIrqData); 153 154 } -
c/src/lib/libbsp/i386/i386ex/include/bsp.h
r30ba752 r04bc5d9 46 46 #define MUST_WAIT_FOR_INTERRUTPT 0 47 47 48 #define Install_tm27_vector( handler ) set_vector( (handler), 0x90, 1 )49 48 49 #define Install_tm27_vector(handler) \ 50 { \ 51 rtems_isr_entry dummy; \ 52 rtems_interrupt_catch(handler, 0x90, &dummy); \ 53 } 50 54 #define Cause_tm27_intr() asm volatile( "int $0x90" : : ); 51 55 -
c/src/lib/libbsp/i386/i386ex/start/start.s
r30ba752 r04bc5d9 28 28 * 29 29 * $Id$ 30 31 32 changes: 33 SetExRegByte(ICW3S , 0x02 ) # MUST be 0x02 according to intel 34 SetExRegByte(ICW3M , 0x04 ) # IR2 is cascaded internally: was 0x02 => IR1 is cascaded 35 30 36 */ 31 37 … … 39 45 */ 40 46 41 EXTERN (main) /* exits to bspstart */ 47 #define NEXT_GAS 48 49 EXTERN (boot_card) /* exits to bspstart */ 42 50 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 46 57 BEGIN_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 ); 58 SYM(IDTR): DESC3( SYM(Interrupt_descriptor_table), 0x07ff ); 59 60 SYM(Interrupt_descriptor_table): /* Now in data section */ 61 .rept 256 62 .word 0,0,0,0 63 .endr 64 101 65 END_DATA 102 66 103 .section .gdt104 67 BEGIN_DATA 105 PUBLIC (_Global_descriptor_table) 106 68 /* .section .gdt */ 69 PUBLIC (_Global_descriptor_table) 70 107 71 SYM(GDTR): DESC3( GDT_TABLE, 0x1f ); # one less than the size 108 72 SYM (_Global_descriptor_table): 109 SYM(GDT):110 73 SYM(GDT_TABLE): DESC2(0,0,0,0,0,0); 111 74 SYM(GDT_ALIAS): DESC2(32,0x1000,0x0,0x93,0,0x0); … … 122 85 */ 123 86 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 179 88 .section .reset 180 89 181 90 PUBLIC ( SYM(reset) ) 182 SYM(reset): 183 .code16 91 SYM(reset): 184 92 nop 185 93 cli 186 #ifdef NEXT_GAS187 addr32188 #endif189 94 jmp SYM(_initInternalRegisters) /* different section in this file */ 190 95 .code32 /* in case this section moves */ … … 194 99 nop 195 100 nop 196 101 102 103 197 104 .section .initial 198 105 199 106 /* 200 107 * Enable access to peripheral register at expanded I/O addresses … … 220 127 outb al , dx 221 128 222 SYM(Watchdog): 223 SetExRegByte( WDTSTATUS, 0x01 ) # disable watchdog timer 129 SYM(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 224 134 225 135 /* … … 409 319 SetExRegByte(ICW1S , 0x11 ) # EDGE TRIGGERED 410 320 SetExRegByte(ICW2S , 0x28 ) # Slave base vector after Master 411 SetExRegByte(ICW3S , 0x0 4 ) # ( was 0x02! )slave cascaded to IR2 on master321 SetExRegByte(ICW3S , 0x02 ) # slave cascaded to IR2 on master 412 322 SetExRegByte(ICW4S , 0x01 ) # must be 0x01 413 323 414 324 SetExRegByte(ICW1M , 0x11 ) # edge triggered 415 SetExRegByte(ICW2M , 0x20 ) 416 SetExRegByte(ICW3M , 0x0 2 )# IR2 is cascaded internally325 SetExRegByte(ICW2M , 0x20 ) # base vector starts at byte 32 326 SetExRegByte(ICW3M , 0x04) # IR2 is cascaded internally 417 327 SetExRegByte(ICW4M , 0x01 ) # idem 418 328 419 329 SetExRegByte(OCW1M , 0xde ) # IR0 only = 0xfe. for IR5 and IR0 active use 0xde 420 330 SetExRegByte(INTCFG , 0x00 ) 331 332 movw $0xFFFB, SYM(i8259s_cache) /* set up same values in cache */ 421 333 422 334 SYM(SetCS4): … … 431 343 SetExRegWord(UCSMSKH, 0x03F7) 432 344 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 ********************************************************/ 438 350 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): 472 352 movw $ _ram_gdt_offset , di 473 353 movw $ _ram_gdt_segment , cx … … 481 361 repne 482 362 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 483 376 484 377 /***************************** … … 487 380 ****************************/ 488 381 489 movw $ _ram_gdt_segment, ax 490 mov ax , ds 382 /* movw $ _ram_gdt_segment, ax */ 383 491 384 #ifdef NEXT_GAS 492 385 data32 493 386 addr32 494 387 #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 496 391 497 392 498 393 SYM(SetUCS): 499 SetExRegWord(UCSADL, 0x070 4) # now 512K starting at 0x3f80000.394 SetExRegWord(UCSADL, 0x0702) # now 512K starting at 0x3f80000. 500 395 SetExRegWord(UCSADH, 0x03f8) 501 396 SetExRegWord(UCSMSKH, 0x0007) … … 514 409 *********************/ 515 410 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 517 414 /* 518 415 * Copy the data section down to RAM 519 416 */ 520 SYM(_copy_data): 417 /*SYM(_copy_data): */ 418 SYM(_load_segment_registers): 521 419 .code32 522 420 pLOAD_SEGMENT( GDT_DATA_PTR, fs) … … 526 424 pLOAD_SEGMENT( GDT_DATA_PTR, es) 527 425 528 movl $ SYM(_data_start) , edi # ram destination426 /* movl $ SYM(_data_start) , edi # ram destination 529 427 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 533 429 repne # while ecx != 0 534 430 movsb # move a byte 535 431 */ 536 432 /* 537 433 * Set up the stack 538 434 */ 435 436 SYM(lidtr): 437 lidt SYM(IDTR) 539 438 540 439 SYM (_establish_stack): 541 440 movl $end, eax # stack starts right after bss 542 /* movl eax, stack_start # save for brk() routine */543 441 movl $stack_origin, esp # this is the high starting address 544 442 movl $stack_origin, ebp … … 563 461 pushl $0 # argv 564 462 pushl $0 # argc 565 call SYM (main) # does not return 463 call SYM(boot_card) 566 464 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 581 467 582 468 END 469 -
c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
r30ba752 r04bc5d9 21 21 * $Id$ 22 22 */ 23 24 void bsp_clean_up(void); 23 25 24 26 #include <bsp.h> … … 80 82 bsp_libc_init((void *) heap_start, heap_size, 0); 81 83 84 82 85 #ifdef RTEMS_DEBUG 83 86 rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); … … 93 96 void bsp_start( void ) 94 97 { 95 /*96 * we do not use the pretasking_hook.98 /* 99 * we do not use the pretasking_hook. 97 100 */ 98 101 … … 101 104 Cpu_table.interrupt_table_segment = get_ds(); 102 105 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 */ 104 107 105 108 #if defined(RTEMS_POSIX_API) … … 107 110 #endif 108 111 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 *) 110 115 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 111 119 112 120 /* … … 120 128 rtems_irq_mngt_init(); 121 129 } 130 void bsp_clean_up(void) { 131 printk("bsp_cleanup called\n"); 132 } -
c/src/lib/libbsp/i386/i386ex/startup/linkcmds
r30ba752 r04bc5d9 12 12 * 13 13 * $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 ) 14 22 */ 15 16 23 17 24 ENTRY(reset) ; … … 19 26 { 20 27 21 /*******************************************************************************22 * Interrupts section:23 *24 * This section defines the layout of the interrupts in ROM ( VMA ) as well as their25 * location in RAM (LMA). The _rom_ and _ram_ variables are used in start.s26 * in order for the code to move the interrupt vector tables from ROM to RAM27 * while still running in real-mode. The tables are moved from ROM, as the IDT28 * is initialized with only 16-bit offsets for the interrupt handlers.29 * This is purely an implementation issue. If you prefer the interrupt handlers30 * to be resident in flash, then you must provide the code to create the interrupt31 * gates with full 32bit offsets. The code in the current start.s does NOT support32 * 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_ and55 * _ram_ variables are used by start.s to copy the GDT from ROM to RAM when still in56 * real-mode. The move from ROM to RAM is made as a writeable GDT is required for the57 * 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_ and80 * _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 101 28 /**************************************************************************************** 102 29 * data section: 103 30 * 104 31 * 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. 106 34 ***********************************************************************************/ 107 35 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; 109 44 110 45 .data : 111 AT ( _rom_data_start ) 46 AT ( _rom_data_start ) 112 47 { 113 48 _sdata = .; 114 49 *(.data); 115 _edata = ALIGN( 0x10 );50 _edata = .; 116 51 } 117 52 _data_start = ADDR(.data) ; … … 124 59 * The bss section is the last section in RAM. 125 60 *************************************************************************************/ 61 _edata = ALIGN( 0x10 ); 126 62 .bss : 127 63 { … … 144 80 * are complete. 145 81 *************************************************************************************/ 146 stack_size = 0x 1000 ;82 stack_size = 0x8000 ; 147 83 stack_origin = end + stack_size ; 148 84 heap_bottom = stack_origin + 4 ; … … 187 123 * This section is defined after the data section. It must be in the top 64K of memory 188 124 * 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. 190 127 ******************************************************************************************/ 191 128 … … 196 133 197 134 /******************************************************************************************* 198 * reset section:135 * board reset section: 199 136 * 200 137 * This section contains the short jmp from the reset section to the initial section. It is … … 202 139 ******************************************************************************************/ 203 140 204 .reset 141 .reset 0x3fffff0: 205 142 { 206 143 *(.reset);
Note: See TracChangeset
for help on using the changeset viewer.