Linux-Development-Sys Digest #189, Volume #8      Tue, 3 Oct 00 22:13:26 EDT

Contents:
  Re: tar & other systems (bill davidsen)
  Re: Text-based user interface development (Grant Edwards)
  Ensuring graceful treatment of mem shortage (Bernd Strieder)
  2.4.0 n.g. for multi-LUN? (bill davidsen)
  Re: Ensuring graceful treatment of mem shortage ("James T. Dennis")
  Linux partition question? ("E-mu")
  Re: Linux partition question? ("James T. Dennis")
  M820E linux driver (David Aguilera)
  how to "send a signal" from kernel to user process? ("Duke Lee")
  Re: Block Device Help Please (Mark McDougall)
  Re: PCI Documentation (Mark McDougall)
  waitpid() and race conditions ([EMAIL PROTECTED])
  Re: Text-based user interface development (Bob Hauck)
  Re: Text-based user interface development (Bob Hauck)

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

From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: tar & other systems
Date: Tue, 3 Oct 2000 18:17:34 +0000 (UTC)

In article <[EMAIL PROTECTED]>,
Juergen Heinzl <[EMAIL PROTECTED]> wrote:
| In article <8r001t$qsu$[EMAIL PROTECTED]>, Apple wrote:
| >I want to read an exabyte from a scsi 's tape what was written with
| >Sun-Solaris 7 's tar command.
| >When I do tar tvf /dev/st0 I have an I/O error .
| >I try to put blocking factor  like tar tvfb /dev/st0 20 but it is same I/O
| >error
| >What can I do.
| [-]
| 
| I've never tried an Exabyte tape so take this with two grains of
| salt, but what's the block size ? I don't mean the blocking factor,
| but see mt ( setblk ) as it can be changed and for instance I used
| to write to an HP drive using 1k blocks instead of the default 0.5k
| block size.

  Sounds right, I exchange 8mm between Linux and AIX, and I force the
block size to be sure they agree. BTW: upping the block size to 5k will
just about double the performance of 4mm DAT, haven't quantified 8mm
yet, but it's definitely better.

-- 
  bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
Make the rules? I don't make the rules. I don't even FOLLOW the rules!

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

From: [EMAIL PROTECTED] (Grant Edwards)
Crossposted-To: comp.os.linux.development.apps,it.comp.os.linux.development
Subject: Re: Text-based user interface development
Date: Tue, 03 Oct 2000 19:17:23 GMT

In article <8rd4lv$som$[EMAIL PROTECTED]>, Thomas Dickey wrote:

>>  1) A package called "CDK" that provides a widget-set on top of
>>     ncurses.  Last time I worked on it, some of the widgets
>>     were buggy, and there wasn't any screen-traversal code.  I
>>     fixed some bugs and added a screen traversal engine, but it
>>     wasn't very complete.  Unless somebody has put some effort
>>     into it, I wouldn't recommend it for use "out-of-the-box".
>
>this is at least the 4th time you've mentioned that, but I have
>seen no patch.

Oh, sorry.  I thought I had copied you on that back when
somebody else was going to take over working my changes, but
after looking back through my e-mail I guess I didn't.  The
snapshot of where I left off is at

 ftp://ftp.visi.com/users/grante/stuff/cdk.tar.gz

I'd only fixed up about 1/3 of the widgets to work with the
screen traversal engine, and there were some other minor things
left to finish.

Back in January somebody said he wanted to continue work on
it and get it folded back into the CDK distro. I guess it
didn't happen. At the time (late January), my work was based on
4.9.8 and the current version was 4.9.9.  If you want to
enquire further, let me know, and I'll send you they guy's
e-mail address (I don't like posting other people's e-mail
addresses to Usenet).

>(I don't recall the specific bugs reported, but that was about
>a year ago)

Most of the bugs had to do with trying to use widgets with no
borders.  IIRC, I tweaked on some of the alignment and
justification stuff too -- but that was mostly as a result of
trying to add a method for widgets to show that they had the
focus.

