Re: Problem with: OSPF thru netgraph & Gif Tunnels

2005-04-25 Thread Julian Elischer
Chris Bose wrote:
Hi All,

I’m trying to setup a network between two locations over a WAN and I’m 
running into a wall when I try to get OSPF to talk over my WAN tunnel.  I’ve 
realized that I’m not smart enough and need your help.


The problem is as follows:
My network consists of the following:
Site A connects together with a few quagga routers on freebsd 4.8
Site A:
Router 1: FXP0 (10.1.1.1/24)
Router 1: FXP0 (10.1.2.1/24)
Router 1: FXP0 (10.1.3.1/24)
Router 1: GIF0 (10.1.4.1 -> 10.2.4.1)

Site B connects to site A by using the GIF interface over the public network
"public network" == Internet right?

SiteB:
Router 2: FXP0 (10.2.1.1/24)
Router 2: FXP0 (10.2.2.1/24)
Router 2: FXP0 (10.2.3.1/24)
Router 2: GIF0 (10.2.4.1 -> 10.1.4.1)


I run OSPFv2 (quagga) at Site A and at Site B.  There is no problem 
connecting site A & B together via OSPF over the GIF0 tunnel.  Essential OSPF
 multicasts its route advertisements thru the GIF tunnel to the other side. 
This works fine because the OSPF router and the GIF tunnel are both on the 
same freebsd computer
With such a simple network, why not use static routing?

Now here is what I’m trying to do to setup site C.

At site C  I need to separate this into two computers.  One computer will 
terminate the GIF tunnel and the other computer runs the OSPF router.
why do you "need" to do this?

So the setup between A and B looks like this:

SiteA:Computer 1   SiteB:Computer 2
(OSPF + GIF0) == (GIF0 + OSPF)

And setup between Site B and C looks like this:


SiteB:Computer 2  SiteC:Computer 3  SiteC:computer 4
(OSPF + GIF1) == (GIF1)  -(OSPF)

=== denotes GIF tunnel
--- denotes normal Ethernet connection
Computer 3 has two ethernet interfaces


The problem that I have is I can’t get Computer 4 to communicate to computer 
2 thru the GIF.  The computers can ping each other, but the OSPF multicast 
packets don’t go thru.
do the packets get as far as computer 3?
I'm not an expert in multicast, but what in teh setup makes you think that
the multicast packets SHOULD be sent through the tunnel?
I have tried IPFW fwd commands on computer 3
I'm not sure that forwarding works for non-tcp traffic. Certainly that is
true for local forwarding.

Ifpw fwd computer 2 ip from computer 4 to any

But that didn’t work
I’ve tried Ethernet bridging… but bridging doesn’t work on a Gif interface.
I’ve tried to replace the gif tunnel with Netgraph UDP tunnel, but I can’t 
use that in the bridge either.
Interesting..
You should be able to make it work by using an ng_eiface instead of an ng_iface
node for the tunnel, so that you are tunnelling ethernet packets instead of ip
packets, then on the far end you can feed them straight into the bridge node.
though you don't really understand where bridging comes into it in the first 
place. You have different subnets so you should be routing and not bridging.

I use UDP netgraph tunnels all the time.
sometimes encrypted by using IPSEC on the UDP packets
connecting an iface node to a ksocket(udp) node.
I also sometimes use mpd to encapsulate ppp instead of plain ip,
and use it's udp transport method to do the work (When I want to
bond several links into one tunnel using multilink ppp)
I have NEVER however had experience with multicast and tunnels.

I used the sample in /src/examples/netgraph/bridge.
but you are not using a bridge.. are you?

I have not tried L2TPv3…


So my question is how to get the above configuration working.  I think this 
should be really simple to do, it’s a typical configuration as far as I can 
tell.  Please show your ingenuity with your reply.  I really appreciate it.


I tried to make the example generic without any configuration files because 
there is nothing specific about my configuration.  Please post your own 
configuration for the above if applicable.  You can assume that I have a 
virgin computer and I can configure it any which way I want.  If you need me 
to give you any configuration please let me know.  If you want me to post a 
better network diagram please let me know as well.


Many thanks,
Chris.

__ Do You Yahoo!? Tired of 
spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com 
___ freebsd-hackers@freebsd.org 
mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To 
unsubscribe, send any mail to "[EMAIL PROTECTED]"
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: libthread 1:1 threads

