Re: Port/Package Management?

2007-03-12 Thread Joseph Koshy

This time I am interested in the operational principle
of  the port/package system, what is going on while
installing packages, and where is the source files if
I want to do some modification?


See /usr/src/usr.sbin/pkg_install/*

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


Why max mmap size limited to half of virtual address space?

2007-03-12 Thread Anton Yuzhaninov
Hello,

Why  max mmap size limited to half virtual address space?
On i386 it limited to 2 Gb:

/sys/vm/vm_mmap.c

  /* make sure mapping fits into numeric range etc */
if ((ssize_t) uap-len  0 ||
((flags  MAP_ANON)  uap-fd != -1))
return (EINVAL);


(ssize_t) uap-len  0
limit maximum value for uap-len to SIZE_T_MAX/2

May be this check can be removed?

It test it on FreeBSD 6.2 i386 - without this check a can map 2400 Mb
file.

Also mmap man page say, that 2 Gb limit was a documentation bug, but this
limit still exist on i386.

-- 
 Anton Yuzhaninov.

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


Re: Port/Package Management?

2007-03-12 Thread Darren Pilgrim

Yong Ma wrote:

This time I am interested in the operational principle of  the
port/package system, what is going on while installing packages, and 
where is the source files if I want to do some modification?


/usr/ports/Mk

bsd.port.mk is the central component.  There are extra files for various 
frameworks and platforms.


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


Re: How does not practice freebsd kernel programming?

2007-03-12 Thread Soeren Straarup
On Mon, Mar 12, 2007 at 09:36:43AM +0530, ajay gopalakrishnan wrote:
 Hi,
 
 What is the best way to start practicing kernel programming on freebsd for
 amateurs. I have found many sites about Linux kernel programming but none
 for FReebsd kernel programming.
 What are the usual steps followed while learning freebsd kernel programming?
 

The way I did it was to take a spare computer and then play with loadeable
modules.
Fx:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/driverbasics-char.html#AEN8704
Which I need to get updated.

/Soeren

-- 
Soeren Straarup   | aka OZ2DAK aka Xride
FreeBSD committer | FreeBSD since 2.2.6-R
  If a program is not working right, then send a patch
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Fix for bug in IPFilters ipfs tool

2007-03-12 Thread Roger Olofsson

Hello Frank and thank you for your very inspiring post,

I have a similar setup, two machines, both dualhomed, connected to two 
small switches where only one machine has both nics active at the same time.


One diffence is that I use Freevrrpd as a heartbeat monitor which works 
excellent. The scripts you describe sounds similar to mine, I do some 
fiddling with cron as well and kick down and up some services.


When Freevrrpd makes the switch from one machine to the other all 
connections appear to remain unaltered. I have not tcpdumped to see how 
much gets lost in the 3 seconds or so that the switch is allowed to take 
but the transition appears to work.


I don't rely on ipfs at all, but your post made me realize that I should 
look into using it to complement freevrrpd.


Thank you,

/Roger

Frank Knobbe skrev:

Greetings,

A couple years ago, I had sent a patch to Darren for ipfs in ipfilter
(patched on FreeBSD 5.3). I never heard back from him, and assumed that
either it wasn't in proper format or already being worked on or he was
too busy.

Now that I'm upgrading my systems to FBSD 6.2, I encountered the same
problem, and roughly the same fix has to be applied again, so it doesn't
appear like it had been looked at. Hence I'm posting again (this time to
the list).

My setup is such that I have two router connections from my hosting
provider which I feed to two small switched which are linked with a
cross-over cable. The server has two network cards which connect to each
switch. Only one card is active at a time. I got a script running that
pings the default gateway and when it fails, it does the following:
- Bring interface A down, and B up.
- Remove the IP address from i/f A and assign to i/f B.
- Run sed over rc.conf, ipf.rules and ipnat.rules and change the
interface name from A to B.
- Save currently active ipfilter rules (using ipfstat), run sed over
those to change the i/f name, and reload them.
- And finally, save the ipfilter state table, run ipfs over it to change
the i/f names, and reload the state table.

This way the server achieves complete redundancy. Any router, switch,
cable, NIC can fail, and the server will switch to the other network
card while preserving connection states. Works like a charm.

But only after I had worked on ipfs. Out of the box, ipfs did not
properly make the interface change in the saved state files. In FBSD
6.2, the command to change the interfaces (-i) is even disabled,
probably because it never worked :)

Below is a patch that will fix ipfs such that it is able to successfully
change the interface names in the saved state files. The patch below
also enables the -i flag again. After applying this patch, one can
change interfaces as outlined above, and have ipfs rename them in the
state files, allowing a clean fail-over between interfaces within
ipfilter and also preserving the connection state. Any established
connection will remain active.

This is my first bug/fix report, so please be gentle if I cross-posted
too much. I would appreciate if someone could apply the patch to ipfs.c
so that other users can make use of it. The version of ipfs this was
diff'ed from is:

/*  $FreeBSD: src/contrib/ipfilter/tools/ipfs.c,v 1.3.2.1 2006/08/24
07:37:1
0 guido Exp $   */

