Linux-Development-Sys Digest #37, Volume #8 Fri, 21 Jul 00 16:13:15 EDT
Contents:
Re: how to install Gentus in one disk partition only? (Gerald Schnabel)
Generating a diff file ("Andreas Homa")
Re: re-linking an executable? (John Reiser)
about memory managment ("WSH")
Re: Generating a diff file (Alexander Viro)
How to write a device driver for data acquisition via ISA card ("Chun Seong Ng")
Re: How to write a device driver for data acquisition via ISA card (Daniel Hartman)
Re: SC400 bootloader ([EMAIL PROTECTED])
Re: embedded linux footprint size (Rich Hampton)
Ip Forwarding function ("Ram�n Ag�ero")
measuring time on LINUX ([EMAIL PROTECTED])
Re: Generating a diff file (Kaz Kylheku)
Re: How to force a clean reboot from a module? ("Norm Dresner")
Re: A good IDE (Dave Blake)
Re: Mount of Zip doesn't work since linux-2.4.0-test2 (bill davidsen)
Re: strange "mv" bug ([EMAIL PROTECTED])
Re: Newbie module problem (Rudi Sluijtman)
Re: convert.c (Rudi Sluijtman)
Re: A good IDE (John Gluck)
Re: How to force a clean reboot from a module? (Rick Ellis)
Re: device names (Rudi Sluijtman)
Re: floating point issue (Paul Hughett)
----------------------------------------------------------------------------
From: Gerald Schnabel <[EMAIL PROTECTED]>
Crossposted-To: alt.comp.periphs.mainboard.abit
Subject: Re: how to install Gentus in one disk partition only?
Date: Fri, 21 Jul 2000 17:26:15 +0200
Vero wrote:
>
> can Gentus [Red Hat6.1] be installed in just one partition?
According to http://www.gentus.com/whatsnew3.html there is no 1024
cylinder limit since Gentus 2.0, so it should work.
------------------------------
From: "Andreas Homa" <[EMAIL PROTECTED]>
Subject: Generating a diff file
Date: Fri, 21 Jul 2000 17:31:09 +0200
Hi,
I must be blind :-(
Can anybody tell me a URL where I can find how to generate or write a
diff-File to apply a patch to the kernel ???
Ciao
Andreas
------------------------------
From: John Reiser <[EMAIL PROTECTED]>
Subject: Re: re-linking an executable?
Date: Fri, 21 Jul 2000 08:40:05 -0700
> Anybody know of a way to re-link and executable file in linux? I would
> like to take an arbitrary executable file for which I have no source
> code and for which I do not control the original compilation, and be
> able to relink it to include a different initial entry point (which is a
> routine I have written) , and to include the library routines on which
> that routine depends.
In general, there are severe problems because most of the relocation
information has been discarded by /bin/ld. In particular, the layout
of .text, .data, and .bss has been frozen, and there is precious little
virtual address space available which meets all the applicable conventions.
By shifting the file image of .data (and everything at higher virtual
addresses) to one page higher in the file, and adjusting Elf32_Phdr.p_offset
for the PT_LOAD of .data, you can squeeze in T bytes of new .text and
4KB - T bytes of new .data, but /bin/ld has already chosen the value of T.
And if the old boundary between .text and .data is exactly on a page
boundary, then you're out of luck. Tinker with /usr/bin/objdump
and its options --headers, --file-headers, --private-headers,
--section-headers, etc.
At the lowest level, changing the entry point is trivial: overwrite
Elf32_Ehdr.e_entry; see <elf.h>. But the conventions for the execution
environment of e_entry are not the same as for the usual C language
call, so some glue code in assembler probably will be needed.
Space can be stolen from the DT_HASH table for dynamic runtime
symbol resolution, by reducing the number of buckets used for closed
chaining. For an example of this, search http://freshmeat.net
for my project 'elfvector' which is GPL.
For large amounts of new code (more than 4KB), your best bet probably
is to put it into a .so dynamic module ("shared library"), add that
module to the DT_NEEDED list by taking space from the DT_HASH table,
add upto 4KB of glue code at the boundary between .text and .data,
and change e_entry.
--
John Reiser, [EMAIL PROTECTED]
------------------------------
From: "WSH" <[EMAIL PROTECTED]>
Subject: about memory managment
Date: Fri, 21 Jul 2000 23:37:30 +0800
hi
When I tracing source, some problem occurs
1)I have memory less than 1G, so the PAGE_OFFSET is 0xc0000000
so, the kernel space is from 0xc0000000-0xffffffff????
or what does this means?
2)where can I find data about fixmap.c(compile time virtual memory
allocation)?
thanks
------------------------------
From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: Generating a diff file
Date: 21 Jul 2000 11:41:51 -0400
In article <8l9qas$on1$10$[EMAIL PROTECTED]>,
Andreas Homa <[EMAIL PROTECTED]> wrote:
>Hi,
>I must be blind :-(
>
>Can anybody tell me a URL where I can find how to generate or write a
>diff-File to apply a patch to the kernel ???
man diff
man patch
--
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid. Get yourself a better computer" - Dilbert.
------------------------------
From: "Chun Seong Ng" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.setup,it.comp.os.linux.software,linux.dev.kernel
Subject: How to write a device driver for data acquisition via ISA card
Date: Fri, 21 Jul 2000 17:09:17 +0100
Hey everybody, I want to respond to a hardware interrupt from a data
acquisition card via ISA card. I manage to communicate with the card
throught simply I/O program. And now I would like to write a user program
with an interrupt handler.
My questions are:
1) My first step is to install the interrupt handler to the kernel. The
following is my source code. Is my structure of source code to install
interrupt handler correct? What am I missing? And what functions and header
files I need to install and service an interrupt routine?
#include <linux/sched.h>
main()
{
unsigned int CAN_irq = 9;
if (CAN_irq >= 0)
{
int result = request_irq(CAN_irq, CAN_ISR, SA_INTERRUPT, "CAN", NULL);
if (result)
{
printk(KERN_INFO "CAN card can't get assigned irq %i/n", CAN_irq);
CAN_ISR = -1;
}
return 0;
}
note: I also wrote CAN_ISR interrupt service routine.
2) Is there any example of device driver codes like this?
3) How to compile it? Is "gcc -O -D__KERNEL__ -o test test.c" correct?
4) Is it possible (reasonable, etc) to write a user program that uses a
hardware interrupt without writing a device driver?
For your information, I'm using RH 6.1 with gcc-2.91.66. I'm referring Linux
Device Driver by Alessandro Rubini and Linux Kernel Internal by M Beck, U
Kunitz and etc. Any other good references?
Thank you.
Regards,
Chun Seong
------------------------------
From: Daniel Hartman <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.setup,it.comp.os.linux.software,linux.dev.kernel
Subject: Re: How to write a device driver for data acquisition via ISA card
Date: Fri, 21 Jul 2000 10:28:01 -0700
A good place to start is the Linux Lab Project:
http://www.llp.fu-berlin.de/
Chun Seong Ng wrote:
>
> Hey everybody, I want to respond to a hardware interrupt from a data
> acquisition card via ISA card. I manage to communicate with the card
> throught simply I/O program. And now I would like to write a user program
> with an interrupt handler.
>
> My questions are:
> 1) My first step is to install the interrupt handler to the kernel. The
> following is my source code. Is my structure of source code to install
> interrupt handler correct? What am I missing? And what functions and header
> files I need to install and service an interrupt routine?
>
> #include <linux/sched.h>
>
> main()
> {
> unsigned int CAN_irq = 9;
>
> if (CAN_irq >= 0)
> {
>
> int result = request_irq(CAN_irq, CAN_ISR, SA_INTERRUPT, "CAN", NULL);
>
> if (result)
> {
> printk(KERN_INFO "CAN card can't get assigned irq %i/n", CAN_irq);
> CAN_ISR = -1;
> }
>
> return 0;
> }
>
> note: I also wrote CAN_ISR interrupt service routine.
>
> 2) Is there any example of device driver codes like this?
>
> 3) How to compile it? Is "gcc -O -D__KERNEL__ -o test test.c" correct?
>
> 4) Is it possible (reasonable, etc) to write a user program that uses a
> hardware interrupt without writing a device driver?
>
> For your information, I'm using RH 6.1 with gcc-2.91.66. I'm referring Linux
> Device Driver by Alessandro Rubini and Linux Kernel Internal by M Beck, U
> Kunitz and etc. Any other good references?
>
> Thank you.
>
> Regards,
> Chun Seong
--
Daniel A. Hartman, Ph.D.
MST-6: Welding and Joining
Los Alamos National Laboratory
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: SC400 bootloader
Date: 21 Jul 2000 18:35:34 +0200
Jeff Say <[EMAIL PROTECTED]> wrote:
> I have sc400 (486) based embedded PC AT board,4M Flash and 16M DRAM SBC.
> I do not
> want to use any BIOS to load Linux. Board supports headless operation
> (no keyboard, no display, no floppy/hard disk) - only serial port can be
> used as a console). I need a bootloader to boot Linux. I am trying to
> find a bootloader which graps binary linux image and copies to DRAM,
> then boots from there.
Hi Jeff,
I did something like that with an AMD Elan 410 (at least I think it's
that). I ended up with some assembler code to do some basic
inititalization, switch to protected mode, continue initialization,
and boot from ethernet or flash.
I used a lot of the etherboot-package (or was it the netboot-package?).
It has a method to switch from and to protected mode, and of course it
has a boot loader. And it was not that hard to read the boot image from
flash instead of tftp'ing it from the network.
I used kernel 2.0.x with zimages, I'm not sure if the package is able to
boot newer kernels. But it's definitely worth a look.
Peter
------------------------------
From: Rich Hampton <[EMAIL PROTECTED]>
Subject: Re: embedded linux footprint size
Date: Fri, 21 Jul 2000 17:02:59 GMT
"Alan C. Chang" wrote:
>
> Hi Guys,
>
> I am new for embeded linux development, so, please, forgive me of my stupid
> question.
>
> Here is my question --- They are so many embedded linux companies which
> claim that they can make smaller footprint size of linux kernel. However, I
> was told before that linux is 32bits virtual-memory OS, so it needs some
> extra storage space in addition to memory to do swaping and, usually, it is
> a hard disk drive. I just wonder if we can have hard disk installed in a
> system, do we still need to care about the footprint size of linux kernel ?
> I mean, currently, hard disk is so common and so inexpensive and I do think
> it can save very much money if you have a linux kernel with 0.5MB rather
> than 1MB ?
>
> Thanks !!!
>
> Alan C. Chang 2000-07-17PM
> -----------------------------------
Many, if not most, embedded applications require flash storage rather
than
rotating media for reliability reasons due to harsh environments. Also,
there's a space consideration. If you want to embedd Linux into a hand-
held device, I don't think you'd want a hard disk hanging from it. I'm
currently involved in embedding Linux myself and find that the M-Systems
DiskOnChip devices are great for embedded Linux, although a bit pricey.
There are a number of alternative flash devices that are very small and
fast. If you have an embedded OS/w app that fits into a 2Mb space, then
you can have your system in the size of a pencil eraser.
Rich Hampton
J-Squared
------------------------------
From: "Ram�n Ag�ero" <[EMAIL PROTECTED]>
Subject: Ip Forwarding function
Date: Fri, 21 Jul 2000 17:45:15 +0200
Hi all,
I need to know how ip_forwarding function is implemented within Linux
kernel.
Any help would be thanked...
Regards
Ram�n
------------------------------
From: [EMAIL PROTECTED]
Subject: measuring time on LINUX
Date: Fri, 21 Jul 2000 17:00:25 GMT
I need to measure the amount of time some code
path takes and need a way to get the finest time
stamp before and after the code. This is for
LINUX on an intel 386 architecture.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Generating a diff file
Reply-To: [EMAIL PROTECTED]
Date: Fri, 21 Jul 2000 17:06:33 GMT
On Fri, 21 Jul 2000 17:31:09 +0200, Andreas Homa <[EMAIL PROTECTED]>
wrote:
>Hi,
>I must be blind :-(
>
>Can anybody tell me a URL where I can find how to generate or write a
>diff-File to apply a patch to the kernel ???
Go to the top level directory which has the two versions of the source tree as
children, then do
diff -urNp tree-original tree-modified > my_patch.diff
The patch can then be applied by someone by doing
patch -p0 < my_patch.diff
If you are doing extensive modifications to something, consider using CVS. You
import the source tree into CVS, do arbitrary hacking and when you are ready,
you can produce a patch using cvs rdiff. The CVS merge features will make it
easier to produce updated patches against newer versions of the original
codebase.
--
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.
------------------------------
Reply-To: "Norm Dresner" <[EMAIL PROTECTED]>
From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: How to force a clean reboot from a module?
Date: Fri, 21 Jul 2000 17:56:22 GMT
Yes, it does, and that should be exactly what I need.
Now a follow-up question:
How does one go about finding things like this on one's own without
taking a month off to read the kernel source?
Thanks
Norm
Mario Klebsch <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> In article <cZjd5.6922$[EMAIL PROTECTED]>,
> "Norm Dresner" <[EMAIL PROTECTED]> writes:
> > Is there some way for a driver to force a safe/clean reboot which
includes
> > the normal sync-mechanism and unmounting of file systems?
>
> Dosn't Linux have panic()?
>
> 73, Mario
> --
> Mario Klebsch [EMAIL PROTECTED]
> PGP-Key available at http://www.klebsch.de/public.key
> Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB 1483 30CE 9FB2 A047 9CE0
> Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5 8B98 9464 53FF 9382 F518
------------------------------
From: [EMAIL PROTECTED] (Dave Blake)
Crossposted-To:
comp.os.linux.development.apps,comp.os.linux.development,comp.os.linux.hardware
Subject: Re: A good IDE
Date: 21 Jul 2000 13:43:59 GMT
Reply-To: [EMAIL PROTECTED]
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> what is the best IDE for Linux ?
Many experienced Unix programmers get by fine with
one window for editing, one for gdb, and one for
running the program. In fact, I cannot remember even
seeing an experienced Unix programmer using an IDE.
The command line is very powerful in Unix, and pre-empts
MOST of the need for an IDE (automatically generated
Makefile excepted).
But, Code Crusader is probably the most mature. Kdevelop
is used by many people as well.
--
Dave Blake
[EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: Mount of Zip doesn't work since linux-2.4.0-test2
Date: 21 Jul 2000 18:28:04 GMT
In article <[EMAIL PROTECTED]>,
David A Knight <[EMAIL PROTECTED]> wrote:
| Some of the SCSI modules have changed names and are therefore probably
| not loaded.
|
| I encountered the same problem which was that sd_mod is now just sd
Let's make a meaningless change without thinking, which buys us
nothing but a little namespace clarity and breaks every SCSI system
using modules. Hacker mentality at its finest. The folks in Redmond must
be smiling on yet another tarnish on Linux.
I'd like to let all the security bugs in IE be in the news, with no
complaints about Linux. "I upgraded and my system doesn't work" sounds
like another o/s I won't name.
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
There are those who make things happen, those who watch things happen,
and those who wonder what happened.
-- idea from _Pickles_
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: strange "mv" bug
Reply-To: [EMAIL PROTECTED]
Date: 22 Jul 2000 04:03:55 +1000
[EMAIL PROTECTED] writes:
>That would be a VERY huge command line to make not freeing the memory
>an issue.
Well, "cp" needs to do a similar thing, and it supports recursive copying.
Was quite fun the other day when I copied my newsspool with "cp -av" ---
cp got up to something like 60MB in size.
Of course, it actually *needed* to keep all that memory, but halfway through,
I began to wonder whether using cp had been a good idea....
Bernie
--
The chief distinction of a diplomat is that he can say no in such
a way that it sounds like yes
Lester Pearson
Canadian Prime Minister 1963-68
------------------------------
Subject: Re: Newbie module problem
From: Rudi Sluijtman <[EMAIL PROTECTED]>
Date: Fri, 21 Jul 2000 18:48:19 GMT
"illu" <[EMAIL PROTECTED]> writes:
> Hi
>
> I have tried to work with the simple module from oreilly book...
The source examples in oreilly book are out of date.
You should have a look at the "linux kernel module programming guide"
http://www.linuxdoc.org/LDP/lkmpg/
which is outdated as well, but not as much as the book. You should
also follow the advice in this guide to look at the kernel sources and
see how others do it.
> #define MODULE
> #include <linux/module.h>
if you have modversions enabled you should include:
#if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif
> i get
> hello.o: unresolved symbol printk
> What the .... that means?? Something wrong with the libraries perhaps?
No, the kernel does not use libraries, except libraries that are compiled
from the kernel sources itself.
Have fun,
Rudi Sluijtman.
------------------------------
Subject: Re: convert.c
From: Rudi Sluijtman <[EMAIL PROTECTED]>
Date: Fri, 21 Jul 2000 18:54:12 GMT
"J�r�me Rigobert" <[EMAIL PROTECTED]> writes:
> Hello !
>
> I search the convert.c of LINUX
$ rpm -q -f `which convert`
$ ImageMagick-4.2.9-3
------------------------------
From: John Gluck <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.development.apps,comp.os.linux.development,comp.os.linux.hardware
Subject: Re: A good IDE
Date: Fri, 21 Jul 2000 15:04:47 -0400
[EMAIL PROTECTED] wrote:
> what is the best IDE for Linux ?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
For a moment I thought you meant IDE as in disk drive....
These acronyms... Too many and too many meanings :-)
--
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] (Rick Ellis)
Subject: Re: How to force a clean reboot from a module?
Date: 21 Jul 2000 19:11:42 GMT
In article <a90e5.1662$[EMAIL PROTECTED]>,
Norm Dresner <[EMAIL PROTECTED]> wrote:
> How does one go about finding things like this on one's own without
>taking a month off to read the kernel source?
I found how to do it in less than a minute with:
find -name '*.c' | xargs grep reboot
The watch dog timer driver (drivers/char/wdt.c) is a great example of
how to reboot the system.
--
http://www.fnet.net/~ellis/photo/linux.html
------------------------------
Subject: Re: device names
From: Rudi Sluijtman <[EMAIL PROTECTED]>
Date: Fri, 21 Jul 2000 19:26:59 GMT
[EMAIL PROTECTED] writes:
> I am trying to relate the disk I/O in /proc/stat with a device name.
> How can I match that data with the devices?
disk_io: (3,0):(13713,350842,21318,179236) (3,1):(59543,1126798,48917,506620)
(3,0): 3 is the major devicenumber, 0 is the minor number.
ls -l /dev/hda gives:
brw-rw---- 1 root disk 3, 0 May 5 1998 hda
So hda has major number 3, minor number 0.
finding a devicename for major/minor number combination could be
done using awk:
major=3; minor=0 ; ls -l /dev | awk "\$1 ~ /^b/ && \$5 == \"$major,\" && \$6==$minor
{print \$NF}"
gives you the block device with major 3 minor 0,
major=3; minor=0 ; ls -l /dev | awk "\$1 ~ /^c/ && \$5 == \"$major,\" && \$6==$minor
{print \$NF}"
gives you the character device.
Or you could look for it in /usr/src/linux/Documentation/devices.txt
Or you could do "cat /proc/devices", which gives you ide0 (not a /dev
entry) for blockdevice major 3. It depends on what you need.
Have fun,
Rudi Sluijtman,
------------------------------
From: Paul Hughett <[EMAIL PROTECTED]>
Subject: Re: floating point issue
Date: 21 Jul 2000 20:06:32 GMT
Grant Edwards <[EMAIL PROTECTED]> wrote:
: No. The problem isn't that the library routines aren't
: availabled. The problem is that you aren't allowed to do
: floating point calculations in kernel routines. The kernel
: design doesn't allow for it.
: My understanding is that a user-process floating point context
: isn't saved until it has to be, and doing floating point in a
: kernel module will break this scheme.
One practical approach is to write your own function approximations
using fixed-point arithmetic; this used to be a standard practice
back in the days when floating point hardware was an extra cost
option, if it was available at all. The basic idea is that you
put a conceptual binary point at some convenient place in the
machine word, do your arithmetic using integers, and shift as
necessary to keep the binary point where you want it. I think some
of the lower-end DSP chips provide only fixed-point arithmetic, so
you might be able to find more details in a DSP text. Programming
for embedded processors is another possible source of information.
Alternately, a numeric programming textbook dating back to the
60s or 70s might be relevant.
Paul Hughett
------------------------------
** 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
******************************