pge.c, its a power thing!

2003-11-18 Thread John
Sooo.. is there any chance someone could take a look at this

http://www.seanadams.com/pge/pge.c

and tell me what needs to be done to port this, or maybe just
give me some pointers so i can spend the next year working on
this? :)
I think the big problem (well for me) will be converting this 
from asm/io.h to something else. maybe ppi?


If you want to see what the end result is check this out..

http://www.seanadams.com/pge/

i found this on a mrtg mailing list after looking around for
something like what phk did to monitor his gas usage.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Conflict between sys/sysproto.h stdio.h ... ?

2003-11-18 Thread lucy loo
I am writing a kernel loadable module to reimplement some system calls. I have 
included sys/sysproto.h, sys/systm.h, etc. -- very standard header files for kld 
implmentation. I also want to do file i/o in this module, therefore I need to include 
stdio.h. But it obviously conflicts with those sys/..., and make won't pass. 
Anyone knows how to fix this? 
 
Thanks! 


-
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: CVSUP error...

2003-11-18 Thread Sergey A. Osokin
On Mon, Nov 17, 2003 at 08:18:13PM -0600, Brett L. Brown wrote:
 I'm looking for help on with a CVSUP problem.
 
 I'm trying to run CVSUP with a supfile, I'm typing:
 
 cvsup ports-supfile
 
 and receiving the following:
 
 Cannot get IP address of my own host -- is its hostname correct?
 
 I'm using the host cvsup7.FreeBSD.org (129.250.31.140). I've have 
 also included this information in my /etc/hosts file.
 
 No worky. Any help would be great!

And your 
$ hostname 
is ...

-- 

Rgdz,/\  ASCII RIBBON CAMPAIGN
Sergey Osokin aka oZZ,   \ /AGAINST HTML MAIL
http://ozz.pp.ru/ X  AND NEWS
 / \
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Conflict between sys/sysproto.h stdio.h ... ?

2003-11-18 Thread Bruce M Simpson
On Tue, Nov 18, 2003 at 12:39:37AM -0800, lucy loo wrote:
 I am writing a kernel loadable module to reimplement some system calls. I have 
 included sys/sysproto.h, sys/systm.h, etc. -- very standard header files for kld 
 implmentation. I also want to do file i/o in this module, therefore I need to 
 include stdio.h. But it obviously conflicts with those sys/..., and make won't 
 pass. 

RTFM - particularly style(9), do not include userland headers in the kernel.

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


Re: pge.c, its a power thing!

2003-11-18 Thread Jilles Tjoelker
On Tue, Nov 18, 2003 at 01:45:08AM -0600, John wrote:
 Sooo.. is there any chance someone could take a look at this

 http://www.seanadams.com/pge/pge.c

 and tell me what needs to be done to port this, or maybe just
 give me some pointers so i can spend the next year working on
 this? :)
 I think the big problem (well for me) will be converting this 
 from asm/io.h to something else. maybe ppi?

