Re: bin/27205: Listing all users in the passwd file

2001-05-09 Thread Jamie Heckford

Good points, glad to see the usual FreeBSD approach of allowing
only the best into the code ;)

Some sort of wrapper makes perfect sense for the sendmail option -
I did think of this, but your right, it is best to assume the
"user-friendly" approach
and not give users tweaking to do out of the box.

Could be a possibilty of adding it as a switch / option to pw(8), with
NIS capabilities? (Rewritten in C of course) Would this be deemed useful
and anyone happy to review a patch?

Jamie

On 2001.05.09 08:30 Sean Winn wrote:
> At 04:32  8/05/01 +0100, you wrote:
> 
> > >Number: 27205
> > >Category:   bin
> > >Synopsis:   Listing all users in the passwd file
> > >Confidential:   no
> > >Severity:   non-critical
> > >Priority:   low
> > >Responsible:freebsd-bugs
> > >State:  open
> > >Quarter:
> > >Keywords:
> > >Date-Required:
> > >Class:  change-request
> > >Submitter-Id:   current-users
> > >Arrival-Date:   Tue May 08 08:40:00 PDT 2001
> > >Closed-Date:
> > >Last-Modified:
> > >Originator: Jamie Heckford
> > >Release:FreeBSD 4.2-STABLE i386
> > >Organization:
> >Psi-Domain Limited
> > >Environment:
> >
> >FreeBSD storm.psi-domain.co.uk 4.2-STABLE FreeBSD 4.2-STABLE #2: Fri 
> >Mar  2 10:32:25 GMT 2001
> >
> > >Description:
> >
> >I was recently trying to discover a way of getting a list of all users
> on
> >one of my systems, and could not find an easy way to do it.
> >
> >I discovered the following awk script that prints out all users on the
> system
> >(from /etc/passwd). (Courtesy of sendmail.org)
> >
> >awk -F: '$3 > 100 { print $1 }' /etc/passwd
> >
> >Which will print out a list of all users in the passwd file wuth a UID
> greater
> >than 100.
> >
> >Could this be turned into a command such as "userlist", and/or would it
> be
> >deemed usefull?
> 
> Not particularly, as it doesn't work with NIS, and won't work with 
> nsswitch.conf.
> 
> A small perl script or C program using getpwent() in a loop is more 
> effective, as it takes into account both NIS and nsswitch.conf
> 
> 
> 
> 
> >Another good feature that many people get stuck on is for sending email
> to
> >all users on the system. Maybe it could be included as part of the
> sendmail
> >distro, with something like:
> >
> >awk -F: '$3 > 100 { print $1 }' /etc/passwd > /etc/mail/allusers
> 
> Note: it also picks up 'nobody'
> 
> >and put in cron.daily.
> >
> >This could then be a default in /etc/mail/aliases:
> >
> >allusers:   :include:/etc/mail/allusers
> >
> >What do you think? :)
> 
> Sure. Give spammers one address to email *everyone* on your system in one
> 
> fell swoop...
> 
> In itself, it's a bad default; I'd use a small script that actually
> checks 
> the source address (yes, easily forged, but rarely done on incoming spam)
> 
> before sending out the email to all users.
> 
> In fact, that's what I do...
> 
> (http://www.gothic.net.au/dist/allusers.c)
> 
> The domain and group are hardcoded, but easy enough to change.
> 
> >Jamie
> >
> >
> > >How-To-Repeat:
> >
> >userlist
> >
> >
> >awk -F: '$3 > 100 { print $1 }' /etc/passwd
> >
> >Sendmail
> >---
> >
> >awk -F: '$3 > 100 { print $1 }' /etc/passwd > /etc/mail/allusers
> >echo "allusers:   :include:/etc/mail/allusers" >> /etc/aliases ;
> newaliases
> >echo "#\!/bin/sh" > /etc/periodic/daily/350.allusers
> >echo "awk -F: '$3 > 100 { print $1 }' /etc/passwd > /etc/mail/allusers"
> >> 
> >/etc/periodic/daily/350.allusers
> >chmod 0755 /etc/periodic/daily/350.allusers
> >
> > >Fix:
> >
> >Tested the above and worked fine, just need someone to tell me its great
> >or completly useless! :)
> >
> > >Release-Note:
> > >Audit-Trail:
> > >Unformatted:
> >
> >To Unsubscribe: send mail to [EMAIL PROTECTED]
> >with "unsubscribe freebsd-bugs" in the body of the message
> 
> 
> 
-- 
Jamie Heckford
Network Operations Manager
Psi-Domain - Innovative Linux Solutions. Ask Us How.

FreeBSD - The power to serve

Join our mailing list and stay informed by emailing
[EMAIL PROTECTED] with the line:
subscribe collective

=
email:  [EMAIL PROTECTED]
web:http://www.psi-domain.co.uk/

tel:+44 (0)1737 789 246
fax:+44 (0)1737 789 245
mobile: +44 (0)7866 724 224 

