Linux-Development-Sys Digest #955, Volume #7 Fri, 16 Jun 00 00:13:22 EDT
Contents:
Re: Good Basic compiler for linux? ("news-srv.wam.umd.edu")
Inserting a new system call ("Paolo Romano")
Floating point (John Gluck)
Re: ansiTime library: mktime() inconsistencies across platforms? (Morris M. Keesan)
HELP: Debugging Kernel Drivers (Tod Daniels)
Re: HELP: Debugging Kernel Drivers (Kaz Kylheku)
syscall ("@LeX")
help on mmapping physical memory... (Jeff Chan)
Re: Use of insmod ("Robichaud, Jean-Philippe [BAN:6S33:EXCH]")
Re: HELP: Debugging Kernel Drivers (Tim Morneau)
Re: help on mmapping physical memory... ([EMAIL PROTECTED])
Device driver programming
Re: sigaltstack and libpthread (Henning)
Re: Device driver programming (Grant Edwards)
Re: usleep & threads ("Martin Smith")
Re: Inserting a new system call (Sam Birch)
----------------------------------------------------------------------------
From: "news-srv.wam.umd.edu" <[EMAIL PROTECTED]>
Subject: Re: Good Basic compiler for linux?
Date: Thu, 15 Jun 2000 16:10:47 -0400
The GNOME Project is currently working on GNOME Basic, which will be
compatible with Visual Basic. I believe it will be part of GNOME Office.
Matt
--
Matt Spong <[EMAIL PROTECTED]> www.wam.umd.edu/~spong
Author and maintainer of PowerShell: powershell.sourceforge.net
UM Linux Users Group Secretary/Webmaster: www.umlug.org
AIM: Spong1027 ICQ: 74069183
GPG Public Key: finger [EMAIL PROTECTED]
==========================================================================
"Those who desire to give up freedom in order to gain security, will not
have, nor do they deserve, either one." -Thomas Jefferson
dave <[EMAIL PROTECTED]> wrote in message news:8i5o3t$592$[EMAIL PROTECTED]...
> I manage a small team of VB programmers and I am looking for a Basic
> Compiler and IDE for Linux. I have seen Xbasic and some others but they
are
> quite the quality I am looking for. I need a complete commercial package
> with available support. Anyone know of such a product?
>
> thanks
> [EMAIL PROTECTED]
>
>
------------------------------
From: "Paolo Romano" <[EMAIL PROTECTED]>
Subject: Inserting a new system call
Date: Thu, 15 Jun 2000 22:08:39 +0200
I need to insert a new system call which is similar to read() and that i'll
be refering to as atomic_read()
I have added in the sys_call_table in entry.s the entry sys_atomic_read and
I've updated the number of total entries
I have inserted in unistd.h (sorry at the moment I can't verify the path of
these files, i hope you can help me anyway), the one with the numbers
associated to each system call the correct number for my own system call
In the unistd.h which contains part of the GNU librart and in particular the
prototypes for read and write i have added the prototype of my atomic_read.
I have added the code of my system call in fs/read_write.c which is the file
where is found the code for sys_read and sys_write
I could compile the kernel without any problem. But when i use a C program
including unistd.h (which is need for using read) to test my system call the
compiler says it's unreferenced and returns a linkage error
HELP ME IF YOU CAN!!!
Thanks,
Paolo Romano
------------------------------
From: John Gluck <[EMAIL PROTECTED]>
Subject: Floating point
Date: Thu, 15 Jun 2000 16:10:35 -0400
Hi
This may be a bit off topic but....
Does anyone know where I can find information about validating a
floating point emulation library.
Essentially, the problem is proving that a floating point library will
function and produce correct results within the limits of IEEE754
TIA
--
John Gluck (Passport Kernel Design Group)
(613) 765-8392 ESN 395-8392
Unless otherwise stated, any opinions expressed here are strictly my own
and do not reflect any official position of Nortel Networks.
------------------------------
From: [EMAIL PROTECTED] (Morris M. Keesan)
Crossposted-To: comp.lang.c,comp.os.linux.misc,comp.os.linux.portable
Subject: Re: ansiTime library: mktime() inconsistencies across platforms?
Date: Thu, 15 Jun 2000 20:10:32 GMT
On Wed, 14 Jun 2000 21:04:54 GMT, Mark Law <[EMAIL PROTECTED]> wrote:
>
>#### If replying, please cc "[EMAIL PROTECTED]" ###
Posted and mailed.
>I'm running some test code that calls mktime() with varying inputs,
>where the inputs are predominantly around daylight savings start and end
>transitions; ie. the hour before DST starts, the hour DST starts, the
>hour after DST started, etc. On all but Win NT 4.0, I'm setting the TZ
>environment variable with the DST start and end times so my test results
>should be consistent across systems. I'm using strftime() to format
>then print the results.
...
>My first question is more general. Where is a complete description of
>how mktime() is supposed to behave?
You've posted this to newsgroups where the correct answers may be different, but
since you're asking about Win NT, among others, I think the correct answer is
that the description is in the ISO C standard. There may be a different answer
for Linux. The ISO C standard will cost you almost $200, but we're told that it
should be available soon from ANSI for about $20, downloadable.
You can find the final (pre-standard) draft of C99 at
http://anubis.dkuug.dk/JTC1/SC22/WG14/www/docs/n869/
>There are other test result diffs that follow the same pattern, where
>the pattern is for times given on the boundary of transitioning from
>daylight savings to standard time, SunOS treats tm_isdst = -1 as if its
>a "1" and the resulting time is a daylight savings time and Win NT
>treats tm_isdst = -1 as if its a "0" and the resulting time is NOT a
>daylight savings time.
>
>Which behavior is correct?
What the standards say is that an input value of is_dst < 0 causes mktime "to
attempt to determine whether Daylight Saving Time is in effect for the specified
time." Unfortunately, the language standard doesn't address how the
implementation determines whether DST is in effect, so both of these results
seem to be correct from the language standard viewpoint.
And the language doesn't say anything at all about the TZ environment variable,
or define the effects of any environment variables. All C90 says about
environment variables is that they can be retrieved using getenv(), that the set
of environment names and the method for altering the environment list are
implementation-defined, and that the implementation shall behave as if no
library function calls the getenv function.
--
Morris M. Keesan -- [EMAIL PROTECTED]
Lucent Technologies Software Products Group
------------------------------
From: [EMAIL PROTECTED] (Tod Daniels)
Subject: HELP: Debugging Kernel Drivers
Crossposted-To: comp.os.linux.development.apps
Date: 15 Jun 2000 16:32:30 -0400
I am in the process of writing a linux 2.2.6 device driver for a specific
card I need. I have run into an issue where I can successfully register
the cards interrupt, but when the interrupt goes active, the entire system
hangs -- no keyboard, no network, no console, no ctl-alt-del, nothing.
I believe I have conclusively eliminated hardware conflicts as a source of
problem. I have stripped out all extra hardware and I have tried two
different irqs.
In my request handler, I have the following:
void dcpIrqHandler(int irq, void *dev_id, struct pt_regs *regs)
{
printk(KERN_INFO "test irq %d\n", irq);
..code to ack the interrupt...
}
Unfortunately, I never get to see this in the logs, so I assume the system
freeze happens prior to this.
Does anyone have any good URLs or other information on debugging
techniques for device drivers???? Any code snippets I can include which
may help me to understand why and when this driver freezes???
Thanks...
[EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: HELP: Debugging Kernel Drivers
Reply-To: [EMAIL PROTECTED]
Date: Thu, 15 Jun 2000 20:51:00 GMT
On 15 Jun 2000 16:32:30 -0400, Tod Daniels <[EMAIL PROTECTED]> wrote:
>
>I am in the process of writing a linux 2.2.6 device driver for a specific
>card I need. I have run into an issue where I can successfully register
>the cards interrupt, but when the interrupt goes active, the entire system
>hangs -- no keyboard, no network, no console, no ctl-alt-del, nothing.
>
>I believe I have conclusively eliminated hardware conflicts as a source of
>problem. I have stripped out all extra hardware and I have tried two
>different irqs.
>
>In my request handler, I have the following:
>
>void dcpIrqHandler(int irq, void *dev_id, struct pt_regs *regs)
>{
> printk(KERN_INFO "test irq %d\n", irq);
> ..code to ack the interrupt...
>}
>
>Unfortunately, I never get to see this in the logs, so I assume the system
>freeze happens prior to this.
When developing drivers, fix your /etc/syslog.conf so that KERN_INFO
messages go to your console rather than (just) to /var/log/messages.
Also, be sure to use a real console, not an X based terminal emulator.
--
#exclude <windows.h>
------------------------------
From: "@LeX" <aleefaby*NOSPAM*@libero.it>
Subject: syscall
Date: Thu, 15 Jun 2000 21:08:20 GMT
Hi all!
I'm searching for someone can help me about this question:
I'm tryin' to write a new syscall that makes atomic sys_lseek and sys_write
(I'll call it atomic_read from here)
I've added a new entry for that in the entry.S and <linux/unistd.h> files.
I've also updated the counter in the entry.S file.
I've placed the prototype for atomic_read in <unistd.h>.
Ok... now that's the question :
I've written a small program to test atomic read.
I've compiled it with the follow string :
$gcc -O2 -Wall my_read_test.c -o my_test
the result is an error from the linker, which doesn't resolve the reference
to atomic_read.
Where's the error??
Thanx
@LeX
#define __TRUE__ "C is Better"
------------------------------
From: Jeff Chan <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: help on mmapping physical memory...
Date: Thu, 15 Jun 2000 17:15:38 -0400
Reply-To: [EMAIL PROTECTED]
Hi,
I'm currently running Redhat 6.2 on a pentium computer with 256meg of
memory.
I have this function that maps 30M of memory with 210M as the starting
point.
Mmap returns a VIRTUAL address of the mapped memory.
The question that I have is that how can I get the ACTUAL physical
address of the
mapped memory instead of the virtual address. I tried using the function
virt_to_phys(*addr), but this function is nothing more than casting the
*addr to
an unsigned long.
I need that actual physical address so that I can pass it to
another PCI device so that it can access that physical memory.
Is there other ways that I could map the physical memory and get the
actual
physical address ?? Do I need to write a device driver ??
thx,
Jeff
mem = ::open("/dev/mem",O_RDWR);
void* bufMem = ::mmap(0, // desired location
(opt)
30 * 1024 * 1000, // length
PROT_READ | PROT_WRITE, // protection
MAP_SHARED, // flags
mem, // fd
210 * 1024 * 1000); // offset
------------------------------
From: "Robichaud, Jean-Philippe [BAN:6S33:EXCH]" <[EMAIL PROTECTED]>
Subject: Re: Use of insmod
Date: Thu, 15 Jun 2000 17:32:52 -0400
>
> There's the Linux Kernel Hacker's Guide at the linux documentation project. It's a
>bit old but will provide some hints
>
> http://metalab.unc.edu/mdw/index.html
>
This guide is not avaiable on the net anymore, can you post it on the
newsgroup, I'm sure it will help a lot of us ! (If it is not too big !)
Thanks a lot
Jean-Philippe Robichaud
------------------------------
From: Tim Morneau <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: HELP: Debugging Kernel Drivers
Date: Thu, 15 Jun 2000 16:32:56 -0600
Have you removed the printk from your handler? You can "in theory" use
printk within an interrupt handler because the printk code protects
itself from interruption, but there
are no guarantees with regard to the console handler.
tim
Tod Daniels wrote:
>
> I am in the process of writing a linux 2.2.6 device driver for a specific
> card I need. I have run into an issue where I can successfully register
> the cards interrupt, but when the interrupt goes active, the entire system
> hangs -- no keyboard, no network, no console, no ctl-alt-del, nothing.
>
> I believe I have conclusively eliminated hardware conflicts as a source of
> problem. I have stripped out all extra hardware and I have tried two
> different irqs.
>
> In my request handler, I have the following:
>
> void dcpIrqHandler(int irq, void *dev_id, struct pt_regs *regs)
> {
> printk(KERN_INFO "test irq %d\n", irq);
> ..code to ack the interrupt...
> }
>
> Unfortunately, I never get to see this in the logs, so I assume the system
> freeze happens prior to this.
>
> Does anyone have any good URLs or other information on debugging
> techniques for device drivers???? Any code snippets I can include which
> may help me to understand why and when this driver freezes???
>
> Thanks...
>
> [EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.apps
Subject: Re: help on mmapping physical memory...
Date: Thu, 15 Jun 2000 22:23:35 GMT
I might be wrong here, but I was under the impression that when you
mmap on /dev/mem the offset is the physical address (hence you would
send the physical and return back its virtual address).
Tim
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> Hi,
>
> I'm currently running Redhat 6.2 on a pentium computer with 256meg of
> memory.
> I have this function that maps 30M of memory with 210M as the starting
> point.
> Mmap returns a VIRTUAL address of the mapped memory.
> The question that I have is that how can I get the ACTUAL physical
> address of the
> mapped memory instead of the virtual address. I tried using the
function
>
> virt_to_phys(*addr), but this function is nothing more than casting
the
> *addr to
> an unsigned long.
>
> I need that actual physical address so that I can pass it to
> another PCI device so that it can access that physical memory.
>
> Is there other ways that I could map the physical memory and get the
> actual
> physical address ?? Do I need to write a device driver ??
>
> thx,
> Jeff
>
> mem = ::open("/dev/mem",O_RDWR);
> void* bufMem = ::mmap(0, // desired
location
> (opt)
> 30 * 1024 * 1000, // length
> PROT_READ | PROT_WRITE, // protection
> MAP_SHARED, // flags
> mem, // fd
> 210 * 1024 * 1000); // offset
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: <Joseph Lyman>
Subject: Device driver programming
Date: Thu, 15 Jun 2000 15:28:36 -0700
I would like to start working on some abandoned and unfinished projects-
specifically I would like to take over the Logitech scanner project (since I
happen to have one floating around my house) as well as write some backends
for the sane project.
Programming is one of my passions, but I havent done any device drivers yet.
any tips or places to start? All information would be greatly appreciated.
Thanks in advance
Joseph Lyman
[EMAIL PROTECTED]
------------------------------
From: Henning <[EMAIL PROTECTED]>
Subject: Re: sigaltstack and libpthread
Date: Fri, 16 Jun 2000 00:58:06 +0200
Thats a nice idea, but I need this functionality for the base thread (main),
because I implement a "Exception Handler" in there which must write the
cause and location of the cause to a logfile and then it can go home ;-).
But what to do there?
Kaz Kylheku schrieb:
> On Thu, 15 Jun 2000 12:15:54 +0200, Henning <[EMAIL PROTECTED]> wrote:
> >Hy folks,
> >
> >does anyone have an idea what to do if I want to catch
> >stack exceptions (limited stack size) with pthread library bound?
> >
> >If an exception occures the pthread_sighandler wants to determine
> >thread_self but this is found on the program stack NOT on the alternate
> >exception stack. What should I call or set to make this possible?
>
> This is a problem.
>
> As a workaround, try reserving an area at the top of the thread's stack as the
> alternate stack. E.g.
>
> void *thread_function_wrapper(void *arg)
> {
> /* Reserved stack area with conservative 32 byte alignment. */
>
> char reserved[4096] __attribute__ (( aligned (32) ));
>
> /* set up alt stack */
>
> return thread_function(arg);
> }
>
> A pointer to ``reserved'' can be associated with a thread-specific data
> key for later retrieval, so that the setting up of the alternate stack
> can be done later.
>
> --
> #exclude <windows.h>
------------------------------
From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: Device driver programming
Date: Fri, 16 Jun 2000 02:03:24 GMT
In article <[EMAIL PROTECTED]>, Joseph Lyman wrote:
>Programming is one of my passions, but I havent done any device drivers yet.
>any tips or places to start? All information would be greatly appreciated.
_Linux_Device_Drivers_ by Rubini is a good place to start. You
need to be aware that it's a little dated. Most of the
examples are done with a 2.0 kernel and there's a chapter at
the end discussing 2.0-2.1 differences.
Still, it's an excellent introduction to how device drivers
work.
--
Grant Edwards grante Yow! If I felt any more
at SOPHISTICATED I would DIE
visi.com of EMBARRASSMENT!
------------------------------
From: "Martin Smith" <[EMAIL PROTECTED]>
Subject: Re: usleep & threads
Date: Thu, 15 Jun 2000 11:28:42 -0400
But there is always a re-entrant safe version - (e.g. strtok_r) - right??
Kaz Kylheku <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On 13 Jun 2000 10:11:57 -0400, Brian Lalor <[EMAIL PROTECTED]> wrote:
> >"David B. van Balen" <[EMAIL PROTECTED]> writes:
> >
> Perhaps you are unfamiliar with beasties like gethostbyname(), inet_ntoa()
and
> strtok().
>
> --
> #exclude <windows.h>
------------------------------
From: Sam Birch <[EMAIL PROTECTED]>
Subject: Re: Inserting a new system call
Reply-To: [EMAIL PROTECTED]
Date: Fri, 16 Jun 2000 04:03:49 GMT
First, "atomic_read" is a bad name...duplicate of an internal kernel
macro in include/asm-i386/atomic.h.
Second, I don't have much experience with system call creation, but I
have used ioctl's in modules/modifications. If you need to use
syscall, I can't offer anything very helpful...but if you can use
ioctl, I can try to help you.
HTH
Sam
On Thu, 15 Jun 2000 22:08:39 +0200, "Paolo Romano"
<[EMAIL PROTECTED]> wrote:
>I need to insert a new system call which is similar to read() and that i'll
>be refering to as atomic_read()
>I have added in the sys_call_table in entry.s the entry sys_atomic_read and
>I've updated the number of total entries
>I have inserted in unistd.h (sorry at the moment I can't verify the path of
>these files, i hope you can help me anyway), the one with the numbers
>associated to each system call the correct number for my own system call
>In the unistd.h which contains part of the GNU librart and in particular the
>prototypes for read and write i have added the prototype of my atomic_read.
>I have added the code of my system call in fs/read_write.c which is the file
>where is found the code for sys_read and sys_write
>
>I could compile the kernel without any problem. But when i use a C program
>including unistd.h (which is need for using read) to test my system call the
>compiler says it's unreferenced and returns a linkage error
>
>HELP ME IF YOU CAN!!!
>
>Thanks,
>
> Paolo Romano
>
------------------------------
** 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
******************************