killing process from interrupt

2009-04-30 Thread Alexej Sokolov
Hello, I have in my interrupt function the pointer to structure of some process. What is the safe way to kill the process? psignal (p, 9); ? Thanx Alexej ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hac

Intel Pro 82546GB COPPER. Frames reception by disabled interrupts

2009-03-26 Thread Alexej Sokolov
Hello, interrupts disable: E1000_WRITE_REG(&adapter->hw, E1000_IMC, 0x); this clears interrupt mask register. Question: Will network adapter accept incoming frames and transfer them to hast memory by disabled interrupts ? Thenx, Alexej ___ fre

Re: rebuilding libpcap

2009-03-16 Thread Alexej Sokolov
Ohhh... thanks a lot ! I'am jaust about to do it... 2009/3/16 Dan Nelson > In the last episode (Mar 16), Alexej Sokolov said: > > how to correctly rebuild only libpcap from /usr/src/contrib without > > rebuilding the whole world ? I try to do in libpcap some changes,

rebuilding libpcap

2009-03-16 Thread Alexej Sokolov
Hello, how to correctly rebuild only libpcap from /usr/src/contrib without rebuilding the whole world ? I try to do in libpcap some changes, then make; make install in /usr/src/contrib/libpcap, but the changes are not visible by calling changed functions :( What I do wrong ? Thanks, Alexej P.S: %

Re: Problems mapping an vm_object to a process memory space

2009-03-13 Thread Alexej Sokolov
hi , I had a problem with remapping too. Could I see your code? here is my code, that some times on AMD64 runs wrong : http://pastebin.com/m78da0b37 And now I solved the problem with remapping by using /dev/mem device. It has mmap syscal. And it seems to be working without problem. Alexej < 2009

Fwd: write protection by mmap of /dev/mem doesn't work

2009-03-10 Thread Alexej Sokolov
Sorry, it was my mistake ! seg fault was by reading of data. To do this should PROT_READ|PROT_WRITE be setted. Now it works! Alexej -- Forwarded message -- From: Alexej Sokolov Date: 2009/3/10 Subject: write protection by mmap of /dev/mem doesn't work To: freebsd-ha

write protection by mmap of /dev/mem doesn't work

2009-03-10 Thread Alexej Sokolov
hello, How can I mmap some memory regions with PROT_WRITE protection flag ? What i do: /* Open mem device */ if ((devmem_fd = open("/dev/mem", O_RDWR)) == -1){ perror("/dev/mem"); exit (1); } then if I try to mmap some memory region with PROT_READ i

Re: wrong data in remapped buffer

2009-03-10 Thread Alexej Sokolov
2009/3/9 John Baldwin > On Monday 09 March 2009 3:38:55 pm Alexej Sokolov wrote: > > 2009/3/9 John Baldwin > > > > > On Friday 06 March 2009 11:13:38 am Alexej Sokolov wrote: > > > > Hello, > > > > I try to MALLOC a buffer in kern, then remap it

Re: wrong data in remapped buffer

2009-03-09 Thread Alexej Sokolov
2009/3/9 John Baldwin > On Friday 06 March 2009 11:13:38 am Alexej Sokolov wrote: > > Hello, > > I try to MALLOC a buffer in kern, then remap it with vm_map_find(), to > space > > of user process. > > Some times the remapped buffer in user space contain incorrect d

Re: uma_zone

2009-03-08 Thread Alexej Sokolov
2009/3/7 Robert Watson > On Wed, 4 Mar 2009, Alexej Sokolov wrote: > > how can I get the size and pointer of some allocated uma zone ? For >> example: zone_pack >> > > Could you tell us a bit more about the context in which you want to do > this? Interrupt kontex

wrong data in remapped buffer

2009-03-06 Thread Alexej Sokolov
Hello, I try to MALLOC a buffer in kern, then remap it with vm_map_find(), to space of user process. Some times the remapped buffer in user space contain incorrect data. What could be a reason of this problem and how to solve it ? Thanx, Alexej P.S. Whole code of remapping function: http://past

uma_zone

2009-03-04 Thread Alexej Sokolov
how can I get the size and pointer of some allocated uma zone ? For example: zone_pack Thanx Alexej ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-

bus_setup_intr (9)

2009-02-12 Thread Alexej Sokolov
hello, from man: int bus_setup_intr(device_t dev, struct resource *r, int flags, driver_filter_t filter, driver_intr_t ithread, void *arg, void **cookiep); The function filter returns value of type driver_filter_t (int). This function will run if interrupt happen. Questio

Re: strange output in /var/log/messages

2009-02-12 Thread Alexej Sokolov
2009/2/12 Stefan Lambrev > Hi, > On Feb 12, 2009, at 6:57 PM, Alexej Sokolov wrote: > > Hello, > I try now to debug a kernel module and I make some output with printf(9). > But the text appears in /var/log/messages in very strange form: > > Feb 12 17:54:34 myhost ker

strange output in /var/log/messages

2009-02-12 Thread Alexej Sokolov
Hello, I try now to debug a kernel module and I make some output with printf(9). But the text appears in /var/log/messages in very strange form: Feb 12 17:54:34 myhost kernel: b Feb 12 17:54:34 myhost kernel: eg Feb 12 17:54:34 myhost kernel: in Feb 12 17:54:34 myhost kernel: . Feb 12 17:54:34 myh

taskqueue (9)

2009-02-10 Thread Alexej Sokolov
Hello, the structure task(9) contain field ta_priority. Which role plays this priority if the task will wake up for run. Or it is used only for order of task in waitqueue while pending ? Thanks Alexej ___ freebsd-hackers@freebsd.org mailing list http://

Re: bus_dma (9). What exactly means "Loading of memory allocation" ?

2009-02-02 Thread Alexej Sokolov
Hi, thanx for your answer. I checked the source code of the *dma() functions. If I understand it correctly, "loading of memory allocation" means the following: 1. At first memory allocation should be done: bufp = *alloc(sizeof ) 2. then in ... _bus_dmamap_load_buffer() we get physical addres

bus_dma (9). What exactly means "Loading of memory allocation" ?

2009-02-01 Thread Alexej Sokolov
Hi, at first the cut of text from man (9) bus_dma: bus_dmamap_t A machine-dependent opaque type describing an individual mapping. One map is used for each memory allocation that will be loaded. Maps can be reused once they have been unloaded... Question: What

Re: KLD: program.ko: depends of kernel - no avaiable

2009-01-28 Thread Alexej Sokolov
//lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org" -- Alexej Sokolov ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-

Re: How to access kernel memory from user space

2009-01-16 Thread Alexej Sokolov
On Thu, Jan 15, 2009 at 01:22:18PM -0600, Gerry Weaver wrote: > _ > > From: Alexej Sokolov [mailto:bsd.qu...@googlemail.com] > To: Gerry Weaver [mailto:ger...@compvia.com] > Cc: freebsd-hackers@freebsd.org > Sent: Thu, 15 Jan 2009 12:31:00 -0600 > Subject: Re: How to

Re: How to access kernel memory from user space

2009-01-15 Thread Alexej Sokolov
2008/12/23 Gerry Weaver > Hello All, > > I am working on a driver that collects various network statistics via pfil. > I have a simple array of structures that I use to store the statistics. I > also have a user space process that needs to collect these statistics every > second or so. A copy ope

Re: panic by unlocking of mutex in KLD

2009-01-12 Thread Alexej Sokolov
2009/1/12 Mateusz Guzik > On Mon, Jan 12, 2009 at 07:16:51PM +0100, Alexej Sokolov wrote: > > 2009/1/12 Mateusz Guzik > > > > > On Mon, Jan 12, 2009 at 05:19:56PM +0100, Alexej Sokolov wrote: > > > > 2009/1/12 Mateusz Guzik > > > > > Mutexes

Re: panic by unlocking of mutex in KLD

2009-01-12 Thread Alexej Sokolov
2009/1/12 Mateusz Guzik > On Mon, Jan 12, 2009 at 07:16:51PM +0100, Alexej Sokolov wrote: > > 2009/1/12 Mateusz Guzik > > > > > On Mon, Jan 12, 2009 at 05:19:56PM +0100, Alexej Sokolov wrote: > > > > 2009/1/12 Mateusz Guzik > > > > > Mutexes

Re: panic by unlocking of mutex in KLD

2009-01-12 Thread Alexej Sokolov
2009/1/12 Mateusz Guzik > On Mon, Jan 12, 2009 at 05:19:56PM +0100, Alexej Sokolov wrote: > > 2009/1/12 Mateusz Guzik > > > Mutexes have owners. It panics on loading because processes cannot > > > return to userland with locks held. > > > > i am not sure

Re: panic by unlocking of mutex in KLD

2009-01-12 Thread Alexej Sokolov
2009/1/12 Mateusz Guzik > On Mon, Jan 12, 2009 at 02:47:26PM +0100, Alexej Sokolov wrote: > > Hello, > > > > by unloading of folowing module I have kernel panic. > > > > I would like to get any explanation about my mistake. > > > > #incl

panic by unlocking of mutex in KLD

2009-01-12 Thread Alexej Sokolov
default: error = EOPNOTSUPP; break; } return (error); } /* Module structure */ static moduledata_t mod_data = { "mymod", load, NULL }; MODULE_VERSION (kld, 1); DECLARE_MODULE (kld, mo

vm_map (9) + MAP_PREFAULT and MAP_PREFAULT_PARTIAL

2008-12-09 Thread Alexej Sokolov
Hello, could anyone explain what exactly do the cow-flags MAP_PREFAULT_PARTIAL, MAP_PREFAULT. I couldn't understand it from man pages and from source code. It's mean that the pages will be wired ? Thanks, -- Alexej Sokolov <[EM

Re: kernel vm_submap's

2008-12-04 Thread Alexej Sokolov
2008/12/4 pluknet <[EMAIL PROTECTED]> > 2008/12/4 Alexej Sokolov <[EMAIL PROTECTED]>: > > Hello, > > Where/How can I get information about vm_submap's in the actual stable > > kernel: > > % uname -v > > FreeBSD 7.0-RELEASE-p5 #0: Tue Oct 7 19:05

kernel vm_submap's

2008-12-04 Thread Alexej Sokolov
Hello, Where/How can I get information about vm_submap's in the actual stable kernel: % uname -v FreeBSD 7.0-RELEASE-p5 #0: Tue Oct 7 19:05:20 CEST 2008 And what kind of data is present in these submaps (mallocs, mbufs, DMA-buffer..)? Thanks, ___ freebs

Re: vm_map_entry for kernel virtual addres

2008-12-04 Thread Alexej Sokolov
2008/12/3 Mark Tinguely <[EMAIL PROTECTED]> > > 2008/12/3 Mark Tinguely <[EMAIL PROTECTED]> > > > > > on 3 Dec 2008 15:35:27, Alexej Sokolov <[EMAIL PROTECTED]> > asked: > > > > > > > Hello, > > > > If I allocate

vm_map_entry for kernel virtual addres

2008-12-03 Thread Alexej Sokolov
Hello, If I allocate memory from a kernel module: MALLOC(addr, vm_offset_t, PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); how can I get a pointer to vm_map_entry structure which describes the memory region where "addr" is ? Thanks, Alexey ___ freebsd-hackers

getting vm_object from allocated memory in kernel

2008-12-01 Thread Alexej Sokolov
Hello, I try to allocate a memory in the system call and then I would like to get vm_object of allocated space to remap it later: /* Syscall func */ static int syscf(struct thread *td, void *sa) { ... vm_offset_t addr; ... MALLOC(addr, vm_offset_t, PAGE_SIZE, M_DEVBUF, M_WAITOK | M

Re: remapping kernel buffer in VMS of user process

2008-12-01 Thread Alexej Sokolov
On Mon, Dec 01, 2008 at 10:12:09AM -0500, Alexander Kabaev wrote: > On Mon, 1 Dec 2008 02:38:51 +0100 > Alexej Sokolov <[EMAIL PROTECTED]> wrote: > > > Hello, > > > > I would like to remap some buffers allocated in kernel space to memory > > space of certa

remapping kernel buffer in VMS of user process

2008-11-30 Thread Alexej Sokolov
using its kernel virtual addresses (bufp) */ ... } -- Alexej Sokolov <[EMAIL PROTECTED]> ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, s

Re: copy, copyin, copyout

2008-11-25 Thread Alexej Sokolov
On Tue, Nov 25, 2008 at 06:55:21PM +0100, Max Laier wrote: > On Tuesday 25 November 2008 18:37:50 Alexej Sokolov wrote: > > Hello, > > could anyone please explain to me the difference between functions: > > copystr() and copyinstr() ? > > > > For i386 copyinstr i

copy, copyin, copyout

2008-11-25 Thread Alexej Sokolov
() I could copy data between user and kernel memory. copystr() seemed to be able to do the same what copyinstr do. % uname -rp 7.0-RELEASE-p5 i386 -- Alexej Sokolov <[EMAIL PROTECTED]> ___ freebsd-hackers@freebsd.org mailing list http://lists.freeb

Re: Ответ: KLD loading, liking

2008-11-18 Thread Alexej Sokolov
2. Attacking FreeBSD with Kernel Modules: http://packetstormsecurity.org/papers/unix/bsdkern.htm > > -- > Ed Schouten <[EMAIL PROTECTED]> > WWW: http://80386.nl/ -- Alexej Sokolov <[EMAIL PROTECTED]> ___ freebsd-hackers@freebsd

Re: KLD loading, liking

2008-11-17 Thread Alexej Sokolov
On Sun, Nov 16, 2008 at 11:09:00AM +0100, Ed Schouten wrote: > * Alexej Sokolov <[EMAIL PROTECTED]> wrote: > > What exact does the macro MODULE_DEPEND ? The man page is to short, and I > > guess it tell no all things that the macro does. > > MODULE_DEPEND is used to s

Re: vm_map_find

2008-11-15 Thread Alexej Sokolov
On Sat, Nov 15, 2008 at 11:10:25PM -0500, Robert Noland wrote: > On Sun, 2008-11-16 at 04:42 +0059, Alexej Sokolov wrote: > > Hello, > > my question is about vm_map_find (9) > > int > > vm_map_find(vm_map_t map, vm_object_t object, vm_ooffset_t offset, > >

Make files for /usr/src/sys/dev/*

2008-11-15 Thread Alexej Sokolov
hello, where are the Makefiles for drivers in /usr/src/dev/* % uname -v FreeBSD 7.0-RELEASE-p5 Thanks ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECT

vm_map_find

2008-11-15 Thread Alexej Sokolov
Hello, my question is about vm_map_find (9) int vm_map_find(vm_map_t map, vm_object_t object, vm_ooffset_t offset, vm_offset_t *addr, vm_size_t length, boolean_t find_space, vm_prot_t prot, vm_prot_t max, int cow); Could anyone explain what exactly parameter "cow" for ? Which v

KLD loading, liking

2008-11-15 Thread Alexej Sokolov
Hello, i am looking for some infos (may be papers) about how KLD linker works. After kompiling the KLD contain two important sections: % readelf -S mymod.ko | grep set [ 7] set_sysinit_set PROGBITS0560 000560 04 00 A 0 0 4 [ 8] set_modmetadata_s PROGBITS0564 00056