Re: Unable to get APM working -- help!

2004-12-26 Thread security
> On Sun, 26 Dec 2004 13:28, [EMAIL PROTECTED] wrote:
>> > Try acpiconf -i 1
>>
>> Same result :/
>
> Hmm.. what's your dmesg output when you boot verbose with ACPI enabled?
>

Check the end of mail

>> > I prefer acpi_pcc http://www.spa.is.uec.ac.jp/~nfukuda/software/ which
>> I
>> > believe does the same thing but only needs a kernel module to work.
>>
>> Does it work on Pentium-M ?
>
> Yep.
>

I'll try it out; meanwhile, I've discovered the sysctl to change this
manually. I've checked it works by trying to compile something at the
lowest CPU clock speed. It was slow to hell :-)

>> >> load, and maxing it (1.6GHz) under load, but with ACPI off. With ACPI
>> on
>> >> it's always at 1.6GHz. Plus, I've noticed the 'top' CPU values are
>> plain
>> >> wrong. I was compiling thunderbird, xmms, and firefox and it showed
>> all
>> >> processes with 0.00% CPU.
>> >
>> > Do your kernel and userland match?
>>
>> 5.3-RELEASE from cd and a custom kernel I built. I've just tested, and
>> the
>> results are widly innacurate ONLY with ACPI turned on.. weird.
>
> Any chance there is a new BIOS available for that system?
>

A quick googling session brought up nothing.

>> Did you have to do anything in special to make -i 0 work? (it says
>> device
>> not configured to me.. perhaps I missed something)
>
> No.. If I try and look at a non existent battery slot it says 'device not
> configured' so maybe it thinks you have no batteries for some strange
> reason.
>
I've installed klaptop and it shows battery as -1 and 'not charging'
acpiconf -i[0-9] didn't do any good either :/

> --
> Daniel O'Connor software and network engineer
> for Genesis Software - http://www.gsoft.com.au
> "The nice thing about standards is that there
> are so many of them to choose from."
>   -- Andrew Tanenbaum
> GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
>


dmesg (ACPI on, boot verbose)


Copyright (c) 1992-2004 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 5.3-RELEASE #1: Sat Dec 25 03:41:40 WET 2004
[EMAIL PROTECTED]:/usr/src/sys/i386/compile/laptop-kernel
WARNING: debug.mpsafenet forced to 0 as ipsec requires Giant
WARNING: MPSAFE network stack disabled, expect reduced performance.
Preloaded elf kernel "/boot/kernel/kernel" at 0xc09cb000.
Calibrating clock(s) ... i8254 clock: 1193164 Hz
CLK_USE_I8254_CALIBRATION not specified - using default frequency
Timecounter "i8254" frequency 1193182 Hz quality 0
Calibrating TSC clock ... TSC clock: 1598650059 Hz
CPU: Intel(R) Pentium(R) M processor 1.60GHz (1598.65-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x6d6  Stepping = 6
  
Features=0xafe9f9bf
real memory  = 535691264 (510 MB)
Physical memory chunk(s):
0x1000 - 0x0009efff, 647168 bytes (158 pages)
0x0010 - 0x003f, 3145728 bytes (768 pages)
0x00c26000 - 0x1f5b4fff, 513339392 bytes (125327 pages)
avail memory = 514539520 (490 MB)
bios32: Found BIOS32 Service Directory header at 0xc00f6310
bios32: Entry = 0xfd520 (c00fd520)  Rev = 0  Len = 1
pcibios: PCI BIOS entry at 0xfd520+0x262
pnpbios: Found PnP BIOS data at 0xc00f6350
pnpbios: Entry = f:ab76  Rev = 1.0
Other BIOS signatures found:
wlan: <802.11 Link Layer>
null: 
random: 
io: 
mem: 
Pentium Pro MTRR support enabled
acpi0:  on motherboard
acpi0: [MPSAFE]
pci_open(1):mode 1 addr port (0x0cf8) is 0x8000f904
pci_open(1a):   mode1res=0x8000 (0x8000)
pci_cfgcheck:   device 0 [class=06] [hdr=80] is there (id=35808086)
pcibios: BIOS version 2.10
Found $PIR table, 9 entries at 0xc00fdd00
PCI-Only Interrupts: none
Location  Bus Device Pin  Link  IRQs
embedded0   30A   0x60  6
embedded0   30B   0x61  10
embedded0   30C   0x62  6
embedded0   30D   0x63  6
embedded26A   0x68  10
embedded26B   0x69  10
embedded26C   0x6a  6
embedded24A   0x61  10
embedded24B   0x62  6
embedded22A   0x63  6
embedded00A   0x60  6
embedded00B   0x61  10
embedded00C   0x62  6
embedded00D   0x63  6
embedded0   31A   0x62  6
embedded0   31B   0x61  10
embedded0   29A   0x60  6
embedded0   29B   0x63  6
embedded0   29C   0x62  6
embedded0   29D   0x6b  10
embedded01A   0x60  6
embedded01B   0x61  10
slot 1  10A   0x60  6
slot 1  10B   0x61  10
AcpiOsDerivePciId: bus 0 dev 31 func 0
AcpiOsDerivePciId: bus 0 dev 31 func 0
AcpiOsDerivePciId: bus 0 dev 31 func 1
acpi0: Power Button (fixed)
atpic: Programming IRQ9 as level/low
AcpiOsDerivePciId: bus 0 dev 0 func 0
AcpiOsDerivePciId: bus 0 dev 0 func 1
acpi_ec0:  port 0x66,0x62 on acpi0
acpi_ec0: info: new max delay is 970 us
ACPI timer looks GOOD min = 2, max = 3, width = 1
ACPI timer looks GOOD min = 2, 

Re: Unable to get APM working -- help!

2004-12-26 Thread security
> On Sun, 26 Dec 2004 13:28, [EMAIL PROTECTED] wrote:
>> > Try acpiconf -i 1
>>
>> Same result :/
>
> Hmm.. what's your dmesg output when you boot verbose with ACPI enabled?
>

I'll be mailing it right next from other mail account (it's timeouting on
this web mail - subject is 'dmesg from acer laptop')

