Linux-Development-Sys Digest #451, Volume #8     Mon, 29 Jan 01 20:13:08 EST

Contents:
  Re: Linux Kernel book about linux 2.0 still useful?? ("Bill Anderson")
  Re: Kernel's HARD reset (David Vidal Rodriguez)
  Re: booting CD, ramfs -> / in 2.4, some issues ([EMAIL PROTECTED])
  can Linux be secure? ([EMAIL PROTECTED])
  Re: can Linux be secure? (Erik de Castro Lopo)
  How to Recompile the Linux Kernel? ("Efrain Pinto")
  Re: Accessing Kernel Process Structs from a Module (Bob Dilworth)
  Re: Newbie to kernel module programming ("Rich")
  Re: Newbie to kernel module programming ("Rich")
  test ("Ed Gregg")
  How can I lock a page and get the physical addr from user mode? ("Ed Gregg")
  Re: Newbie to kernel module programming ("Rich")
  Re: Newbie to kernel module programming ("Rich")
  Re: How can I lock a page and get the physical addr from user mode? (MurThauZ)
  Re: getche() ("Filipe Maia")
  Re: Why max 8 SCSI LUNS/device (bill davidsen)
  Re: Kernel's HARD reset (bill davidsen)

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

From: "Bill Anderson" <[EMAIL PROTECTED]>
Subject: Re: Linux Kernel book about linux 2.0 still useful??
Date: Tue, 30 Jan 2001 10:39:06 +0700

In article <[EMAIL PROTECTED]>, "Kaelin Colclasure"
<[EMAIL PROTECTED]> wrote:

> Carfield Yim <[EMAIL PROTECTED]> writes:
> 
>> I have borrow a book of linux kernel call "Linux Kernel Internals"
>> http://www.amazon.com/exec/obidos/ASIN/0201331438/qid=980587111/sr=2-
>> 3/ref=sc_b_3/105-4344940-5085540
>> 
>> After scanning through the book, I find that it is a good written book.
>> However, the kernel this book discussing is still 2.0, do I still worth
>> to put time to read it?
> 
> IMO the book is excellent and well worth the time of anyone wanting to
> explore the Linux kernel. If you're waiting for a book to be printed
> that actually matches the ``current'' version of the Linux kernel, I
> suspect Linux will be a historical footnote by then -- along with all
> the hardware it presently runs on... :-)

Not neccesarily. _Linux_Internals_ by Moshe Bar covers 2.4.0, and seems
to be a pretty good book IMO.



Bill Anderson

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

From: David Vidal Rodriguez <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: Re: Kernel's HARD reset
Date: Mon, 29 Jan 2001 19:41:48 +0100

OK, I think I have it. The kernel option "reboot=warm" should do it,
shouldn't it?

Is there a /proc-style solution for the same?

Regards,
--
  ------------------------------------------------------------------------
 David Vidal R. ([EMAIL PROTECTED])



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

From: [EMAIL PROTECTED]
Subject: Re: booting CD, ramfs -> / in 2.4, some issues
Date: Mon, 29 Jan 2001 18:44:29 -0000

On Mon, 29 Jan 2001 08:35:44 GMT Peter T. Breuer <[EMAIL PROTECTED]> wrote:
| [EMAIL PROTECTED] wrote:
|> On Sat, 27 Jan 2001 13:35:53 +0100 Kasper Dupont <[EMAIL PROTECTED]> wrote:
|
|> | A quite good way to initialize /etc/mtab is by doing
|> | "cp /proc/monts /etc/mtab" somewhere in the bootup after
|> | the pivot_root call.
|
|> I could put that in my cdinit program before it hands off to
|> init, just in case the rc scripts don't initialize it.
|
| You need to modify the root entry.

What kind of modification do you have in mind?

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: [EMAIL PROTECTED]
Subject: can Linux be secure?
Date: Mon, 29 Jan 2001 19:12:11 -0000

Note that the question is "can", not "is".  Also note that I did
say "Linux" and not a distribution such as "Redhat", "SuSE", or
"Debian".

If a custom made distribution consisting of well audited programs
and other components (including especially system and administration
facilities) is bundled with the Linux kernel, just how safe is the
kernel itself in terms of security, compared to a system like OpenBSD?
Assume one used all the same program components as OpenBSD did and
just compare the kernels.

I'm trying to make a fairly final decision between going with Linux
or OpenBSD for some custom firewalls I am building.  These will be
fairly stripped down; if it isn't needed, it isn't there.  They will
also be able to boot from CD (optional) further preventing insertion
of trojans in the event someone does get in.

The reasons I tend to lean towards Linux include being more familiar
with it (e.g. less likely to make a breaching error), and the VTAP
feature (formerly ethertap).

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: Erik de Castro Lopo <[EMAIL PROTECTED]>
Subject: Re: can Linux be secure?
Date: Mon, 29 Jan 2001 20:18:09 GMT