>>  2) A package that used to be from Borland that provides a
>>     whole text-mode application framework (menus, windows,
>>     data-entry, various widgets, etc.).

>but it's specific to the console (uses too many special
>characters to port well)

Ah, yes. I couldn't remember why I decided it wouldn't work for
my app. That was it

>>  3) The "newt" library from RedHat that provides a good widget
>>     set and layout/screen traversal routines.  Runs on top of
>>     slang. Fast and small, but some features may be limiting:
>>     you can only write to the "top" window, and you have to
>>     destroy the top window before you can do anything with the
>>     next one down.  For many types of apps, this is OK.
>
>would be OK if it were documented (hate to say what I do with
>stuff like that ;-)

Yea, that's the big problem with newt.  If you can find an
example that's close enough to what you want to do, it's not
too hard to figure things out, but the docs haven't been
updated in a loooong time (IIRC they don't cover any of the
geometry management stuff).

I must say the documentaion for CDK was pretty well done.

-- 
Grant Edwards                   grante             Yow!  By MEER biz doo
                                  at               SCHOIN...
                               visi.com            

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

From: Bernd Strieder <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Ensuring graceful treatment of mem shortage
Date: Tue, 03 Oct 2000 21:23:26 +0200

Hello,

during reading some articles in this newsgroup and others, I found that
virtual memory shortage is a very annoying thing, and that a lot of work
that has already been done on that subject might be not enough in some
situations.

The main point is to prevent applications from crashing. SIGSEGVs are
the most annoying things, since recovering from them is almost
impossible. Additionally its not fully portable.

If mem shortage might happen, then the only sensible place you can treat
it in your apps is at allocation of memory. There is malloc() returning
0, C++ new returning 0 or throwing exceptions, garbage collectors trying
harder to find some mem to return or even other strategies. Most
programming languages have mechanisms to get along in a defined manner
in cases of memory shortage.

One feature that defeats all these mechanisms is Linux' memory
overcommittment feature. The kernel returns some memory region that
might hopefully be extended to the size you have ordered in the first
place, this happening anywhere in your app. If that fails, your
application crashes, although being fully correct and all measures being
taken to cope with memory shortage. Overcommittment has been invented to
make programmers life easier in other regards, where crashes are no big
problem to the particular group of users and programmers.

The problem is old. How do you write applications that don't crash,
regardless of the OS and its configuration? Is it possible to avoid
generation of SIGSEGV under all circumstances? Is that goal to be headed
for, or do programmers have to admit to the lusers that under
circumstances the app might crash in any situation?

Wouldn't it be desirable to turn on overcommittment per process for
those who need it?

Any references, ideas, opinions?

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

From: [EMAIL PROTECTED] (bill davidsen)
Subject: 2.4.0 n.g. for multi-LUN?
Date: Tue, 3 Oct 2000 19:50:29 +0000 (UTC)

  I've tried most versions of 2.4.0testXXX on a small box I use for
testing. I seem to get a kernel panic every time I try to access the
SCSI drives, which are on a single unit number, multiple LUNs (standard
RAID setup). When I load the controller module it sees all the drives,
CDs and tapes, and I can use the tape or CD, but when I insert the
sd_mod module the system pauses for a while and then crashes with the
usual meaningless "trying to kill init" message, made really useless by
wraping the screen at 20 characters.

  I realize this isn't a very common configuration, but it works in
2.2.14, so I know the hardware is right.

  AHA1520 (built-in) controller, CORE array, 4mm DAT, old IBM CD. Small
system, will return to being a utility system at some time, probably
stuck at 2.2.14.

  I did try several other controllers, but 2.2.14 works with the one I
have. Didn't help, so I suspect the problem is related to the use of
LUNs, the only unusual thing about this system.

-- 
  bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
