Linux-Development-Sys Digest #44, Volume #7      Wed, 11 Aug 99 21:14:24 EDT

Contents:
  Re: Device driver programming (Dave Platt)
  Re: Linux hangs at reboot after recompiling kernel 2.2.10 (Kaz Kylheku)
  Code for security: chroot and child processes ("Sean O'Dell")
  Re: Cross-compiling kernel ->PowerPC (Robin Smith)
  Re: rc.local or command line (Stuart R. Fuller)
  Re: Code for security: chroot and child processes (Oystein Viggen)
  Re: Kernel config error (Billy Donahue)
  threads ("Bill Burris")
  Re: My first linux program: non-bios boot loader (Neil Koozer)
  Re: My first linux program: non-bios boot loader (John Reiser)
  module configuration (Guilhem Tardy)
  creating a Unix domain socket file? ("Tim Sell")
  moving driver to 2.2 (Joseph M Nemetz)
  setsockopt doesn't work on linux? (David Nordstedt)
  Catching signals within device driver modules? (Stephen Polkowski)
  Re: My first linux program: non-bios boot loader (Emile van bergen)
  Re: rc.local or command line ("Michael Faurot")
  ONLY ADULTS 13957 ([EMAIL PROTECTED])
  Re: Drivers for SIS 5597/98 Video chipset (Gary Momarison)
  Re: Code for security: chroot and child processes ("Sean O'Dell")

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

From: [EMAIL PROTECTED] (Dave Platt)
Subject: Re: Device driver programming
Date: Wed, 11 Aug 1999 17:49:31 GMT

>>   I am new to Red hat Linux...Even though I have done device drivers
>>for NT and some embedded systems.. I am trying to write a dummy device
>>driver....Can somebody point to resources that can help me
>
>A great proportion of the kernel source code consists of device drivers, so
>there is no shortage of example code. Find a driver that is closest to what you
>want to do and then make something similar.

Also, buy a copy of "Linux Device Drivers" by Alessandro Rubini
(O'Reilly nutshell series - bucking bronco on the cover).  This is an
excellent introduction to the whys and wherefores of Linux device
driver programming, and gives details on the differences between
various major versions of the Linux kernel which affect device-driver
functionality.  Well worth the cost ($30 list in the U.S.).

-- 
Dave Platt                                           [EMAIL PROTECTED]
Visit the Jade Warrior home page:  http://www.radagast.org/jade-warrior/
  I do _not_ wish to receive unsolicited commercial email, and I will
     boycott any company which has the gall to send me such ads!

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Linux hangs at reboot after recompiling kernel 2.2.10
Date: Tue, 10 Aug 1999 22:36:57 GMT

On 10 Aug 1999 23:32:55 +0200, Ulrich Weigand
<[EMAIL PROTECTED]> wrote:
>Guilhem Tardy <[EMAIL PROTECTED]> writes:
>
>>Well, the RH 6.0 distribution I was using so far was configured with
>>SCSI as a module. Why would it be better to have it fixed in the kernel?
>>(sorry for being curious)
>
>Well, you have a chicken-and-egg problem: the module resides in a file

It's a chicken and egg problem in which the solution is known a priori
to be in favor of the egg. You must have an egg statically compiled into
your kernel so that you can get the chicken going. Or was that the
other way around?

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

From: "Sean O'Dell" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.security,comp.os.linux.development.apps
Subject: Code for security: chroot and child processes
Date: Wed, 11 Aug 1999 12:23:11 -0700

Two questions:

1)  Is there any way to force chroot() to work when the process is not
running as root?

2)  Is there any way to make a program run as root when it being spawned by
another process which is not root?

Basically, I have a program which needs to do some root-level
activity...sometimes, but not always.  Problem is, the program gets spawned
by a non-root process.  I wanted this program to be able to do some
root-level stuff, but otherwise be relatively bullet-proof.  The program
interprets files owned by other users on my system.  I wanted to notch the
uid of the program down to whatever the uid is of the files being
interpreted, so users won't have access to the root-level functionality of
the program.

