Linux-Development-Sys Digest #423, Volume #8     Wed, 17 Jan 01 04:13:07 EST

Contents:
  X/Open Transport Interface on Linux (Mehmet Ali Guler)
  Re: devloper.kde.org is down? (The Ghost In The Machine)
  How to get CPU & Memory status in kernel? (Chien-Hwa Hwang)
  Symbol table storage. (Thaddeus L Olczyk)
  PATH for cooperating executables? (Kaelin Colclasure)
  Re: cpu_present_map vs. cpu_number_map? (Kaelin Colclasure)
  Re: Emacs window size. (Thaddeus L Olczyk)
  how to turn on/off the 3 LEDs on the keyboard? (Hackker Wong)
  Re: double to byte stream convert ("O.Petzold")

----------------------------------------------------------------------------

From: Mehmet Ali Guler <[EMAIL PROTECTED]>
Subject: X/Open Transport Interface on Linux
Date: Tue, 16 Jan 2001 16:58:02 -0600
Reply-To: [EMAIL PROTECTED]

Is there a port of the X/Open Transport Interface (XTI or TLI) to the
Linux platform? If so, where can I get them?
Any information would be greatly appreciated!



------------------------------

From: [EMAIL PROTECTED] (The Ghost In The Machine)
Subject: Re: devloper.kde.org is down?
Date: Wed, 17 Jan 2001 00:47:11 GMT

In comp.os.linux.development.system, Thaddeus L Olczyk
<[EMAIL PROTECTED]>
 wrote
on Wed, 03 Jan 2001 14:41:46 GMT
<[EMAIL PROTECTED]>:
>Anyone know whats up?
>Is this temporary or permanent?
>Is there anyplace else on the net I can go to get information?
>Especially a list of kde classes, and documentation of them.

Looks up to me.  You can check to see if you've got the right IP#
by using nslookup:

nslookup developer.kde.org
[...]

Non-authoritative answer:
Name:    alpha.tat.physik.uni-tuebingen.de
Address:  134.2.170.97
Aliases:  developer.kde.org

-- 
[EMAIL PROTECTED] -- insert random misquote here
EAC code #191       5d:09h:38m actually running Linux.
                    Microsoft.  When it absolutely, positively has to act weird.

------------------------------

From: Chien-Hwa Hwang <[EMAIL PROTECTED]>
Subject: How to get CPU & Memory status in kernel?
Date: 17 Jan 2001 02:55:35 GMT

Hi,

        I have a question. Does anybody know that how to get CPU usage and
Memory status in linux kernel. I just trace source code of kernel, and found
out it call si_meminfo() to get these. But it seems call assembly code to do
works at bottom layer. So I want to know how do kernel achieve this. Thanks.


                                        Jack.

------------------------------

From: [EMAIL PROTECTED] (Thaddeus L Olczyk)
Subject: Symbol table storage.
Date: Wed, 17 Jan 2001 04:28:35 GMT
Reply-To: [EMAIL PROTECTED]

I've compiled the KDE source ( in particular kdelibs ) and am now
trying to single step through some of it.
The problem is that even though I enable debugging, and even check
makefile output (gcc/g++ always are called with the -g option ),
there seems to be no debugging/symbol table information stored
anywhere. 
I've also renamed strip so that it is not callled.
I wonder if the symbol tables might not be stored in a seperate file,
which does not get copied during the install process.
Can anyone help?
TIA

------------------------------

From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: PATH for cooperating executables?
Date: 16 Jan 2001 21:42:39 -0800