>> > I prefer acpi_pcc http://www.spa.is.uec.ac.jp/~nfukuda/software/ which
>> I
>> > believe does the same thing but only needs a kernel module to work.
>>
>> Does it work on Pentium-M ?
>
> Yep.
>

I'll try it out; meanwhile, I've discovered the sysctl to change this
manually. I've checked it works by trying to compile something at the
lowest CPU clock speed. It was slow to hell :-)

>> >> load, and maxing it (1.6GHz) under load, but with ACPI off. With ACPI
>> on
>> >> it's always at 1.6GHz. Plus, I've noticed the 'top' CPU values are
>> plain
>> >> wrong. I was compiling thunderbird, xmms, and firefox and it showed
>> all
>> >> processes with 0.00% CPU.
>> >
>> > Do your kernel and userland match?
>>
>> 5.3-RELEASE from cd and a custom kernel I built. I've just tested, and
>> the
>> results are widly innacurate ONLY with ACPI turned on.. weird.
>
> Any chance there is a new BIOS available for that system?
>

A quick googling session brought up nothing.

>> Did you have to do anything in special to make -i 0 work? (it says
>> device
>> not configured to me.. perhaps I missed something)
>
> No.. If I try and look at a non existent battery slot it says 'device not
> configured' so maybe it thinks you have no batteries for some strange
> reason.
>
I've installed klaptop and it shows battery as -1 and 'not charging'
acpiconf -i[0-9] didn't do any good either :/

> --
> Daniel O'Connor software and network engineer
> for Genesis Software - http://www.gsoft.com.au
> "The nice thing about standards is that there
> are so many of them to choose from."
>   -- Andrew Tanenbaum
> GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
>

dmesg
Description: Binary data


dmesg
Description: Binary data


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


Re: Unable to get APM working -- help!

2004-12-26 Thread Daniel O'Connor
On Sun, 26 Dec 2004 15:26, [EMAIL PROTECTED] wrote:
> I'll try it out; meanwhile, I've discovered the sysctl to change this
> manually. I've checked it works by trying to compile something at the
> lowest CPU clock speed. It was slow to hell :-)

That's probably clock throttling which is different..

[Enhanced] Speed Step reduces the clock speed and the CPU core voltage.. clock 
throttling just idles the CPU for a certain proportion of the time. If you 
want slow try forcing them both to the slowest speed.. Pentium-M 75Mhz :)