---8
--- ipfs.c.org  Sun Mar 11 14:19:32 2007
+++ ipfs.c  Sun Mar 11 14:21:24 2007
@@ -133,6 +133,14 @@
strcpy(ips.ips_is.is_ifname[1], s);
rw = 1;
}
+if (!strncmp(ips.ips_is.is_ifname[2], ifs, olen + 1)) {
+strcpy(ips.ips_is.is_ifname[2], s);
+rw = 1;
+}
+if (!strncmp(ips.ips_is.is_ifname[3], ifs, olen + 1)) {
+strcpy(ips.ips_is.is_ifname[3], s);
+rw = 1;
+}
if (rw == 1) {
if (lseek(fd, pos, SEEK_SET) != pos) {
perror(lseek);
@@ -190,6 +198,14 @@
strcpy(nat-nat_ifnames[1], s);
rw = 1;
}
+if (!strncmp(nat-nat_ifnames[2], ifs, olen + 1)) {
+strcpy(nat-nat_ifnames[2], s);
+rw = 1;
+}
+if (!strncmp(nat-nat_ifnames[3], ifs, olen + 1)) {
+strcpy(nat-nat_ifnames[3], s);
+rw = 1;
+}
if (rw == 1) {
if (lseek(fd, pos, SEEK_SET) != pos) {
perror(lseek);
@@ -216,7 +232,7 @@
char *dirname = NULL, *filename = NULL, *ifs = NULL;
 
progname = argv[0];

-   while ((c = getopt(argc, argv, d:f:lNnSRruvWw)) != -1)
+   while ((c = getopt(argc, argv, d:f:i:lNnSRruvWw)) != -1)
switch (c)
{

Re: How does not practice freebsd kernel programming?

2007-03-12 Thread Michael M. Press

You can play with adding system calls to FreeBSD. This is
not something that people need to do very often, but it is a
good way to give yourself some experience writing code that
runs in kernel mode. The following OnLamp tutorial is intended
for OpenBSD, but I think most of it applies to FreeBSD as
well:

http://www.onlamp.com/pub/a/bsd/2003/10/09/adding_system_calls.html
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How does not practice freebsd kernel programming?

2007-03-12 Thread Alexander N. Mueller
 What is the best way to start practicing kernel programming on freebsd for
 amateurs. I have found many sites about Linux kernel programming but none
 for FReebsd kernel programming.
 What are the usual steps followed while learning freebsd kernel
 programming?

Maybe you should take a look at the book The Design and Implementation of
the FreeBSD Operating System  by Marshall Kirk McKusick.  I'm also a
beginner in this field, and IMHO this book is a great introduction.

Regards,

Alex

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


Re: 6.2-RELEASE Kernel Panic (thread taskq)

2007-03-12 Thread Scott Oertel

Scott Oertel wrote:

Hello all,

I have 8 machines running 6.2-RELEASE, they're all under pretty heavy 
load. All but one is running Dual Opterons on Tyan motherboards, the 
other is running 2x Dual Core Xeon, on a Supermicro mb. I am receiving 
this panic on all the machines, some of them it happens once a month, 
others every few days. The only thing they all have in common now is 
they're running 3ware 9550SX SATA RAID controllers, and a PAE/SMP kernel


I have done a lot of searching around and have found other people 
having this same issue, but nobody seems to have a fix for it, or the 
threads just die eventually. I'm trying to get a dump but they seem to 
be corrupted when I try and load them into the debugger. I am going to 
attempt to do some online debugging next time I encounter one of these 
panic's


Anyway, here is the panic message. I have access to a serial console 
on all the machines, and I've enabled the kernel option to drop to the 
debugger on panic. Does anyone have any advice, or a fix in regards to 
this issue?


Here is the closest thing I got with nm from the instruction pointer:

[EMAIL PROTECTED] ~]# nm -n /boot/kernel/kernel | grep c03f60
c03f6050 T _mtx_lock_sleep

-

kernel trap 12 with interrupts disabled
Fatal trap 12: page fault while in kernel mode

cpuid = 3; apic id = 07
fault virtual address   = 0x104
fault code  = supervisor read, page not present
instruction pointer = 0x20:0xc03f60ed
stack pointer   = 0x28:0xe8e05c90
frame pointer   = 0x28:0xe8e05c9c
code segment= base 0x0, limit 0xf, type 0x1b
   = DPL 0, pres 1, def32 1, gran 1
processor eflags= resume, IOPL = 0
current process = 5 (thread taskq)
trap number = 12
panic: page fault
cpuid = 3


Uptime: 2d19h50m39s

Cannot dump. No dump device defined.   ### NOTE:  I've defined the 
dump device now.


Automatic reboot in 15 seconds - press a key on the console to abort




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




Any ideas? Should I forward this to the freebsd-stable list, do you guys 
think it would be more appropriate to send things like this there?




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


Re: 6.2-RELEASE Kernel Panic (thread taskq)

2007-03-12 Thread Scott Oertel

Markus Oestreicher wrote:

Scott Oertel schrieb:
I have 8 machines running 6.2-RELEASE, they're all under pretty 
heavy load. All but one is running Dual Opterons on Tyan 
motherboards, the other is running 2x Dual Core Xeon, on a 
Supermicro mb. I am receiving this panic on all the machines, some 
of them it happens once a month, others every few days. The only 
thing they all have in common now is they're running 3ware 9550SX 
SATA RAID controllers, and a PAE/SMP kernel


I have done a lot of searching around and have found other people 
having this same issue, but nobody seems to have a fix for it, or 
the threads just die eventually. I'm trying to get a dump but they 
seem to be corrupted when I try and load them into the debugger. I 
am going to attempt to do some online debugging next time I 
encounter one of these panic's


I had the same panic about once a day. In my case the machine was a mail
server running amavisd-new and SpamAssassin. After I have disabled razor
and pyzor checks the machine has been stable for months.

What are the machines running in your case?

Markus


Interesting, I read your previous post regarding the panic, it's nearly 
identical. These machines are hosting sites and filtering mail. I'll try 
and disable some of the filtering and see what happens. I'm not 
confident it will fix the problem, but it's worth a shot.



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