Changeset 7df54df in mainline


Ignore:
Timestamp:
2005-09-02T14:00:48Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
32f6e1bd
Parents:
73838ed
Message:

Fixed stack settings in boot.S in real mode.
Added ia32 memmap support.
Added cpuid support.

Files:
2 added
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/Makefile.inc

    r73838ed r7df54df  
    3333        arch/mm/tlb.c \
    3434        arch/asm_utils.S \
    35         arch/fmath.c
     35        arch/fmath.c \
     36        arch/mm/memory_init.c
  • arch/amd64/src/amd64.c

    r73838ed r7df54df  
    3939
    4040#include <arch/bios/bios.h>
     41#include <arch/mm/memory_init.h>
    4142
    4243void arch_pre_mm_init(void)
     
    6566        }
    6667}
     68
     69void arch_late_init(void)
     70{
     71        if (config.cpu_active == 1) {
     72                memory_print_map();
     73               
     74                #ifdef __SMP__
     75                acpi_init();
     76                #endif /* __SMP__ */
     77        }
     78}
     79
     80void calibrate_delay_loop(void)
     81{
     82        return;
     83        i8254_calibrate_delay_loop();
     84        i8254_normal_operation();
     85}
  • arch/amd64/src/asm_utils.S

    r73838ed r7df54df  
    4444        movq $halt, (%rsp)
    4545        jmp printf
     46
     47.global has_cpuid
     48.global rdtsc
     49
     50
     51## Determine CPUID support
     52#
     53# Return 0 in EAX if CPUID is not support, 1 if supported.
     54#
     55has_cpuid:
     56        pushq %rbx
     57       
     58        pushfq                  # store flags
     59        popq %rax               # read flags
     60        movq %rax,%rbx          # copy flags
     61        btcl $21,%ebx           # swap the ID bit
     62        pushq %rbx
     63        popfq                   # propagate the change into flags
     64        pushfq
     65        popq %rbx               # read flags   
     66        andl $(1<<21),%eax      # interested only in ID bit
     67        andl $(1<<21),%ebx
     68        xorl %ebx,%eax          # 0 if not supported, 1 if supported
     69       
     70        popq %rbx
     71        ret
     72
     73
     74rdtsc:
     75        xorq %rax,%rax
     76        rdtsc
     77        ret
     78       
    4679
    4780# Push all general purpose registers on stack except %rbp, %rsp
  • arch/amd64/src/boot/boot.S

    r73838ed r7df54df  
    3434
    3535#define START_STACK     0x7c00 
    36 #define START_STACK_64  $0xffffffff80007c00
     36#define START_STACK_64  0xffffffff80007c00
    3737                                       
    3838#
     
    5252        movw %ax,%ds
    5353        movw %ax,%ss            # initialize stack segment register
    54         movl START_STACK,%esp   # initialize stack pointer
     54        movl $(START_STACK),%esp        # initialize stack pointer
    5555       
    56 #       call memmap_arch_init
     56        call memmap_arch_init
    5757       
    5858        movl $0x80000000, %eax 
     
    117117.code64
    118118start64:
    119         movq START_STACK_64, %rsp
     119        movq $(START_STACK_64), %rsp
    120120       
    121121        call main_bsp   # never returns
  • arch/amd64/src/dummy.s

    r73838ed r7df54df  
    3535.global cpu_sleep
    3636.global cpu_print_report
    37 .global arch_late_init
    38 .global calibrate_delay_loop
    3937.global dummy
    40 .global rdtsc
    4138.global reset_TS_flag
    4239.global fpu_init
    4340       
    44 .global memory_print_map
    45 .global get_memory_size
    46 
    47 get_memory_size:
    48         movq $4*1024*1024, %rax
    49         ret
    50 
    51 rdtsc:
    5241before_thread_runs_arch:
    5342userspace:
    54 calibrate_delay_loop:
    5543cpu_identify:
    5644cpu_arch_init:
    5745cpu_sleep:
    5846cpu_print_report:
    59 arch_late_init:
    60 calibrate_delay_loop:
    6147reset_TS_flag:
    6248fpu_init:
    63 memory_print_map:       
    6449       
    6550dummy:
  • src/build.amd64

    r73838ed r7df54df  
    55(cd ../arch/amd64/src;make gencontext;./gencontext)
    66# Create links to ia32 architecture
    7 for a in drivers bios; do
    8   ln -sf ../../ia32/src/$a ../arch/amd64/src/
    9 done
    10 for a in frame.c tlb.c; do
    11   ln -sf ../../../ia32/src/mm/$a ../arch/amd64/src/mm
     7
     8(
     9set -e
     10cd ../arch
     11for a in drivers bios mm/frame.c mm/tlb.c mm/memory_init.c boot/memmap.S; do
     12  echo ln -sf `pwd`/ia32/src/$a amd64/src/$a
     13  ln -sf `pwd`/ia32/src/$a amd64/src/$a
    1214done
    1315
    14 for a in ega.h i8042.h i8259.h i8254.h cpuid.h interrupt.h bios; do
    15   ln -sf ../../ia32/include/$a ../arch/amd64/include/
     16for a in ega.h i8042.h i8259.h i8254.h interrupt.h bios mm/memory_init.h; do
     17  echo ln -sf `pwd`/ia32/include/$a amd64/include/$a
     18  ln -sf `pwd`/ia32/include/$a amd64/include/$a
    1619done
    17 ln -sf ../../../ia32/include/mm/memory_init.h ../arch/amd64/include/mm/
    18 
     20)
    1921make dist-clean ARCH=ia32
    2022make all ARCH=amd64
  • src/main/main.c

    r73838ed r7df54df  
    187187                panic("can't create kinit thread\n");
    188188        thread_ready(t);
    189 
    190189        /*
    191190         * This call to scheduler() will return to kinit,
Note: See TracChangeset for help on using the changeset viewer.