> > Any chance there is a new BIOS available for that system?
>
> A quick googling session brought up nothing.

How about say, checking the makers web site?

> > No.. If I try and look at a non existent battery slot it says 'device not
> > configured' so maybe it thinks you have no batteries for some strange
> > reason.
>
> I've installed klaptop and it shows battery as -1 and 'not charging'
> acpiconf -i[0-9] didn't do any good either :/

Without ACPI support being able to read your battery status no userland 
program will work.

Your dmesg shows acpi_cmbat entries, ie
acpi_cmbat0:  on acpi0
acpi_cmbat1:  on acpi0

which I think is pretty fundamental to being able to read battery status ;)


-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


pgp0eP5lW6cb9.pgp
Description: PGP signature


Re: Unable to get APM working -- help!

2004-12-26 Thread security
> On Sun, 26 Dec 2004 15:26, [EMAIL PROTECTED] wrote:
>> I'll try it out; meanwhile, I've discovered the sysctl to change this
>> manually. I've checked it works by trying to compile something at the
>> lowest CPU clock speed. It was slow to hell :-)
>
> That's probably clock throttling which is different..

Yes, the sysctl included "throttle". As I said, I'm new to the laptop
world.. Is the power saving difference a lot if I just throttle the clock,
instead of using enhanced speed step?

>
> [Enhanced] Speed Step reduces the clock speed and the CPU core voltage..
> clock
> throttling just idles the CPU for a certain proportion of the time. If you
> want slow try forcing them both to the slowest speed.. Pentium-M 75Mhz :)
>
>> > Any chance there is a new BIOS available for that system?
>>
>> A quick googling session brought up nothing.
>
> How about say, checking the makers web site?
>

I also did, nothing :-P

>> > No.. If I try and look at a non existent battery slot it says 'device
>> not
>> > configured' so maybe it thinks you have no batteries for some strange
>> > reason.
>>
>> I've installed klaptop and it shows battery as -1 and 'not charging'
>> acpiconf -i[0-9] didn't do any good either :/
>
> Without ACPI support being able to read your battery status no userland
> program will work.
>
> Your dmesg shows acpi_cmbat entries, ie
> acpi_cmbat0:  on acpi0
> acpi_cmbat1:  on acpi0
>
> which I think is pretty fundamental to being able to read battery status
> ;)
>

Yesterday I googled a bit for my laptop name+linux and I found a post from
a guy who had the same exact problem under Linux. He had /proc/acpi but no
/proc/acpi/battery.

I know battery status can be seen, as the laptop shipped with win XP home,
which I promptly got rid of, but I installed a game there to see how many
FPS I'd get playing with the laptop. So I still messed around with it
(windows) for around 35 minutes, and could see the little battery icon
discharging.

If the acpi_cmbat0/1 shows up on dmesg, what could be wrong? Perhaps this
ACPI implementation is a bit weird and I should send a copy of my asl to
freebsd-acpi ?


>
> --
> Daniel O'Connor software and network engineer
> for Genesis Software - http://www.gsoft.com.au
> "The nice thing about standards is that there
> are so many of them to choose from."
>   -- Andrew Tanenbaum
> GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
>


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


Re: Unable to get APM working -- help! [no acpi_cmbat entries]

2004-12-26 Thread security
Just a quick add, my dmesg doesn't show acpi_cmbat entries. You probably
confused my dmesg with yours (from the dmesg mail I sent you)