I was hoping there would be some way to allow the program to run as the uid
of the owner of the executable itself, but that doesn't happen by default,
and I haven't found any other way to make that work.  By default, the
program should (ideally to solve my problem) run as root, since root owns
the executable, even though it is spawned by a non-root process.

    -Sean O'Dell



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

From: Robin Smith <[EMAIL PROTECTED]>
Subject: Re: Cross-compiling kernel ->PowerPC
Date: 06 Aug 1999 09:19:53 +0100

BRIOLE <[EMAIL PROTECTED]> writes:

> Hello all,
> 
> I would like to use Linux on IBM rs6k model 250 workstations
> (power pc 601 based), but I need to cross-compile Linux
> for these workstations from a 80x86 based Linux PC.
> How can I do this? (I'm a new in cross-compiling)
> 
> I thank you in advance,
> 
> Sylvain.
> 
> -- 
> Sylvain Briole (aka Eclice sur IRC / supaero)
> Lille - Nord - France
> EMail InterNet : [EMAIL PROTECTED] / [EMAIL PROTECTED]

I did this sort of thing many years ago when I wanted to compile Atari
ST programs on Suns when Suns were based on the 68000 series of chips.

The simple solution is to get the C compiler for your target platform
( Power PC ) and compile this on the 80x86 platform. The
compiler/assembler only produces files of numbers. I'm not sure if you
will have big-endian/little-endian problems but give this a try.

Anyone else got anything to add about this?

Robin

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

From: [EMAIL PROTECTED] (Stuart R. Fuller)
Subject: Re: rc.local or command line
Reply-To: [EMAIL PROTECTED]
Date: Wed, 11 Aug 1999 19:10:01 GMT

Vyl Chan ([EMAIL PROTECTED]) wrote:
: Hi,
: 
:       I'm having some trouble running a script that runs perfectly from
: the command line but doesn't run completely from rc.local. What is the
: difference between invoking a script from the command line and invoking
: from the rc.local??

Command line:                           rc.local:
======================================================================
You type the script name in live        The script name is read from a script

The script executes in the              The script executes as "root"
context of the user typing
the command

The script executes with the            The script executes with the 
current directory usually known         current directory being wherever
to the user entering the command        the previous command(s) left it

The script, and all the commands        Who knows what the PATH is
it calls are found in the PATH
that the user has defined

So, if that doesn't help, you need to post some more information, such as what
distribution (and version) you're running, what "doesn't run completely"
means, maybe the contents of the script, etc.

        Stu

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

From: Oystein Viggen <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.security,comp.os.linux.development.apps
Subject: Re: Code for security: chroot and child processes
Date: 11 Aug 1999 21:30:43 +0200

"Sean O'Dell" wrote: 

> 2)  Is there any way to make a program run as root when it being spawned by
> another process which is not root?

Yes.
chmod +s <program>

Oystein
-- 
"But you know what they say - The world wasn't built in a day"

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

From: Billy Donahue <[EMAIL PROTECTED]>
Subject: Re: Kernel config error
Date: Wed, 11 Aug 1999 15:25:56 -0400

Kevin Newman wrote:
> 
> I recently upgraded the kernel on my system and everytime I try to
> configure it I get an error message after issueing the command "make
> xconfig". I have done "make  mrproper" and have the appropriate kernel
> source & header files installed. I am running Linux Mandrake 5.3 with
> kernel 2.2.5-ac3-5mdk on an AMD K6 system. I have enclosed an attachment
> with the exact error I am receiving. Any help would be appreciated. I am
> relatively new to Linux so please give advice in plane english :-)
> 
> Thanks,
> Kevin Newman
> 
>   --------------------------------------------------------------------------------
>  [Image]

Jeezus!  Thanks for the GIF!
What, you couldn't paste that into a text file and attach THAT!
Grrr!!!  Don't DO That!!!!

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