Make the rules? I don't make the rules. I don't even FOLLOW the rules!

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

From: "James T. Dennis" <[EMAIL PROTECTED]>
Subject: Re: Ensuring graceful treatment of mem shortage
Date: 3 Oct 2000 20:40:08 GMT

In comp.os.linux.development.apps Bernd Strieder <[EMAIL PROTECTED]> wrote:

> Hello,

 ... 

> One feature that defeats all these mechanisms is Linux' memory
> overcommittment feature.  ...

 ...


> Wouldn't it be desirable to turn on overcommittment per process for
> those who need it?

> Any references, ideas, opinions?

 Might it make sense to add an additional system call (nomalloc())
 that would not overcommit.  Then you could all gmalloc to 
 force malloc to file if the memory can't be guaranteed.  Maybe
 you'd have to add a gbrk (for a "guaranteed" versions of this
 functions).

 I could also see some situations (embedded work) where you 
 might want to disable the overcommit system wide.  

 I suppose this could also be done as a sysctl().  I suppose
 one might want to extend sysconf() to allow one to read
 this info back from the kernel.  Note: I see a not in sysconf(3):

       These values also exist, but may not be standard.

       _SC_PHYS_PAGES
              The  number of pages of physical memory.  Note that
              it is possible for the product of  this  value  and
              the value of _SC_PAGE_SIZE to overflow.

       _SC_AVPHYS_PAGES
              The number of currently available pages of physical
              memory.

 That might help for now (no changes necessary?).



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

From: "E-mu" <[EMAIL PROTECTED]>
Subject: Linux partition question?
Date: 03 Oct 2000 22:07:15 GMT

I was told that linux will not work correctly if the primary extended
partition is a windows and not linux?  Well I used PArtition Magic 5.0 to
create a Extended PArtition that Linux FDISK sees as a windows FAT32
partition?  I then created all my logicals under this.  See my scenario
below:  1-6


1)My /boot partition is on the first 22 megs as linux ext2 /boot  Primary
partition.

2) My windows 98SE  is next Primary partition 7000 megs.  FAT32

3) Created an extended primary about 5756 .  Partition Magic does not label
this as a windows FAT32 PArtition but linux FDISK does?

4) Created a Logical Windows drive FAT32 500 megs for my windows 98 SE Swap
drive. Drive D:

5) Created a Logical Linux swap file 256 megs

6) Created a Logical Linux ext2 for my    /     << root.   I used the
remainder of my drive to create this last logical about 5000megs


Now even though the Red Hat Linux Tech support people said that this
shouldn't work, apparently it does.  WHy, I have no idea?  I know that linux
FDISK would not have allowed me to do it this way.  I was told that the
Extended Primary Partition should have been a Linux one and not windows?

I think I tried it that way at first having the primary extended partition
as LINUX, but then I was not able to create a FAT 32 and only a FAT16
logical partition for windows drive D:


Any clues about this?  Why is it working?




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

From: "James T. Dennis" <[EMAIL PROTECTED]>
Subject: Re: Linux partition question?
Date: 3 Oct 2000 23:47:41 GMT

E-mu <[EMAIL PROTECTED]> wrote:

> I was told that linux will not work correctly if the primary extended
> partition is a windows and not linux?  Well I used PArtition Magic 5.0 to

 Utter hogwash!
 
> create a Extended PArtition that Linux FDISK sees as a windows FAT32
> partition?  I then created all my logicals under this.  See my scenario
> below:  1-6

 This is nonsense.  A FAT32 partition is a filesystem; it must exist
 *in* a regular or in a logical partition.  An extended partition is
 a container that hold logical parititions.  A normal PC can only have
 at most *ONE* extended partition (type 05h).  However there are a 
 couple of other "extended" partition types (including 85h for Linux
 specifically).

 Use a real copy of fdisk instead of some whatever GUI interface
 PM is showing you.

