Linux-Development-Sys Digest #279, Volume #8     Wed, 15 Nov 00 04:13:08 EST

Contents:
  Re: New Operating System (Erik Hensema)
  Re: Problems getting MAC address of network card (David Wragg)
  Re: Allocating Non-cacheable memory (David Wragg)
  Re: receiving data from raw socket ([EMAIL PROTECTED])
  Re: Problems getting MAC address of network card ([EMAIL PROTECTED])
  global opened file table ([EMAIL PROTECTED])
  Re: auto power off (Jim Broughton)
  Re: auto power off ("Karl Heyes")
  Re: injecting keystrokes into virtual console ([EMAIL PROTECTED])
  VMElinux compilation problem
  Re: injecting keystrokes into virtual console (George MacDonald)
  Linux kernel guide ("Igor Belianov")
  Re: Linux kernel guide ("Igor Belianov")
  Re: CMOS access (Josef Moellers)
  Re: New glibc-2.2 building (Andreas Jaeger)

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

From: [EMAIL PROTECTED] (Erik Hensema)
Subject: Re: New Operating System
Date: Tue, 14 Nov 2000 21:03:22 +0100
Reply-To: [EMAIL PROTECTED]

Curt Beattie ([EMAIL PROTECTED]) wrote:
>Anyone wanting to work on development of a new operating system, come
>to http://spaceshaker.dyndns.org

Yes, I'd very much would like to work on an OS created by a multiposting
spammer. I just can't begin to imagine the fame I'll get!


-- 
Erik Hensema ([EMAIL PROTECTED])
Registered Linux user #38371 -- http://counter.li.org

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

From: David Wragg <[EMAIL PROTECTED]>
Subject: Re: Problems getting MAC address of network card
Date: 14 Nov 2000 14:59:36 +0000

Johan <[EMAIL PROTECTED]> writes:
> I'm trying to get the MAC address from my ethernet card with the name
> eth0. I do this with the ioctl call SIOCGIFHWADDR with an ifreq struct
> (ifr) as an argument. The hardware address is then supposed to be put in
> ifr.ifr_hwaddr.sa_data but that string is empty. Why?
> 
> [snip]
>   if (ioctl(ioctl_sid, SIOCGIFHWADDR, &ifr) < 0) {
>     printf("Unable to get MAC addrress of the interface: %s.",
>     interface);
>     close(ioctl_sid)
>     return(-1);
>   }
> 
>   else  {
>     memcpy(mac_addr, ifr.ifr_hwaddr.sa_data, 8);
>   }
>   printf("mac_addr = %s\n", mac_addr); /* This one returns an empty
> string, why? */

ifr_hwaddr is a struct sockaddr.  The sa_data field contains the raw
address data, not a MAC address formatted as a string.  It is not nul
terminated, and it is not something you want printed on a tty in any
case.

You need to check that ifr_hwaddr.sa_family contains ARPHRD_ETHER;
then sa_data contains the six bytes of the Ethernet MAC.  If you want
it printed in the conventional form, you need to use printf (I don't
think there is a libc function to do this).


David Wragg

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

From: David Wragg <[EMAIL PROTECTED]>
Subject: Re: Allocating Non-cacheable memory
Date: 14 Nov 2000 21:39:50 +0000

Kristof Beyls <[EMAIL PROTECTED]> writes:
> I mean processor cache. I hoped there would be a system call that
> would allocate a block of memory that will never be placed in the
> processor cache.

Accessing memory with caching disabled is easy enough.  You open
/dev/mem with the O_SYNC flag, then mmap whatever physical address
range you want (it's an odd mechanism, but it has been present in
Linux for a long time, and is implemented on every architecture I
think).

The more complicated part is allocating memory.  The physical
addresses for user pages can vary, so that allocating it as normal
user memory won't work.  In the kernel, you can easily allocate pages
and provide a mmap function to userspace; by copying the relevant code
from driver/char/mem.c, you can disable caching for the relevant pages
in an architecture independent way.  If you explain what you want to
use the memory for, it will be easier to suggest the most appropriate
way to allocate it.


David Wragg

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

From: [EMAIL PROTECTED]
Subject: Re: receiving data from raw socket
Date: Tue, 14 Nov 2000 22:29:12 GMT

In article <[EMAIL PROTECTED]>,
  "ByungDeok Kim" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am trying to read data from RAW Socket, but