From: "Bill Burris" <[EMAIL PROTECTED]>
Subject: threads
Date: Wed, 11 Aug 1999 13:33:07 -0600

How are threads implemented on Linux?  Are they part of the kernel or are
they a user level library?

If they are implemented at the user level, what happens when a thread blocks
on I/O?  Do the other threads in the process still run, or is the complete
process suspended?

thanks

Bill
--
http://www.icrossroads.com/~spider




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

From: Neil Koozer <[EMAIL PROTECTED]>
Subject: Re: My first linux program: non-bios boot loader
Date: Wed, 11 Aug 1999 10:16:03 +0000

>   My other constraint (and probably for a lot of people) is that
>  I am not always booting the same thing, i.e. I already have
>  different kernel (and even different root partitions) on the
>  same PC - and most people have also different operating system,
>  for instance *BSD. I will not boot Linux to change the kernel
>  to be booted and then reboot.
>
>   Your bootloader is nicely written, but I do not see how to
>  extend it to handle different kernel or different OS.

I don't know how either, but to get multiple kernels you could use floppies
and do:
nuni /vmlinuz1
nuni /vmlinuz2
nuni /vmlinuz3        #changing floppies after each command

Incidentally, I like having the boot loader on floppy.  In my linux-only
machine I had nothing at all in the mbr or in hda1 until I wanted to test
nuni in the mbr.

Alternatively, one could modify lilo to use my IDE code any time "linear" is
ivoked and the target is an IDE drive.  That was my original intent, but I'm
afraid of messing up lilo.


>   Note also that you will find (older but still in use) IDE
>  hard disk which cannot do LBA addressing, just CHS (see
>  ATA doc, bit 6 of register 6, from memory); Linux is perfectly
>  working with these HD, but they will not boot with your
>  bootloader.

Yah, I know.  The philosophy is that if it freezes with a red "E" displayed,
then it didn't work and you try lilo.  If lilo gives "LI" or "L 01 01..."
you try nuni.  Of course this choice could be automated at install time with
a little utility to detect LBA drives:

if [ lba_ok ] then
    nuni /vmlinuz /dev/hda
else
    lilo
fi

Neil.



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

From: John Reiser <[EMAIL PROTECTED]>
Subject: Re: My first linux program: non-bios boot loader
Date: Wed, 11 Aug 1999 12:50:15 -0700

Nice job, Neil.

About a year ago, I wrote some boot loaders myself.
ftp://ftp.teleport.com/users/jreiser/mbr03.tgz and
e2boot4c.tgz .  mbr03 detects EBIOS dynamically;
e2boot4c boots from a ext2 path that is looked up
at boot time.  Both need no extra storage other than
themselves (512 bytes for mbr03, 1KB for e2boot4c).

Merging your (E)IDE driver with these might be fun.

-- 
[EMAIL PROTECTED]

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

From: Guilhem Tardy <[EMAIL PROTECTED]>
Subject: module configuration
Date: Wed, 11 Aug 1999 15:44:54 -0400

Hi!

Anyone could point me to some better info about how the modules are
loaded and their configuration (I got some from the depmod / modprobe /
kerneld man pages)?

I use the initrd command to load the SCSI module (works fine), and this
is what is loaded before anything else (I believe that only the SCSI
lines of the file "/etc/conf.modules" are used here). Still, I would
have some other modules loaded at boot time.
Using the RH 6.0's Control Panel, I can't edit the modules because I
installed a new kernel (2.2.11) and didn't figure out how to create a
new file "module-info-2.2.11"?
I am ready to edit the file "/etc/conf.modules" by hand, but I have no
clue about the syntax of the options either (e.g. IRQ).

Well, all this sounds like a real lack of info! Hope you'll have some
links for me...
Guilhem.

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

From: "Tim Sell" <[EMAIL PROTECTED]>
Subject: creating a Unix domain socket file?
Date: Wed, 11 Aug 1999 15:05:19 -0400