ppi would be more clean, but you can do it the same dirty way under
FreeBSD as well. Use i386_set_ioperm() instead of ioperm(). See the
manpage, although I think the arguments are the same. Use
machine/cpufunc.h instead of asm/io.h (ignore the comment about
sys/systm.h, that's a kernel-only include file).

Ignore the setuid crap in the webpage, of course. Just start it as root
(that could be fixed if you used ppi).

Be warned that I haven't tested any of this.

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


Re: CVSUP error...

2003-11-18 Thread Amit
Brett L. Brown wrote:

 Hey!
 
 I'm looking for help on with a CVSUP problem.
 
 I'm trying to run CVSUP with a supfile, I'm typing:
 
 cvsup ports-supfile
 
 and receiving the following:
 
 Cannot get IP address of my own host -- is its hostname correct?
 
 I'm using the host cvsup7.FreeBSD.org (129.250.31.140). I've have
 also included this information in my /etc/hosts file.

To clarify, is your own hostname in /etc/hosts?

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


RE: CVSUP error...

2003-11-18 Thread John Polstra
On 18-Nov-2003 Brett L. Brown wrote:
 
 I'm looking for help on with a CVSUP problem.
 
 I'm trying to run CVSUP with a supfile, I'm typing:
 
 cvsup ports-supfile
 
 and receiving the following:
 
 Cannot get IP address of my own host -- is its hostname correct?

This problem is discussed in the CVSup FAQ at www.cvsup.org.

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


Re: console redirection to serial in Freebsd 5.1

2003-11-18 Thread Sebastian Yepes F. [ESN]
On Tue, 18 Nov 2003 12:00:33 -0500
Loh John Wu [EMAIL PROTECTED] wrote:

 So I have a fresh install of FreeBSD 5.1 from a CD (ISO).
 
 Now I'm trying to turn on console redirection in my image, but I can't seem
 to get it to work properly.
 
 I read the article on turning on console redirection at
 
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serialconsole-setu
 p.html
 
 but I think that doc was geared towards a 4.X release as it says that
 specific sio options
 need to be set in the kernel config file.
 
 However, reading the man page on the sio driver in 5.1-release man pages at
 
 http://www.freebsd.org/cgi/man.cgi?query=sioapropos=0sektion=0manpath=Fre
 eBSD+5.1-RELEASEformat=html
 
 it seems that we just need to set those configs that used to be in the
 kernel conf file in 4.7 in the
 /boot/devices.hints file.
 
 So I've set these options in the hints file to turn on the serial
 redirection with the flag 0x90
 
 hint.sio.0.at=isa
 hint.sio.0.port=0x3F8
 hint.sio.0.flags=0x90
 hint.sio.0.irq=4
 hint.sio.1.at=isa
 hint.sio.1.port=0x2F8
 hint.sio.1.irq=3
 hint.sio.2.at=isa
 hint.sio.2.disabled=1
 hint.sio.2.port=0x3E8
 hint.sio.2.irq=5
 hint.sio.3.at=isa
 hint.sio.3.disabled=1
 hint.sio.3.port=0x2E8
 hint.sio.3.irq=9
 
 I've also set in the /boot.config file the -P flag to
 set the console to the serial console in the presence of a keyboard.
 
 and I've changed /etc/ttys to allow for the ttyd0 as well.
 
 I am using the generic FreeBSD 5.1 kernel with the generic 5.1 kernel config
 options,
 but from what I read, I think I can still enable serial console redirection
 with the generic kernel.
 Any ideas as to what I might be missing to have the redirection to teh
 serial console.
 
 Thanks,
 John
 
 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 To unsubscribe, send any mail to [EMAIL PROTECTED]


echo -h /boot.conf

and you well have serial...


-- 

if (Better You Treat Them) { return Worst You Get Treated; }

I have a dream that one day this nation will rise up and live out the true meaning of 
its creed..
(Martin Luther King)
/*
FingerPrint:
 0D42 F870 F650 6B86 CA9E
 E199 A57D 3824 F8AA A934
*/
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


memory address space conversion

2003-11-18 Thread Sean McNeil
Hello all,

I ask a while ago a question and received great response.  I'm hoping to
repeat the experience :)

I have a driver that I cannot change the ioctl API to.  Unfortunately,
it has a peculiar need to return a user-space address based on the
physical address.  Here is the scenario:

user calls mmap and gets a user-space mapping to a chunk of memory.
user calls an ioctl that passes an array of user-space addresses inside
that mapping.

I had a hack working for the case of a single-threaded process, but it
will not work in a threaded environment.  Here is what I came up with:

static vm_map_entry_t find_entry (vm_map_t map, vm_paddr_t address)
{
vm_map_entry_t entry;
int i;

for (i = 0, entry = map-header;
 i  map-nentries;
 i++, entry = entry-next)
{
vm_page_t page;
vm_paddr_t paddr;

if (entry-eflags  MAP_ENTRY_IS_SUB_MAP)
{
vm_map_entry_t sub_entry =
find_entry (entry-object.sub_map, address);

if (! sub_entry) continue;

entry = sub_entry;
break;
}

if (entry-object.vm_object == NULL)
continue;

VM_OBJECT_LOCK (entry-object.vm_object);
page = vm_page_lookup (entry-object.vm_object,
   OFF_TO_IDX(MMAP_OFFSET));
paddr = (page) ? VM_PAGE_TO_PHYS (page) : 0;
VM_OBJECT_UNLOCK (entry-object.vm_object);

if (paddr == address) break;
}

return (i  map-nentries) ? entry : NULL;
}