>> On Sun, 26 Dec 2004 15:26, [EMAIL PROTECTED] wrote:
>>> I'll try it out; meanwhile, I've discovered the sysctl to change this
>>> manually. I've checked it works by trying to compile something at the
>>> lowest CPU clock speed. It was slow to hell :-)
>>
>> That's probably clock throttling which is different..
>
> Yes, the sysctl included "throttle". As I said, I'm new to the laptop
> world.. Is the power saving difference a lot if I just throttle the clock,
> instead of using enhanced speed step?
>
>>
>> [Enhanced] Speed Step reduces the clock speed and the CPU core voltage..
>> clock
>> throttling just idles the CPU for a certain proportion of the time. If
>> you
>> want slow try forcing them both to the slowest speed.. Pentium-M 75Mhz
>> :)
>>
>>> > Any chance there is a new BIOS available for that system?
>>>
>>> A quick googling session brought up nothing.
>>
>> How about say, checking the makers web site?
>>
>
> I also did, nothing :-P
>
>>> > No.. If I try and look at a non existent battery slot it says 'device
>>> not
>>> > configured' so maybe it thinks you have no batteries for some strange
>>> > reason.
>>>
>>> I've installed klaptop and it shows battery as -1 and 'not charging'
>>> acpiconf -i[0-9] didn't do any good either :/
>>
>> Without ACPI support being able to read your battery status no userland
>> program will work.
>>
>> Your dmesg shows acpi_cmbat entries, ie
>> acpi_cmbat0:  on acpi0
>> acpi_cmbat1:  on acpi0
>>
>> which I think is pretty fundamental to being able to read battery status
>> ;)
>>
>
> Yesterday I googled a bit for my laptop name+linux and I found a post from
> a guy who had the same exact problem under Linux. He had /proc/acpi but no
> /proc/acpi/battery.
>
> I know battery status can be seen, as the laptop shipped with win XP home,
> which I promptly got rid of, but I installed a game there to see how many
> FPS I'd get playing with the laptop. So I still messed around with it
> (windows) for around 35 minutes, and could see the little battery icon
> discharging.
>
> If the acpi_cmbat0/1 shows up on dmesg, what could be wrong? Perhaps this
> ACPI implementation is a bit weird and I should send a copy of my asl to
> freebsd-acpi ?
>
>
>>
>> --
>> Daniel O'Connor software and network engineer
>> for Genesis Software - http://www.gsoft.com.au
>> "The nice thing about standards is that there
>> are so many of them to choose from."
>>   -- Andrew Tanenbaum
>> GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
>>
>
>
> ___
> 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: parameters for tsleep(9)