=


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: bin/27205: Listing all users in the passwd file

2001-05-09 Thread Peter Pentchev

I'd think id(1) would be a more proper place, as it already knows how to
format various passwd(5) and group(5) information.

How about the attached patch?  (and I'm probably starting another of those
bikesheds as to whether new options should be added to existing utilities..)

G'luck,
Peter

-- 
This sentence contains exactly threee erors.

On Wed, May 09, 2001 at 10:56:12AM +0100, Jamie Heckford wrote:
> Good points, glad to see the usual FreeBSD approach of allowing
> only the best into the code ;)
> 
> Some sort of wrapper makes perfect sense for the sendmail option -
> I did think of this, but your right, it is best to assume the
> "user-friendly" approach
> and not give users tweaking to do out of the box.
> 
> Could be a possibilty of adding it as a switch / option to pw(8), with
> NIS capabilities? (Rewritten in C of course) Would this be deemed useful
> and anyone happy to review a patch?
[snip]
> > >
> > >I discovered the following awk script that prints out all users on the
> > system
> > >(from /etc/passwd). (Courtesy of sendmail.org)
> > >
> > >awk -F: '$3 > 100 { print $1 }' /etc/passwd
> > >
> > >Which will print out a list of all users in the passwd file wuth a UID
> > greater
> > >than 100.
> > >
> > >Could this be turned into a command such as "userlist", and/or would it
> > be
> > >deemed usefull?
> > 
> > Not particularly, as it doesn't work with NIS, and won't work with 
> > nsswitch.conf.
> > 
> > A small perl script or C program using getpwent() in a loop is more 
> > effective, as it takes into account both NIS and nsswitch.conf

Index: src/usr.bin/id/id.1
===
RCS file: /home/ncvs/src/usr.bin/id/id.1,v
retrieving revision 1.9
diff -u -r1.9 id.1
--- src/usr.bin/id/id.1 2000/11/20 19:20:48 1.9
+++ src/usr.bin/id/id.1 2001/05/09 14:33:53
@@ -43,21 +43,28 @@
 .Nd return user identity
 .Sh SYNOPSIS
 .Nm
+.Op Fl a
 .Op Ar user
 .Nm
-.Fl G Op Fl n
+.Fl G Op Fl an
 .Op Ar user
 .Nm
 .Fl P
+.Op Fl a
 .Op Ar user
 .Nm
-.Fl g Op Fl nr
+.Fl g
+.Op Fl a | Fl r
+.Op Fl n
 .Op Ar user
 .Nm
 .Fl p
+.Op Fl a
 .Op Ar user
 .Nm
-.Fl u Op Fl nr
+.Fl u
+.Op Fl a | Fl r
+.Op Fl n
 .Op Ar user
 .Sh DESCRIPTION
 The
@@ -80,6 +87,10 @@
 as white-space separated numbers, in no particular order.
 .It Fl P
 Display the id as a password file entry.
+.It Fl a
+Display information about all system users, not just about the calling process.
+This flag cannot be used together with
+.Fl r .
 .It Fl g
 Display the effective group ID as a number.
 .It Fl n
@@ -118,6 +129,8 @@
 and
 .Fl u
 options instead of the effective ID.
+This flag cannot be used together with
+.Fl a .
 .It Fl u
 Display the effective user ID as a number.
 .El
Index: src/usr.bin/id/id.c
===
RCS file: /home/ncvs/src/usr.bin/id/id.c,v
retrieving revision 1.12
diff -u -r1.12 id.c
--- src/usr.bin/id/id.c 1999/09/06 20:07:12 1.12
+++ src/usr.bin/id/id.c 2001/05/09 14:33:53
@@ -55,6 +55,9 @@
 #include 
 #include 
 
+intGflag, Pflag, aflag, gflag, id, nflag, pflag, rflag, uflag;
+
+intid_doit __P((struct passwd *));
 void   current __P((void));
 void   pline __P((struct passwd *));
 void   pretty __P((struct passwd *));
