Subject: Linux-Development Digest #824
From: Digestifier <Linux-Development-Request@senator-bedfellow.MIT.EDU>
To: Linux-Development@senator-bedfellow.MIT.EDU
Reply-To: Linux-Development@senator-bedfellow.MIT.EDU
Date:     Sun, 12 Jun 94 23:13:05 EDT

Linux-Development Digest #824, Volume #1         Sun, 12 Jun 94 23:13:05 EDT

Contents:
  Re: looking for some information on the clone() system call. (Michael David McCartney)
  Bbs software for linux? (Andrew Grillet)
  Status of Modules in Kernel? (Christian Holtje)
  Porting a simple device driver. Advice required. (Will O'Brien)
  Re: beginners question to Xlib programming (Dan Pop)
  Re: Filesystem semantics protecting meta data ... and users data (John F. Haugh II)
  Real time linux (Mark Montague)
  Re: Filesystem semantics protecting meta data ... and users data (John F. Haugh II)
  beginners question to Xli (Riku Saikkonen)
  Re: Buslogic 445S driver (John Will)
  Re: Porting a simple device driver. Advice required. (Byron A Jeff)
  Re: beginners question to Xlib programming (Elaine Walton)
  Re: beginners question to Xlib programming (Brandon S. Allbery)
  PAS SCSI + HD (Yeung_Wan_Kwong)
  Re: IDE PERF. PATCH SECURITY HOLE (Dances With Geeks)

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

From: mmccartn@cs.utexas.edu (Michael David McCartney)
Subject: Re: looking for some information on the clone() system call.
Date: 12 Jun 1994 16:39:46 -0500

In article <Dr74Mv.4L@pe1chl.ampr.org>, Rob Janssen <pe1chl@rabo.nl> wrote:
>In <2t9s2b$hll@levelland.cs.utexas.edu> danielsi@cs.utexas.edu
>  (Daniel Aaron Supernaw-Issen) writes:
>
>
>>Hey all.  I'm looking for some information on the clone system call.  I 
>>understand that it is undocumented, all i need is the paramter list, I'm 
>>more than happy to experiement from there.  Better yet, could someone 
>>explain how to find out this information from looking at kernel source?
>>I grep through all the includes for clone, came up with the syscall number 
>>(120) but thats it.  Basically, I hope to implement a kernel level thread
>>package.
>
> [deleted: a long repost containing a great description of clone along with
>  some example code]

i found this description and the code to be an excellent resource
however i had some difficulty getting it to work properly.  after
banging on it a while i realized that the assembly code in do_clone()
is not restoring the stack before doing a "ret" and this causes things
to go crazy.

to fix this, you must insert 2 instructions so that the end of the
assembly code looks like this:

           "3:\n\t"
           "movl %%ebp,%%esp\n\t"       <-- add this to restore esp
           "popl %%ebp\n\t"             <-- add this to restore ebp
           "ret\n\t"
 
with this fix, the code works like a charm.  thanks to the original poster!
mike

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

From: Andrew.Grillet@purplet.demon.co.uk (Andrew Grillet)
Subject: Bbs software for linux?
Date: Sun, 12 Jun 1994 18:15:00 +0000

 -=> On 04-16-94  23:31, Shawn Rhoads posted to All <=-

 SR> From: shawn@eng.tridom.com (Shawn Rhoads)
 SR> Date: Fri, 15 Apr 1994 20:53:39 GMT
 SR> Organization: AT&T Tridom, Marietta, GA
 SR> Message-ID: <CoBJDF.Kzt@tridom.com>
 SR> Newsgroups: comp.os.linux.development

 SR> Howdy,

 SR> I was wondering if anyone can suggest a good BBS package for Linux,
 SR> complete with source code?

 I want one too =                                   
 Preferably with good documentation.


.. Coldbeer.can not found sysop not loaded.


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

From: choltje@ux1.cso.uiuc.edu (Christian Holtje)
Subject: Status of Modules in Kernel?
Date: 12 Jun 1994 22:10:16 GMT

What is the status of including modules in the Kernel? Are they going to be
the way of the future? (I saw the /proc/modules and the /linux/modules
directories in > 1.1.8 or so) Is it going to be integrated into the kernel?
Just curious. They will be totally dynamic like oberon (sp?), yes? Will I
be able to change my sound card settings on the fly? (That'd be great for
installing and setting up the sound card and other drivers, just keep
trying till it all works...:) Will there be a front end for loadind modules
and configuring them?

        -Doc

-- 
    ---     ---     ---   -      -  -  -   ---  -----  docwhat@uiuc.edu
   +   -  +    -  +      +      +  -  +  -   +   -    CS major at Illinois
  *   +  *    +  *      *  +   *  +*+*  +*+*+   *    --- finger me at ---
 ****     ***     ***   **  **   *  *  *   *   *    choltje@ux1.cso.uiuc.edu

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

From: wgo10@cus.cam.ac.uk (Will O'Brien)
Subject: Porting a simple device driver. Advice required.
Date: 12 Jun 1994 22:27:13 GMT

I'm currently trying to port an application from Interactive Unix 3.3 to 
Linux. The software in question is required to control both a specialised
video card and a CCD camera that is controlled via a seperate RISC 
controller installed on the system bus.

I have only a little experience of Linux, although it seems to suit my
meeds very well. I may be doing this the wrong way, which is why
I need your help.

The Interactive version of the software uses a device driver to provide
fast access to the I/O ports controlling the RISC/Video cards. This 
brings me to my first question:

Q: Is it really necessary to use a device driver to access the I/O ports
   on an ISA bus (300-310h)?

Assuming the answer to that question is "yes", I need to know how to 
set up a custom written device driver. It needs to be set up onto the
special file "/dev/ri", presumably with the mknod command. It is then 
accessed via an IOCTL call from the application. I think I will need to
recompile my kernel to include this driver, but I don't know how to go
about doing this. In Interactive, there is a command kconfig that does
this automatically, and without the need to actually recompile the 
kernel. Therefore, my second question is:

Q: How do I set up a custom simple character mode device driver?


Other information that may be relavent:-
   MCC Interim Linux. (Didn't install sources though)
   386DX ISA Viglen host
   No other fancy stuff (ie sound cards/CDROM).

If anyone could point me in the right direction I would be most
appreciative. This driver seems to be the most challenging part of
the porting exercise. I've got it to compile properly, I think, but 
I'm not sure about the interface necessary between device drivers and
Linux.

Thanks,
Will O'Brien,
Selwyn College,
Cambridge,
ENGLAND.

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

From: danpop@cernapo.cern.ch (Dan Pop)
Subject: Re: beginners question to Xlib programming
Date: Sun, 12 Jun 1994 22:22:23 GMT

In <2tfp6m$3rq@charm.magnus.acs.ohio-state.edu> ewalton@magnus.acs.ohio-state.edu (Elaine Walton) writes:

>In article <2tdv36$mql@clark.edu>, PETERSEN KIRK A <un17@clark.edu> wrote:
>>
>>    I compile with the following command line:
>>
>>gcc -ansi -O2 -m486 -o prog -lX11 main.c
>>
>Libraries must be at the end of the line:
>
>gcc -ansi -O2 -m486 -o prog main.c -lX11
>
>[Why? I don't know.]

Well, it's obvious, if you think about it.

gcc -ansi -O2 -m486 -o prog -lX11 main.c

will compile main.c to main.o, then it will invoke ld with the relevant
arguments and options in the _same_ order as in its command line:

ld -o prog -lX11 main.o ...

This will cause libX11 to be searched before main.o, at a moment when
no symbol from libX11 is referenced. When main.o references symbols
from libX11 it's already too late, ld doesn't return to previously
searched libraries, it only "hopes" that one of the libraries waiting
to be searched contain the unresolved symbols.

Some systems have "smart" linkers, which are not sensitive to the order
in which libraries are specified, but the "standard Unix" ld is not one
of them :-(

Dan
-- 
Dan Pop 
CERN, CN Division
Email: danpop@cernapo.cern.ch
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland

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

Crossposted-To: comp.benchmarks,comp.sys.sun.admin,comp.security.unix
From: jfh@rpp386 (John F. Haugh II)
Subject: Re: Filesystem semantics protecting meta data ... and users data
Reply-To: jfh@rpp386.cactus.org (John F. Haugh II)
Date: Sun, 12 Jun 1994 22:53:07 GMT

In article <2t6u8dINNnhf@usenet.pa.dec.com> neideck@nestvx.enet.dec.com (Burkhard Neidecker-Lutz) writes:
>In article <DHOLLAND.94Jun8134511@husc7.harvard.edu> dholland@husc7.harvard.edu (David Holland) writes:
>>Now, after recovery and reboot, file X contains some blocks that used
>>to be in file Y... which still contain the data from file Y.
>>
>>Security breach.
>
>Maybe on UNIX V6 15 years ago.

Two nits -- V6 was more than 15 years ago, and the blocks were zero
filled on allocation the same way as they are now.  The function in
traditional UNIX systems which allocates blocks is alloc().  Anyone
with a copy of Lions' book can verify my statement.
-- 
John F. Haugh II  [ NRA-ILA ] [ Kill Barney ] !'s: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 251-2151 [GOP][DoF #17][PADI][ENTJ]   @'s: jfh@rpp386.cactus.org
 There are three documents that run my life: The King James Bible, the United
 States Constitution, and the UNIX System V Release 4 Programmer's Reference.

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

From: plph@load.engin.umich.edu (Mark Montague)
Subject: Real time linux
Date: 13 Jun 1994 00:15:31 GMT

What is the current state of real time programming under Linux?  I need
to write a program that uses a schedule of events to control some
external hardware.  The events are specified to the 1/100 of a second and
MUST occur no more than +- 1/15 second from the specified time, with +-
1/30 second being much preferrable.  So for example, the input file might
contain the line:
        0:34:12.59 FOO
which would indicate that the event FOO is to be performed 34 min, 12.59
seconds after some refference time (e.g., when the program was started).

I will be running only the event-scheduling program on the machine and
hence I am not worried about process contention.  The program will be
able to guarentee that each event will be completed before the next event
needs to be handled.

Are there system calls or libraries that can help me with this under
Linux, or will something have to be done from scratch?

Many thanks in advance.

                Mark Montague
                plph@umcc.umich.edu

--
P.S.: if I could find a way to get the current time of day down to the
1/100 sec and could have the program be signaled (as with alarm()) with
the time specified to the 1/100 sec, this would be sufficient.  As I
understand it, though, gettime(), alarm(), et.al. only have 1 second
resolution and usleep() could make the program sleep right through
the event time.
--



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

Crossposted-To: comp.benchmarks,comp.sys.sun.admin,comp.security.unix
From: jfh@rpp386 (John F. Haugh II)
Subject: Re: Filesystem semantics protecting meta data ... and users data
Reply-To: jfh@rpp386.cactus.org (John F. Haugh II)
Date: Sun, 12 Jun 1994 22:59:07 GMT

In article <DHOLLAND.94Jun10102522@husc7.harvard.edu> dholland@husc7.harvard.edu (David Holland) writes:
>Are they? Is this *guaranteed*? Is there anything that insures that
>these zeros are *written out* before the blocks can be reused? Suppose
>the crash occurs after the old file's cleared inode has been written,
>but before the zeroed blocks have been written out? Then a second
>crash, at the wrong time, could have this same effect. Although I
>suppose in this case fsck could take care of the problem.

The 6th Edition alloc() function wouldn't return the block number
until the block had been zero'd.  That is how strong the guarantee is.
-- 
John F. Haugh II  [ NRA-ILA ] [ Kill Barney ] !'s: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 251-2151 [GOP][DoF #17][PADI][ENTJ]   @'s: jfh@rpp386.cactus.org
 There are three documents that run my life: The King James Bible, the United
 States Constitution, and the UNIX System V Release 4 Programmer's Reference.

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

Subject: beginners question to Xli
From: riku.saikkonen@compart.fi (Riku Saikkonen)
Date: Mon, 13 Jun 94 03:33:00 +0200

>gcc -ansi -O2 -m486 -o prog -lX11 main.c
>/tmp/cca005581.o:  Undefined symbol _XOpenDisplay referenced from text segment

Now, I'm not at all sure about this, but I remember I had the same
problem with a small non-X program that needed libm. I fixed it by
moving the -l to the end of the command line. I don't know why it should
be there, but that seemed to fix it for me...

So try:
gcc -ansi -O2 -m486 -o prog main.c -lX11

-=- Rjs -=- riku.saikkonen@compart.fi
GCS/O -d+ p c++(+++) l++ u e m++@ s/- n+ h-- f+ !g w+ t(-) r !y(*)
"Yet neither by wolf, nor by Balrog, nor by Dragon, would Morgoth
have achieved his end, but for the treachery of Men." - J.R.R. Tolkien


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

Subject: Re: Buslogic 445S driver
From: john.will@dscmail.com (John Will)
Date: Sun, 12 Jun 94 19:24:00 -0640

E > I should add that apparently it is not possible to get meaningful 
E >information from the board itself as to what revision level it is - we 
E >may be reduced to using bios signatures to determine which ones are "safe"
E >above 16Mb.

That would be a SERIOUS mistake IMO!  Since you can upgrade the BIOS on
any board to the current one, you may be shooting yourself (and us as well)
in the foot.  The change from REV-B th REV-C involved an update of a PAL
that's soldered onto the host adapter, I suspect that the D & E versions
may involve more than a BIOS change also.  As a minimum, I'd make sure that
it's more than a BIOS change before depending on it...

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

From: byron@cc.gatech.edu (Byron A Jeff)
Subject: Re: Porting a simple device driver. Advice required.
Date: 12 Jun 1994 21:15:03 -0400

In article <2tg241$of3@lyra.csx.cam.ac.uk>,
Will O'Brien <wgo10@cus.cam.ac.uk> wrote:
-I'm currently trying to port an application from Interactive Unix 3.3 to 
-Linux. The software in question is required to control both a specialised
-video card and a CCD camera that is controlled via a seperate RISC 
-controller installed on the system bus.
-
-I have only a little experience of Linux, although it seems to suit my
-meeds very well. I may be doing this the wrong way, which is why
-I need your help.
-
-The Interactive version of the software uses a device driver to provide
-fast access to the I/O ports controlling the RISC/Video cards. This 
-brings me to my first question:
-
-Q: Is it really necessary to use a device driver to access the I/O ports
-   on an ISA bus (300-310h)?

No. It becomes necessary when you need access to interrupts. Or if you need
to turn interrupts off (which is why I wrote my first device driver). If not
you can find the IO port routines in /usr/include/asm/io.h. The only
requirement then is that you have root access. 

-
-Assuming the answer to that question is "yes", I need to know how to 
-set up a custom written device driver. It needs to be set up onto the
-special file "/dev/ri", presumably with the mknod command. It is then 
-accessed via an IOCTL call from the application. I think I will need to
-recompile my kernel to include this driver, but I don't know how to go
-about doing this. In Interactive, there is a command kconfig that does
-this automatically, and without the need to actually recompile the 
-kernel. Therefore, my second question is:
-
-Q: How do I set up a custom simple character mode device driver?

Get a copy of the kernel hackers guide. It can be found on sunsite.unc.edu:
/pub/Linux/docs/LDP/kernel-hackers-guide. It has the answers to all of the
above questions and more. 

Also the simplest way is to just compile it into the kernel without dealing
with modules.

Send me mail if you have more questions.

BAJ
-- 
---
Another random extraction from the mental bit stream of...
Byron A. Jeff - PhD student operating in parallel - And Using Linux!
Georgia Tech, Atlanta GA 30332   Internet: byron@cc.gatech.edu

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

From: ewalton@magnus.acs.ohio-state.edu (Elaine Walton)
Subject: Re: beginners question to Xlib programming
Date: 13 Jun 1994 02:22:28 GMT

Having used smart linkers in MessyDOS, I was unprepared for this anomaly.
;)
-Sean

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

From: bsa@kf8nh.wariat.org (Brandon S. Allbery)
Subject: Re: beginners question to Xlib programming
Date: Sun, 12 Jun 1994 23:12:07 GMT

In article <2tfp6m$3rq@charm.magnus.acs.ohio-state.edu>, ewalton@magnus.acs.ohio-state.edu (Elaine Walton) says:
+---------------
| Libraries must be at the end of the line:
| [Why? I don't know.]
+------------->8

Because libraries are only searched at the point where they are specified, and
only fopr routines that are needed *at* *that* *time*.  If you specify a
library first, ld will only search it for a routine that defines "_main";
since there isn't one, it will ignore the library, go on to compile your
program, and then complain because the routines called by the program weren't
found.

And no, you do not want to change this.  You could never replace a routine in
a library with your own version otherwise.  (For example, you would never be
able to use a debugging malloc.)

++Brandon
-- 
Brandon S. Allbery         kf8nh@kf8nh.ampr.org          bsa@kf8nh.wariat.org
The FUDs at Microsoft are shouting "Kill The Wabi!"

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

Crossposted-To: comp.sys.ibm.pc.hardware.storage
From: wkyeung@ee.cuhk.hk (Yeung_Wan_Kwong)
Subject: PAS SCSI + HD
Date: Mon, 13 Jun 1994 02:45:46 GMT

Hi all netter, Linux expert, SCSI expert,

I have problem to get the "Installation Boot Disk" from the Trans
Ameritech April release of Slackware to work with my PAS SCSI + HD.

I have the follwoing.

1. 20MB RAM
2. Proaudio Studio 16 SCSI
3. Toshiba XM-3401A
4. Seaget ST 3655N Fast SCSI-2 HD
5. two IDE hook up to a cheapie IDE card
6. ISA bus ONLY

I have this setup.

1. Seagate as the end device in the internal SCSI cable. The HD is
terminated. It is set to SCSI id 0
2. Toshiba CDROM as the device with ID 3, terminator taken out !

THis setup work flawlessly under OS/2, fdisk can see the drive and
format it as either FAT or HPFS.

IN THE LINUX
^^^^^^^^^^^^^

I buy the SCSI HD to try out Linux !
I have the Trans Ameritech Linux CD April release.
I try to RAWRITE the "SCSI" Bootdisk and Colrlite Root disk. When I
boot of the boot disk, the LILO load with a "boot#" prompt, then I
press entre, the LOADRAMDISK appear and then a juck of message comes
out stating those UART and Bogomips etc.... 

Then it come to the PAS SCSI driver, it return one SCSI host detected
and I can see the LED in the HD turns on but then the boot process
hang. I have try to play around the SCSI id of BOTH device.

The follwoing phenomen is observerd.

If I set the scsi id of the CDROM < (smaller than) the HD e.g. CDROM
as id 3, HD as Id 4, then the SCSI driver goes one step further with
the CDROM recognize and return the vendor information.

PLEASE HELP !!!!!!!!!!!!

Any advice would be welcome. As I have 20MB RAM, buying of a ISA
Busmaster SCSI host adaptor will definitely co's me problem (I guess).
If I need to stay with PIO, I will stay with my PAS SCSI until the
next board upgrade !!!!!!


PLEASE REPLY TO 
tc152678@hkpu01.hkp.hk
* I am using my friends a/c *
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Emmanuel Yiu 


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

From: lilo@slip-9-8.ots.utexas.edu (Dances With Geeks)
Subject: Re: IDE PERF. PATCH SECURITY HOLE
Date: 13 Jun 1994 02:52:40 GMT

On Sun, 12 Jun 94 20:38:22 GMT, Frank Lofaro (ftlofaro@unlv.edu) wrote:

> The IDE performance patch has a serious security hole!  ANY USER can
> set the multiple mode and irq unmasking if they have access to the
> drive. Even if it is ONLY READ-ONLY access to one partition.

NO USER other than root needs to have access to a partition, even READ-ONLY.
Mount works just fine without that access, and users can access files to
their hearts' content.

Access to raw disk partitions via the ability to access the device is
a SECURITY HOLE.

> I have a Seagate 1239A (a total piece of crap), and a Samsung drive.
> The Samsung works fine with the IDE patch, but the Seagate trashes
> file systems badly if ANY IDE performance features are enabled. Now if
> a user has even read-only access to any partition on /dev/hda (the
> Seagate), they can trash all the filesystems there. NOT GOOD.

> I think putting an suser() check on the setting ioctls would be the
> best solution.

See above.  The solution is simpler: 'chown root.root /dev/hd*; chmod
u+rw,g-rwx,o-rwx /dev/hd*'.  ;)


lilo

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


** 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: Linux-Development-Request@NEWS-DIGESTS.MIT.EDU

You can send mail to the entire list (and comp.os.linux.development) via:

    Internet: Linux-Development@NEWS-DIGESTS.MIT.EDU

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

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