cannot make it.
>
> I am using select and recvfrom from the raw
socket.
>
> sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
>
> and I used
> IP_HDRINCL because I need to make ip header and
udp header.
>
> I found that it is possible to send raw packet
with any ip header and udp
> header.
>
> but  I don't see any data coming in the raw
sock which I used to send
> packets.
>
> does anybody know that is it possible to send
and receive data using raw
> socket?
>
> thanks for reading......
>
>


You need to precise the protocol for your
rawsocket because you only can receive packets
of this protocol .

IPPROTO_RAW = 255

Then you canjust receive packet with protocol
field = 255 in the ip header (= nothing in
theory) .

Use IPPROTO_ICMP, IPPROTO_IGMP, IPPROTO_TCP or
IPPROTO_UDP instead.


Julien.







Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: [EMAIL PROTECTED]
Subject: Re: Problems getting MAC address of network card
Date: Tue, 14 Nov 2000 22:31:29 GMT

In article <[EMAIL PROTECTED]>,
  David Wragg <[EMAIL PROTECTED]> wrote:
> Johan <[EMAIL PROTECTED]> writes:
> > I'm trying to get the MAC address from my ethernet card with the
name
> > eth0. I do this with the ioctl call SIOCGIFHWADDR with an ifreq
struct
> > (ifr) as an argument. The hardware address is then supposed to be
put in
> > ifr.ifr_hwaddr.sa_data but that string is empty. Why?
> >
> > [snip]
> >   if (ioctl(ioctl_sid, SIOCGIFHWADDR, &ifr) < 0) {
> >     printf("Unable to get MAC addrress of the interface: %s.",
> >     interface);
> >     close(ioctl_sid)
> >     return(-1);
> >   }
> >
> >   else  {
> >     memcpy(mac_addr, ifr.ifr_hwaddr.sa_data, 8);
> >   }
> >   printf("mac_addr = %s\n", mac_addr); /* This one returns an empty
> > string, why? */
>
> ifr_hwaddr is a struct sockaddr.  The sa_data field contains the raw
> address data, not a MAC address formatted as a string.  It is not nul
> terminated, and it is not something you want printed on a tty in any
> case.
>
> You need to check that ifr_hwaddr.sa_family contains ARPHRD_ETHER;
> then sa_data contains the six bytes of the Ethernet MAC.  If you want
> it printed in the conventional form, you need to use printf (I don't
> think there is a libc function to do this).
>
> David Wragg
>


the struct sockaddr is 16byte lenght , the MAC addr is 6 byte lenght,
and begins at the third byte of the structure .




Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: [EMAIL PROTECTED]
Subject: global opened file table
Date: Tue, 14 Nov 2000 22:38:01 GMT



The problem : how can a packet be queued in the corespondant socket
cache ? ()

I'm wondering if each file in each task must be checked to do that .

- Is there a global (not process-related) opened-files table ?
- If yes : what's its symbol ? where is it filled ? (i didnt find
anything in the sys_open source code from fs/open.c)

thx in advance.
Julien.




Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: Jim Broughton <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.setup
Subject: Re: auto power off
Date: Wed, 15 Nov 2000 00:20:34 GMT

Fokkema DBRA wrote:
> 
> Hi!
> 
> I just upgraded from RH6.2 to RH7.0 and I noticed something slightly irritating.
> When I shut down my system under RH6.2 the kernel automatically powered down
> the system. Under RH7.0, it just halts the system. Why is this? Is it a kernel
> problem (just switch this option and recompile?) or do I have to edit some
> file or is it something else?
> 
> Hope that someone can help.
> 
> Regards,
> 
> David

 Im not sure whether the shutdown command is still
current. Try man shutdown.

shutdown -h now # this shuts er down now.
shutdown -h +5 # shutdown in 5 minutes.


is the normal command in most linux systems.
You must of course have apm compiled into the kernel.
(apm= advanced power management)
-- 
Jim Broughton
(The Amiga OS! Now there was an OS)
If Sense were common everyone would have it!
Following Air and Water the third most abundant
thing on the planet is Human Stupidity.

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

From: "Karl Heyes" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.setup
Subject: Re: auto power off
Date: Wed, 15 Nov 2000 01:39:42 +0000

In article <[EMAIL PROTECTED]>, "Jim Broughton"
<[EMAIL PROTECTED]> wrote:

> Fokkema DBRA wrote:
>> 
>> Hi!
...
> 
>  Im not sure whether the shutdown command is still
> current. Try man shutdown.
> 
> shutdown -h now # this shuts er down now. shutdown -h +5 # shutdown
> in 5 minutes.
> 
> 
> is the normal command in most linux systems. You must of course have
> apm compiled into the kernel.
> (apm= advanced power management)

