Changeset dcbc8be in mainline for arch/ia32/src/boot/boot.S


Ignore:
Timestamp:
2005-06-02T23:56:26Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ac5d02b
Parents:
7dcbc0a1
Message:

Big changes in IA-32 address space map.
Now the kernel is mapped above 0x80000000. Finally!
Userspace address space starts at 0x00000000.
Changes in many places.
This improvement temporarily breaks SMP and most likely also other stuff.
Supported size of memory is now only 4M as it is the biggest size that can be mapped at once on IA-32.

Changes in linker script.
Changes required because of the above.
Do not patch hardcoded_* variables but assign to them instead.

Cosmetic changes here and there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/boot/boot.S

    r7dcbc0a1 rdcbc8be  
    4040#
    4141kernel_image_start:
     42        cli
    4243        call memmap_arch_init
    43         cli
    4444        xorw %ax,%ax
    4545        movw %ax,%ds
     
    6363        lidt idtr
    6464
     65        #
     66        # Here we setup mapping for both the unmapped and mapped sections of the kernel.
     67        # For simplicity, we set only one 4M page for 0x00000000 and one for 0x80000000.
     68        #
     69        movl %cr4, %ecx
     70        orl $(1<<4), %ecx
     71        movl %ecx, %cr4                         # turn PSE on
     72       
     73        movl $((1<<7)|(1<<0)), %eax
     74        movl %eax, page_directory               # mapping 0x00000000 => 0x00000000
     75
     76        movl $(page_directory+(4096/2)), %edx
     77        movl %eax, (%edx)                       # mapping 0x80000000 => 0x00000000
     78
     79        leal page_directory, %eax
     80        movl %eax, %cr3
     81       
     82        # turn on paging
     83        movl %cr0, %ebx
     84        orl $(1<<31), %ebx
     85        movl %ebx, %cr0
     86
     87        movl $_hardcoded_ktext_size, hardcoded_ktext_size
     88        movl $_hardcoded_kdata_size, hardcoded_kdata_size
     89        movl $_hardcoded_load_address, hardcoded_load_address
     90
    6591        call main_bsp                   # never returns
    66        
    6792
    6893        cli
    6994        hlt
     95
     96.section K_DATA_START
     97
     98.align 4096
     99page_directory:
     100        .space 4096, 0
Note: See TracChangeset for help on using the changeset viewer.