I have an executable which needs to fork/exec a `helper' program that's
part of the same package. Is there an idiomatic way to determine the
path to the helper executable based on the parent process? Do people
just examine argv[0] for this sort of thing? I'd prefer to not have to
rely on the PATH environment if possible. [But I'd also prefer that the
program/helper work if the user decides to try them out from the build
tree, so capturing --exec-prefix at compile-time is not sufficient.]

-- Kaelin

------------------------------

From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: Re: cpu_present_map vs. cpu_number_map?
Date: 16 Jan 2001 21:54:19 -0800

Kaelin Colclasure <[EMAIL PROTECTED]> writes:

[...]
> The kernel sources have revealed to me the existance of a couple of
> promising-looking variables:
> 
>     cpu_present_map - a bit mask of physically-present CPU's
>     cpu_number_map[NR_CPUS] - an array of ???
> 
> At first blush, checking for the highest bit set in cpu_present_map
> would seem to tell me how big my array needs to be, and then I'd
> just need to allocate a buffer at each position where a bit was set.
> But do those indices in fact correlate to what smp_processor_id ()
> is going to return? Or does cpu_number_map[] need to play into this
> somewhere? (And what the heck is in there anyway?)
> 
> Is there a way to peek at these things without adding code to my
> device driver? I do believe they are exported kernel symbols...

Well, with some help from the #kernelnewbies folks I have partially
answered some of these questions:

---8<---
[root@gemini /root]# grep cpu /proc/ksyms
c0255780 boot_cpu_data_Rsmp7771ef76
c02b2600 cpu_data_Rsmp440df478
c02b2560 cpu_number_map_Rsmpc48679de
c02b3700 __cpu_logical_map_Rsmpaea62bd2
c0255d18 smp_num_cpus_Rsmp3b86334d
c0255d10 cpu_present_map_Rsmp4c52cf6f
c0255d14 cpu_online_map_Rsmpc0aa8a72
[root@gemini /root]# gdb /boot/vmlinux-2.2.14-5.0.14smp /proc/kcore
GNU gdb 19991004
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
#0  0x0 in ?? ()
(gdb) x/xw 0xc0255d10
0xc0255d10 <cpu_present_map>:   0x00000002
(gdb) x/xw 0xc0255d14
0xc0255d14 <cpu_online_map>:    0x00000002
(gdb) x/4xw 0xc02b2560
0xc02b2560 <cpu_number_map>:    0xffffffff 0x00000000 0xffffffff 0xffffffff
--->8---

Here on one of the `broken' machines I can see that the cpu_present_map
and cpu_online_map do indeed have one bit set corresponding to the
processor in slot 1. And cpu_number_map is -1 at all entries except
where the processor is, and that entry is 0.

---8<---
[kaelin@soyuz perforce]$ grep cpu /proc/ksyms
c0205080 boot_cpu_data_Rsmp2e96a284
c025dbe0 cpu_data_Rsmp107d1104
c025db40 cpu_number_map_Rsmpc48679de
c025ef60 __cpu_logical_map_Rsmpaea62bd2
c0205398 smp_num_cpus_Rsmp3b86334d
c0205390 cpu_present_map_Rsmp4c52cf6f
c0205394 cpu_online_map_Rsmpc0aa8a72
[kaelin@soyuz linux]$ sudo gdb /boot/vmlinux-2.2.17-4smp-klc /proc/kcore
Password:
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...

warning: unknown architecture file may be incompatible with i386 target.
#0  0x0 in ?? ()
(gdb) x/xw 0xc0205390
0xc0205390 <cpu_present_map>:   0x00000003
(gdb) x/xw 0xc0205394
0xc0205394 <cpu_online_map>:    0x00000003
(gdb) x/4xw 0xc025db40
0xc025db40 <cpu_number_map>:    0x00000000 0x00000001 0xffffffff 0xffffffff
--->8---

And here on my SMP machine, two bits are set corresponding to processors
0 and 1 and cpu_number_map contains 0 and 1 in the first two entries.

-- Kaelin

------------------------------

From: [EMAIL PROTECTED] (Thaddeus L Olczyk)
Subject: Re: Emacs window size.
Date: Wed, 17 Jan 2001 06:46:21 GMT
Reply-To: [EMAIL PROTECTED]

On 16 Jan 2001 11:23:28 -0600, [EMAIL PROTECTED] (gpk)
wrote:

>In article <[EMAIL PROTECTED]>,
>Thaddeus L Olczyk <[EMAIL PROTECTED]> wrote:
>>I've asked this question to no avail on the emacs newsgroup.
>>From an emacs standpoint I seem to be doing everything
>>right, so it must be a linux problem.
>>From linux, when I open emacs or create a new frame, I am disatisified
>>with the size of the window.
>>I've create both a default-frame-alist and initial-frame-alist,
>>configured them accordingly with (height . x) (width . y) and
>>no matter what the windows come up the same size.
>>I don't have this problem with Windows. I figure there must be
>>something strange about linux, or gnome ( version 1.2.1 ). ANy ideas?
>>TIA
>>
>>
>
> check the "-geometry" command line arg on the emacs man page.
>
That only works for the first  frame any new frames opened are the
default size.

------------------------------

From: Hackker Wong <[EMAIL PROTECTED]>
Subject: how to turn on/off the 3 LEDs on the keyboard?
Date: Wed, 17 Jan 2001 15:39:39 +0800

hi,

do u know how to turn on/off the 3 LEDs (caps lock, num lock, scroll
lock) on the keyboard? i want to control the LEDs in my program. is
there any system call to do this? i found a function register_led() in
/usr/src/linux/drivers/char/keyboard.c, but i don't know how to use it.

pls help! thx a lot!

--
- By Hackker
****************************************************
  Mr. Hackker Wong,
  Y99 Student of Computer Science,
  The Chinese University of Hong Kong.
****************************************************
 -The World can't run without computer technicians-



------------------------------

From: "O.Petzold" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: double to byte stream convert
Date: Wed, 17 Jan 2001 09:26:50 +0100

> #include <iostream>
> #include <ieee754.h>
>
> int main()
> {
>     double fp = +1.01234523e34;
>     union ieee754_double fp_in, fp_out;
>
>     fp_out.d = fp;
>
>     unsigned int negative = fp_out.ieee.negative;
>     unsigned int mantissa0 = fp_out.ieee.mantissa0;
>     unsigned int mantissa1 = fp_out.ieee.mantissa1;
>     unsigned int exponent  = fp_out.ieee.exponent;
>
>     cout << "out_fp = " << fp_out.d << endl;
>     cout << "negative: " << negative << endl;
>     cout << "mantissa0: " << mantissa0 << endl;
>     cout << "mantissa1: " << mantissa1 << endl;
>     cout << "exponent: " << exponent << endl;
>
>     fp_in.ieee.negative = negative;
>     fp_in.ieee.mantissa0 = mantissa0;
>     fp_in.ieee.mantissa1 = mantissa1;
>     fp_in.ieee.exponent = exponent;
>
>     cout << "in_fp = " << fp_in.d << endl;
> }

Thanks to all who got an answer to me. Unfurtuneally the problems
are going on. As I can read in the RPC 1832 /XDR. I have to
bit shift the neg., exp., und mat. and I'm not a expert for this.
Double-Precision Floating Point
+------+------+------+------+------+------+------+------+
|byte 0         | byte 1       |byte 2        |byte 3        |byte 4
|byte 5        |byte 6        |byte 7       |
S|                     E
|
F                                                                       |
+------+------+------+------+------+------+------+------+
1| <--  11  --> | <-----------------  52 bits   -------------------> |
<-----------------------  64 bits  ------------------------->

My first try looks like this:

    char fp_bs[8];
    memset(fp_bs, 0, sizeof(fp_bs));

    fp_bs[0] = exponent & 0xFF | (negative & 0x01);
    fp_bs[1] = (exponent >> 8) & 0xFF | (mantissa0 & 0x16);

    for(size_t i = 0; i < 8; i++) {
      printf("%x ", fp_bs[i]);
    }
    printf("\n");

No idea if this is working in the correct manner. I assume using a char[]
isn't very usefull, uint would be better but, how can I catch up the right
Byte of the unit ?
Who can help to encode  and decode this to the XDR Standard ?
Another question to the NBO. Why does exist only htonl/htons (long int
and short int) and no "normally" 4Byte int ? Does the XDR independens
from the NBO ? Regarding the Answers, I should use these functions so
I assume these functions are much more low level as XDR. Well, how can
I implement the NBO per hand, is there an example ? The Problem is
I'm on an embedded system, where I don't have to much libs.

Thanks Olaf



------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list by posting to the
comp.os.linux.development.system newsgroup.

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to