2005-04-25 Thread Kostik Belousov
On Sat, Apr 23, 2005 at 07:30:08AM -0700, David Leimbach wrote:
> On 4/22/05, Lyndon Nerenberg <[EMAIL PROTECTED]> wrote:
> > --On 2005-4-22 3:02 PM -0700 David Leimbach <[EMAIL PROTECTED]> wrote:
> > 
> > > According to the man page, and plan 9 where rfork originated you can
> > > use it to modify an extant process.  In fact you have to set the
> > > RFPROC flag to make a new process or all the changes apply to the
> > > current one.
> > 
> > Unfortunately the semantics of FreeBSD rfork() have diverted far enough
> > from the original plan9 rfork() such that you can't consider it as the
> > same call. This makes life miserable for things like running Inferno on
> > FreeBSD.
> > 
> 
> Yes the latest Inferno snapshot is currently not so happy on FreeBSD. 
> Charles Forsyth is working on getting it going again though [ I
> believe he's a vitanuova employee].

Inferno works ok on 4-STABLE.  For 5-STABLE and 6-CURRENT, see kern/80130.
David Xu already commited fix for 6-CURRENT, I am impatiently waiting for MFC.

Best regards,
Kostik Belousov.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


preadv() / pwritev()

2005-04-25 Thread Marc Olzheim
Are there plans on implementing preadv() and pwritev() ? I kind of miss
the functionality and I saw NetBSD had it already...

Are there any issues with it that I'm not aware of ?

Marc


pgpMrCgB7FChi.pgp
Description: PGP signature


Re: Problem with: OSPF thru netgraph & Gif Tunnels

2005-04-25 Thread Bruce M Simpson
On Sun, Apr 24, 2005 at 10:41:31PM -0700, Chris Bose wrote:
> I?m trying to setup a network between two locations over a WAN and I?m 
> running into a wall when I try to get OSPF to talk over my WAN tunnel.  I?ve 
> realized that I?m not smart enough and need your help.

I haven't looked in depth at the information but it sounds to me as though
the most likely failure mode is that multicast isn't working over the gif
tunnel for whatever reason.

You could try configuring OSPF in NBMA mode over the tunnel, that way OSPF
discovery isn't dependent upon multicasts being forwarded over the tunnel,
but requires you to explicitly specify the OSPF peers at either end.

Regards,
BMS
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: about execute assembly exapmles under freebsd

2005-04-25 Thread Maslan
hey if u need u to use linux calling way u will need to brandelf the
executable (if it's elf)


On 4/24/05, Tetsuji Maverick Rai <[EMAIL PROTECTED]> wrote:
> I refined my code to make the binary shorter.  Your code is in Linux
> system call convention (ie, arguments are in eax,ebx,ecx...), however in
> FreeBSD by default arguments must be pushed in the stack.
> 
> -t.s-
> .section .data
> output:
>.ascii "The processor Vendor ID is ''\n"
> .section .text
> .globl _start
> _start:
>xor %eax, %eax
>cpuid
>mov $output, %edi  # load address of output in edi
>movl %ebx, 28(%edi)
>movl %edx, 32(%edi)
>movl %ecx, 36(%edi)
>pushl $42
>mov $output, %eax
>pushl %eax
>pushl $1
>mov $4,%eax
>push %eax
>int $0x80
>add $16,%esp   # of course you can omit this
>xor %eax,%eax  # this is shorter than "pushl $0; pushl $1; mov
> $1,%eax"
>push %eax
>inc %eax
>push %eax
>int $0x80
> --t.s end--
> 
> and it works like this:
> 
> ---cut-
> freebsd53:~/tmp% as t.s -o t.o
> freebsd53:~/tmp% ld t.o -o t
> freebsd53:~/tmp% ./t
> The processor Vendor ID is 'GenuineIntel'
> ---cut-
> 
> 
> HHCHANG wrote:
> 
> >Hi,
> >I couldn't execute assembly example  under freebsd .
> >The environment and tools I used were (in IBM X31 box):
> >1.
> >bash-2.05b# uname -a
> >FreeBSD sexbear.localhost 5.3-STABLE FreeBSD 5.3-STABLE #3: Sun Feb 20 
> >21:55:06 UTC 2005[EMAIL PROTECTED]:/usr/obj/usr/src/sys/SEXBEAR??i386
> >2.
> >bash-2.05b# as -v
> >GNU assembler version 2.15 [FreeBSD] 2004-05-23 (i386-obrien-freebsd) using 
> >BFD version 2.15 [FreeBSD] 2004-05-23
> >
> >bash-2.05b# ld -v
> >GNU ld version 2.15 [FreeBSD] 2004-05-23
> >
> >3.(compile and execute the example)
> >bash-2.05b#
> >  as -gstabs -o cpuid.o cpuid.s
> >  ld -o cpuid cpuid.o
> >  cpuid (no output after executing the program)
> >  gdb cpuid
> >  (gdb) run
> >  Starting program: /usr/local/src/code/chap04/cpuid
> >  Program exited with code 0340.
> >  (gdb) break *_start
> >  (gdb) run
> >  Program exited with code 0340.
> >###example in book###
> >#cpuid.s Sample program to extract the processor Vendor ID
> >.section .data
> >output:
> >   .ascii "The processor Vendor ID is ''\n"
> >.section .text
> >.globl _start
> >_start:
> >   movl $0, %eax
> >   cpuid
> >   movl $output, %edi
> >   movl %ebx, 28(%edi)
> >   movl %edx, 32(%edi)
> >   movl %ecx, 36(%edi)
> >   movl $4, %eax
> >   movl $1, %ebx
> >   movl $output, %ecx
> >   movl $42, %edx
> >   int $0x80
> >   movl $1,
> >   %eax
> >   movl $0, %ebx
> >   int $0x80
> >
> >###example in book###
> >
> >I viewed the tutorial: http://www.int80h.org/bsdasm/.
> >but I couldn't find any syntax error in the program.
> >Could someone give me a hint where I could find the more information?
> >Thanks~
> >
> >Regards,
> >___
> >freebsd-hackers@freebsd.org mailing list
> >http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> >To unsubscribe, send any mail to "[EMAIL PROTECTED]"
> >
> >
> >
> 
> --
> Tetsuji 'Maverick' Rai
> PGP Key fingerprint = 2021 6BF9 CEA3 73DE FF17  B326 F4DA F04E F784 3B85
> gpg fingerprint
> Aviation Jokes: http://www.geocities.com/tetsuji_rai/
> Profile http://maverick.ns1.name/
> http://maverick.IsASecret.com/
> 
> ___
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
> 


-- 
I'm Searching For Perfection,
So Even If U Need Portability U've To Use Assembly ;-)
http://www.maslanlab.org
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


cvsup hang

2005-04-25 Thread benchmark
Applogies if this isn't the right forum (as indicated in the Doc). my
questions to the [EMAIL PROTECTED] is'nt getting any responses

Basic info: FreeBSD 5.3

I have been trying to use cvsup to sync up my ports, but it seems to
hang everytime, see the following...

rainier# cvsup -L 2 -h cvsup10.FreeBSD.org /root/ports-supfile
Parsing supfile "/root/ports-supfile"
Connecting to cvsup10.FreeBSD.org
Connected to cvsup10.FreeBSD.org
Server software version: SNAP_16_1h
Negotiating file attribute support
Exchanging collection information
Network read failure: Connection timed out

typical port operations such as make install, etc all worked fine.

I suspect that this has something to do with my network, but couldn't
figure out why. I have a DHCP setup, with my box being a dhcp client.
However, i did set up the name of the host as 'rainier'.

rainier# hostname
rainier.sbcglobal.com
rainier# host rainier.sbcglobal.com
Host rainier.sbcglobal.com not found: 3(NXDOMAIN)
rainier#

Any suggestions? (most other network functions work fine, www, ping,
etc, though slow)
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: SIS NIC drivers problem if use "media 100baseTX mediaopt full-duplex"

2005-04-25 Thread Dean Strik
Jason Tsai wrote:
> First sorry for my poor writing engish! I don't know if it's right to
> post in this mailist, but I think it's best place I can ask this kind
> of question.
> 
> I am using FreeBSD 5.4-RC3 now for testing purpose, I find that if I
> use  ifconfig_sis0="inet 10.10.1.148  netmask 255.255.255.0"  in
> /etc/rc.conf, everything goes ok when I am using Jmeter(from Windows
> Box) to load testing tomcat(on FreeBSD 5.4-RC3); but if I change
> ifconfig_sis0  to "inet 10.10.1.148  netmask 255.255.255.0 media
> 100baseTX mediaopt full-duplex", I always got "sis0 watchdog timeout"
> error when I am doing testing. 

Just don't set media and mediaopt. That only works right when both sides
of the link (your freebsd machine and the switch on the other side) are
configured to always use the 100/FD setting.

-- 
Dean C. Strik Eindhoven University of Technology
[EMAIL PROTECTED]  |  [EMAIL PROTECTED]  |  http://www.ipnet6.org/
"This isn't right. This isn't even wrong." -- Wolfgang Pauli
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


C-style expression processing...

2005-04-25 Thread Ron Chen
Hi,

I am trying to add a new feature in Gridengine
(free/opensource) to support ex-LSF users - there are
more and more LSF users migrating to Gridengine), and
some requested this one:

In LSF, a user can specify from the command line the
resource requirements of a batch job:

 (mem >= 100 || pg < 200.0)

Where mem and pg are variables (they changes in time,
and the master cluster scheduler has the most
up-to-date information). And what I need is to find
out whether the expression is true or not.

My question is, is there an expression processing
library that can handle complex equations easily?

 -Ron



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: PXEBOOT/TFTPBOOT + big MD_ROOT problem

2005-04-25 Thread Emmanuel Chriqui
> I'm trying to make very big MD_ROOT (300MB) sent using
> PXEBOOT+TFTPBOOT. No NFS. It's a sort of diskless machine with all the
> system on ram. There is a problem when the preloaded image is >~32MB. 
> Kernel loads but it does not seem to find the files. It seems as if 
> only part of the image is really there. With a "small" image (<~32MB), 
> no probleme. I use the same image, off course, same init etc... just 
> more data for my application in the big image case.
> 
> I use a classic mfs_root approche to make my image
> 
> dd if=/dev/zero of=$MFS_FILE bs=1k count=$SIZE mdconfig -a -t vnode -f 
> $MFS_FILE -u0 bsdlabel -w /dev/md0 newfs /dev/md0a mount /dev/md0a 
> $MFS_FILE_MOUNT cp ... my content...
> umount $MFS_FILE_MOUNT
> fsck -t ufs /dev/md0a
> mdconfig -d -u 0
> 
> then I mount the $MFS_FILE_MOUNT . 
> 
> I use i386/5.4RC2/TFTPD/PXEBOOT+TFTPBOOT . 
> (same pb with a 5.3). 
> 
> Am I missing something obvious? 
> 

It seems not.
There seems to be a size limitation in the loader (and pxeboot since it is
built using loader code).

I've tried loading through pxeboot + TFTP : the tftp pxeboot client is
limited to 32MB unfortunately (BTW : the one of the tftp port works fine). I
tried to use pxeboot + NFS, kernel hangs because of loader limitation (BTW :
you can use only NFS UDP since the pxeboot NFS client don't do TCP which
means booting using this this technique using TFTP is not less reliable than
NFS). I even tried pxegrub, but again it's the loader ...

It seems the only reasonable solution is to make a small jumpstart mfsroot,
make a md device (malloc / ..) with any size you want as long as you have
enough memory (even
1GB+) and then fetch the mfsroot image using tftp/nfs/scp/.. and chroot
to it.

Emmanuel.

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: region code in cdrecord

2005-04-25 Thread Julian H. Stacey
> folks reasons why, but I hope not that often).  Anyhow, the disk is 
> (like I said, but in roundabout fashion I admit) region 2, so suggesting 