[EMAIL PROTECTED] wrote:
> 
> Note that the question is "can", not "is".  Also note that I did
> say "Linux" and not a distribution such as "Redhat", "SuSE", or
> "Debian".

Of course it can. The problem is that all of the major deistribution
install everything by default. It is this default installation which
is insecure. For instance, all the distributions I have seen enable
NFS by default even though less than 10% of people probably use it.
Running NFS on the public internet is just asking to be hacked.

To make any of these systems secure is trival for anyone with a little
experience. Its basically a matter of installing the latest security
patches and disabling everything that isn't needed.


> If a custom made distribution consisting of well audited programs
> and other components (including especially system and administration
> facilities) is bundled with the Linux kernel, just how safe is the
> kernel itself in terms of security, compared to a system like OpenBSD?
> Assume one used all the same program components as OpenBSD did and
> just compare the kernels.

OpenBSD is installs "secure by default". You then have to add stuff
to make it insecure^H^H^H^H^H^H fuctional.

Debian is audited almost as heavily as OpenBSD but the default
install is insecure just like most other distributions. 

Erik
-- 
+----------------------------------------------------------+
  Erik de Castro Lopo  [EMAIL PROTECTED] (Yes its valid)
+----------------------------------------------------------+
"The whole principle is wrong; it's like demanding that grown men live
on 
skim milk because the baby can't eat steak."
- author Robert A. Heinlein on censorship.

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

From: "Efrain Pinto" <[EMAIL PROTECTED]>
Subject: How to Recompile the Linux Kernel?
Date: Sun, 28 Jan 2001 21:58:43 -0400

I need help about how can i recompile the Linux Kernel. I�m using Mandrake
7.0 and
i must use a small recompiled Linux kernel version capable of running on a
486 that is
suposed could provide wireless internet connection for laptops in a
building.



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

From: Bob Dilworth <[EMAIL PROTECTED]>
Subject: Re: Accessing Kernel Process Structs from a Module
Date: Mon, 29 Jan 2001 15:29:57 -0500

Kasper Dupont wrote:

<snip>

> > init_task_union.task contains init which is a member of the task ring
> > (it's a ring,not a list). You can then walk it via ->next_task in 2.2 until
> > you reach init_task again. The for_each_task() macro will also do that for
> > you.
> >
> > -Andi
>
> I tried that once, but found that it
> didn't work because the macro used a
> symbol which was not exported. But
> starting with current instead did
> work. If you want to know which one
> is the init_task, you can probably
> use the pid.

Actually, Andi's suggestion seemed to work OK, at least in 2.2.16.  I used the
for_each_task macro and was able to display the PIDs of the currently running
processes (at any rate it matched when I did a ps -e).  Someone else pointed out
that it would be important to do a read lock on the structure to insure that
you're getting semi-valid data.  I haven't gotten around to this yet altho the
kernel coe that uses the for_each_task macro does seem to do a read lock prior to
running the macro.

Thanks!!!!!

Bob Dilworth
Toledo, Ohio
[EMAIL PROTECTED]


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

From: "Rich" <[EMAIL PROTECTED]>
Subject: Re: Newbie to kernel module programming
Date: Mon, 29 Jan 2001 22:26:28 GMT

In article <953fsr$161e$[EMAIL PROTECTED]>, "Arno Geissel"
<[EMAIL PROTECTED]> wrote:

> What kind of error do you get? I also got lots of errors in headers when
> tried to compile with the C++ instead of the C compiler.
> 
> Arno
> 

Ok, thanks.. I don't have problems with the CONFIG_MODVERSIONS lines
anymore, but I still have problems with:

#include <linux/proc_fs.h>

the kind of errors i'm getting are all kinds of syntax errors in
proc_fs.h and also files that proc_fs.h includes.

Has anyone else ever had this problem? I'm really stumped here.

Thanks!

Rich.

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

From: "Rich" <[EMAIL PROTECTED]>
Subject: Re: Newbie to kernel module programming
Date: Mon, 29 Jan 2001 22:33:23 GMT

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]  wrote:
> 
> It would help a lot if you'd actually post the errors.  Saying "I get
> errors" makes anyone trying to help have to guess.
> 
> --
> http://www.spinics.net/linux

Well, i'm getting pages upon pages of errors, general syntax type errors
in proc_fs.h as well as header files that proc_fs.h includes. For
example, some of the errors I get are like this:

/usr/include/linux/proc_fs.h: In function `proc_scsi_unregister':
/usr/include/linux/proc_fs.h:359: dereferencing pointer to incomplete type
/usr/include/linux/proc_fs.h:363: dereferencing pointer to incomplete type
/usr/include/linux/proc_fs.h:365: dereferencing pointer to incomplete type
/usr/include/linux/proc_fs.h:368: sizeof applied to an incomplete type
/usr/include/linux/proc_fs.h: At top level:
/usr/include/linux/proc_fs.h:397: parse error before `ino_t'

and so on..
I don't know why it's finding errors in the header files themselves.  Any
help would be appreciated.

Thanks!

Rich

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

From: "Ed Gregg" <[EMAIL PROTECTED]>
Subject: test
Date: Mon, 29 Jan 2001 17:29:50 -0500





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

From: "Ed Gregg" <[EMAIL PROTECTED]>
Subject: How can I lock a page and get the physical addr from user mode?
Date: Mon, 29 Jan 2001 17:28:54 -0500

I have a user-mode program that is programming a device directly. I need to
give the device the
PCI address of a memory location so the device
can write to this location. Is there user mode system calls or ioctls that I
can use that will lock down the memory, and return the physical address
of the memory?

Thanks,
Ed



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

From: "Rich" <[EMAIL PROTECTED]>
Subject: Re: Newbie to kernel module programming
Date: Mon, 29 Jan 2001 22:39:04 GMT

In article <[EMAIL PROTECTED]>, "Arne Driescher"
<[EMAIL PROTECTED]> wrote:

> Let's guess: You haven't forgot -D__KERNEL__ -DMODULE -O2  in the
> gcc-command line by chance?
> 
> Just a guess :-)
> 
> -Arne

Actually, I tried compiling with those arguments, as the Linux Kernel
Programming Guide said to.  This was the exact command I used:

gcc -Wall -DMODULE -D__KERNEL__ -O2 -DLINUX -c procfs.c

(actually I didn't have the -O2 in there before, I tried it with it, but
still no dice).

The kind of errors I'm getting are like this:

/usr/include/linux/proc_fs.h:365: dereferencing pointer to incomplete type
/usr/include/linux/proc_fs.h:368: sizeof applied to an incomplete type
/usr/include/linux/proc_fs.h: At top level:
/usr/include/linux/proc_fs.h:397: parse error before `ino_t'
/usr/include/linux/proc_fs.h:397: warning: no semicolon at end of struct
or union
/usr/include/linux/proc_fs.h:399: parse error before `mode'
/usr/include/linux/proc_fs.h:399: warning: data definition has no type or
storage class
/usr/include/linux/proc_fs.h:400: conflicting types for `name'
/usr/include/linux/coda.h:537: previous declaration of `name'
/usr/include/linux/proc_fs.h:401: parse error before `}'
/usr/include/linux/proc_fs.h:435: parse error before `mode_t'
/usr/include/linux/coda.h:261: storage size of `va_atime' isn't known


I don't understand why this would happen, since all of the errors are in
the header files.

Any help would be greatly appreciated.

thanks!

Rich.

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

From: "Rich" <[EMAIL PROTECTED]>
Subject: Re: Newbie to kernel module programming
Date: Mon, 29 Jan 2001 22:45:29 GMT

In article <5Q7d6.17022$[EMAIL PROTECTED]>, "Rich C."
<[EMAIL PROTECTED]> wrote:

> Hey all,
> 
> I am trying to learn to program kernel modules, so I read the Linux
> Kernel Module Programming Guide_.
> 
> I followed all the examples exactly, and tried to compile them.  For
> some reason, I get errors when I try to compile the lines:
> 
> #if CONFIG_MODVERSIONS==1
> #define MODVERSIONS
> #include <linux/modversions.h>
> #endif
> 
> if I comment these lines out of the hello world example, it compiles
> fine.
>  If I leave them in, I get truckloads of errors.  The same thing happens
> when I try to include proc_fs.h using the line:
> 
> #include <linux/proc_fs.h>
> 
> How could there be errors in the header files themselves? This doesn't
> seem to make sense to me.  Has anyone else encountered this problem? Are
> my header files out of date?
> 
> Thanks for any help!
> 
> Rich.

Just some additional information, I hope this helps:

As a test, I created a file with the only line in it being:

#include <linux/proc_fs.h>

I then compiled it using the command:

gcc -Wall -DMODULE -D__KERNEL__ -O2 -DLINUX -c tst-procfs.c

and I still got all the errors. The errors were in proc_fs.h as well as
other files which proc_fs.h includes.  Examples of errors I'm getting are
like this:

/usr/include/linux/proc_fs.h:397: parse error before `ino_t'
/usr/include/linux/proc_fs.h:397: warning: no semicolon at end of struct
or union
/usr/include/linux/proc_fs.h:399: parse error before `mode'
/usr/include/linux/proc_fs.h:399: warning: data definition has no type or
storage class
/usr/include/linux/proc_fs.h:400: conflicting types for `name'
/usr/include/linux/coda.h:537: previous declaration of `name'
/usr/include/linux/proc_fs.h:401: parse error before `}'