How do I create a "socket special file"?  For example, /dev/printer and
/dev/log look like this:
    4719 srw-rw-rw-   1 root     root            0 Aug 10 08:18 /dev/log=
    4673 srwxrwxrwx   1 root     root            0 Feb  9  1999
/dev/printer=

How would I create such files?  (I'm looking for something like mkfifo or
mknod.)



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

From: [EMAIL PROTECTED] (Joseph M Nemetz)
Subject: moving driver to 2.2
Date: 11 Aug 1999 21:35:38 GMT


 I'm porting a driver I wrote for kernel 2.0 to 2.2 and am having 
problems extracing the correct
MINOR # from the inode in the release method. 
Has the prototype changed? 
According to printk's placed in here the MINOR # is always 0 but 
it's getting correctly extracted
in the open method so my device is getting opened once then never released.


here's the code
=========================================================================
static int device_release(struct inode *inode_p,struct file * file_p)
{
  int instance;
  instance = MINOR(inode_p->i_rdev);
  if(instance >= 100)
   // call one function
  else
   // call the other 
}
===========================================================================

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

From: David Nordstedt <[EMAIL PROTECTED]>
Subject: setsockopt doesn't work on linux?
Date: Wed, 11 Aug 1999 18:17:55 -0400
Reply-To: [EMAIL PROTECTED]

Hi,

I'm trying to set the send and receive buffer sizes on my RH 6.0
system,  but it doesn't change the size (smaller or larger).  It stays
at 131070 or something similar.  I can set the buffer sizes up to 1 Meg
on Solaris 7.  Does linux work differently for setsockopt?

-- 
David R. Nordstedt
=============================
[EMAIL PROTECTED]

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

From: Stephen Polkowski <[EMAIL PROTECTED]>
Subject: Catching signals within device driver modules?
Date: Wed, 11 Aug 1999 16:40:50 -0500

Hi,

        I need to catch a signal within a 2.2 kernel module.  Can this be done
or do all modules share the same interrupt vectors?

        Specifically, I'm writing a driver that allows the root user to read or
write the Intel MSRs.  This much of my driver works.  However, when a
user tries to read or write an unsupported MSR, the Intel Pentium II
returns with a GP(0).  This causes my module to die with a SEGV. 

        How can I catch this signal within my module?  I already have the Linux
Device Drivers book, but it doesn't cover this type of problem.   
Thanks in advance.

Regards,

Steve
-- 
Stephen Polkowski
Centaur Technology  
Austin, TX
(512) 418-5730

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

From: Emile van bergen <[EMAIL PROTECTED]>
Subject: Re: My first linux program: non-bios boot loader
Date: Wed, 11 Aug 1999 23:38:15 +0000


To add my own into this MBR fun: some time ago I wrote my own
MBR-based boot manager for booting multiple OS'ses. It has some very
nice properties:

* For each OS, you can define its own partition table
* Able to daisy-chain and boot from other harddisks than the first one
  as well.
* No extra (primary) partition needed, just one extra sector after the
MBR for each OS choice.

It works as follows:

If there's no key in the buffer when the MBR is entered, just use the
standard algorithm that all MBR's use: find the first partition table
entry that has bit 7 the drive field set. (N.B.: this also means 0x81
etc, so you could have an entry pointing to the MBR of another harddisk
which contains the same boot manager, etc.). 

If a key is in the buffer, it will display a menu containing up to 7 OS
choices and wait for your keypress. Now, suppose you choose entry '2'.
It then gets sector 2 + 1 = 3, which contains the (perhaps completely)
customized partition table, _along with the same MBR code_ for operating
system number 2 and writes it back to the real MBR.

The great thing in this is that you can hide some partitions for a
specific OS, just by not specifying them in its respective table. Each
OS can read the real MBR, as it reflects the last choice made. You can
accommodate each OS to suit its crazy assumptions about partition
layout. Etc.