2004-12-26 Thread Roman Kurakin
Hi,
1) man tsleep
2) tsleep is just msleep with NULL mutex.
if you check sys/kern/kern_synch.c you will
see KASSERT (ident != NULL && ...
ident is exactly the first parameter.
rik
Norbert Koch:
Hello.
I am just writing a device driver for the i82527 (can-bus) chip.
For testing I need the driver to poll the chip instead of running
in interrupt mode.
My dev_t read function basically looks like this:
for (;;)
{
 while (chip_has_data(...))
 {
   read_chip_data(...);
   error = do_uiomove(...);
   if (error || enough_read(...))
   {
 return error;
   }
 };
 if (do_not_block_on_read(...))
 {
   return EWOULDBLOCK;
 }
 error = tsleep (XXX, PCATCH|PWAIT, "canrd", hz / 10);
 if (error != EWOULDBLOCK)
 {
   return error;
 }
}
XXX should be 'something' which could be used
as parameter to wakeup(9), I read in tsleep(9).
In the kernel source tree I found one
place where tsleep _only_ sleeps: in sys/isa/ppc.c
(which already seems to be in the attic [?] but
still is in my computer's source tree).
Here, the first parameter was set to NULL.
Doing this I found, that tsleep immediately
returns 0 (which means: wakueup was called)
_without_ waiting. I even crashed or
froze the kernel by calling tsleep (NULL, ...)
for a random number of times. After changing
this to the address of the read-function itself,
all worked fine. No more crashes.
Just for my understanding: Is this a bug?
Does the first parameter have to point to
something useful?
Is it allowed to point it to a code position?
Or should I use some kind of dummy data in
the softc structure instead?
What about the second parameter: Is PWAIT
ok here or should I use PZERO or whatever?
(And btw, why has ppc.c been removed?)
Thank you.
___
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: Unable to get APM working -- help! [no acpi_cmbat entries]

2004-12-26 Thread Daniel O'Connor
On Mon, 27 Dec 2004 02:47, [EMAIL PROTECTED] wrote:
> Just a quick add, my dmesg doesn't show acpi_cmbat entries. You probably
> confused my dmesg with yours (from the dmesg mail I sent you)

Err, I said you didn't have any cmbat entries.. My point was that the lack of 
those entries is probably a hint as to why you can't see any battery info.

As you suggest, try posting on freebsd-acpi about it.

> >> On Sun, 26 Dec 2004 15:26, [EMAIL PROTECTED] wrote:
> >>> I'll try it out; meanwhile, I've discovered the sysctl to change this
> >>> manually. I've checked it works by trying to compile something at the
> >>> lowest CPU clock speed. It was slow to hell :-)
> >>
> >> That's probably clock throttling which is different..
> >
> > Yes, the sysctl included "throttle". As I said, I'm new to the laptop
> > world.. Is the power saving difference a lot if I just throttle the
> > clock, instead of using enhanced speed step?
> >
> >> [Enhanced] Speed Step reduces the clock speed and the CPU core voltage..
> >> clock
> >> throttling just idles the CPU for a certain proportion of the time. If
> >> you
> >> want slow try forcing them both to the slowest speed.. Pentium-M 75Mhz
> >>
> >> :)
> >> :
> >>> > Any chance there is a new BIOS available for that system?
> >>>
> >>> A quick googling session brought up nothing.
> >>
> >> How about say, checking the makers web site?
> >
> > I also did, nothing :-P
> >
> >>> > No.. If I try and look at a non existent battery slot it says 'device
> >>>
> >>> not
> >>>
> >>> > configured' so maybe it thinks you have no batteries for some strange
> >>> > reason.
> >>>
> >>> I've installed klaptop and it shows battery as -1 and 'not charging'
> >>> acpiconf -i[0-9] didn't do any good either :/
> >>
> >> Without ACPI support being able to read your battery status no userland
> >> program will work.
> >>
> >> Your dmesg shows acpi_cmbat entries, ie
> >> acpi_cmbat0:  on acpi0
> >> acpi_cmbat1:  on acpi0
> >>
> >> which I think is pretty fundamental to being able to read battery status
> >> ;)
> >
> > Yesterday I googled a bit for my laptop name+linux and I found a post
> > from a guy who had the same exact problem under Linux. He had /proc/acpi
> > but no /proc/acpi/battery.
> >
> > I know battery status can be seen, as the laptop shipped with win XP
> > home, which I promptly got rid of, but I installed a game there to see
> > how many FPS I'd get playing with the laptop. So I still messed around
> > with it (windows) for around 35 minutes, and could see the little battery
> > icon discharging.
> >
> > If the acpi_cmbat0/1 shows up on dmesg, what could be wrong? Perhaps this
> > ACPI implementation is a bit weird and I should send a copy of my asl to
> > freebsd-acpi ?
> >
> >> --
> >> Daniel O'Connor software and network engineer
> >> for Genesis Software - http://www.gsoft.com.au
> >> "The nice thing about standards is that there
> >> are so many of them to choose from."
> >>   -- Andrew Tanenbaum
> >> GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
> >
> > ___
> > 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]"

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


pgp1AkkPDOpbS.pgp
Description: PGP signature


i386_set_ioperm on FreeBSD 5.3

2004-12-26 Thread Tom Alsberg
Hi there.

I'm trying to use some code I wrote quite a while ago using Doug
White's FreeBSD IPMI code (kcs.c, send-kcs-command.c, etc.).

It still works as it did back then on FreeBSD 4.10.  On FreeBSD 5.3 it
does not.

Problem seems to be, that i386_set_ioperm isn't doing what it should.
The program gets SIGBUS when doing outb, while it shouldn't.

I looked in /usr/src/sys/i386/i386/sys_machdep.c, not many changes
from 4.10 - all except one are additions that would return an error in
case of failure.  One seems to be quite modest (struct change):

-   if (p->p_addr->u_pcb.pcb_ext == 0)
-   if ((error = i386_extend_pcb(p)) != 0)
+   if (td->td_pcb->pcb_ext == 0)
+   if ((error = i386_extend_pcb(td)) != 0)

Yet, clearly something fails on FreeBSD 5.3.  I can confirm that this
is indeed the problem with a few-line program that will
i386_set_ioperm and then try to do outb.  Any idea if i386_set_ioperm
broke somehow in 5.3?  Haven't checked much, but it seems that the
data it is changing is not being used after all.

  Thanks, any help appreciated,
  -- Tom

-- 
  Tom Alsberg - hacker (being the best description fitting this space)
  Web page: http://www.cs.huji.ac.il/~alsbergt/
DISCLAIMER:  The above message does not even necessarily represent what
my fingers have typed on the keyboard, save anything further.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"