Linux-Development-Sys Digest #765, Volume #7     Thu, 13 Apr 00 05:13:14 EDT

Contents:
  Re: 2.3.99-4-2: Kernel panic: VFS: Unable to mount root fs on .... (Ivan De 
Saedeleer)
  Re: QUESTION: time stampinig in user programs (Chris Eddy)
  Accessing x86 debug registers in Solaris ([EMAIL PROTECTED])
  Disableing NCURSES Input ("Mike")
  Re: device driver development (Manoj Patil)
  Re: Kernel development (xworldnet.att.net (Bill Touchstone))
  Re: Disableing NCURSES Input ("Daniel Beer")
  RE: schedule_timeout() ("V.Vijay Kumar")
  device driver development and C++ ("Olivier Dufils")
  RE: system call pre-emptable ??? ("V.Vijay Kumar")
  BDF File Format ("Michael Schoettner")
  Re: device driver development and C++ ("Peter T. Breuer")
  Re: device driver development and C++ (Mathias Waack)
  Re: Bootdisks, rdev, and root filesystems...aargh! (Anders Larsen)
  Re: device driver development and C++ (Mark McDougall)
  Re: How to debug driver that freezes the system? (Josef Moellers)

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

From: Ivan De Saedeleer <[EMAIL PROTECTED]>
Subject: Re: 2.3.99-4-2: Kernel panic: VFS: Unable to mount root fs on ....
Crossposted-To: linux.dev.kernel
Date: Thu, 13 Apr 2000 02:14:52 GMT

In linux.dev.kernel Christian Jönsson <[EMAIL PROTECTED]> wrote:
> VFS: Mounted root (ext2 filesystem).
> kmod: failed to exec /sbin/modprobe -s -k block-major-3, errno = 2
> VFS: Cannot open root device "306" or "03:06"
> Please append a correct "root=" boot option
> Kernel panic: VFS: Unable to mount root fs on 03:06.

Same problem here, i don't have found the solution yet...

Bye

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

From: Chris Eddy <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux,comp.os.linux.development,comp.os.linux.development.apps
Subject: Re: QUESTION: time stampinig in user programs
Date: Wed, 12 Apr 2000 20:40:28 -0600

Guys,

If all you want is a fine resolution of the current moment, you may want to
try ftime(3).
It will return a unix timeval (the count of seconds since January 1, 1970),
and a millitm value that is good for .001 resolution.
And the function has been around for years, and is supported on every
platform that I've encountered.

Chris Eddy

Andreas Kahari wrote:

> Does the program use any sys/usr time while it is suspended in 'sleep'?
> It doesn't look as if it did. I replaced your sleep call with a large
> empty loop and it worked fine.
>
>   for (i = 0; i < 100000000; i++) { }
>
> With no optimization, I got
>
> res = 129605319
> tms_utime=1
> tms_stime=0
> tms_cutime=0
> tms_cstime=0
>
> res = 129605739
> tms_utime=403
> tms_stime=0
> tms_cutime=0
> tms_cstime=0
>
> ...running on an Sun Ultra 5 (Solaris). I also incorporated the
> following changes...
>
> Style: You should use "struct tms buffer;" instead of an array of length
> 1. Call 'times' with '&buffer' and access the struct data using '.'
> instead of '->'. The 'main' routine should return a 0 after successful
> execution.
>
> /A
>
> In article <[EMAIL PROTECTED]>,
> Christian Langis <[EMAIL PROTECTED]> wrote:
> > Hi there.
> > I am programming scientific applications for which I
> > need very sharp time stamping functions. First I used GETTIMEOFDAY
> which
> > return time stamp information precise to the micro second. But the
> since
> > our programs did not behave in time as we expected, we suspected that
> > system execution time might have something to do with the time
> > discrepancies of our program. Therefore, we wanted to use usertime
> time
> > stamps only. Therefore, we switched to TIMES.
> >
> > Our system is set up on RedHat 5.2. And with the simple test:
> >
> > #include <sys/times.h>
> > #include <stdio.h>
> > void main(void)
> > {
> > struct tms buffer[1];
> > clock_t res;
> >
> > res = times(buffer);
> > printf("res = %ld\n", res);
> > printf("tms_utime=%ld\n", buffer->tms_utime);
> > printf("tms_stime=%ld\n", buffer->tms_stime);
> > printf("tms_cutime=%ld\n", buffer->tms_cutime);
> > printf("tms_cstime=%ld\n\n", buffer->tms_cstime);
> >
> > sleep(1); //sleep for 1 second
> >
> > res = times(buffer);
> > printf("res = %ld\n", res);
> > printf("tms_utime=%ld\n", buffer->tms_utime);
> > printf("tms_stime=%ld\n", buffer->tms_stime);
> > printf("tms_cutime=%ld\n", buffer->tms_cutime);
> > printf("tms_cstime=%ld\n\n", buffer->tms_cstime);
> > }
> >
> > we get the execution:
> >
> > res = 78324562
> > tms_utime=0
> > tms_stime=0
> > tms_cutime=0
> > tms_cstime=0
> >
> > res = 78324663
> > tms_utime=0
> > tms_stime=0
> > tms_cutime=0
> > tms_cstime=0
> >
> > which shows that TIMES doesn't work (it does not fill the TMS
> > strcuture).
> >
> > Does anybody knows what is the problem? Or does anybody knows other
> > useful timestamp functions (preferably usertime only)?
> >
> > thanks
> >
> > --
> > Christian Langis NRC, building M-50, room 343
> > NRC researcher 1500 Montreal road
> > [EMAIL PROTECTED] Ottawa, Canada
> > (613)993-8558 K1A 0R6
> >
> >
> --
> # Andreas Kähäri
> # Brought to you from Uppsala, Sweden
> # http://hello.to/andkaha
> # Remember, an e-mail is as secure as a postcard
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.


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

From: [EMAIL PROTECTED]
Subject: Accessing x86 debug registers in Solaris
Date: Thu, 13 Apr 2000 05:31:50 GMT

Is there a way to access the x86 debug registers using the
ioctl() interface? (how?)

Is there a better way under Solaris?

sys/regs.h defines dbregset_t, which to me is only
referenced in sys/pcb.h in a pcb_t structure, which is
used in sys/klwp.h.  However these types don't make it
into sys/procfs.h, nor sys/old_procfs.h.  I am using
the version of ioctl that is defined by sys/old_procfs.h.

It doesnt look like PIOCGXREGSIZE,PIOCGXREG,PIOCSXREG are
related. And struct user seems to have lost its u_debugreg
field as I move from Linux to Solaris.  So PIOCGETU seems
wrong.  PCWATCH is not available in sys/old_procfs.h, and
even still, it seems to only define one watch area.

I wish I could look at the source code.

Thanks for your time,

Pete Huerter.


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: "Mike" <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.development,comp.os.linux.development.apps,linux.dev.c-programming,linux.redhat.development
Subject: Disableing NCURSES Input
Date: Thu, 13 Apr 2000 06:04:18 GMT

Hello ncurses gurus!

Im useing ncurses to perform screen output for an application that I am
writing, but, the ncurses package seems to assume that I would also like to
perform input.

This, however, is not the case.

The application is a server and it needs to monitor all of its own file
descriptors, includeing stdin, in an optimized fashion.

Ive checked the ncurses documentation and various websites, manuals, etc.
but have yet to find an example of how I can tell ncurses to ignore input,
and allow the server apps signal handler to handle it.

Any suggestions?

mike
[EMAIL PROTECTED]




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

From: Manoj Patil <[EMAIL PROTECTED]>
Subject: Re: device driver development
Date: Thu, 13 Apr 2000 11:55:58 +0530

You must not give the .o extension while removing the loaded kernel module

Florian Heinz wrote:

> Long wrote:
> >
> > Please help... anyone,
> >
> > I am developing a device driver.  Everytime after loading using insmod
> > driver.o and it has an error in the driver.  I am forced to reboot the
> > system to reload the driver. Otherwise it says "driver.o: a module named
> > driver already exists."  Is there anyway that I can undo the loading so that
> > I can reload the driver without having to reboot the system.  I try rmmod
> > but it says: "rmmod: module driver.o not loaded".  Any suggestion is
> > appreciated.
>
> perhaps you should use the name which lsmod shows you as argument for
> rmmod...
> e.G. not "rmmod driver.o" but "rmmod driver"...


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

