Changeset dcbc8be in mainline for arch/ia32/src/mm/page.c


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/mm/page.c

    r7dcbc0a1 rdcbc8be  
    5454
    5555        if (config.cpu_active == 1) {
    56                 dba = frame_alloc(FRAME_KA | FRAME_PANIC);
     56                dba = KA2PA(frame_alloc(FRAME_KA | FRAME_PANIC));
    5757                memsetb(dba, PAGE_SIZE, 0);
    58                 cpu_write_dba(dba);
    5958           
    6059                bootstrap_dba = dba;
     
    6261                /*
    6362                 * Identity mapping for all but 0th page.
     63                 * PA2KA(identity) mapping for all but 0th page.
    6464                 */
    65                 for (i = 1; i < frames; i++)
     65                for (i = 1; i < frames; i++) {
    6666                        map_page_to_frame(i * PAGE_SIZE, i * PAGE_SIZE, PAGE_CACHEABLE, 0);
     67                        map_page_to_frame(PA2KA(i * PAGE_SIZE), i * PAGE_SIZE, PAGE_CACHEABLE, 0);                     
     68                }
    6769
    6870                trap_register(14, page_fault);
     71                cpu_write_dba(dba);             
    6972        }
    7073        else {
     
    105108        int pde, pte;
    106109
    107         dba = cpu_read_dba();
     110//      TODO: map_page_to_frame should take dba as a parameter
     111//      dba = cpu_read_dba();
     112        dba = bootstrap_dba;
    108113
    109114        pde = page >> 22;               /* page directory entry */
     
    117122                 * frame for the page table and clean it.
    118123                 */
    119                 newpt = frame_alloc(FRAME_KA);
     124                newpt = KA2PA(frame_alloc(FRAME_KA));
    120125                pd[pde].frame_address = newpt >> 12;
    121126                memsetb(newpt, PAGE_SIZE, 0);
     
    124129        }
    125130        if (copy) {
    126                 newpt = frame_alloc(FRAME_KA);
     131                newpt = KA2PA(frame_alloc(FRAME_KA));
    127132                memcopy(pd[pde].frame_address << 12, newpt, PAGE_SIZE);
    128133                pd[pde].frame_address = newpt >> 12;
Note: See TracChangeset for help on using the changeset viewer.