How to get a kthread ID?

2007-10-25 Thread Sergey Matveychuk

Is there a possibility to get a kthread ID inside a kthread?
Just like pthread_self(3).

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


Re: How to get a kthread ID?

2007-10-25 Thread Dag-Erling Smørgrav
Sergey Matveychuk [EMAIL PROTECTED] writes:
 Is there a possibility to get a kthread ID inside a kthread?
 Just like pthread_self(3).

curthread?

DES
-- 
Dag-Erling Smørgrav - [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: How to get a kthread ID?

2007-10-25 Thread Marc Lörner
On Thursday 25 October 2007 11:02, Sergey Matveychuk wrote:
 Is there a possibility to get a kthread ID inside a kthread?
 Just like pthread_self(3).

In function kthread_exit there you see that you can obtain the 
thread-structure with curthread. 
And then in this thread-structure is the field td_tid.

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


Re: Getting nonstandard serial baud rates w/FTDI

2007-10-25 Thread Brooks Talley
Thanks to everyone who applied.  The OpenBSD approach to setting UFTDI baud 
rates is definitely superior.

However, the root of my problem turned out to be Python.  Even with the new 
baud rate hardcoded in the UFTDI kernel module and manually added to termios.h, 
Python was refusing to admit that it was a valid baud rate.

The issue is that Python (2.5.1) compiles its own termios interface module, 
which builds a list of allowed baud rates from the defines in termios.h.  
Python's termios.c does something like this:

include termios.h
termios_constants[] = {
   {B300,B300},
   {B1200,B1200},
   {B2400,B2400},
.
.
.
#ifdef B115200
   {B115200,B115200}
#endif
#ifdef B230400
   {B230400,B230400}
#endif

So of course my new buad rate never got added to the list.  It's a fairly ugly 
problem, because the valud baud rates are set in #defines in termios.h and 
Python wants an array of them, and of course there's no way (that I know of) to 
enumerate defines and get a list of those that start with B followed by 
numbers (and, of course, for all I know there's some other BX define 
somewhere that is not intended to indicate an allowed baud rate).

The real solution would be to use the OpenBSD UFTDI baud rate generator and 
update Python's termios.c to avoid the list of valid baud rates and have it 
just ask the serial port to set the requested rate and report back any error.  
But that requires far more than my meager skills.  I just added another 
hardcoded #ifdef to Python's termios.c and it is all working now.

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


Re: Serial speed for boot device selection prompt

2007-10-25 Thread Sean Bruno



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

  
Thanks for the pointers.  I am currently unable to access 
www.freebsd.org for some reason.  It appears that I get a timeout trying 
to retrieve anything from the web site.  Other folks in my office seem 
to have the same problem, yet I can access the web site from my home 
network.


Any ideas what the connection issues might be?

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


Re: USB vs PAE

2007-10-25 Thread John Baldwin
On Wednesday 24 October 2007 05:06:39 pm M. Warner Losh wrote:
 In message: [EMAIL PROTECTED]
 Bob Bishop [EMAIL PROTECTED] writes:
 : Hi,
 : 
 : On 23 Oct 2007, at 20:45, Ivan Voras wrote:
 : 
 :  Bob Bishop wrote:
 :  Hi,
 : 
 :  The whole USB kit and caboodle is nodevice'd out in the PAE  
 :  config. Can
 :  anyone give a succinct summary of what needs fixing? (EVERYTHING!  
 :  is an
 :  acceptable answer) Thanks
 : 
 :  I'm running USB keyboard and mouse under PAE without problems. Don't
 :  know about other USB devices. AFAIK everything that is 64-bit clean
 :  (i.e. works on AMD64 and other architectures) should work ok with PAE,
 :  so try compiling it in and see for yourself.
 : 
 : 
 : Yes. Keyboard and umass (CDROM and memory stick) seem to work here on  
 : 6.2R. Thanks!
 
 In 6.x the big problem is busdma support.  USB doesn't use it quite
 right, which means that buffers that it uses must be in the lower
 4GB.  If not, then it won't work.
 
 Current does proper scatter/gather, so should work without issue.

Ah, ok.  How does USB on 6.x work with amd64?  Also, any idea when the USB 
stuff will be MFC'd to 6?

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


Re: Serial speed for boot device selection prompt

2007-10-25 Thread Jeremy Chadwick
On Thu, Oct 25, 2007 at 10:36:28AM -0700, Sean Bruno wrote:
 Thanks for the pointers.  I am currently unable to access www.freebsd.org 
 for some reason.  It appears that I get a timeout trying to retrieve 
 anything from the web site.  Other folks in my office seem to have the same 
 problem, yet I can access the web site from my home network.

 Any ideas what the connection issues might be?

Someone else recently reported similar on their FreeBSD box, and the fix
for them was to disable RFC1323 TCP window scaling.  Try this:

sysctl -w net.inet.tcp.rfc1323=0

If this works for you, you can place the variable=value portion in
/etc/sysctl.conf for application upon start-up.

If your FreeBSD box acts as a gateway for the rest of your office, and
the then that might explain why others are seeing the same thing.
Otherwise the problem is likely not FreeBSD-related, and you should
talk to your office networking folks to find out what's going on.

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

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


FreeBSD.org website problems was: Serial speed for boot device selection prompt

2007-10-25 Thread Sean Bruno

Jeremy Chadwick wrote:

On Thu, Oct 25, 2007 at 10:36:28AM -0700, Sean Bruno wrote:
  
Thanks for the pointers.  I am currently unable to access www.freebsd.org 
for some reason.  It appears that I get a timeout trying to retrieve 
anything from the web site.  Other folks in my office seem to have the same 
problem, yet I can access the web site from my home network.


Any ideas what the connection issues might be?



Someone else recently reported similar on their FreeBSD box, and the fix
for them was to disable RFC1323 TCP window scaling.  Try this:

sysctl -w net.inet.tcp.rfc1323=0

If this works for you, you can place the variable=value portion in
/etc/sysctl.conf for application upon start-up.

If your FreeBSD box acts as a gateway for the rest of your office, and
the then that might explain why others are seeing the same thing.
Otherwise the problem is likely not FreeBSD-related, and you should
talk to your office networking folks to find out what's going on.

  

Interesting, what is _really_ going on with the website?

I was having connectivity issues to www.freebsd.org from linux, netbsd 
and freebsd machines.  After adjusting  the appropriate value for linux, 
netbsd and freebsd the issues seem to clear.


Under linux adjust:

net.ipv4.tcp_window_scaling

Under FreeBSD/NetBSD adjust:

net.inet.tcp.rfc1323

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


Re: How to get a kthread ID?

2007-10-25 Thread Julian Elischer

Dag-Erling Smørgrav wrote:

Sergey Matveychuk [EMAIL PROTECTED] writes:

Is there a possibility to get a kthread ID inside a kthread?
Just like pthread_self(3).


curthread?


well that's a thread pointer, but you are I guess correct because from there
you can get to curthread-td_tid which is the thread ID.



DES


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


Re: Serial speed for boot device selection prompt

2007-10-25 Thread Larry Baird
In article [EMAIL PROTECTED] you wrote:
 On Wed, Oct 24, 2007 at 10:50:21AM -0700, Sean Bruno wrote:
 I have a drive that contains two seperate bootable partitions(ad0s1a and 
 ad0s2a).  The boot device selection menu(boot0?) appears to only be able to 
 support 9600 8N1.  I wanted to run the serial console at 115200, but I 
 currently have to switch to 9600 if I need to change the boot device.  Is 
 there a way around this that I can't see?  Could I get around this with a 
 BIOS that can do console redirection?
 
 Which boot device selection menu are you referring to?  boot0?
 implies you don't know.  Here's the difference:
 
 boot0 is this stage:
 
 F1  FreeBSD
 F5  Drive 1
 Default: F1
 
 boot2 is this stage:
 
 FreeBSD/i386 BOOT
 Default: 0:ad(0,a)/boot/loader
 boot:
 
 If you want serial capability in boot0, you should set
 BOOT_COMCONSOLE_SPEED=115200 in your make.conf.  After you do that,
 you'll need to rebuild the boot blocks.  The procedure for doing that is
 step 4 of Section 24.6.5.2 in the Handbook:
 
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serialconsole-setup.html

The BIOS call that boot.S is using (int 0x14) only supports a maximum
speed of 9600.  To get speeds greater that 9600, it needs to do the
I/O itself.  There used to be a version floating around that did this.
I have a extemely modified version that uses this method.  If you can't
find a version that does this, let mw know and I'll see if I can cleanup
what I have.

Larry

-- 

Larry Baird| http://www.gta.com
Global Technology Associates, Inc. | Orlando, FL
Email: [EMAIL PROTECTED] | TEL 407-380-0220, FAX 407-380-6080
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Serial speed for boot device selection prompt

2007-10-25 Thread Sean Bruno



If you want serial capability in boot0, you should set
BOOT_COMCONSOLE_SPEED=115200 in your make.conf.  After you do that,
you'll need to rebuild the boot blocks.  The procedure for doing that is
step 4 of Section 24.6.5.2 in the Handbook:

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



The BIOS call that boot.S is using (int 0x14) only supports a maximum
speed of 9600.  To get speeds greater that 9600, it needs to do the
I/O itself.  There used to be a version floating around that did this.
I have a extemely modified version that uses this method.  If you can't
find a version that does this, let mw know and I'll see if I can cleanup
what I have.

Larry

  
Thanks, that at least confirmed my theory while reviewing the assembly 
that boot.S was not capable of

more than 9600.

I'll look around first, but may request the code later.

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


Re: Getting nonstandard serial baud rates w/FTDI

2007-10-25 Thread Bernd Walter
On Thu, Oct 25, 2007 at 08:52:48AM -0700, Brooks Talley wrote:
 Thanks to everyone who applied.  The OpenBSD approach to setting UFTDI baud 
 rates is definitely superior.
 
 However, the root of my problem turned out to be Python.  Even with the new 
 baud rate hardcoded in the UFTDI kernel module and manually added to 
 termios.h, Python was refusing to admit that it was a valid baud rate.
 
 The issue is that Python (2.5.1) compiles its own termios interface module, 
 which builds a list of allowed baud rates from the defines in termios.h.  
 Python's termios.c does something like this:
 
 include termios.h
 termios_constants[] = {
{B300,B300},
{B1200,B1200},
{B2400,B2400},
 .
 .
 .
 #ifdef B115200
{B115200,B115200}
 #endif
 #ifdef B230400
{B230400,B230400}
 #endif
 
 So of course my new buad rate never got added to the list.  It's a fairly 
 ugly problem, because the valud baud rates are set in #defines in termios.h 
 and Python wants an array of them, and of course there's no way (that I know 
 of) to enumerate defines and get a list of those that start with B followed 
 by numbers (and, of course, for all I know there's some other BX define 
 somewhere that is not intended to indicate an allowed baud rate).
 
 The real solution would be to use the OpenBSD UFTDI baud rate generator and 
 update Python's termios.c to avoid the list of valid baud rates and have it 
 just ask the serial port to set the requested rate and report back any error. 
  But that requires far more than my meager skills.  I just added another 
 hardcoded #ifdef to Python's termios.c and it is all working now.

I will take care about the ftdi driver within the next days, but will
not MFC it until the releases are done.
The python part is left for someone else.

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