Check the apm options as well, your system may need to go back into
real mode.

karl.

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

From: [EMAIL PROTECTED]
Subject: Re: injecting keystrokes into virtual console
Date: Wed, 15 Nov 2000 04:16:10 -0000

On Tue, 14 Nov 2000 10:17:18 -0000 Mirco Zaggy <[EMAIL PROTECTED]> wrote:

| Take a look at the gpm (general purpose mouse?) source.
| I hope that helps .
| Greetings Mirco.

I just got into gpm source and looked at what was going on, and where the
corresponding kernel functions are.  Apparently gpm works by telling the
kernel what part of the screen to select and copy into the selection buffer,
and in another call, when to insert it into the input.

The problem here is that there is no direct input from process space to
the keyboard input or the selection buffer.  The obvious workaround is to
switch to a temporary VC, position the cursor, output some text, select
the text, switch the VC back with this text now in the buffer, and finally
cause it to be pasted in.  But this is a limited range of input values.
I need to be able to enter some control characters.

Unless one is found I'm not yet aware of, it looks like I will need to
write some kernel code to implement the facility to allow a process to
stuff in keyboard input as if typed from the keyboard.

I'll also have to decide what level(s) to implement it, such as before
keyboard translation (e.g.  stuff in scan codes) or after (e.g. stuff in
ASCII).  I'll also need to decide what way the process will request this
from the kernel.   Such a choice will probably be among a syscall, an ioctl
on the console, an ioctl on the individual VC, one keyboard stuffing device,
a keyboard stuffing device per VC, or some use of /proc.

I doubt that syscall or /proc are good choices.  Any suggestions or thoughts
on the merits of these choices?

I only have need for this feature in video based virtual consoles.  However,
there may be benefit to generalizing it so that serial ttys can also work.
It's almost getting to the point where it's like a pty which is associated
with a video console.  In fact I'm starting to think a generalized console
device object which can change it's way of operating via ioctl might be a
better long term solution.  The object would have one or more input sources,
and one or more output destinations, which can be changed dynamically, all
on the "outside" (analogous to the pty side).  It would be basically a pty
which can be bound to a physical device (serial port, virtual console) when
desired, and unbound and rebound later.  Oh, I think I'm carrying this idea
a bit too far already.

-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]

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

From: <[EMAIL PROTECTED]>
Subject: VMElinux compilation problem
Date: 15 Nov 2000 04:57:55 GMT


Dear comp.os.linux.development.system,

Has anyone in this newsgroup used Vmelinux (a set of utilities 
used to access VME via a universe chip)?

I have an SBS VP7 (700 Mhz PIII with the Universe IIb/64M/12G) 
It has the stock RH 7.0 with gcc-2.96.54 on it.  When I try to 
make the "vmeutils" program, I get this wierd error 
(Using VMElinux-0.95)

[root@host vmeutils]# make
gcc  -g -o vmeutils vmeutils.cpp commands.cpp unilib.cpp 
commands.cpp:111: cannot convert `void (*) (char *, int)' to `void *' 
in initialization
make: *** [vmeutils] Error 1

I have listed the first 111 lines of the file in question, 
commands.cpp below:
If anyone has any suggestions as to what the problem might be, 
I would greatly appreciate them.  The main problem is that I 
have not seen such a weird casting statement before, and I don't 
really know what it is trying to do.  Thanks in advance.  --Kyle

(commands.cpp)
 head -111 commands.cpp
//---------------------------------------------------------------------------
//title: VME Debugger for XVME-655 
//version: Linux 0.9
//date: February 1998
//designer: Michael Wyrick                                                      
//programmer: Michael Wyrick
//project: VMELinux Project in association with Chesapeake Research
//platform: Linux 2.0.30 on a XVME-655                                        
//language: GCC 2.7.2
//module: 
//------------------------------------------------------------------------------  
//  Purpose:                                                                    
//  Docs:                                                                       
//------------------------------------------------------------------------------  
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <sys/ioctl.h>
#include <asm/io.h>
#include <malloc.h>

#include "unilib.h"
#include "commands.h"
#include "universe.h"
#include "vmeutils.h"

#define CMDT_NULL  0
#define CMDT_FUNC  1
#define CMDT_MODC  2
#define CMDT_MODI  3
#define CMDT_MODL  4
#define CMDT_MODB  5

#define DEFCNT 128

// Size of a DMA write file transfer
#define WRITEBUFSIZE    1024

int VMEspace = 1;        // 1 = A16, 2 = A24, 3 = A32

char TestValueC = 0;
int  TestValueI = 0;
long TestValueL = 0;
     