where MMAP_OFFSET is 0x4000.  This was the offset passed in by the
mmap call.

Does anyone know of a more proper mechanism that will work for the
threaded model?  Any and all assistance will be greatly appreciated.

TIA,
Sean


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


ICH5 + SATA + Seagate Barracuda 7200.7 ?

2003-11-18 Thread Thierry Herbelot
Hello,

I'm in the process of selecting new computers, and I'm tempted by an 
ASUS P4P800, with Seagate SATA disks.

After googling a bit, it seems that the ICH5 is indeed supported in SATA 
mode from the 4.9-Release (perhaps also 5.1 ?)
(at least the chip is correctly identified by
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/ata/ata-pci.c?annotate=1.32.2.17)

The driver seems to be a bit fragile, if this message is to be relied on :
http://lists.freebsd.org/pipermail/freebsd-stable/2003-November/004796.html

Under Linux, the SATA support also is very recent :
http://www.spinics.net/lists/kernel/msg223000.html
it should be included in 2.4.23

So the question is : 
is there some actual, positive, experience in using the above combination, and 
with which stability ?

Cheers

TfH

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


mtime and directories...

2003-11-18 Thread lists
Changing a file, of course, results in a change to its modification 
time. Am I correct in determining that the mtime of the enclosing 
directory is also updated?