As someone said the Region code is in the VOB file:
How about putting your Region 2 DVD media in a FreeBSD box,
using /usr/ports/multimedia/dvdrip to creat a .avi file,
writing that .avi back to a new CDROM or DVD (yes, films 
can squezze onto a 700M CDROM).
Drawbacks:
Not all television DVD players can play .avi, but some can.
With no VOB files, I guess you'll also lose any menu type stuff.

-
Julian StaceyNet & Sys Eng Consultant, Munich   http://berklix.com
Mail in Ascii (Html=Spam).  Ihr Rauch = mein allergischer Kopfschmerz.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: region code in cdrecord

2005-04-25 Thread Julian H. Stacey
> There are so many bad assumptions here!
> 
> bad#2: that ANY of them do.  A very small amount of dvd players have the 
> ability to add patches to them, these all (in every case) need you to 
> run Windows code to get these patches installed, and I don't run 
> Windows, anywhere, anytime.

My DVD Player, (eg external player. Not a computer as such, plugs
into TV), did not require me to run Windows or FreeBSD. I just ran
google, found the unlock code, & typed it in using remote controller.

A DVD drive is another matter, that might need evil MS to zap it.

-
Julian StaceyNet & Sys Eng Consultant, Munich   http://berklix.com
Mail in Ascii (Html=Spam).  Ihr Rauch = mein allergischer Kopfschmerz.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Re: region code in cdrecord