> 1)My /boot partition is on the first 22 megs as linux ext2 /boot  Primary
> partition.

        /dev/hda1? Type 83 (Linux native)?

> 2) My windows 98SE  is next Primary partition 7000 megs.  FAT32

        /dev/hda2?  Type ?

> 3) Created an extended primary about 5756 .  Partition Magic does not label
> this as a windows FAT32 PArtition but linux FDISK does?

        /dev/hda??  

> 4) Created a Logical Windows drive FAT32 500 megs for my windows 98 SE Swap
> drive. Drive D:

> 5) Created a Logical Linux swap file 256 megs

> 6) Created a Logical Linux ext2 for my    /     << root.   I used the
> remainder of my drive to create this last logical about 5000megs

 Why not include the output from 'fdisk -l /dev/hda' (or /dev/sda
 or whatever) in your next post?

> Now even though the Red Hat Linux Tech support people said that this
> shouldn't work, apparently it does.  WHy, I have no idea?  I know that linux
> FDISK would not have allowed me to do it this way.  I was told that the
> Extended Primary Partition should have been a Linux one and not windows?

  Bull!  There should be an primary partition which is type "extended"
  (or Win'95 Extended, or Linux extended; types 05h, 0Fh or 85h respectively)

  Look at the numeric types!

> I think I tried it that way at first having the primary extended partition
> as LINUX, but then I was not able to create a FAT 32 and only a FAT16
> logical partition for windows drive D:

  I think that you have no idea what you tried (in terms of the
 actual partition that was generated by whatever you were typing
 and clicking on).

> Any clues about this?  Why is it working?

  It's probably working because the software you're using is smarter
  than the people who are telling you that it won't work.



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

From: David Aguilera <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,comp.os.linux.portable
Subject: M820E linux driver
Date: Tue, 03 Oct 2000 20:45:23 -0400

Hello,,,

        Is thier somebody out there the would know were I can get the
drivers for a HP cd-writer plus model M820e with a PC CARD ( scsi )...
I'm in need of on quickly... The cd-writer works fine with at scsi
adaptec 1480... So it the pc card that gives me problem ... Linux is
always asking me to install the module insmod < module >  I've tried a
bunch but unsucessful... Any info would be highly apreciated....
        Thanks.......

David....

[EMAIL PROTECTED]




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

From: "Duke Lee" <[EMAIL PROTECTED]>
Subject: how to "send a signal" from kernel to user process?
Date: Tue, 3 Oct 2000 17:56:57 -0700

I wrote a network driver as a kernel module.  The driver needs to wake up
the user process whenever it receives a packet.  To do this, I have been
using /proc file system.  I have helper processes that polls on a /proc file
and sends signal to the user process.

I am wondering if there a way to "send signals" (SIGUSR1 nad SIGUSR2) to the
user process directly from the kernel module if I have the pid of the user
process?   The term "sending signal" might not make sense since I am
suspecting that it might be as simple as scheduling the user process with
some parameters.  I don't quite understand.

I have been looking at the source for few days and I am really confused.
Please help!

duke




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

From: Mark McDougall <[EMAIL PROTECTED]>
Subject: Re: Block Device Help Please
Date: Wed, 04 Oct 2000 12:21:56 +1100

"[EMAIL PROTECTED]" wrote:

> Can a device driver guru please help me with this.
> I'm Writing a block device driver in linux,
> A real simplified verison of the code is
> //BLKSIZE = 1024
> void request_block(void) // less kernel 2.2.32
> {
>     INIT_REQUEST; // and all that protection
>     if (CURRENT->cmd = read)
>         memcpy(CURRENT->buffer,my_input_buffer,BLKSIZE);
>     if (CURRENT->cmd = write)
>         memcpy(my_input_buffer,CURRENT->buffer,BLKSIZE);
>     end_request(1);
> }
> CURRENT->current_no_sectors is 2.
> I'm only putting 1024 bytes in the buffer.
> When I read the device it gives me only every second 1024 bytes.
> If I pump in more than 1024 eg 2048 ,
> there are problems with stability.

First of all, you *must* use the values passed with the CURRENT macro in
order to determine how many bytes to fill. Block devices will use the
readahead to grab more than a single sector at a time. Of course your
"input_buffer" will need to be large enough to handle all cases.

You also have to be aware that sectorsize and blocksize are 2 different
entities, and you need to be careful which of them you use and where.
The request function works in sectors - not blocks. Check what hardsect
size you've registered with your block device.

Regards,

--
|     Mark McDougall    |
|        Engineer       |
| Virtual Logic Pty Ltd |
| http://www.vl.com.au  |

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

From: Mark McDougall <[EMAIL PROTECTED]>
Subject: Re: PCI Documentation
Date: Wed, 04 Oct 2000 12:27:50 +1100

[EMAIL PROTECTED] wrote:

> I am writing a pci driver to interface with a home-grown pci
> peripheral.  I already have  Linux Device Drivers by Alessandro Rubini,
> first edition.  Does anyone know of any other documentation concerning
> pci drivers and pci peripherals.

What exactly are you having a problem with?

There's not much to concern yourself about with pci devices other than
determining the resource allocations. Apart from that, once you've
mapped any memory and/or I/O space you're talking to a "device" -
whether it's PCI, ISA or something else is not relevant!?!

Regards,

--
|     Mark McDougall    |
|        Engineer       |
| Virtual Logic Pty Ltd |
| http://www.vl.com.au  |

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

From: [EMAIL PROTECTED]
Subject: waitpid() and race conditions
Date: Wed, 04 Oct 2000 11:38:04 +1000

Hi,
        

1.      from what i can gather I think I have written a piece of kernel code
that has a race condition. ie. it actually calls out to a user space
program using execve(). the userspace program verifies a digital
signature in a file. 

I need someway to block access to the filesystem from other processes so
they cannot rename files and the like...

2. waitpid() has an argument in which you can grab the exitstatus of the
process it was waiting for.... however you use the macro WEXITSTATUS to
get this value.  have included linux/wait.h yet for some reason it still
doesn't recognise the macro when I try and compile it... Is it available
to kernel programmers.??

thanks

dan

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

From: [EMAIL PROTECTED] (Bob Hauck)
Crossposted-To: comp.os.linux.development.apps,it.comp.os.linux.development
Subject: Re: Text-based user interface development
Reply-To: bobh{at}haucks{dot}org
Date: Tue, 03 Oct 2000 23:04:39 GMT

On Tue, 03 Oct 2000 15:42:05 GMT, Grant Edwards <[EMAIL PROTECTED]> wrote:

> 2) A package that used to be from Borland that provides a
>    whole text-mode application framework (menus, windows,
>    data-entry, various widgets, etc.).  

Turbovision.  Last I looked at it (a couple of years ago) it seemed to
be pretty console-bound.  Had a lot of quirks running in an xterm.


-- 
 -| Bob Hauck
 -| To Whom You Are Speaking
 -| http://www.haucks.org/

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

From: [EMAIL PROTECTED] (Bob Hauck)
Crossposted-To: comp.os.linux.development.apps,it.comp.os.linux.development
Subject: Re: Text-based user interface development
Reply-To: bobh{at}haucks{dot}org
Date: Tue, 03 Oct 2000 23:04:40 GMT

On Tue, 03 Oct 2000 15:04:12 GMT, Lew Pitcher <[EMAIL PROTECTED]>
wrote:

>However, there are a number of text windowing systems
>available ("A-flat" (IIRC) comes to mind) that can be used instead.

There was a "D-Flat" from one of the DDJ columnists.  I started a port
to put it on top of ncurses, never finished it (did get the TED editor
demo to compile though).


-- 
 -| Bob Hauck
 -| To Whom You Are Speaking
 -| http://www.haucks.org/

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


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