From owner-freebsd-hackers Sat Dec 12 02:55:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA10309 for freebsd-hackers-outgoing; Sat, 12 Dec 1998 02:55:27 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from numeri.campus.luth.se (numeri.campus.luth.se [130.240.197.103]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA10304 for ; Sat, 12 Dec 1998 02:55:25 -0800 (PST) (envelope-from k@numeri.campus.luth.se) Received: from numeri.campus.luth.se (localhost [127.0.0.1]) by numeri.campus.luth.se (8.8.8/8.8.8) with ESMTP id LAA11884; Sat, 12 Dec 1998 11:59:30 +0100 (CET) (envelope-from k@numeri.campus.luth.se) Message-Id: <199812121059.LAA11884@numeri.campus.luth.se> X-Mailer: exmh version 2.0.2 2/24/98 To: hackers@FreeBSD.ORG cc: brodnik@sm.luth.se Subject: Special memory with know phys addr -> kernel virt addr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 12 Dec 1998 11:59:29 +0100 From: Johan Karlsson Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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