2005-04-25 Thread Sergey Babkin

>(like I said, but in roundabout fashion I admit) region 2, so suggesting 
>that I ignore the region is silly, it's there already.  My dvd (and that 
>of my friend's, I tested) both immediately choke on trying to play this 

Sorry, can't help with your original question,
but I can help with the choice of DVD players.
Phillips makes a good reprogrammable one.
I think the model is called 642 in US and 630
in Europe, I can look at mine (US) at home. Walmart
and Target sell them for shomething like $70. 
Changing the region code is a breese -
you get the tray open, press the "secret" button
sequence and can enter the new code. Setting
the code to 0 would make it region-free and
would play any disks except the very paranoid ones.
For those you can change it back to 1 or 2.

>disk, they don't even open a menu.  I need to change that encoded region 
>value from 2 to 1.  Having software here that coded, say, a null value 

AFAIK it's done in a more interesting way: the
region code on CD is actually a small interpreted
bytecode program that reads the player's configuration
data with the region code in it and decides if it 
wants to play on this player or not.
That's why some disks won't work with the
players having region 0. I'd guess that this
program can be happily amputated altogether.

-SB
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: preadv() / pwritev()

2005-04-25 Thread Bruce M Simpson
On Mon, Apr 25, 2005 at 12:10:08PM +0200, Marc Olzheim wrote:
> Are there plans on implementing preadv() and pwritev() ? I kind of miss
> the functionality and I saw NetBSD had it already...

