Linux-Development-Sys Digest #104, Volume #8     Sun, 27 Aug 00 00:13:14 EDT

Contents:
  interrupt, task queue and wait queue. ("Peter Huang")
  Re: Printer driver question (Grant Edwards)
  Re: LARGE FILE API - fcntl bad (Andreas Jaeger)
  Re: BOOK: Any good books on Client/Server Design Architectures ("Christos 
Karayiannis")
  Re: where is "make" in linux ("Christos Karayiannis")
  Re: Programming newbie's question (Fred Thirton)
  Re: How do I create a var in user space. (Kasper Dupont)
  Re: insmod and initializing function pointers (Kasper Dupont)
  Re: Kernel compiling: I need an expert:) (Kasper Dupont)
  Re: Kernel upgrade confusion: lilo/loadlin (Kasper Dupont)
  Re: Programming /dev/ttyS* in Unix (Moritz Franosch)
  time measurements ("naomi avigdor")
  Re: where is "make" in linux
  Bug in dynamic linker (Charles Ju)
  Re: Programming newbie's question (David M. Cook)
  Re: b Need Developers ("Robert M. Pritchett - RMP Consulting Partners LLC")

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

From: "Peter Huang" <[EMAIL PROTECTED]>
Subject: interrupt, task queue and wait queue.
Date: Fri, 25 Aug 2000 22:20:26 -0700


Hi all..

I have a very interesting problem. Currently, I am using the bottom half of
the interrupt to wake up a wait queue element waiting in the read() routine.

This is how I implement the bottom half:

1)The interrupt routine stored relevent data in the immidiate queue and
activate the bottom half.

2)The immediate queue function look at a bit that is atomically set by the
read routine just before the read routine going to sleep on a wait queue. If
the bit is set, it calls wake_up_interruptible on the wait_q that is wait
upon by the read routine. If the bit is not set, it queue the relevant data
in the schedule queue.

3) The schedule queue than constantly check the atomic bit that should be
set by the read routine. If the bit is not set, it would recursively queue
the data to itself(reschedule itself).

The problem is that the schedule queue runs at the interrupt time. As a
result, the other functions such as the read routine is not runned any more
and the calling function and the driver now runs in a loop. I also know that
the schedule queue can also run in the non-interrupt time. If the schedule
queue is runned in the non-interrupt time, I believe that it would give up
the cpu time and allow other processes to run.  Any one has any ideas??

Furthermore, this problem is mainly a question of dealing with the interrupt
arriving before the wake_up_interruptable() in a read() routine is prepared
to be waked up by the bottom half of the interrupt handle and perform
reading. Since I'm new a writing interrupts and Linux, does any know of a
"general" way of handling this problem.

thanks

Peter



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

From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: Printer driver question
Date: Sat, 26 Aug 2000 05:28:35 GMT

In article <gXGp5.14940$[EMAIL PROTECTED]>, Christopher Browne wrote:

>I've had to mess around with some of the "weird printer controls" on
>occasion; that sort of thing tends to be controlled in one of three
>ways:
>
>a) On a Postscript printer, there may be special Postscript predicates
>   to initiate special actions like switching trays, changing colours,
>   or switching cartridges.

Yup, I've had to stick a Postscript command onto the front of a data stream
heading to HP printers to do things like select a paper tray or
enable/disable duplex printing.

If you're lucky the Postscript command for selecting a paper tray (for
example) will be the same for two different models from the same
manufacturer, but don't bet on two different manufacturers being compatible.

-- 
Grant Edwards                   grante             Yow!  I guess we can live
                                  at               on his POT FARM in HADES!!
                               visi.com            

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

From: Andreas Jaeger <[EMAIL PROTECTED]>
Subject: Re: LARGE FILE API - fcntl bad
Date: 26 Aug 2000 08:02:12 +0200

>>>>> P Eng writes:

 > I don't know who the problem lies with....but fcntl is broken when
 > trying to use LARGE FILE support.  (I'm working on RedHat 6.2....is it
 > the Linux kernel or is it glibc)

 > This is because F_SETxx and F_SETxx64 have the same define values, but
 > size of flock is different in size depending on _FILE_OFFSET_BITS
 > (which selects the size of the file offset).

This will be fixed in glibc 2.2.  Linux 2.4.0-test7 is the first
kernel with fcntl for LFS and we couldn't implement it in glibc before
that correctly.

Until glibc 2.2 is out: Don't use those constants.

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

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