Subject: Re: Kernel development
From: bill.t@(x)worldnet.att.net (Bill Touchstone)
Date: Thu, 13 Apr 2000 06:53:12 GMT

The following books (and others) are very good. My technique was while reading 
the books, study the code. Look at all parts of it (even as you read that 
section in the book). I learned far more by reading code than reading the book. 

That will depend on how much OS/driver oriented experience you have to date.

Bill


In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
>
>Philip wrote:
>> 
>> Ivan Van den Bossche wrote:
>> >
>> > Hello everybody,
>> >
>> > Where can I find the right documentation on the WEB to get started with
>> > Kernel development?  What do I need to know?
>> >
>> 
>> C
>
>I'm going to assume you're already aware of that requirement, and
>provide you
>with somewhat more useful references:
>
>OS design theory and other kernel implementations (these are books):
>
>The Design and Implementation of the 4.4BSD Operating System (you've
>heard of BSD, right?)
>        by Kirk McKusick, Keith Bostic, Michael Karels.
>        Addison-Wesley, May 1996, ISBN 0201549794
>
>Operating Systems (this is the 2nd edition, may be a newer one, check)
>        by William Stallings
>        Prentice Hall, Oct 1994, ISBN 0024154938
>
>Operating Systems: Design and Implementation, 2nd Ed. (MINIX code
>in-line with text, very good)
>        by Andrew S. Tanenbaum
>        Prentice Hall PTR, Jan 1997, ISBN 0136386776
>
>For more advanced stuff look at other books by Tanenbaum. He is a
>generally well-respected
>operating systems expert and most of his books are quite insightful. He
>has one called
>'Modern Operating Systems' as well as 'Distributed Operating Systems',
>namely.
>
>The Linux kernel in particular (these are online resources):
>The Linux Kernel (http://www.linuxdoc.org/LDP/tlk/tlk.html)
>Linux Kernel Hacker's Guide
>(http://www.linuxdoc.org/LDP/khg/HyperNews/get/khg.html)
>
>I can't really say whether you should read the latter two first, with
>Linux sources, of
>course, or one or two of the physical books (the 4.4BSD book should go
>with either 4.4BSD
>source or FreeBSD/OpenBSD/NetBSD) ... you'll have to figure that out for
>yourself.
>
>> --
>> Philip van Hoof aka freax         _/_/_/
>> http://users.pandora.be/skatan  _/_/  _/ _/_/   _/_/_/    _/_/   _/   _/
>> mailto:[EMAIL PROTECTED]        _/_/     _/ _/  _/       _/  _/   _/  _/
>> Microsoft OS are bad, and   _/_/_/_/   _/  _/ _/_/    _/_/_/_/   _/_/
>> their morals are even worse  _/_/     _/     _/      _/    _/  _/  _/
>> (Linus Torvalds 8 Sept.1996)_/_/     _/      _/_/_/ _/    _/ _/     _/
>
>
>-- 
>Nathan Dorfman <[EMAIL PROTECTED]>                [http://www.rtfm.net]
>"The light at the end of the tunnel is the headlight of an approaching
>train." --/usr/games/fortune


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

Crossposted-To: 
comp.os.linux.development,comp.os.linux.development.apps,linux.dev.c-programming,linux.redhat.development
Subject: Re: Disableing NCURSES Input
From: "Daniel Beer" <[EMAIL PROTECTED]>
Reply-To: "Daniel Beer" <[EMAIL PROTECTED]>
Date: Thu, 13 Apr 2000 19:04:56 +1300

On Thu, 13 Apr 2000 06:04:18 GMT, "Mike" <[EMAIL PROTECTED]> wrote:
>Hello ncurses gurus!
>
>Im useing ncurses to perform screen output for an application that I am
>writing, but, the ncurses package seems to assume that I would also like to
>perform input.
>
>This, however, is not the case.
>
>The application is a server and it needs to monitor all of its own file
>descriptors, includeing stdin, in an optimized fashion.
>
>Ive checked the ncurses documentation and various websites, manuals, etc.
>but have yet to find an example of how I can tell ncurses to ignore input,
>and allow the server apps signal handler to handle it.
>
>Any suggestions?
>
>mike
>[EMAIL PROTECTED]

NCurses doesn't take input unless you ask it to, by way of getch() or
similar.  If it's screwed up your terminal, you can reset it using
tcgetattr() and tcsetattr().

--
   _     _
 o' \,=./ `o   Daniel Beer <[EMAIL PROTECTED]>
    (o o)      dlbeer.freeshell.org
ooO--(_)--Ooo-


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

From: "V.Vijay Kumar" <[EMAIL PROTECTED]>
Subject: RE: schedule_timeout()
Date: Thu, 13 Apr 2000 02:50:35 -0400

Use kernel timer to reschedule ur function after 1 sec inside an intr 
handler

>===== Original Message From [EMAIL PROTECTED] =====
>On Wed, 12 Apr 2000 16:32:11 -0500, Aurelie Fonteny <[EMAIL PROTECTED]>
>wrote:
>>Hi,
>>I want to delay a task for 1 s. This task is inside of a transmission
>>procedure for a network device driver. So here is how it looks like :
>>
>>start_bh_atomic();
>><CODE>
>>current->state = TASK_UNINTERRUPTIBLE;
>>schedule_timeout(HZ);
>><CODE>
>>end_bh_atomic();
>
>No no no! You must not reschedule in a bottom half or interrupt context. 
Prior
>to calling schedule_timeout, you must do end_bh_atomic.
>
>>When I run the driver and it goes to this part of the code, nothing is
>>responding anymore : mouse is not working, I can't type anything..., and I
>>just can do a reset! And when I delete the two line with current->state ans
>>schedule_timeout(), it's working fine.
>>Does anyone know why?
>
>Read the ``scheduling in interrupt'' panic message on the console. ;)
>
>--
>#exclude <windows.h>


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

From: "Olivier Dufils" <[EMAIL PROTECTED]>
Subject: device driver development and C++
Date: Thu, 13 Apr 2000 09:33:57 +0200

I am developping a device driver for linux.
I first wrote it with the C language and it works perfectly.
I now need to have a C++-Class in my driver. I then gave the extension
".cpp" to my driver file.
When i now try to compile the file (driver.cpp), i got a lot of
compiler-errors.

Can somebody help me?

Olivier



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

From: "V.Vijay Kumar" <[EMAIL PROTECTED]>
Subject: RE: system call pre-emptable ???
Date: Thu, 13 Apr 2000 02:22:45 -0400

>===== Original Message From Badrinath Venkatachari <[EMAIL PROTECTED]> =====
>Hi,
>  If I blocked the immediate processing of a read() request in the
>kernel,  (by say Qing the request, waiting for sometime and then issuing
>the request after sometime, while the process (in the kernel) that
>issued the request waited on a wait_queue, would it be possible to
>receive requests from other processes ??
>
> In other words,  can other read() system calls result in a context
>switch while I am yet to issue the pending request ??? I want to be able
>to Q requests from multiple processes before servicing them. (assume
>that the mechanism to make the requesting process (in the kernel) wait
>on a wait_queue has been established and it can be woken up properly).
>
>thanks a lot in advance
>badri
>

No problem, you can do that. We are doing a similar thing in our write 
request 
in our driver. We have made a wait_queue for our device. When we find that 
the 
write buffer for the device is full, we make the processes wait in the wait 
queue. Then when the interrupt comes, it dumps the write buffer onto the 
device and wakes up the waiting processes.

For more info refer to Linux device drivers by Rubini.

Vijay.


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

From: "Michael Schoettner" <[EMAIL PROTECTED]>
Subject: BDF File Format
Date: Thu, 13 Apr 2000 09:53:17 +0200

Hi all,

I'm searching source code for handling the BDF file format. An e-mail would
be great.

Many thanks in advance,

Michael

Michael Schoettner
University of Ulm
Department of Distributed Systems
Oberer Eselsberg
D-89069 Ulm
Phone: + 49 731/502-4238, Fax  : + 49 731/502-4142
E-Mail: [EMAIL PROTECTED]
Web:   http://www-vs.informatik.uni-ulm.de/Mitarbeiter/Schoettner/
Tip:     http://www-vs.informatik.uni-ulm.de/Projekte/plurix.html



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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: device driver development and C++
Date: 13 Apr 2000 07:56:10 GMT

Olivier Dufils <[EMAIL PROTECTED]> wrote:
: I am developping a device driver for linux.
: I first wrote it with the C language and it works perfectly.
: I now need to have a C++-Class in my driver. I then gave the extension
: ".cpp" to my driver file.
: When i now try to compile the file (driver.cpp), i got a lot of
: compiler-errors.

: Can somebody help me?

No. Think about it! Where is your memory handling coming from?
And the exception handling? Got it yet?

Peter

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

From: Mathias Waack <[EMAIL PROTECTED]>
Subject: Re: device driver development and C++
Date: Thu, 13 Apr 2000 10:09:09 +0200

Olivier Dufils wrote:
> I am developping a device driver for linux.
> I first wrote it with the C language and it works perfectly.
> I now need to have a C++-Class in my driver. I then gave the extension
> ".cpp" to my driver file.

You should'nt use C++ for driver code. But it may works. Sometimes. 
Eventually. Maybe.

> When i now try to compile the file (driver.cpp), i got a lot of
> compiler-errors.

First put all kernel specific includes into an "extern C" directive:

extern "C" {
#include <asm/io.h> 
...
}

Calling kernel functions from within C++ objects should now work, but 
the opposite way may fail. Make sure that the kernel can never 
access one of your C++ classes. For instance you must not provide 
a member function as function pointer to the kernel. 

After that, try it again. Capture the output of the compiler, 
and ask this group again. Include the sources, the command line 
und the output of the compiler into your posting. And of course 
the linux version you're using. Then we are eventually able 
to help you. 

Mathias

-- 
Mathias Waack           |     [EMAIL PROTECTED]
Tel.:  +49 621 181 2717  Fax.:  +49 621 181 2713

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

From: Anders Larsen <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux,comp.os.linux.misc
Subject: Re: Bootdisks, rdev, and root filesystems...aargh!
Date: Thu, 13 Apr 2000 09:49:48 +0200

bob smith wrote:
> 
> Take a look at this how-to, linux from scratch how-to, found at:
> http://www.linuxdocs.org/LDP/LGissue49/misc/beekmans/LFS-HOWTO.html
> Really great.

Not that great, after all.
"DNS: Domain 'www.linuxdocs.org' is invalid: Host not found (authoritative)."

--
Anders Larsen
e-mail: alarsen AT baumerident DOT com

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

From: Mark McDougall <[EMAIL PROTECTED]>
Subject: Re: device driver development and C++
Date: Thu, 13 Apr 2000 18:52:20 +1000

Olivier Dufils wrote:

> I now need to have a C++-Class in my driver.

Why do you *need* a C++ class in your driver?
Was this your idea, or someone else's???

Regards,

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

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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: How to debug driver that freezes the system?
Date: Thu, 13 Apr 2000 10:51:53 +0200

"Mr. Oogie Boogie" wrote:

> I finally found the bug that was causing my system to freeze. It was
> the atomic system call clear_bit(). I took out all of the atomic
> calls, test_and_set_bit(), set_bit(), etc because they also seemed to
> freeze my system, but not as often. The clear_bit() call froze my
> system about once every 100 times it was used. Luckly, the driver
> works fine without the atomic calls. I just did 1,000,000 read/writes
> with no problems, hurray!

To quote Mr. Dijkstra: "Testing will never show the absence of bugs,
only their presence" (this quote is probably not literally, but that was
the essence.)
My experience also shows that you can test code to every depth, as soon
as it is used in another environment, things go awefully wrong.

So, if you think you will need the atomic operations, make sure they
work. If you don't need them, why did you put them in in the first
place?

-- =

Josef M=F6llers
Fujitsu Siemens Computers
SHV Server DS 1

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


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