Note that the binary needs to be installed using a tool like norton
diskedit for DOS or something alike; I haven't created a nice goowie
installer. That also has the advantage to edit the menus (the strings
are at fixed places) and you have complete control of each of the
partition tables, because you can view any sector as a
partition table.

Because I wrote this before I started appreciating the AT&T syntax, it
has to be assembled by the shareware DOS assembler A86, which is
contained in the tarfile along with the source and binary.

You can get it at
ftp://n293.ede.telekabel.euronet.nl/pub/evb/bootmgr.tgz.

If you like it, but have questions about it, don't hestitate to e-mail
me.

Hope it will be put to use on other computers than just the ones I've
touched ;-)


-- 

M.vr.gr. / Best regards,

Emile van Bergen (e-mail address: [EMAIL PROTECTED])

This e-mail message is 100% electronically degradeable and produced
on a GNU/Linux system.
~
~
:wq



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

From: "Michael Faurot" <[EMAIL PROTECTED]>
Subject: Re: rc.local or command line
Date: 11 Aug 1999 18:53:57 GMT

Vyl Chan <[EMAIL PROTECTED]> wrote:
: Hi,

:       I'm having some trouble running a script that runs perfectly from
: the command line but doesn't run completely from rc.local. What is the
: difference between invoking a script from the command line and invoking
: from the rc.local??

Probably the definition of the $PATH environment variable.  Meaning
that when you run the shell program any programs being called from
that shell program will use the $PATH variable that was setup when you
logged in.  When that shell program runs from rc.local, the $PATH
variable is probably not the same, and the shell program can't find
some program(s) you're calling.

In short, set your PATH variable explicitly within your shell program,
or else use full pathnames.

-- 
==============================================================================
 Michael | mfaurot  | Question authority.
 Faurot  | atww.net | 

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

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.hardware,comp.os.linux.misc
Subject: ONLY ADULTS 13957
Date: Wed, 11 Aug 1999 16:16:10 -0600
Reply-To: [EMAIL PROTECTED]

Free XXX:

http://207.240.225.250






ygDSTQZ@

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

Subject: Re: Drivers for SIS 5597/98 Video chipset
From: Gary Momarison <[EMAIL PROTECTED]>
Date: 11 Aug 1999 17:26:36 -0700

"TH" <[EMAIL PROTECTED]> writes:

> I'm desperately looking for Linux drivers (INTEL) for this video chipset
> (onboard in my PCCHIPS M571 Motherboard) (www.pcchips.com.tw)
> If someone can give me more info, I would appreciate it.

I'm not aware of any drivers, per se, for any chipsets, but the XFree86
version 3.3.3.1 X server named "SVGA" has support for that chipset.
I've not heard of it working for any MB other than the ASUS-97V, but it
might.  There are also X servers by Xi Graphics and Metro Link, Inc.
that might support it, but you have to pay for them.

-- 
Look for Linux info at http://www.dejanews.com/home_ps.shtml and
Gary's Encyclopedia at http://www.aa.net/~swear/pedia/index.html

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

From: "Sean O'Dell" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.security,comp.os.linux.development.apps
Subject: Re: Code for security: chroot and child processes
Date: Wed, 11 Aug 1999 16:59:14 -0700

Thank you for your help!  It works great, but now I've run into something
else I'm not sure about.  When the program is run, I use seteuid to change
the uid of the process to the uid of the owner of the file interpreted by
the program, for security reasons.  I also chroot to the user's home
directory, just for further safety.  However, there are some functions to
the program which I need to seteuid back to root and also see the file
system hierarchy above where I chroot'ed (just temporarily).  I haven't
figured out how to "undo" the chroot...is it possible?

    -Sean

Oystein Viggen <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> "Sean O'Dell" wrote:
>
> > 2)  Is there any way to make a program run as root when it being spawned
by
> > another process which is not root?
>
> Yes.
> chmod +s <program>
>
> Oystein
> --
> "But you know what they say - The world wasn't built in a day"



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


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