From: "Christos Karayiannis" <[EMAIL PROTECTED]>
Subject: Re: BOOK: Any good books on Client/Server Design Architectures
Date: Sat, 26 Aug 2000 13:10:34 +0300

Check out:
Internetworking with TCP/IP, Vol. III: Client-Server Programming and
Applications, Linux/Posix Version
by Douglas E Comer
when it is available.

CeePlsPls <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Thanx



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

From: "Christos Karayiannis" <[EMAIL PROTECTED]>
Subject: Re: where is "make" in linux
Date: Sat, 26 Aug 2000 13:23:05 +0300

You should change your directory to /usr/src/linux first.

<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> When I try "make menuconfig", I got error message "hash: make: command not
> found". I also use `find / -name "make"' to search for it, but it returns
> nothing. Could someone please tell me where I can get the "make" command?
> Thanks a lot.
> -jesse
>
> --
> Posted via CNET Help.com
> http://www.help.com/



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

From: Fred Thirton <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Programming newbie's question
Date: Sat, 26 Aug 2000 08:43:00 -0600



Andreas Rottmann wrote:

> Find a good book on C under Linux/Unix and write some little programs
> yourself. That will get you bootstrapped.

As someone who is just getting started with Linux and Linux programming, I
must ask, what "C under Linux/Unix" books are good?

----
[EMAIL PROTECTED]: because you won't mail me.  Spammers will.


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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: How do I create a var in user space.
Date: Sat, 26 Aug 2000 16:59:48 +0200

[EMAIL PROTECTED] wrote:
> 
> Hi,
> 
> I'm writing a device driver and would like to allocate memory in user
> space.
> 
> I'm passing a variable into a function that expects user space .
> I'm not looking for large pages of memory,
> just primitaves like long and long long.
> 
> As i can see vmalloc still allocates in kernal space.
> 
> Can any one please help
> Richard

If the memory should belong to one specific process
the best choice would be to somehow require the
user space program to allocate memory and give you
the pointer.

You could also call do_mmap, but that will not allow
you to allocate less than one page, and it would be
a hack anyway.

If the memory should be global and not belong to one
specific process, what you need is probably a daemon
process.

If you want to call malloc in the user programs runtime
library from a kernel driver, forget about it, that is
not possible.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: insmod and initializing function pointers
Date: Sat, 26 Aug 2000 17:18:14 +0200

Gora Mohanty wrote:
> 
> Hello,
>   I have written a device driver that works under kernel 2.2 (principal
> platform) and 2.0. I would like to offer my users a choice between different
> read methods, selectable at module load-time. (Same also applies for open
> methods, but set that aside for now.)
> 
>   I used what I thought was a cute idea, but it does not work. Say, that I
> have three read methods: aqr_read_demand, aqr_read_block, and aqr_read_mmap.
> I define a global function pointer of the appropriate type, aqr_read, that is
> initialized to aqr_read_demand. Here is what I have tried to get aqr_read set
> to one of the other methods:
>   (i) insmod acqisol.o aqr_read=aqr_read_block. OK, I understand why this does
>       not work.
>  (ii) Then I tried getting the module symbols with nm and used that with
>       insmod, viz.,
>         insmod acqisol.o aqr_read=0x<val>
>       where <val> is the number for aqr_read_block in the first column of the
>       output of nm. Maybe, I do not understand the output of nm: I was unable
>       to find a description of it.
> (iii) I was sure that this third method should work. I loaded the module once,
>       and within the module printed out the value of each function with printk
>       and %p. I have verified that with the default initialization, aqr_read
>       and aqr_read_demand are the same pointer. However, when I unload the
>       module, and reload it with,
>         insmod acqisol.o aqr_read=0x<val>
>       where, now, <val> is the pointer value for aqr_read_block, obtained from
>       the first load, it does not work. The printk value shows aqr_read set to
>       something other than the value specified on the insmod command line.
> 
> What is going on? How can I achieve what I want? My apologies if this has
> already been answered: a look through dejanews did not turn up anything.
> 
> Regards,
> Gora

You should not try to initialize the function pointer
directly from the insmod command line. They will not
necesarrily be the same each time you load the module.
And mistakes could crash you system.