long FixedAdder = 0;
long VME_Valid_Base = 0;
long VME_Valid_Cnt  = 0;

typedef void (*func)(char *,int);

  //The above line seems to be the offender, though it is not line 111

typedef struct {
  int  CmdType;
  char *command;
  int  NumParams;
  void *pointer;
  //func pointer;

  // void (*func)(char *,int) pointer;
  } COMMAND;

COMMAND cmdTable[] = {
    {CMDT_FUNC,"QUIT",0,quit},
    {CMDT_FUNC,"Q",0,quit},
    {CMDT_FUNC,"EXIT",0,quit},
    {CMDT_FUNC,"E",0,quit},
    {CMDT_FUNC,"HELP",0,help},
    {CMDT_FUNC,"?",0,help},
    {CMDT_FUNC,"STATUS",0,status},
    {CMDT_FUNC,"REGS",0,regs},
    {CMDT_FUNC,"CLS",0,clear},

    {CMDT_FUNC,"D",2,Display},
    {CMDT_FUNC,"R",2,Display},
    {CMDT_FUNC,"RB",2,Display},
    {CMDT_FUNC,"T",2,DisplayMonitor},
    {CMDT_FUNC,"DW",2,DisplayWord},
    {CMDT_FUNC,"RW",2,DisplayWord},
    {CMDT_FUNC,"DL",2,DisplayLong},
    {CMDT_FUNC,"RL",2,DisplayLong},
    
    {CMDT_FUNC,"W",2,Write},
    {CMDT_FUNC,"WB",2,Write},
    {CMDT_FUNC,"WW",2,WriteWord},
    {CMDT_FUNC,"WL",2,WriteLong},

    {CMDT_FUNC,"RF",2,ReadFile},
    {CMDT_FUNC,"WF",2,WriteFile},
    {CMDT_FUNC,"WSRF",2,WriteSRecordsFile},
    
    {CMDT_FUNC,"SEEK",1,Seek},
    
    {CMDT_FUNC,"REGR",1,ReadReg},
    {CMDT_FUNC,"REGW",2,WriteReg},
    
    {CMDT_FUNC,"MAP",1,vmemap1},         

    {CMDT_FUNC,"TESTWRITE",1,TestWrite},         
    {CMDT_FUNC,"TESTREAD",1,TestRead},         
    {CMDT_FUNC,"TESTDMA",1,TestDMA},
    {CMDT_FUNC,"TESTPROGRAMMED",1,TestProgrammed},         

    {CMDT_FUNC,"WINT", 1, wint},
    
    {CMDT_MODL,"FA",1,&FixedAdder},         

    {CMDT_NULL,"",0,NULL}               // End of Table
  };  

______________________
Kyle Richard Burchesky
UIC Physics Department




-- 


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

From: George MacDonald <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: injecting keystrokes into virtual console
Date: Wed, 15 Nov 2000 05:33:46 GMT

[EMAIL PROTECTED] wrote:
> 
> On Tue, 14 Nov 2000 10:17:18 -0000 Mirco Zaggy <[EMAIL PROTECTED]> wrote:
>
>  Oh, I think I'm carrying this idea  a bit too far already.
>

A hardware solution?  -> http://www.vetra.com

-- 
We stand on the shoulders of those giants who coded before.
Build a good layer, stand strong, and prepare for the next wave.
Guide those who come after you, give them your shoulder, lend them your code.
Code well and live!   - [EMAIL PROTECTED] (7th Coding Battalion)

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

From: "Igor Belianov" <[EMAIL PROTECTED]>
Subject: Linux kernel guide
Date: Wed, 15 Nov 2000 10:27:34 +0300

Greetings :))

I remember someone asked for the Linux kernel info.