By the looks of pwrite() and writev() it could probably be implemented
fairly easily; it would largely be a matter of rototiling pwrite() to
accept an array of iovecs, as writev() currently does, as pwrite() already
knows how to pass a single uio/iovec on the stack with the desired start
offset. Looking at the man page for pwritev() it only accepts a start
offset, rather than an individual offset for each scatter/gather element.

I don't do enough thread-based programming at the moment to make this worth
my while, though, but I'm happy to look at a patch.

BMS


pgpClgMnMoRjH.pgp
Description: PGP signature


Re: preadv() / pwritev()

2005-04-25 Thread Marc Olzheim
On Mon, Apr 25, 2005 at 02:50:45PM +0100, Bruce M Simpson wrote:
> I don't do enough thread-based programming at the moment to make this worth
> my while, though, but I'm happy to look at a patch.

Ok, something like this ?
I'm a bit puzzled by the coding style in the file, but I think I got the
spirit of it. ;-)

Possibly more of dofileread() and dopreadv() and their write-cousins
could be merged into each other, but this patch is better readable...

Marc
--- sys/kern/syscalls.masterMon Apr 25 16:56:40 2005
+++ sys/kern/syscalls.masterMon Apr 25 17:05:07 2005
@@ -646,6 +646,10 @@
 454MSTD{ int _umtx_op(struct umtx *umtx, int op, long id, void *uaddr,\
void *uaddr2); }
 455MSTD{ int thr_new(struct thr_param *param, int param_size); }
+456MSTD{ ssize_t preadv(struct thread *td, int fd, struct uio * auio,\
+   u_int iovcnt, off_t offset, int flags); }
+457MSTD{ ssize_t pwritev(struct thread *td, int fd, struct uio * auio,\
+   u_int iovcnt, off_t offset, int flags); }
 
 ; Please copy any additions and changes to the following compatability tables:
 ; sys/compat/freebsd32/syscalls.master
--- sys/compat/freebsd32/syscalls.masterMon Apr 25 16:56:52 2005
+++ sys/compat/freebsd32/syscalls.masterMon Apr 25 17:05:31 2005
@@ -620,3 +620,9 @@
 452UNIMPL  setaudit_addr
 453UNIMPL  auditctl
 454UNIMPL  _umtx_op
+456STD { ssize_t freebsd32_preadv(struct thread *td, int fd,\
+   u_int iovcnt, struct uio * auio, off_t offset, int flags); }
+; XXX note - bigendian is different
+457STD { ssize_t freebsd32_pwritev(struct thread *td, int fd,\
+   u_int iovcnt, struct uio * auio, off_t offset, int flags); }
+; XXX note - bigendian is different
--- sys/kern/sys_generic.c  Mon Apr 25 16:12:58 2005
+++ sys/kern/sys_generic.c  Mon Apr 25 17:19:49 2005
@@ -80,6 +80,8 @@
size_t, off_t, int);
 static int dofilewrite(struct thread *, struct file *, int,
const void *, size_t, off_t, int);
+static int dopreadv(struct thread *, int, struct uio *, off_t, int);
+static int dopwritev(struct thread *, int, struct uio *, off_t, int);
 static voiddoselwakeup(struct selinfo *, int);
 
 /*
@@ -233,9 +235,48 @@
return (error);
 }
 
+/*
+ * Scatter positioned read system call.
+ */
+#ifndef _SYS_SYSPROTO_H_
+struct preadv_args {
+   struct thread   *td;
+   int fd;
+   struct  iovec *iovp;
+   u_int   iovcnt;
+   off_t   offset;
+};
+#endif
+/*
+ * MPSAFE
+ */
+int
+preadv(struct thread *td, struct preadv_args *uap)
+{
+   struct uio *auio;
+   int error;
+
+   error = copyinuio(uap->iovp, uap->iovcnt, &auio);
+   if (error)
+   return (error);
+   error = dopreadv(td, uap->fd, auio, uap->offset, FOF_OFFSET);
+   free(auio, M_IOV);
+   return (error);
+}
+
 int
 kern_readv(struct thread *td, int fd, struct uio *auio)
 {
+   return (preadv(td, fd, auio, (off_t)-1, 0));
+}
+
+static int
+dopreadv(td, fd, auio, offset, flags)
+   struct thread *td;
+   struct uio *auio;
+   int fd, flags;
+   off_t offset;
+{
struct file *fp;
long cnt;
int error;
@@ -253,13 +294,14 @@
return(0);
}
auio->uio_rw = UIO_READ;
+   auio->uio_offset = offset;
auio->uio_td = td;
 #ifdef KTRACE
