Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Dec 1998 11:59:29 +0100
From:      Johan Karlsson <k@numeri.campus.luth.se>
To:        hackers@FreeBSD.ORG
Cc:        brodnik@sm.luth.se
Subject:   Special memory with know phys addr -> kernel virt addr
Message-ID:  <199812121059.LAA11884@numeri.campus.luth.se>

next in thread | raw e-mail | index | archive | help
Hi


I have a special memory, which I try to access using 
3.0-current as of 981113, located at physical address from 
my_mem_phys_start_addr to my_mem_phys_start_addr.

During the memory scan loop in i386/i386/machdep.c:init386 this memory is 
marked as bad and will therefor not be used by the VM.

Now I want to be able to use this memory in the kernel.

This is how I try to do it
==============

    phys_size = my_mem_phys_end_addr - my_mem_phys_start_addr;  
    /*
     * Allocate a submap in the kernel virtual memory map
     */
    my_mem_kernel_submap =
      kmem_suballoc(kernel_map,
		    &my_mem_kernel_submap_min,
		    &my_mem_kernel_submap_max,
		    phys_size);
    /*
     * Map phys pages into submap
     */
    my_mem_virtual_base = my_mem_kernel_submap_min;
    my_mem_virtual_top =
      pmap_map(my_mem_virtual_base,
	       my_mem_phys_start_addr,
	       my_mem_phys_end_addr,
	       VM_PROT_READ | VM_PROT_WRITE);

===========

The function with this code is runned by 
SYSINIT(my_mem, SI_SUB_DRIVERS, SI_ORDER_FIRST, my_mem_init, NULL)


When I reboot my machine with my new kernel it panic printing
"kmem_suballoc: unable to change range to submap"
which is found in vm/vm_kern.c:kmem_suballoc.


I used 2.2.x before but I had to move to 3.0 since I needed some other 
functions. When I did the same thing in 2.2.x no panic occured.

Is there somthing wrong with the way I try to do this?
or is there a known problem with kmem_suballoc ?

Thanks for any help with my problem.

/Johan K

-- 
Johan Karlsson		mailto:k@numeri.campus.luth.se
SWEDEN



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812121059.LAA11884>