It's available on
ftp.linuxdoc.org/pub/Linux/docs/LDP/linux-kernel/tlk-0.8-3.html.tar.gz for
download (I'd prefer this way :)) or online www.linuxdoc.org/LDP/tlk

--
Igor V. Belianov
=======================
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Office: +7 (812) 464 44 63
Home: +7 (812) 172 91 89



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

From: "Igor Belianov" <[EMAIL PROTECTED]>
Subject: Re: Linux kernel guide
Date: Wed, 15 Nov 2000 10:30:51 +0300

Ehrrr, forgive me, please, I misprinted

ftp://linuxdoc.org/pub/Linux/docs/LDP/linux-kernel/tlk-0.8-3.html.tar.gz -
this is correct


"Igor Belianov" <[EMAIL PROTECTED]> wrote in message
news:8utdve$21nt$[EMAIL PROTECTED]...
> Greetings :))
>
> I remember someone asked for the Linux kernel info.
>
> It's available on
> ftp.linuxdoc.org/pub/Linux/docs/LDP/linux-kernel/tlk-0.8-3.html.tar.gz for
> download (I'd prefer this way :)) or online www.linuxdoc.org/LDP/tlk
>
> --
> Igor V. Belianov
> -----------------------
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> Office: +7 (812) 464 44 63
> Home: +7 (812) 172 91 89
>
>



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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: CMOS access
Date: Wed, 15 Nov 2000 08:39:54 +0100

Ken Wilson wrote:
> =

> Hi,
> =

> Can I access the CMOS of an x86 system on Red Hat 6.2 ?
> In DOS, I can do IO to port 70h, how do I do in Linux?

There's a mini-howto on IO-programming. Look for
        mini/IO-Port-Programming.gz
On my system (a SuSE box) it's under /usr/doc/howto/en.
If access to these ports is time-critical, you might want to put it into
a module.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T.  Pratchett)

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

From: Andreas Jaeger <[EMAIL PROTECTED]>
Subject: Re: New glibc-2.2 building
Date: 15 Nov 2000 09:17:37 +0100

>>>>> Gene Heskett writes:

Gene> Unrot13 this;
Gene> Reply to: <[EMAIL PROTECTED]>

Gene> Gene Heskett sends Greetings to Andreas Jaeger;

>>>>>>> Gene Heskett writes:

AJ> > Need expert opinions here regarding glibc-2.2 built from the
AJ> > tar.gz. I've built it, and installed it, but apparently *not*
AJ> > where a red hat install wants it.

AJ> You've got to run configure with --prefix=/usr - have a look at
AJ> the Spec file.

Gene> Ok, I can do that.  But see below, what do I do with the old install?

AJ> > After a reboot, the glibc version is still, according to
AJ> > gnorpm's verify function, 2.1.94-3.  So I assume the next step
AJ> > is a 'make uninstall', and a
AJ> Did you use RPM to install glibc?  Otherwise rpm won't update the
AJ> numbers

Gene> Maybe not, but a query/verify operation on 2.1.96-3 reports that it is
Gene> still perfectly installed on that machine.

AJ> > new configure with --prefix=/ and --exec-prefix=/ followed by a
AJ> > fresh make and install.
AJ> Don't do this!

Gene> According to my relatively untrained snooping, thats where the 2.1.94-3
Gene> is now installed!  This by an upgrde to RH 7.0 a month or so back that I
Gene> just told to godoit.  glibc.so.6 is in /lib, not in /usr/lib.

If you configure with --prefix=/usr, libc.so.6 will end in /lib - and
not in /usr/lib.  RTFM.

I can't comment on your RedHat setup and the previous build - I'd
advise to remove the previous build and start fresh again.

[...]
AJ> > Right/Wrong?

AJ> > Also, as this is 7.0, and gcc is the busted one, should I set
AJ> > an
AJ> > 'export CC=kgcc' before the rebuild?  2.96-whatever didn't toss
AJ> > any errors that I saw go by.

AJ> Shouldn't be a problem.

Gene> Ok.  Unforch, it turns out the makefile doesn't have a 'make uninstall'
Gene> option, so I've got probably 50 megs of stuff laying around in the
Gene> various corners of /usr/local/wherever I'll have to run down and rm
Gene> eventually just for space patrol.

Gene> IMO the INSTALL file really should contain some suggestions for prefix
Gene> and exec-prefix based on what vendors kit you actually have installed.
Gene> That would save a lot of heartaches all around.

It seems you didn't read the "Specific advice for Linux systems":

   Linux expects some components of the libc installation to be in
`/lib' and some in `/usr/lib'.  This is handled automatically if you
configure glibc with `--prefix=/usr'.  If you set some other prefix or
allow it to default to `/usr/local', then all the components are
installed there.


Gene> Now, when I get all done, will I have a 'glibc.so.6(GLIB-2.2)' installed
Gene> someplace?  I am so tired of downloading rpm based updates to what I'm
Only if you use rpm to package and install glibc yourself.
Gene> using that purport to fix this and that that I've had problems with,
Gene> only to have gnorpm refuse to install the update because I don't have
Gene> the above quoted library which until yesterday was not available
Gene> publicly.  Thats why I jumped onto that like a hungry lion in the first
Gene> place.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs [EMAIL PROTECTED]
   private [EMAIL PROTECTED]
    http://www.suse.de/~aj

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


** 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 (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

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