The reason I'm asking this is because I need to be able to determine if 
any file has changed within a directory from a shell script, Perl, or 
Python. All I need to know is if at least one file has changed. I don't 
need to find all such files. [Sidelight: anyone know how, if possible, 
to stop find after finding one file? I can't figure this one out alone.]

My initial solution was to use 'find' to find any files newer than a 
marker file. However, I believe I've determined that the mtime of 
enclosing directories also changes to reflect the last file that was 
updated within its hierarchy. So, it makes sense that I simply check 
the directory that contains the marker file.

Thanks,

Alex

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


secure file flag?

2003-11-18 Thread Rayson Ho
I am wondering if it is useful to have a secure file flag??

The secure file flag will be set for files that contain sensitive data.
Then the OS will take special care when operating on those secure
files.

e.g. when deleting a secure file, the OS will overwrite the file with
random data.

One advantage would be to have secure files in the same filesystem as
other normal files.

Any one knows if FreeBSD has already implemented this??

Thanks,
Rayson


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: mtime and directories...

2003-11-18 Thread ari
[EMAIL PROTECTED] said this stuff:

 Changing a file, of course, results in a change to its modification 
 time. Am I correct in determining that the mtime of the enclosing 
 directory is also updated?

The mtime of a directory is updated when the directory file changes.
Directory files contain filenames and their associated inode numbers.
Modify any of that information (e.g., create a new file, remove or
rename an existing file), and the mtime will be changed.  Changing the
ctime or mtime of a file within a directory does not modify that of the
directory itself.

 The reason I'm asking this is because I need to be able to determine if 
 any file has changed within a directory from a shell script, Perl, or 
 Python. All I need to know is if at least one file has changed. I don't 
 need to find all such files. [Sidelight: anyone know how, if possible, 
 to stop find after finding one file? I can't figure this one out alone.]

% find /some/dir criteria |head -1

In this case, 'head' will exit after reading one line, causing 'find' to
receive a SIGPIPE if it tries writing more data.  The 'find' command
doesn't typically trap SIGPIPE, so the process will exit.  Of course, it
won't receive the signal immediately --- only if it calls write(2)
again, and on descriptor 1.  If 'find' matches only one file, it will
wind up seeking through the entire tree.  This may not be sufficient for
your application.

To truly make find exit after it matches one file, you can do something
along the lines of:

% prescript find /some/dir criteria -exec postscript '{}' \;

... where prescript contains a somewhat more error-tolerant version of
the following:

  #!/bin/sh
  echo $$ /pid/dir/find.pid
  exec $@

... and postscript contains a somewhat more useful version of the
following:

  #!/bin/sh
  dostuffwith $@ 
  pid=`cat /pid/dir/find.pid`
  rm -f /pid/dir/find.pid
  kill $pid


 My initial solution was to use 'find' to find any files newer than a 
 marker file. However, I believe I've determined that the mtime of 
 enclosing directories also changes to reflect the last file that was 
 updated within its hierarchy. So, it makes sense that I simply check 
 the directory that contains the marker file.

Again, a directory's modification time is updated only if the actual
directory contents have changed, not the contents or inodes of the files
within it.

ari

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


Re: secure file flag?

2003-11-18 Thread Bruce M Simpson
On Tue, Nov 18, 2003 at 04:31:32PM -0800, Rayson Ho wrote:
 I am wondering if it is useful to have a secure file flag??
...
 e.g. when deleting a secure file, the OS will overwrite the file with
 random data.

I've got patches somewhere for zeroing out memory mappings in this way, but
they are incomplete. :-(

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


Re: ICH5 + SATA + Seagate Barracuda 7200.7 ?

2003-11-18 Thread Dan Strick

 I'm in the process of selecting new computers, and I'm tempted by an
 ASUS P4P800, with Seagate SATA disks.

  ...

 is there some actual, positive, experience in using the above combination,
 and with which stability ?


The ASUS P4P800 uses the Intel 865PE chipset.  I have a Gigabyte 8KNXP which
uses the Intel 875P chipset (almost the same thing) and a pair of Seagate
ST3120026AS (120 GB Barracuda 7200.7) disks.  They seem to work fine with
FreeBSD 4.9-Release in either native or legacy mode even though 4.9-Release
understands the ICH5 SATA controller only as yet another model of ICHx ATA
controller.  The driver thinks the disks are on an old 40 conductor IDE cable
and tries to do dma at ATA33 speed, but the controller ignores the driver
and runs at SATA150 rates.  I used to operate the ICH5 SATA controller in
native mode but had to switch to legacy mode because the AWARD BIOS won't
boot off the controller in native mode.  Legacy mode is less than ideal
because the driver can't operate both drives at once.

FreeBSD-current probably understands the SATA controller better than 4.9.
I used to use 5.1-Release but had to give it up because it was just too
flaky.  (The rest of 5.1 was flaky.  The 5.1 ATA driver seemed to work ok.)
I have not attempted to upgrade to current because the traffic in
[EMAIL PROTECTED] suggests that it works correctly only on alternate
weekdays.

I have made no real attempt to stress the disk system.  It seems to work.
I have used it to install FreeBSD several times and caused hours of
continuous disk activity building ports and running miscellaneous programs.
I have noticed no hiccups.

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


console redirection to serial in Freebsd 5.1

2003-11-18 Thread Loh John Wu
So I have a fresh install of FreeBSD 5.1 from a CD (ISO).

Now I'm trying to turn on console redirection in my image, but I can't seem
to get it to work properly.

I read the article on turning on console redirection at

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serialconsole-setu
p.html

but I think that doc was geared towards a 4.X release as it says that
specific sio options
need to be set in the kernel config file.

However, reading the man page on the sio driver in 5.1-release man pages at

http://www.freebsd.org/cgi/man.cgi?query=sioapropos=0sektion=0manpath=Fre
eBSD+5.1-RELEASEformat=html

it seems that we just need to set those configs that used to be in the
kernel conf file in 4.7 in the
/boot/devices.hints file.

So I've set these options in the hints file to turn on the serial
redirection with the flag 0x90

hint.sio.0.at=isa
hint.sio.0.port=0x3F8
hint.sio.0.flags=0x90
hint.sio.0.irq=4
hint.sio.1.at=isa
hint.sio.1.port=0x2F8
hint.sio.1.irq=3
hint.sio.2.at=isa
hint.sio.2.disabled=1
hint.sio.2.port=0x3E8
hint.sio.2.irq=5
hint.sio.3.at=isa
hint.sio.3.disabled=1
hint.sio.3.port=0x2E8
hint.sio.3.irq=9

I've also set in the /boot.config file the -P flag to
set the console to the serial console in the presence of a keyboard.

and I've changed /etc/ttys to allow for the ttyd0 as well.

I am using the generic FreeBSD 5.1 kernel with the generic 5.1 kernel config
options,
but from what I read, I think I can still enable serial console redirection
with the generic kernel.
Any ideas as to what I might be missing to have the redirection to teh
serial console.

Thanks,
John

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