if (KTRPOINT(td, KTR_GENIO)) 
ktruio = cloneuio(auio);
 #endif
cnt = auio->uio_resid;
-   if ((error = fo_read(fp, auio, td->td_ucred, 0, td))) {
+   if ((error = fo_read(fp, auio, td->td_ucred, flags, td))) {
if (auio->uio_resid != cnt && (error == ERESTART ||
error == EINTR || error == EWOULDBLOCK))
error = 0;
@@ -430,9 +472,48 @@
return (error);
 }
 
+/*
+ * Gather posiotioned write system call
+ */
+#ifndef _SYS_SYSPROTO_H_
+struct pwritev_args {
+   struct thread   *td;
+   int fd;
+   struct  iovec *iovp;
+   u_int   iovcnt;
+   off_t   offset;
+};
+#endif
+/*
+ * MPSAFE
+ */
+int
+pwritev(struct thread *td, struct pwritev_args *uap)
+{
+   struct uio *auio;
+   int error;
+
+   error = copyinuio(uap->iovp, uap->iovcnt, &auio);
+   if (error)
+   return (error);
+   error = dopwritev(td, uap->fd, auio, uap->offset, FOF_OFFSET);
+   free(auio, M_IOV);
+   return (error);
+}
+
 int
 kern_writev(struct thread *td, int fd, struct uio *auio)
 {
+   return (dopwritev(td, fd, auio, (off_t)-1 , 0));
+}
+
+static int
+dopwritev(td, fd, auio, offset, flags)
+   struct thread *td;
+   struct uio *auio;
+   int fd, flags;
+   off_t offset;
+{
struct file *fp;
long cnt;
int error;
@@ -445,6 +526,7 @@
return (EBADF);
auio->uio_rw = UIO_WRITE;
auio->uio_td = td;
+   aui

Re: preadv() / pwritev()

2005-04-25 Thread Marc Olzheim
On Mon, Apr 25, 2005 at 05:23:14PM +0200, Marc Olzheim wrote:
>  int
>  kern_readv(struct thread *td, int fd, struct uio *auio)
>  {
> + return (preadv(td, fd, auio, (off_t)-1, 0));
> +}

->dopreadv()

Hit the send button too quickly, I'll submit a new one after testing.

Marc


pgpoFklMqNhu2.pgp
Description: PGP signature


Re: region code in cdrecord

2005-04-25 Thread David Gilbert
> "Tim" == Tim Kientzle <[EMAIL PROTECTED]> writes:

Tim> I wouldn't "rather", but I think it might be simpler.  I also
Tim> seem to recall hearing about discs whose region-coding was done
Tim> in such a way that they would not play on unlocked players.

Well (to put that to rest), there are two types of region coding in
use on DVDs.  The first is the one we're talking about here ... which
is a code in the files that tells the DVD player which region the disk
is.  Early "unlocked" players were simply patched to accept any
region.

The second type is code in the menu system that queries the region
code and then acts on it.  Early players returned '0' for this
function ... and the disks were coded to not play.

The fix for this was players that you could change the region on
... and "unlocked" players of this type allow you to set the region an
unlimited number of times.  "locked" players usually let you set the
region some small number of times.

Dave.

-- 

|David Gilbert, Independent Contractor.   | Two things can only be |
|Mail:   [EMAIL PROTECTED]|  equal if and only if they |
|http://daveg.ca  |   are precisely opposite.  |
=GLO
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: preadv() / pwritev()

2005-04-25 Thread Marc Olzheim
On Mon, Apr 25, 2005 at 05:23:14PM +0200, Marc Olzheim wrote:
> On Mon, Apr 25, 2005 at 02:50:45PM +0100, Bruce M Simpson wrote:
> > I don't do enough thread-based programming at the moment to make this worth
> > my while, though, but I'm happy to look at a patch.
> 
> Ok, something like this ?
> I'm a bit puzzled by the coding style in the file, but I think I got the
> spirit of it. ;-)

More like this then...

Marc
--- sys/sys/uio.h.orig  Mon Apr 25 18:23:58 2005
+++ sys/sys/uio.h   Mon Apr 25 18:30:54 2005
@@ -101,6 +101,8 @@
 __BEGIN_DECLS
 ssize_treadv(int, const struct iovec *, int);
 ssize_twritev(int, const struct iovec *, int);
+ssize_tpreadv(int, const struct iovec *, int, off_t);
+ssize_tpwritev(int, const struct iovec *, int, off_t);
 __END_DECLS
 
 #endif /* _KERNEL */
--- sys/compat/freebsd32/syscalls.master.orig   Mon Apr 25 16:56:52 2005
+++ sys/compat/freebsd32/syscalls.masterMon Apr 25 18:45:38 2005
@@ -406,8 +406,13 @@
 286UNIMPL  nosys
 287UNIMPL  nosys
 288UNIMPL  nosys
-289UNIMPL  nosys
-290UNIMPL  nosys
+; 289 and 290 from NetBSD (OpenBSD: 267 and 268)
+289STD { ssize_t freebsd32_preadv(int fd, u_int iovcnt,\
+   struct uio * auio, off_t offset); }
+; XXX note - bigendian is different
+290STD { ssize_t freebsd32_pwritev(int fd, u_int iovcnt,\
+   struct uio * auio, off_t offset); }
+; XXX note - bigendian is different
 291UNIMPL  nosys
 292UNIMPL  nosys
 293UNIMPL  nosys
--- sys/kern/syscalls.master.orig   Mon Apr 25 16:56:40 2005
+++ sys/kern/syscalls.masterMon Apr 25 18:45:47 2005
@@ -411,8 +411,11 @@
 286UNIMPL  nosys
 287UNIMPL  nosys
 288UNIMPL  nosys
-289UNIMPL  nosys
-290UNIMPL  nosys
+; 289 and 290 from NetBSD (OpenBSD: 267 and 268)
+289MSTD{ ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt,\
+   off_t offset); }
+290MSTD{ ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt,\
+   off_t offset); }
 291UNIMPL  nosys
 292UNIMPL  nosys
 293UNIMPL  nosys