Instead you should use an integer variable initialized
from the command line like: read_method=0
in the module initialization code you should then do
something like:
  switch(read_method) {
  case 0: aqr_read=aqr_read_demand; break;
  case 1: aqr_read=aqr_read_block; break;
  case 2: aqr_read=aqr_read_mmap; break;
  default: printk("Invalid read_method=%d\n",read_method); return 1;
  }

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.setup
Subject: Re: Kernel compiling: I need an expert:)
Date: Sat, 26 Aug 2000 17:32:13 +0200

Karl Heyes wrote:
> 
> In article <[EMAIL PROTECTED]>, Paul Pygeon
> <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I've tried to compile a 2.4.0-test6 kernel and everything works fine
> > until I tried to make modules. At this time I've the message below.
> >
> > Also, if I try to boot with my new kernel, I get this message:
> > "Warning: unable to open an initial console
> 
> This is because you have removed the console code when you rebuilt the
> kernel.  It's only a warning, but not very helpful if you are trying it out.
> check you config. I'm guessing the virtual console stuff.
> 
> > Kernel panic: No init found. Try passing init=option to kernel"
> 
> This is the showstopper. init is the first process in UNIX terms usually
> located in /sbin. either something is overriding it (odd but possible, check
> the parameters you are passing to the kernel eg lilo.conf), or you maybe
> mounting the wrong partition on /. It still maybe a valid filesystem (eg ext2)
> just not one with an init program where it's expecting it.  You can use rdev
> for this.
> 
> karl
> 

The "Warning: unable to open an initial console" message also
shows up if /dev/console is missing. So a wrong root partition
or using a wrong filesystem sounds likely.

If you are using UMSDOS or booting with a ramdisk there are
a couple of other possible explanations.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Kernel upgrade confusion: lilo/loadlin
Date: Sat, 26 Aug 2000 17:42:21 +0200

Lawrence wrote:
> 
> Hi everyone,
> 
> newbie here. First of all, I think the site I'm using is forcing the post
> to a developpement group; sorry in advance if my newbie question ends up
> in an advanced group.
> 
> That said, I'm using loadlin to boot Red Hat 6.0 (works fine) and I want
> to upgrade my distribution and/or kernel eventually. Faqs and howtos give
> tips for updating lilo configuration. I don't know anything about lilo
> yet; not even whether I'm using it implicitely or not. So in my case
> (loadlin), what would I have to do differently to make a new kernel boot
> and work properly?
> 
> Thanks in advance,
> -Lawrence
> 
> --
> Posted via CNET Help.com
> http://www.help.com/

If you are using loadlin, you are most likely not using lilo
at all. When compiling your kernel you always first do
"make dep", after that you should choose "make bzImage".
Copy the file arch/i386/boot/bzImage to some place on your
DOS partition. I advice that you keep your old kernel file,
in case something goes wrong, but store your new kernel
with a new name in the same directory as loadlin and your
old kernel. You probably start loadlin from some .BAT file
just edit that file to use your new kernel.

-- 
Kasper Dupont

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

From: Moritz Franosch <[EMAIL PROTECTED]>
Subject: Re: Programming /dev/ttyS* in Unix
Date: 26 Aug 2000 17:58:58 +0200


[EMAIL PROTECTED] (Grant Edwards) writes:

> In article <[EMAIL PROTECTED]>, Pliev wrote:
> 
> >Do you can to say to me, how in Unix (Linux) can to program COM
> >ports (/dev/ttyS*).
> 
>    http://www.linuxdoc.org/HOWTO/Serial-Programming-HOWTO.html

and info libc (Low-Level Terminal Interface, describes the functions
to program the serial port), 
Serial-HOWTO (about setting up the serial port).

Moritz

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

From: "naomi avigdor" <[EMAIL PROTECTED]>
Subject: time measurements
Date: Sat, 26 Aug 2000 17:53:11 GMT

hi,

I would like to measure the time it takes to execute some specific
functions (which I wrote) in my process. my process runs for some
time (minutes), and these functions are called many times. out of
the total run time, I need to know that function A uses 10% of the
time, function B 2% of the time, etc. etc. the time should include i/o
time and all system calls. no other user process is running in my
machine.

the only solution that I can think of is "gettimeofday" at each entry
and exit to the various functions and total the delta times over all the
calls.

is there a better way?

thank you,
naomi avigdor



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

From: <[EMAIL PROTECTED]>
Subject: Re: where is "make" in linux
Date: Sat, 26 Aug 2000 19:29:17 GMT

Dewald,

Thank you for the help. Could you further explain what to do with the 
source code?

Regards,