Any help would be appreciated. Thanks all for the great response so far!

Rich.

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

From: MurThauZ <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: How can I lock a page and get the physical addr from user mode?
Date: Mon, 29 Jan 2001 23:03:25 GMT

Ed Gregg a �crit :

> I have a user-mode program that is programming a device directly. I need to
> give the device the
> PCI address of a memory location so the device
> can write to this location. Is there user mode system calls or ioctls that I
> can use that will lock down the memory, and return the physical address
> of the memory?
>
> Thanks,
> Ed

Hi,
Just open /dev/mem, then do a mmap using your physical adresse as offset,
and 0 as vaddr  .... it will return you a pointer in the virtual address space
of you process that will map what ever you want.
And the best : mmap is posix ...

regards,
                Eric.


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

From: "Filipe Maia" <[EMAIL PROTECTED]>
Subject: Re: getche()
Date: Mon, 29 Jan 2001 22:56:58 -0000

Thanks for the help.
It is already working.
I used the tcsetattr() function and it worked :-)

George Houpis escreveu na mensagem <[EMAIL PROTECTED]>...
>Well Filipe, here is some code that you can use/modify for your use.  It
does
>use the termios functions.  Terminal attributes dictate by default use
unlimited
>timer, no character maximum.  You need to change it to unlimited time but
>one character buffer (so that when the buffer is full, it returns and does
not
>block.)  Attached code is derived from the late Richard Stevens who wrote
>the book "Advanced Programming in the Unix Environment."  This is a decent
>beginner book around $50-$60.
>
>To use these functions, try
>    tty_cbreak( STDIN_FILENO);
>or
>    tty_raw( STDIN_FILENO);
>where STDIN_FILENO is the file descriptor for standard input (stdin maps to
>this file descriptor) which defaults to 0.  1 is stdout, and 2 is stderr.
>
>I recommend that you read the code and understand the terminal attribute
>setting functions: tcsetattr
>
>Enjoy
>
>George Houpis
>
>
>
>
>root wrote:
>
>> I just wanted a funtion that could get input without need to press enter.
I don't
>> need to change the echo.
>> How can i change the terminal setup from c/c++. Writting to some files?
>> BTW what are terminal modes. I am really a newbie. Please use basic
words.
>>
>> Thanks for your help.
>>
>> George Houpis wrote:
>>
>> > Try getchar().  If you need it without blocking or without echoing,
then you
>> > have more work to do, i.e. you need to setup terminal modes.
>> >
>> > getchar() need #include <stdio.h>, Linux does not use conio.h, that is
unique
>> > to DOS...
>> >
>> > Welcome to the better programming environment.
>> >
>> > George
>> >
>> > Filipe Maia wrote:
>> >
>> > > Is there a equivelant linux function for the windows getche from
conio.h?
>> > > I am newbie in programming and i am having some difficulties in
porting code
>> > > from win to linux.
>> > > Can someone help me?
>



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

From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: Why max 8 SCSI LUNS/device
Date: 30 Jan 2001 00:10:50 GMT

In article <[EMAIL PROTECTED]>,
Josef Moellers  <[EMAIL PROTECTED]> wrote:
| Bill Anderson wrote:
| > =
| 
| > Is there any (good) reason why the kernel still limits (apparently even=
| 
| > in 2.4) the maximum number of LUNS/SCSI device to 8?
| > =
| 
| > If not, how difficult would it be to modify that?
| 
| boot: linux max_scsi_luns=3D128
| 
| Works for us,

  New one on me. I can see why you need to increase the number of total
SCSI devices, but which devices are you using with more than three bits
for LUNs? Tape jukebox of some sort?

-- 
  bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
"I am lost. I am out looking for myself. If I should come back before I
return, please ask me to wait."  -seen in a doctor's office

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

From: [EMAIL PROTECTED] (bill davidsen)
Crossposted-To: comp.os.linux.misc
Subject: Re: Kernel's HARD reset
Date: 30 Jan 2001 00:14:31 GMT

In article <[EMAIL PROTECTED]>,
David Vidal Rodriguez  <[EMAIL PROTECTED]> wrote:
| OK, I think I have it. The kernel option "reboot=warm" should do it,
| shouldn't it?

  From memory this works on the next boot.

| Is there a /proc-style solution for the same?

  Therefore by the time you're up it's too late.

  You can probably write a driver to diddle the bits in the memory which
control this, although I notice that a number of old BIOSs (like yours?)
don't honor this and boot cold every blessed time.

-- 
  bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
"I am lost. I am out looking for myself. If I should come back before I
return, please ask me to wait."  -seen in a doctor's office

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


** 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