Virtual device driver programming

2006-06-23 Thread Johnny Choque
Hi all, I'm interested in programming a virtual network device driver -Linux concept- on a FreeBSD box. The idea behind of this sort of interface is the following: From the kernel's point of view, a network interface is a software object that can process outgoing packets, and the actual

Re: Virtual device driver programming

2006-06-23 Thread Dmitry Pryanishnikov
Hello! On Fri, 23 Jun 2006, Johnny Choque wrote: I'm interested in programming a virtual network device driver -Linux concept- on a FreeBSD box. The idea behind of this sort of interface is the following: From the kernel's point of view, a network interface is a software object that can

Re: Virtual device driver programming

2006-06-23 Thread Robert Watson
On Fri, 23 Jun 2006, Johnny Choque wrote: I'm interested in programming a virtual network device driver -Linux concept- on a FreeBSD box. The idea behind of this sort of interface is the following: From the kernel's point of view, a network interface is a software object that can process

Simple question about mmap() system call

2006-06-23 Thread Dmitry Pryanishnikov
Hello! I'm writing an utility that should examine some bytes of a large file and modify them - that't all. I've decided to mmap() the file: void *diskp; if ((fd=open(argv[1], O_RDWR)) == -1) err(EX_NOINPUT, Can't open %s for readind and writing, argv[1]); if

Re: Simple question about mmap() system call

2006-06-23 Thread Stanislav Sedov
On Fri, 23 Jun 2006 17:47:57 +0300 (EEST) Dmitry Pryanishnikov [EMAIL PROTECTED] wrote: Hello! I'm writing an utility that should examine some bytes of a large file and modify them - that't all. I've decided to mmap() the file: void *diskp; if ((fd=open(argv[1], O_RDWR)) ==

Buses, devices and modules

2006-06-23 Thread Artem Ignatiev
Hi all, I have a question regarding probe and attach routines. I've got 2 modules: for bus (mybus.ko) and for device (mydev.ko) on that bus. mydev.ko has MODULE_DEPEND(mydev, mybus, 1, 1, 1); When kldloading mydev.ko, mybus.ko is loading automatically, then it founds its device, attaches

Re: Simple question about mmap() system call

2006-06-23 Thread Dan Nelson
In the last episode (Jun 23), Dmitry Pryanishnikov said: I'm writing an utility that should examine some bytes of a large file and modify them - that't all. I've decided to mmap() the file: void *diskp; if ((fd=open(argv[1], O_RDWR)) == -1) err(EX_NOINPUT, Can't open %s

Re: Simple question about mmap() system call

2006-06-23 Thread Dmitry Pryanishnikov
Hello! On Fri, 23 Jun 2006, Konstantin Belousov wrote: if ((diskp=mmap(NULL, 512, PROT_READ | PROT_WRITE, 0, fd, 0)) == MAP_FAILED) err(EX_IOERR, Can't mmap() file); shows actual first byte of my file. But modification doesn't get written back to the disk, file

Re: Virtual device driver programming

2006-06-23 Thread Julian Elischer
Robert Watson wrote: On Fri, 23 Jun 2006, Johnny Choque wrote: I'm interested in programming a virtual network device driver -Linux concept- on a FreeBSD box. The idea behind of this sort of interface is the following: From the kernel's point of view, a network interface is a software

mmap() vs. character special file

2006-06-23 Thread Dmitry Pryanishnikov
Hello! mmap(2) manpage has the following title: NAME mmap -- allocate memory, or map files or devices into memory I'm curious about mmap()ing devices (particularly, HDD slices). The manpage mentions character special files only once: [EINVAL] MAP_ANON has not been

Re: mmap() vs. character special file

2006-06-23 Thread Stanislav Sedov
On Sat, 24 Jun 2006 01:27:05 +0300 (EEST) Dmitry Pryanishnikov [EMAIL PROTECTED] wrote: Hello! mmap(2) manpage has the following title: NAME mmap -- allocate memory, or map files or devices into memory I'm curious about mmap()ing devices (particularly, HDD slices). The manpage