@@ -69,12 +72,10 @@
int argc;
char *argv[];
 {
-   struct group *gr;
struct passwd *pw;
-   int Gflag, Pflag, ch, gflag, id, nflag, pflag, rflag, uflag;
+   int ch;
 
-   Gflag = Pflag = gflag = nflag = pflag = rflag = uflag = 0;
-   while ((ch = getopt(argc, argv, "PGgnpru")) != -1)
+   while ((ch = getopt(argc, argv, "PGagnpru")) != -1)
switch(ch) {
case 'G':
Gflag = 1;
@@ -82,6 +83,9 @@
case 'P':
Pflag = 1;
break;
+   case 'a':
+   aflag = 1;
+   break;
case 'g':
gflag = 1;
break;
@@ -104,6 +108,9 @@
argc -= optind;
argv += optind;
 
+   if (aflag && (rflag || (argc != 0)))
+   usage();
+
switch(Gflag + Pflag + gflag + pflag + uflag) {
case 1:
break;
@@ -115,7 +122,20 @@
usage();
}
 
-   pw = *argv ? who(*argv) : NULL;
+   if (!aflag) {
+   pw = *argv ? who(*argv) : NULL;
+   id_doit(pw);
+   } else {
+   while ((pw = getpwent()) != NULL)
+   id_doit(pw);
+   }
+}
+
+int
+id_doit(pw)
+   struct passwd *pw;
+{
+   struct group *gr;
 
if (gflag) {
id = pw ? pw->pw_gid : rflag ? getgid() : getegid();
@@ -123,7 +143,7 @@
(void)printf("%s\n", gr->gr_name);
else
(void)printf("%u\n", id);
-   exit(0);
+   return (0);
}
 
if (uflag) 

FreeBSD ld.so performance ?

2001-05-09 Thread Arun Sharma

http://www.suse.de/~bastian/Export/linking.txt

Has anyone done a comparative study ?

-Arun

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



No Subject

2001-05-09 Thread Ryan Dewalt

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

(I attempted to post this to freebsd-hackers once before, but for
some reason, my attempt hadn't made it to the list, so I swapped to a
different e-mail account and posted this once again.)

I've recently reverse engineered a small piece of hardware, The
'Microsoft Sidewinder Strategic Commander" (MSSC hereafter).  
Official page: 
http://www.microsoft.com/products/hardware/sidewinder/devices/SComm/ 
I've done some cursory searching and found no information on this
device under FreeBSD, so in the spirit of hacking, I wrote my own. 
And have fleshed out how to use it for an input device on FreeBSD. 
(The MSSC is a 'game device' designed for the left hand with Real
Time Strategy games in mind.  X/Y/Rotate, plus 12 individual buttons
and a 3pos slider.) I've gone as far as to cobble together a
'Frankenstein' version of 'moused' and it works just fine. I have
been using it as a left handed mouse on my one machine for about
three days now.

Since I don't exactly have immediate usage for the device, and using
it as a mouse is not the most optimal. (X only supports buttons 1-5
out of the 12 of the device, plus the granularity of the device is
not that great for fine work.  It was meant to be a game controller
after all.) I'd like to release my code to the public for comments,
and perhaps someone else can find use of my work.  BUT, given the way
the world has appeared to be to me, with legal battles and wars over
intellectual properties I'm coming to this list for advice before
releasing anything.  However this device might have alot of potential
for an input device for some other project.

1: Legally 'Covering My Fannie'.  Speaking of Microsoft and Reverse
Engineering is often done with the same care as someone handling a
crystal-meth addicted rampaging bull.  For personal reasons I do not
wish to wander over to the Dark Side of the Force, and release the
specifications knowingly stepping on potential legal toes.  As I said
above, I didn't need any unusual methods to RE the device, very
'clean room' as it were.  The machine that I did all the work on is a
dedicated FreeBSD computer, the Official Drivers were/are not even
installed in any of the computers under my control during the whole
time.  That, coupled with the nature of USB making it almost trivial
to RE a gamepad, it was not a particularly hard task for me.

2: Should I release the code that is wholly my own under the BSD
license?  Its experimental and practically useless as anything other
than experiment/demonstration.  The msscd program is a hack. A very
ugly hack, but it works.  However it was created by taking a chainsaw
to moused and removing what I didn't need... That in and of itself
has other issues as well.

Can I release my findings without having the business end of a lawyer
pointed at me?

 As you can probably guess, this is my first real attempt at this.

- -Ryan

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBOvleAcMKzu1ijLJKEQItbwCfbSi0/m+JkAwcQB/KL45dLcjx47wAnjaT
MEGq4VGVw5FjpU+e81kYymIz
=MoWK
-END PGP SIGNATURE-

-- 
Ryan Dewalt - Code Poet [EMAIL PROTECTED] . 7033229565x116 
"When I say rare I mean just let it look at the oven in terror, then bring it
out to me."  - Wolf  "The 10th Kingdom"

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Question about building source

2001-05-09 Thread Terry Lambert

Makoto MATSUSHITA wrote:
> 
> tlambert2> FWIW: This breaks if you have updated your C++ compiler,
> tlambert2> since the .mk files incorrectly override the paths for
> tlambert2> thing like the RTTI header files and the CRT0 stuff...
> 
> We have chroot(8) already, no problems:) Perhaps the original poster
> assume that /vol1/FreeBSD is for a jail(8) environment.

It still breaks.  See bsd.orig.mk; you _can't_ use a compiler
other than one installed in the default location, or it will
override the compiler defaults which tell it where the correct
header and crt0 files live.  Really.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Question about building source

2001-05-09 Thread Makoto MATSUSHITA


tlambert2> It still breaks.  See bsd.orig.mk; you _can't_ use a
tlambert2> compiler other than one installed in the default location,
tlambert2> or it will override the compiler defaults which tell it
tlambert2> where the correct header and crt0 files live.  Really.

???

If you run 'chroot /vol1/FreeBSD /bin/sh', you'll get an environment
that /vol1/FreeBSD is /; Compiler is in /usr/bin/cc.  Headers are in
/usr/include. Crt* files are in /usr/lib.  All files are located as it
should be.

If it doesn't work as you have said, "make release' also _doesn't_
work; we cannot make a distribution. Obviously, it's wrong:)

-- -
Makoto `MAR' MATSUSHITA

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: bin/27205: Listing all users in the passwd file

2001-05-09 Thread Jamie Heckford

Yup, thats the sort of thing I meant.

Worthy of a review by any of the commiters?

I can remember a big thing going around about modifications
to existing programs a couple of weeks ago, this was not
intended to upset / annoy / start a flame war anyone! :)

Jamie

On 2001.05.09 15:37 Peter Pentchev wrote:
> I'd think id(1) would be a more proper place, as it already knows how to
> format various passwd(5) and group(5) information.
> 
> How about the attached patch?  (and I'm probably starting another of
> those
> bikesheds as to whether new options should be added to existing
> utilities..)
> 
> G'luck,
> Peter
> 
> -- 
> This sentence contains exactly threee erors.
> 
> On Wed, May 09, 2001 at 10:56:12AM +0100, Jamie Heckford wrote:
> > Good points, glad to see the usual FreeBSD approach of allowing
> > only the best into the code ;)
> > 
> > Some sort of wrapper makes perfect sense for the sendmail option -
> > I did think of this, but your right, it is best to assume the
> > "user-friendly" approach
> > and not give users tweaking to do out of the box.
> > 
> > Could be a possibilty of adding it as a switch / option to pw(8), with
> > NIS capabilities? (Rewritten in C of course) Would this be deemed
> useful
> > and anyone happy to review a patch?
> [snip]
> > > >
> > > >I discovered the following awk script that prints out all users on
> the
> > > system
> > > >(from /etc/passwd). (Courtesy of sendmail.org)
> > > >
> > > >awk -F: '$3 > 100 { print $1 }' /etc/passwd
> > > >
> > > >Which will print out a list of all users in the passwd file wuth a
> UID
> > > greater
> > > >than 100.
> > > >
> > > >Could this be turned into a command such as "userlist", and/or would
> it
> > > be
> > > >deemed usefull?
> > > 
> > > Not particularly, as it doesn't work with NIS, and won't work with 
> > > nsswitch.conf.
> > > 
> > > A small perl script or C program using getpwent() in a loop is more 
> > > effective, as it takes into account both NIS and nsswitch.conf
> 
> Index: src/usr.bin/id/id.1
> ===
> RCS file: /home/ncvs/src/usr.bin/id/id.1,v
> retrieving revision 1.9
> diff -u -r1.9 id.1
> --- src/usr.bin/id/id.1   2000/11/20 19:20:48 1.9
> +++ src/usr.bin/id/id.1   2001/05/09 14:33:53
> @@ -43,21 +43,28 @@
>  .Nd return user identity
>  .Sh SYNOPSIS
>  .Nm
> +.Op Fl a
>  .Op Ar user
>  .Nm
> -.Fl G Op Fl n
> +.Fl G Op Fl an
>  .Op Ar user
>  .Nm
>  .Fl P
> +.Op Fl a
>  .Op Ar user
>  .Nm
> -.Fl g Op Fl nr
> +.Fl g
> +.Op Fl a | Fl r
> +.Op Fl n
>  .Op Ar user
>  .Nm
>  .Fl p
> +.Op Fl a
>  .Op Ar user
>  .Nm
> -.Fl u Op Fl nr
> +.Fl u
> +.Op Fl a | Fl r
> +.Op Fl n
>  .Op Ar user
>  .Sh DESCRIPTION
>  The
> @@ -80,6 +87,10 @@
>  as white-space separated numbers, in no particular order.
>  .It Fl P
>  Display the id as a password file entry.
> +.It Fl a
> +Display information about all system users, not just about the calling
> process.
> +This flag cannot be used together with
> +.Fl r .
>  .It Fl g
>  Display the effective group ID as a number.
>  .It Fl n
> @@ -118,6 +129,8 @@
>  and
>  .Fl u
>  options instead of the effective ID.
> +This flag cannot be used together with
> +.Fl a .
>  .It Fl u
>  Display the effective user ID as a number.
>  .El
> Index: src/usr.bin/id/id.c
> ===
> RCS file: /home/ncvs/src/usr.bin/id/id.c,v
> retrieving revision 1.12
> diff -u -r1.12 id.c
> --- src/usr.bin/id/id.c   1999/09/06 20:07:12 1.12
> +++ src/usr.bin/id/id.c   2001/05/09 14:33:53
> @@ -55,6 +55,9 @@
>  #include 
>  #include 
>  
> +int  Gflag, Pflag, aflag, gflag, id, nflag, pflag, rflag, uflag;
> +
> +int  id_doit __P((struct passwd *));
>  void current __P((void));
>  void pline __P((struct passwd *));
>  void pretty __P((struct passwd *));
> @@ -69,12 +72,10 @@
>   int argc;
>   char *argv[];
>  {
> - struct group *gr;
>   struct passwd *pw;
> - int Gflag, Pflag, ch, gflag, id, nflag, pflag, rflag, uflag;
> + int ch;
>  
> - Gflag = Pflag = gflag = nflag = pflag = rflag = uflag = 0;
> - while ((ch = getopt(argc, argv, "PGgnpru")) != -1)
> + while ((ch = getopt(argc, argv, "PGagnpru")) != -1)
>   switch(ch) {
>   case 'G':
>   Gflag = 1;
> @@ -82,6 +83,9 @@
>   case 'P':
>   Pflag = 1;
>   break;
> + case 'a':
> + aflag = 1;
> + break;
>   case 'g':
>   gflag = 1;
>   break;
> @@ -104,6 +108,9 @@
>   argc -= optind;
>   argv += optind;
>  
> + if (aflag && (rflag || (argc != 0)))
> + usage();
> +
>   switch(Gflag + Pflag + gflag + pflag + uflag) {
>   case 1:
>   break;
> @@ -115,7 +122,20 @@
>   usage();
>   }
>  
> - pw = *argv ? who(*argv) : NULL;
> + if (!aflag) 

Re: USB HIDs

2001-05-09 Thread Brian W. Buchanan

On Wed, 9 May 2001, Ryan Dewalt wrote:

> I've recently reverse engineered a small piece of hardware, The
> 'Microsoft Sidewinder Strategic Commander" (MSSC hereafter).  

What do you mean by "reverse-engineering"?  I wrote a userland USB HID
driver using libusb for an experimental RTS game engine as an afternoon
project -- no "reverse-engineering" required at all, and my driver works
equally well with the Strategic Commander or a Gravis USB gamepad or
probably any other USB mouse or joystick-like device.  usb(3) is your
friend.

I haven't yet figured out how to turn on the lights under some of the
buttons, however.  If you figured this out, please tell me how to do
it. :)

Brian

-- 
Brian Buchanan [EMAIL PROTECTED]
--
FreeBSD - The Power to Serve!   http://www.freebsd.org


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



sysctl / CTL_DEBUG

2001-05-09 Thread Alexey V. Neyman

hello there!

There is the following phrase in sysctl(3) manpage:
==
The system defines twenty (struct ctldebug) variables named debug0 through
debug19.
==
Though `sysctl debug | wc -l` shows 43 sysctl variables. And, I was unable
to locate definition of 'struct ctldebug' neither in
/usr/include/sys/sysctl.h (as promised by man page) nor in source tree.

May I ask for clarifications?

-+--
"May the Sun and Water always| Regards, Alexey V. Neyman
fall upon you!" (Supox, from SC2)|mailto: [EMAIL PROTECTED]
-+--


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Question about building source

2001-05-09 Thread Dave Hayes

Terry Lambert <[EMAIL PROTECTED]> writes:
> It still breaks.  See bsd.orig.mk; you _can't_ use a compiler
> other than one installed in the default location, or it will
> override the compiler defaults which tell it where the correct
> header and crt0 files live.  Really.

So this breaks the C++ compiler and any apps that were compiled with
this? Forgive me if I don't understand this...
--
Dave Hayes - Consultant - Altadena CA, USA - [EMAIL PROTECTED] 
>>> The opinions expressed above are entirely my own <<<

"They that can give up essential liberty to obtain a little temporary 
safety deserve neither liberty nor safety."-Benjamin Franklin



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Writing device drivers (was: help me please)

2001-05-09 Thread Greg Lehey

On Wednesday,  9 May 2001 at 10:40:50 +0530, Jayesh Krishna wrote:
> Hi guys...
> I am comfortable with Linux Device Drivers. Presently I am trying
> to write some pseudo-drivers in FreeBSD(4.2-Release). I tried out
> make_pseudo_driver.sh
> in the /usr/share/examples/drivers but it does not work :-( I also
> went through the "FreeBSD Device Driver Writer's Guide" by Eric L.
> Hernes but it seems to be outdated :-(
> Please someone point me out to some docs regarding writing device
> drivers in FreeBSD

"UTSL".  Take a look at a similar driver and get to understand it.
I'm afraid that this is an area which is woefully undocumented.

You'll also get more replies if you put a useful text on the Subject:
line.

Greg
--
Finger [EMAIL PROTECTED] for PGP public key
See complete headers for address and phone numbers

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



KSD

2001-05-09 Thread Tim Wiess

Hello,
Lately I have been reading about the work that is being done to support
kernel scheduled entities in FreeBSD. I am very anxious to look at the
code for this and see if I might be able to contribute anything to the
project. Although, it doesn't look like the code has been merged into
CURRENT yet. Is this true? If so, does anyone know where the current
development for this is being done?

Thanks.

tim



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: KSD

2001-05-09 Thread David Xu

AFAIK,  KSE is not started currently. you might have a look NetBSD,
there is a branch for SA project,  it seems they changed proc to lwp.
many code has  already been commited.

Regards,
David Xu

- Original Message -
From: Tim Wiess <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 10, 2001 2:31 AM
Subject: KSD


> Hello,
> Lately I have been reading about the work that is being done to support
> kernel scheduled entities in FreeBSD. I am very anxious to look at the
> code for this and see if I might be able to contribute anything to the
> project. Although, it doesn't look like the code has been merged into
> CURRENT yet. Is this true? If so, does anyone know where the current
> development for this is being done?
>
> Thanks.
>
> tim
>
>
>
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: KSD

2001-05-09 Thread Tim Wiess

OK, thanks. I'll check it out.

tim


On Thu, 10 May 2001, David Xu wrote:

> AFAIK,  KSE is not started currently. you might have a look NetBSD,
> there is a branch for SA project,  it seems they changed proc to lwp.
> many code has  already been commited.
>
> Regards,
> David Xu
>
> - Original Message -
> From: Tim Wiess <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 10, 2001 2:31 AM
> Subject: KSD
>
>
> > Hello,
> > Lately I have been reading about the work that is being done to support
> > kernel scheduled entities in FreeBSD. I am very anxious to look at the
> > code for this and see if I might be able to contribute anything to the
> > project. Although, it doesn't look like the code has been merged into
> > CURRENT yet. Is this true? If so, does anyone know where the current
> > development for this is being done?
> >
> > Thanks.
> >
> > tim
> >
> >
> >
> > To Unsubscribe: send mail to [EMAIL PROTECTED]
> > with "unsubscribe freebsd-hackers" in the body of the message
>
>
>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



vinum on 2 ide drives?

2001-05-09 Thread Dan Phoenix



These 2 are from running it on each on the ide drives without vinum.

[root@gorbag /mnt1]# dd if=/dev/zero of=bigfile bs=16384k count=1000
1000+0 records in
1000+0 records out
16777216000 bytes transferred in 799.865832 secs (20975038 bytes/sec)
[root@gorbag /mnt2]# dd if=/dev/zero of=bigfile bs=16384k count=1000
1000+0 records in
1000+0 records out
16777216000 bytes transferred in 796.395885 secs (21066427 bytes/sec)
[root@gorbag /mnt2]#

This is from running it on both drives striped with vinum.

[root@gorbag /backup]# dd if=/dev/zero of=bigfile bs=16384k count=1000
1000+0 records in
1000+0 records out
16777216000 bytes transferred in 1365.405607 secs (12287350 bytes/sec)
[root@gorbag /backup]#

seems to be quite abit slower..
now i was running systat -vm 1 while writing to the striped vinum drive
and did see both of them getting hit equally. IN this case prob at around
99% IO on both of them half the time.

[root@gorbag dphoenix]# cat /etc/vinum.conf 
drive ibm1 device /dev/ad1s1e
drive ibm2 device /dev/ad2s1e
volume stripe
  plex org striped 512s
sd length 58643m drive ibm1
sd length 58643m drive ibm2
[root@gorbag dphoenix]# 

ad1: 58644MB  [119150/16/63] at ata0-slave UDMA33
ad2: 58644MB  [119150/16/63] at ata1-master UDMA33

As you can see these are 2 ide drives with 58643 Megs each. Well you can
see that with fdisk anyhow...fdisk seems to be 1 meg less than what dmesg 
reports.

Any suggestions to get some speed here? Or should i just go back to single
ide drives split up again?


--
Dan

+--+ 
|  BRAVENET WEB SERVICES   |
| [EMAIL PROTECTED] |
|  screen;cd /usr/src;make buildworld;cd ~ |
| cp MYKERNEL /sys/i386/conf;cd /usr/src   |
|make buildkernel KERNCONF=MYKERNEL|
|make installkernel KERNCONF=MYKERNEL;make installworld|
+__+



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: vinum on 2 ide drives?

2001-05-09 Thread Greg Lehey

[redirected to -questions]

On Wednesday,  9 May 2001 at 19:51:05 -0700, Dan Phoenix wrote:
>
>
> These 2 are from running it on each on the ide drives without vinum.
>
> [root@gorbag /mnt1]# dd if=/dev/zero of=bigfile bs=16384k count=1000
> 1000+0 records in
> 1000+0 records out
> 16777216000 bytes transferred in 799.865832 secs (20975038 bytes/sec)
> [root@gorbag /mnt2]# dd if=/dev/zero of=bigfile bs=16384k count=1000
> 1000+0 records in
> 1000+0 records out
> 16777216000 bytes transferred in 796.395885 secs (21066427 bytes/sec)
> [root@gorbag /mnt2]#
>
> This is from running it on both drives striped with vinum.
>
> [root@gorbag /backup]# dd if=/dev/zero of=bigfile bs=16384k count=1000
> 1000+0 records in
> 1000+0 records out
> 16777216000 bytes transferred in 1365.405607 secs (12287350 bytes/sec)
> [root@gorbag /backup]#
>
> seems to be quite abit slower..

Indeed.  That's puzzling.

> now i was running systat -vm 1 while writing to the striped vinum
> drive and did see both of them getting hit equally. IN this case
> prob at around 99% IO on both of them half the time.
>
> [root@gorbag dphoenix]# cat /etc/vinum.conf
> drive ibm1 device /dev/ad1s1e
> drive ibm2 device /dev/ad2s1e
> volume stripe
>   plex org striped 512s
> sd length 58643m drive ibm1
> sd length 58643m drive ibm2
> [root@gorbag dphoenix]#

You shouldn't be using power-of-2 stripes.  But that's not what's
causing your problem.s

> ad1: 58644MB  [119150/16/63] at ata0-slave UDMA33
> ad2: 58644MB  [119150/16/63] at ata1-master UDMA33

Nice drives.  They should be much faster than that on dd, but you were
going via the file system.

> Any suggestions to get some speed here? Or should i just go back to
> single ide drives split up again?

I'd like to understand what's going on here first.  This isn't typical
behaviour.  Since you seem to not have anything useful on the drives,
could you repeat with rawio (/usr/ports/benchmarks/rawio)?  We can
also take this offline.

Greg
--
For more information, see http://www.lemis.com/questions.html
Finger [EMAIL PROTECTED] for PGP public key
See complete headers for address and phone numbers

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



fd driver hacking to recover data

2001-05-09 Thread Brian W. Buchanan

Any fdc driver gurus in the house?

I have a bunch of old floppy disks with some text files I'd like to
recover.  Many of them have errors and are unreadable past a certain point
in the disk.  Others I can't read from at all.

The ones I can't read, period, are all 1.44MB-size floppies.  I've tried
dd'ing from /dev/fd0c, /dev/fd0.1440, etc., but exits with "Input/Output
Error" before copying anything.

The kernel prints:

fd0c: hard error reading fsbn 0 of 0-31 (ST0 40 ST1 1 ST2 0
cyl 0 hd 0 sec 1)


I've been more successful reading 720K floppies from /dev/fd0.720, but
many of them have errors that stop dd in its tracks, yielding another
Input/Output error.

The kernel prints:

fd0c: hard error reading fsbn 1503 of 1488-1503 (ST0 44
ST1 20 ST2 20 cyl 41 hd 1 sec 10)


Since the files on the disks are just text, all I want to do is to be able
to extract as many of the bits on the disk as possible, even if some of
the bits are wrong, and then run strings over it and sort out the
content.  I've looked at the floppy driver source and it seems to be
incredibly low-level, i.e. it turns the drive motor on and off, even.  Can
someone familiar with the driver give me some pointers as to what I'd have
to modify to let it 1) read those 1.44MB disks, and 2) tolerate data
errors?

Thanks,

Brian

-- 
Brian Buchanan [EMAIL PROTECTED]
--
FreeBSD - The Power to Serve!   http://www.freebsd.org


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: fd driver hacking to recover data

2001-05-09 Thread Luigi Rizzo

> I have a bunch of old floppy disks with some text files I'd like to
> recover.  Many of them have errors and are unreadable past a certain point
> in the disk.  Others I can't read from at all.
> 
> The ones I can't read, period, are all 1.44MB-size floppies.  I've tried
> dd'ing from /dev/fd0c, /dev/fd0.1440, etc., but exits with "Input/Output
> Error" before copying anything.

i think you can try dd from the raw device (/dev/rfd) using the "iseek"
or "skip" option to jump over the missing sectors.
Alternatively, you can use "conv=noerror,sync" to keep reading
after errors (the bad blocks are NUL-filled)

cheers
luigi

> The kernel prints:
> 
> fd0c: hard error reading fsbn 0 of 0-31 (ST0 40 ST1 1 ST2 0
> cyl 0 hd 0 sec 1)
> 
> 
> I've been more successful reading 720K floppies from /dev/fd0.720, but
> many of them have errors that stop dd in its tracks, yielding another
> Input/Output error.
> 
> The kernel prints:
> 
> fd0c: hard error reading fsbn 1503 of 1488-1503 (ST0 44
> ST1 20 ST2 20 cyl 41 hd 1 sec 10)
> 
> 
> Since the files on the disks are just text, all I want to do is to be able
> to extract as many of the bits on the disk as possible, even if some of
> the bits are wrong, and then run strings over it and sort out the
> content.  I've looked at the floppy driver source and it seems to be
> incredibly low-level, i.e. it turns the drive motor on and off, even.  Can
> someone familiar with the driver give me some pointers as to what I'd have
> to modify to let it 1) read those 1.44MB disks, and 2) tolerate data
> errors?
> 
> Thanks,
> 
> Brian
> 
> -- 
> Brian Buchanan [EMAIL PROTECTED]
> --
> FreeBSD - The Power to Serve!   http://www.freebsd.org
> 
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
> 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: fd driver hacking to recover data

2001-05-09 Thread David Scheidt

On Thu, 10 May 2001, Luigi Rizzo wrote:

:> I have a bunch of old floppy disks with some text files I'd like to
:> recover.  Many of them have errors and are unreadable past a certain point
:> in the disk.  Others I can't read from at all.
:> 
:> The ones I can't read, period, are all 1.44MB-size floppies.  I've tried
:> dd'ing from /dev/fd0c, /dev/fd0.1440, etc., but exits with "Input/Output
:> Error" before copying anything.
:
:i think you can try dd from the raw device (/dev/rfd) using the "iseek"
:or "skip" option to jump over the missing sectors.
:Alternatively, you can use "conv=noerror,sync" to keep reading
:after errors (the bad blocks are NUL-filled)

Depending on how the disks are flakey, you may be able to read the bad
blocks some of the time.  Multiple passes with dd, and combining the results
by hand may be worth trying, as might be different floppy drives.  

David
-- 
[EMAIL PROTECTED]
Bipedalism is only a fad.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: fd driver hacking to recover data

2001-05-09 Thread Brian W. Buchanan

On Thu, 10 May 2001, Luigi Rizzo wrote:

> > I have a bunch of old floppy disks with some text files I'd like to
> > recover.  Many of them have errors and are unreadable past a certain point
> > in the disk.  Others I can't read from at all.
> > 
> > The ones I can't read, period, are all 1.44MB-size floppies.  I've tried
> > dd'ing from /dev/fd0c, /dev/fd0.1440, etc., but exits with "Input/Output
> > Error" before copying anything.
> 
> i think you can try dd from the raw device (/dev/rfd) using the "iseek"
> or "skip" option to jump over the missing sectors.
> Alternatively, you can use "conv=noerror,sync" to keep reading
> after errors (the bad blocks are NUL-filled)

Okay, this works for the disks with errors in the middle of them.  
Thanks!  Reading from the raw devices unfortunately doesn't get me any
farther with the high density disks.

-- 
Brian Buchanan [EMAIL PROTECTED]
--
FreeBSD - The Power to Serve!   http://www.freebsd.org


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: fd driver hacking to recover data

2001-05-09 Thread Greg Lehey

On Wednesday,  9 May 2001 at 22:04:34 -0700, Brian W. Buchanan wrote:
> Any fdc driver gurus in the house?
>
> I have a bunch of old floppy disks with some text files I'd like to
> recover.  Many of them have errors and are unreadable past a certain point
> in the disk.  Others I can't read from at all.
>
> The ones I can't read, period, are all 1.44MB-size floppies.  I've tried
> dd'ing from /dev/fd0c, /dev/fd0.1440, etc., but exits with "Input/Output
> Error" before copying anything.
>
> The kernel prints:
>
> fd0c: hard error reading fsbn 0 of 0-31 (ST0 40 ST1 1 ST2 0
> cyl 0 hd 0 sec 1)
>
>
> I've been more successful reading 720K floppies from /dev/fd0.720, but
> many of them have errors that stop dd in its tracks, yielding another
> Input/Output error.
>
> The kernel prints:
>
> fd0c: hard error reading fsbn 1503 of 1488-1503 (ST0 44
> ST1 20 ST2 20 cyl 41 hd 1 sec 10)
>
>
> Since the files on the disks are just text, all I want to do is to be able
> to extract as many of the bits on the disk as possible, even if some of
> the bits are wrong, and then run strings over it and sort out the
> content.  I've looked at the floppy driver source and it seems to be
> incredibly low-level, i.e. it turns the drive motor on and off, even.  Can
> someone familiar with the driver give me some pointers as to what I'd have
> to modify to let it 1) read those 1.44MB disks, and 2) tolerate data
> errors?

One possibility that I've used in the past is to use a 'read track'
command.  This was back in the days of 8" floppies, but I think the
controllers still understand it.  Basically the command starts at the
index mark and transfers data with no kind of interpretation until the
next index mark.  It's up to the program to then find the start of
each sector and extract the data.  If you're up to this kind of hack,
I can check for more details.

Greg
--
Finger [EMAIL PROTECTED] for PGP public key
See complete headers for address and phone numbers

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



help regarding writing pseudo-drivers in FreeBSD

2001-05-09 Thread Jayesh Krishna

Hi,
I am comfortable with Linux Device Drivers. Presently I am trying
to write some pseudo-drivers in FreeBSD(4.2-release). I tried out 
make_pseudo_driver.sh
in the /usr/share/examples/drivers but it does not work :-( I also
went through the "FreeBSD Device Driver Writer's Guide" by Eric L.
Hernes but it seems to be outdated :-(
Please someone point me out to some docs regarding writing device
drivers in FreeBSD

jayesh

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message