--- sys/kern/sys_generic.c.orig Mon Apr 25 16:12:58 2005
+++ sys/kern/sys_generic.c  Mon Apr 25 18:32:03 2005
@@ -80,6 +80,8 @@
size_t, off_t, int);
 static int dofilewrite(struct thread *, struct file *, int,
const void *, size_t, off_t, int);
+static int dopreadv(struct thread *, int, struct uio *, off_t, int);
+static int dopwritev(struct thread *, int, struct uio *, off_t, int);
 static voiddoselwakeup(struct selinfo *, int);
 
 /*
@@ -233,9 +235,47 @@
return (error);
 }
 
+/*
+ * Scatter positioned read system call.
+ */
+#ifndef _SYS_SYSPROTO_H_
+struct preadv_args {
+   int fd;
+   struct  iovec *iovp;
+   u_int   iovcnt;
+   off_t   offset;
+};
+#endif
+/*
+ * MPSAFE
+ */
+int
+preadv(struct thread *td, struct preadv_args *uap)
+{
+   struct uio *auio;
+   int error;
+
+   error = copyinuio(uap->iovp, uap->iovcnt, &auio);
+   if (error)
+   return (error);
+   error = dopreadv(td, uap->fd, auio, uap->offset, FOF_OFFSET);
+   free(auio, M_IOV);
+   return (error);
+}
+
 int
 kern_readv(struct thread *td, int fd, struct uio *auio)
 {
+   return (dopreadv(td, fd, auio, (off_t)-1, 0));
+}
+
+static int
+dopreadv(td, fd, auio, offset, flags)
+   struct thread *td;
+   struct uio *auio;
+   int fd, flags;
+   off_t offset;
+{
struct file *fp;
long cnt;
int error;
@@ -253,13 +293,14 @@
return(0);
}
auio->uio_rw = UIO_READ;
+   auio->uio_offset = offset;
auio->uio_td = td;
 #ifdef KTRACE
if (KTRPOINT(td, KTR_GENIO)) 
ktruio = cloneuio(auio);
 #endif