jesse
Dewald Rossouw wrote:
> 
> You'll find the source code at:
> 
> http://www.gnu.org/software/make/make.html
> 
> or an RPM package at:
> 
> ftp://ftp.redhat.com/pub/redhat/redhat-6.2/i386/RedHat/RPMS/make-3.78.1-
4.i386.rpm
> 
> The default install path is /usr/bin. However, 'make' is a pretty basic
> utility on a Unix platform. If it is not installed, some of the other
> software you need to build a Linux kernel is sure to be missing.
> 
> 
> [EMAIL PROTECTED] wrote:
> > 
> > When I try "make menuconfig", I got error message "hash: make: command 
not
> > found". I also use `find / -name "make"' to search for it, but it 
returns
> > nothing. Could someone please tell me where I can get the "make" 
command?
> > Thanks a lot.
> > -jesse
> > 
> > --
> > Posted via CNET Help.com
> > http://www.help.com/


--
Posted via CNET Help.com
http://www.help.com/

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

Date: Sat, 26 Aug 2000 18:13:15 -0400
From: Charles Ju <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux
Subject: Bug in dynamic linker

Hi,
I have the following error when I tried to run an executable:

$ magrt -n mag1
BUG IN DYNAMIC LINKER ld.so: dl-version.c: 210: _dl_check_map_versions:
Assertion `needed != ((void *)0)' failed!
$

Can someone tell me how to fix this?

Regards,


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

From: [EMAIL PROTECTED] (David M. Cook)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Programming newbie's question
Date: 26 Aug 2000 22:56:46 GMT

On Sat, 26 Aug 2000 08:43:00 -0600, Fred Thirton <[EMAIL PROTECTED]>
wrote:

>As someone who is just getting started with Linux and Linux programming, I
>must ask, what "C under Linux/Unix" books are good?

Since C was originally developed to make unix easier to port, there's not
all that much call for unix-specific C introductions.  _The C Programming
Language, 2nd Edition_ is still the canonical text.

I've looked over _C for Linux Programming in 21 Days_, and it looks like it
could be pretty good, but I haven't read it in any detail.

See http://members.home.com/davecook/devel/#book for links to Linux
programming texts.  You can find tons more by doing a search on "linux
programming" at amazon.com (this is not an endorsement of amazon.)

Dave Cook


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

From: "Robert M. Pritchett - RMP Consulting Partners LLC" <[EMAIL PROTECTED]>
Crossposted-To: 
alt.computer.consultants.ads.norecruiters,comp.sys.handhelds,comp.unix.programmer
Subject: Re: b Need Developers
Date: Sun, 27 Aug 2000 03:10:52 GMT

Is this a request for consulting services (subcontract) or recruiting for
employment? At least one of our consultants specializes in embedded
systems, that's why I wanted to know. Thanks.

--

Robert M. Pritchett, President - RMP Consulting Partners LLC - member ICCA
Quality means doing it right the first time - http://rmpcp.com
Tired of hearing "W-2 only"? Work the same contract on our 1099 instead!
Please send req's ONLY to [EMAIL PROTECTED] and include the rate range and
the EXACT CITY. Please send r�sum�s ONLY to [EMAIL PROTECTED] - thanks.


Scott A. Vigil <[EMAIL PROTECTED]> wrote in message
news:qBBm5.1346$[EMAIL PROTECTED]...
b

Hello Developers,

We have several consulting positions available for people interested in
helping our customers put databases in their embedded systems.  If
you have experience in one or more of the following and can handle up
to 25% travel, we may be interested in you.

o embedded C or C++
o real-time operating systems
o file systems
o databases

Centura Solutions is a consulting firm which specializes in providing
solutions to users of database, connectivity and integrated development
products.  We have implemented embedded solutions for companies such as
Lucent, Nortel and Hughes Networks.  Centura has the stability of an
established company and the excitement of an internet startup.

If such a faced paced, performance oriented environment sounds good to
you, we may have your dream job.  Send us your resume.

The opportunity is in Seattle.  However, if you really think you're hot
stuff but must stay in California or on the East coast, send in your
resume
anyways.  We might be able to make a deal.

Send resume to [EMAIL PROTECTED]  Please do _not_ hit <reply>.
Also, please do not post reply to news group.

Centura Solutions
1111 3rd Avenue, twenty-eighth floor
Seattle, WA 98101
http://www.centurasolutions.com/solutions/whatwedo.asp
http://www.centurasoft.com






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


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