Changeset 3c7916f in rtems


Ignore:
Timestamp:
Jun 3, 1998, 7:00:57 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
ea57368
Parents:
937a6f3c
Message:

Update from Pedro Romano <pmcnr@…> with an attempt
to fix start16.s. It does not work locally.

Location:
c/src/lib/libbsp/i386/pc386/start
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/start/Makefile.in

    r937a6f3c r3c7916f  
    6161${ARCH}/start16.o: start16.s
    6262        sed -e 's/\/\/.*$$//' < $< | $(CPP) $(ASMFLAGS) -I. -I$(srcdir) \
    63           -DASM -DSTART32ADDR=$(RELOCADDR) - > $*.i
     63          -DASM -DHEADERADDR=$(HEADERADDR) - > $*.i
    6464        $(AS) $(ASFLAGS) -o $@ $*.i
    6565
  • c/src/lib/libbsp/i386/pc386/start/start16.s

    r937a6f3c r3c7916f  
    11/*-------------------------------------------------------------------------+
    2 | start16hi.s v1.0 - PC386 BSP - 1998/04/13
     2| start16.s v1.0 - PC386 BSP - 1998/04/13
    33+--------------------------------------------------------------------------+
    44| This file contains the entry point for the application.
     
    2828
    2929.set PROT_CODE_SEG, 0x08        # offset of code segment descriptor into GDT
     30.set PROT_DATA_SEG, 0x10        # offset of code segment descriptor into GDT
    3031.set CR0_PE,        1           # protected mode flag on CR0 register
    31 .set START32,       START32ADDR # address of protected mode code
     32.set HDRSTART,      HEADERADDR  # address of start of bin2boot header
     33.set HDROFF,        0x24        # offset into bin2boot header of start32 addr
     34.set STACKOFF,      0x200-0x10  # offset to load into %esp, from start of image
    3235
    3336/*----------------------------------------------------------------------------+
     
    5255.code16
    5356
     57        cli                     # DISABLE INTERRUPTS!!!
     58
     59        movw    %cs, %ax        #
     60        movw    %ax, %ds        # set the rest of real mode registers
     61        movw    %ax, %es        #
     62        movw    %ax, %ss        #
     63
     64.code32
     65
     66        movl    $STACKOFF, %esp # set stack pointer
     67        movl    $STACKOFF, %ebp #
     68
     69.code16
     70
    5471#if defined(RTEMS_VIDEO_80x50)
    5572       
     
    7390#endif /* RTEMS_VIDEO_80x50 */
    7491
    75         cli                     # DISABLE INTERRUPTS!!!
    76 
    7792        /*---------------------------------------------------------------------+
    7893        | Bare PC machines boot in real mode! We have to turn protected mode on.
    7994        +---------------------------------------------------------------------*/
    8095
    81         movl    $gdtptr, %eax
    82         andl    $0x0000ffff, %eax       # get offset into segment
    83         lgdt    %cs:(%eax)              # load Global Descriptor Table
    84         movl    $idtptr, %eax
    85         andl    $0x0000ffff, %eax       # get offset into segment
    86         lidt    %cs:(%eax)              # load Interrupt Descriptor Table
     96        lgdt    gdtptr - start16        # load Global Descriptor Table
     97        lidt    idtptr - start16        # load Interrupt Descriptor Table
    8798       
    8899        movl    %cr0, %eax
    89100        orl     $CR0_PE, %eax
    90101        movl    %eax, %cr0              # turn on protected mode
    91 
    92         ljmp    $PROT_CODE_SEG, $1f     # flush prefetch queue
     102       
     103        ljmp    $PROT_CODE_SEG, $1f     # flush prefetch queue, and reload %cs
    931041:
    94105
    95106.code32
    96107
    97         /*---------------------------------------------------------------------+        | we have to enable A20 in order to access memory above 1MByte
     108        /*---------------------------------------------------------------------+
     109        | load the other segment registers
     110        +---------------------------------------------------------------------*/
     111        movl    $PROT_DATA_SEG, %eax
     112        movl    %ax, %ds
     113        movl    %ax, %es
     114        movl    %ax, %ss
     115        addl    $start16, %esp          # fix up stack pointer
     116        addl    $start16, %ebp          # fix up stack pointer
     117
     118        /*---------------------------------------------------------------------+
     119        | we have to enable A20 in order to access memory above 1MByte
    98120        +---------------------------------------------------------------------*/
    99121        call    empty_8042
     
    105127        call    empty_8042
    106128
    107         ljmp    $PROT_CODE_SEG, $START32        # jump to start of 32 bit code
     129        movl    %cs:HDRSTART + HDROFF, %eax     #
     130        pushl   %eax                            # jump to start of 32 bit code
     131        ret                                     #
    108132
    109133/*----------------------------------------------------------------------------+
Note: See TracChangeset for help on using the changeset viewer.