cnt = auio->uio_resid;
-   if ((error = fo_read(fp, auio, td->td_ucred, 0, td))) {
+   if ((error = fo_read(fp, auio, td->td_ucred, flags, td))) {
if (auio->uio_resid != cnt && (error == ERESTART ||
error == EINTR || error == EWOULDBLOCK))
error = 0;
@@ -430,9 +471,47 @@
return (error);
 }
 
+/*
+ * Gather posiotioned write system call
+ */
+#ifndef _SYS_SYSPROTO_H_
+struct pwritev_args {
+   int fd;
+   struct  iovec *iovp;
+   u_int   iovcnt;
+   off_t   offset;
+};
+#endif
+/*
+ * MPSAFE
+ */
+int
+pwritev(struct thread *td, struct pwritev_args *uap)
+{
+   struct uio *auio;
+   int error;
+
+   error = copyinuio(uap->iovp, uap->iovcnt, &auio);
+   if (error)
+   return (error);
+   error = dopwritev(td, uap->fd, auio, uap->offset, FOF_OFFSET);
+   free(auio, M_IOV);
+   return (error);
+}
+
 int
 kern_writev(struct thread *td, int fd, struct uio *auio)
 {
+   return (dopwritev(td, fd, auio, (off_t)-1 , 0));
+}
+
+static int
+dopwritev(td, fd, auio, offset, flags)
+   struct thread *td;

Re: C-style expression processing...

2005-04-25 Thread Divacky Roman
On Sun, Apr 24, 2005 at 10:50:16PM -0700, Ron Chen wrote:
> Hi,
> 
> I am trying to add a new feature in Gridengine
> (free/opensource) to support ex-LSF users - there are
> more and more LSF users migrating to Gridengine), and
> some requested this one:
> 
> In LSF, a user can specify from the command line the
> resource requirements of a batch job:
> 
>  (mem >= 100 || pg < 200.0)
> 
> Where mem and pg are variables (they changes in time,
> and the master cluster scheduler has the most
> up-to-date information). And what I need is to find
> out whether the expression is true or not.
> 
> My question is, is there an expression processing
> library that can handle complex equations easily?

you can easily parse it, using yacc/lex... and even hand-writing such parser
cannot be difficult..
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: preadv() / pwritev()

2005-04-25 Thread Bruce M Simpson
On Mon, Apr 25, 2005 at 06:50:41PM +0200, Marc Olzheim wrote:
> More like this then...

Yep, something like that! Thanks, though I may not have time to commit
this at the moment. :-(

BMS


pgpzcrqJRUpsG.pgp
Description: PGP signature


Re: preadv() / pwritev()

2005-04-25 Thread Marc Olzheim
On Mon, Apr 25, 2005 at 08:29:49PM +0100, Bruce M Simpson wrote:
> > More like this then...
> 
> Yep, something like that! Thanks, though I may not have time to commit
> this at the moment. :-(

Then should I file a PR after someone tells me what kind of naming
scheme they'd rather have than dopreadv() and dopwritev() :-P ? Or
should I combine all of the 4 read functions together (as well as all of
the 4 write functions) ?

The current patch is against 6-CURRENT, but applies almost perfectly
against 5-STABLE as well, and works for me. ;-)

Marc


pgpCBcJPHwAma.pgp
Description: PGP signature


Trouble with 250G SATA drive?

2005-04-25 Thread João Carlos Mendes Luís
Hi all,

I've just bought a Seagate 250G SATA drive to run in a shared
desktop at home.  It should have 3 boot partitions: 16M FreeBSD 5, 16M
linux, 32M NTFS for Windows XP.  The remaining wil be formatted with
FAT32 to be used as a common data for the 3 operating systems.

Well, everything seemed to be fine.  I copied the FreeBSD partition
from the previous installed disk with dump(8), and installed XP from
CDs.  But suddenly, the data and NTFS partitions began to disappear.  I
don't know exactly what were the steps used to crash the disk, but it
happened at least 3 times, after 3 full windows installs (which are not
quick, for my sadness).  In the last one I could almost detect it.

I finished the initial windows instalation, and booted into FreeBSD
to make sure the NTFS and FAT partitions were available.  They seemed to
be.  Then I reboot into windows, and it crashed, with a missing HAL.DLL.
 Boot again into FreeBSD, and the NTFS partition still seemed ok.  But I
gone into the \WINDOWS\system32, and did an ls.  The kernel pushed some
errors with "bad magic" or something like that, and the file system
locked.  Also, the boot information for the first FAT32 partition has
been completely destroyed, leaving it unreadable.

The mainboard is an ASUS K8V, with 1G RAM.  I'm running the 32 bit
version of FreeBSD, although it is an AMD64 machine.  The 250G SATA disk
is on the promise RAID, and I have another PATA 120G on the promise
RAID, and a 40G PATA on standard IDE.

I already had a problem with a previous ASUS board in which the
promise raid could not deal with disks bigger than 120G.  The symptons
were very similar.  Could this be the problem?  Does somebody know if
FreeBSD or mount_ntfs has any kind of disk size limitation in this hardware?

Oh, I did remember now that I was using mount_ntfs -o noatime, if
that matters.

Thanks for any help,

Jonny

PS: Now it has been fully reformatted with no NTFS, using FAT32 instead.
 But I'm afraid of getting into FreeBSD again in this machine.   Please
help!   :-(
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"