Linux-Development-Sys Digest #586, Volume #8 Fri, 23 Mar 01 14:13:13 EST
Contents:
Re: Wannabe -- Wrote LAN driver now want to install ("QuasiCodo")
Re: kernel problem (Kasper Dupont)
Re: bootsector ("Joseph A. Knapka")
Re: Wannabe -- Wrote LAN driver now want to install (Kasper Dupont)
Re: bootsector (Kasper Dupont)
core.pid (Michel Bardiaux)
Re: bootsector ("Joseph A. Knapka")
Re: bootsector ([EMAIL PROTECTED])
Re: core.pid (Kasper Dupont)
Code for SCSI board tekram DC-395x ([EMAIL PROTECTED])
reading PCI chip info
Re: reading PCI chip info ("D. Stimits")
Re: Wannabe -- Wrote LAN driver now want to install (Philip Armstrong)
Re: Too many open files error (Andrei Ivanov)
Re: Wannabe -- Wrote LAN driver now want to install (Dennis Jenkins)
----------------------------------------------------------------------------
From: "QuasiCodo" <[EMAIL PROTECTED]>
Subject: Re: Wannabe -- Wrote LAN driver now want to install
Date: Fri, 23 Mar 2001 15:32:52 GMT
Kasper:
RPM seem to be more specific to RedHat and my customer would like to have a
Linux 2.2 and 2.4 generic driver and installation. I will be using RedHat
7.0 and 6.2 to develop with, but the problem is that he wants all the other
flavors too. So the install has to be generic -- if that is possible.
What I have is a shell of a LAN driver which I will be filling once the real
hw gets here. But in the mean time, I'd like to get the install ready. So
I'm using an old 10 BaseT PCI LAN NIC in place of the real hw. It is a
eMaster PCI. Under RedHat 7.0, I seated the card and it was recognized by
the OS. The de4x5 LAN driver module is loaded automatically -- at least
that's what kernelcfg says, but linuxcfg doesn't see it. If I can figure
out which config file to alter, I can write an install program that will
insert my NIC into the list and do everything for the user.
Anyway, I'm having fun learning Linux. I'll eventually figure it out.
((&-<
"Kasper Dupont" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> QuasiCodo wrote:
> >
> > Hi. I'm new at Linux LAN driver writing and I have found the ne2k-pci.c
> > module, modified it for my hw and now I just need to know if there is a
> > standard way to install it. I've written so much Windows junk, I'm
thinking
> > in INF file terms. Is there something like that with Linux, or do I
just
> > tar it up and distribute it? Forgive me for my ignorance, but I only
have
> > half a brain, and it almost full of Windows crap.
> >
> > ((&-<
>
> RedHat and some other distributions use RPM packages.
> There are also distributions using other package
> systems.
>
> I don't know enough about the different package
> systems to say which one you should prefer.
>
> You can also choose just to distribute a tar
> archive, for sure that is the easiest way to
> distribute your driver.
>
> (I have tried making an RPM file, the process of
> extracting a .srpm file making a few modifications
> and then create a new .srpm and .rpm file is quite
> involving.)
>
> --
> Kasper Dupont
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: kernel problem
Date: Fri, 23 Mar 2001 15:55:52 +0000
Werner K�hnert wrote:
>
> I made the changs You suggested and the output changed in just one way. I now get
> "Attempted to kill the idle task (11)" but no additional message from do_exit or
> sys_exit. I must mention that there is no hard disk connected at the moment.
>
Your problem has nothing to do with a missing harddisk,
at this early point during startup there has not been
made any attempt to access the harddisk.
What you have told has narrowed the posibilites down
to only one call of do_exit.
The do_exit function must be called from the RESTORE_ALL
macro in arch/i386/kernel/entry.S. This is used on the
return path from system calls, exceptions and interrupts.
The do_exit function is called if the final IRET
instruction fails.
Assembly code is a little harder to debug, and I don't
know exactly what are the possible reasons for the IRET
instruction to fail, but I will think some more about it.
I have one idea of where to get more information about
what is happening, but I'm not sure if it will tell me
anything.
In arch/i386/kernel/traps.c change the line:
regs->eip = fixup;
into
printk("fixup: %08X=>%08X regs=%08X
regs->esp=%08X\n",regs->eip,fixup,regs,regs->esp);
regs->eip = fixup;
--
Kasper Dupont
------------------------------
From: "Joseph A. Knapka" <[EMAIL PROTECTED]>
Subject: Re: bootsector
Date: Fri, 23 Mar 2001 16:00:35 GMT
Moe wrote:
>
> Sector is 512 bytes. Bootsector has 1st 8K reserved for itself.
> It helps to know what you are talking about.
OK, help me understand this. On a PC, the BIOS loads only the
first 512-byte sector at boot. So what exactly does it mean
to say that the bootsector has the first 8K reserved? Once
the bootsector is loaded, that code can anything with the
rest of the disk it wants to, in general. Are you talking
about a floppy formatted in some particular way?
Thanks,
-- Joe
> "Rolf Magnus" <[EMAIL PROTECTED]> wrote in message
> news:99fcai$odu$[EMAIL PROTECTED]...
> > Moe wrote:
> >
> > > I tried putting image into bootsector by:
> > > $dd if=boot1 of=/dev/fd0 bs=1k conv=sync
> > > It didn't work and distroyed fs. I formated floppy then same story.
> > > Am I something wrong, or I got two bad floppies?
> > > (Boot1 is less than 8k)
> >
> > A sector is normally 512 bytes long, not 8k
> >
-- Joe Knapka
"It was just a maddened crocodile hidden in a flower bed. It could
have happened to anyone." -- Pratchett
// Linux MM Documentation in progress:
// http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html
* Evolution is an "unproven theory" in the same sense that gravity is. *
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Wannabe -- Wrote LAN driver now want to install
Date: Fri, 23 Mar 2001 16:01:39 +0000
QuasiCodo wrote:
>
> Kasper:
>
> RPM seem to be more specific to RedHat and my customer would like to have a
> Linux 2.2 and 2.4 generic driver and installation. I will be using RedHat
> 7.0 and 6.2 to develop with, but the problem is that he wants all the other
> flavors too. So the install has to be generic -- if that is possible.
>
Then I suggest you just use a tar file, and write
instructions on how to install the driver. You
can also distribute precompiled binaries and a
shell script that copies the driver to the correct
location.
Hopefully some day your driver will be so usefull
that it will be accepted for the official kernel
distributions, at that point you will no longer
have to care about the install. :-)
--
Kasper Dupont
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: bootsector
Date: Fri, 23 Mar 2001 16:09:26 +0000
Joseph A. Knapka wrote:
>
> Moe wrote:
> >
> > Sector is 512 bytes. Bootsector has 1st 8K reserved for itself.
> > It helps to know what you are talking about.
>
> OK, help me understand this. On a PC, the BIOS loads only the
> first 512-byte sector at boot. So what exactly does it mean
> to say that the bootsector has the first 8K reserved? Once
> the bootsector is loaded, that code can anything with the
> rest of the disk it wants to, in general. Are you talking
> about a floppy formatted in some particular way?
>
The BIOS loads 512-bytes, which bytes in which sectors
that are used for the file system structures is choosen
by the file system.
ext2 leaves the first 1024 bytes free for boot code.
FAT only leaves a part of the first 512 bytes for boot
code.
In the MBR things are different, the first 446 bytes of
the sector is available for code, and normally all other
sectors in the first track is also available. The
partition table can be seen as a very primitive file
system. Nothing prevents you from writing an ext2
file system directly to /dev/hda, but in most cases
using partitions is more convenient.
I don't know any filesystems leaving 8K, so I don't
know what Moe was actually talking about.
--
Kasper Dupont
------------------------------
From: Michel Bardiaux <[EMAIL PROTECTED]>
Subject: core.pid
Date: Fri, 23 Mar 2001 16:13:02 GMT
I would like core files to be named from the pid, like core.12345 (yes,
I know it can fill my disk!)
I have looked in the sources for kernel 2.2.17 and it seems one has to
modify binfmt_elf.c and change what is done with variable "corefile".
Is there another way that I missed? Or is there a known patch?
TIA.
--
Michel Bardiaux
Peaktime Belgium S.A. Rue Margot, 37 B-1457 Nil St Vincent
Tel : +32 10 65.44.15 Fax : +32 10 65.44.10
------------------------------
From: "Joseph A. Knapka" <[EMAIL PROTECTED]>
Subject: Re: bootsector
Date: Fri, 23 Mar 2001 16:54:15 GMT
Kasper Dupont wrote:
>
> Joseph A. Knapka wrote:
> >
> > Moe wrote:
> > >
> > > Sector is 512 bytes. Bootsector has 1st 8K reserved for itself.
> > > It helps to know what you are talking about.
> >
> > OK, help me understand this. On a PC, the BIOS loads only the
> > first 512-byte sector at boot. So what exactly does it mean
> > to say that the bootsector has the first 8K reserved? Once
> > the bootsector is loaded, that code can anything with the
> > rest of the disk it wants to, in general. Are you talking
> > about a floppy formatted in some particular way?
> >
>
> The BIOS loads 512-bytes, which bytes in which sectors
> that are used for the file system structures is choosen
> by the file system.
Just as I thought. Thank you for the clarification.
-- Joe
> ext2 leaves the first 1024 bytes free for boot code.
>
> FAT only leaves a part of the first 512 bytes for boot
> code.
>
> In the MBR things are different, the first 446 bytes of
> the sector is available for code, and normally all other
> sectors in the first track is also available. The
> partition table can be seen as a very primitive file
> system. Nothing prevents you from writing an ext2
> file system directly to /dev/hda, but in most cases
> using partitions is more convenient.
>
> I don't know any filesystems leaving 8K, so I don't
> know what Moe was actually talking about.
>
> --
> Kasper Dupont
-- Joe Knapka
"It was just a maddened crocodile hidden in a flower bed. It could
have happened to anyone." -- Pratchett
// Linux MM Documentation in progress:
// http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html
* Evolution is an "unproven theory" in the same sense that gravity is. *
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: bootsector
Date: Fri, 23 Mar 2001 17:38:53 +0100
Kasper Dupont <[EMAIL PROTECTED]> wrote:
> Joseph A. Knapka wrote:
>>
>> Moe wrote:
>> >
>> > Sector is 512 bytes. Bootsector has 1st 8K reserved for itself.
>> > It helps to know what you are talking about.
>>
>> OK, help me understand this. On a PC, the BIOS loads only the
>> first 512-byte sector at boot. So what exactly does it mean
>> to say that the bootsector has the first 8K reserved? Once
>> the bootsector is loaded, that code can anything with the
>> rest of the disk it wants to, in general. Are you talking
>> about a floppy formatted in some particular way?
>>
> The BIOS loads 512-bytes, which bytes in which sectors
> that are used for the file system structures is choosen
> by the file system.
> ext2 leaves the first 1024 bytes free for boot code.
> FAT only leaves a part of the first 512 bytes for boot
> code.
> In the MBR things are different, the first 446 bytes of
> the sector is available for code, and normally all other
> sectors in the first track is also available. The
> partition table can be seen as a very primitive file
> system. Nothing prevents you from writing an ext2
> file system directly to /dev/hda, but in most cases
> using partitions is more convenient.
> I don't know any filesystems leaving 8K, so I don't
> know what Moe was actually talking about.
I think he is speaking about bsd disklabels, which occupy something
like 8k. I see on my machine that /boot/boot1 is 512bytes, and
/boot/boot2 is 7680 bytes. Then the newfs of bsd systems leaves
this space for the disk label and puts the filesystem afterwards.
On x86 it is usual to first put a 512 bytes MBR which contains in particular
a partition table for 4 partitions, and then put the disklabel on a partition.
Frequently the first partition begins at first cylinder second head, which
leaves all sectors except the first one free on the first track. I
think linux fdisk does this, but it is not mandatory. One can even
put a disklabel directly starting on the first sector (that is,
no dos type MBR) this is called dangerously dedicated mode. This is
reported to not work on some Bioses which check the presence of a partition
table. On the other hand this allows to obviate geometry problems on some
other Bioses. Of course all this is not relevant for Linux or
Dos installations.
> --
> Kasper Dupont
--
Michel Talon
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: core.pid
Date: Fri, 23 Mar 2001 16:58:24 +0000
Michel Bardiaux wrote:
>
> I would like core files to be named from the pid, like core.12345 (yes,
> I know it can fill my disk!)
>
> I have looked in the sources for kernel 2.2.17 and it seems one has to
> modify binfmt_elf.c and change what is done with variable "corefile".
>
> Is there another way that I missed? Or is there a known patch?
>
> TIA.
> --
> Michel Bardiaux
> Peaktime Belgium S.A. Rue Margot, 37 B-1457 Nil St Vincent
> Tel : +32 10 65.44.15 Fax : +32 10 65.44.10
It would probably not be very hard to do so,
you will have to change the file fs/binfmt_elf.c
In this file you will find the following lines,
if you change 0 to 1 you will get core files
named core.comm where comm is the name of the
program.
memcpy(corefile,"core.",5);
#if 0
memcpy(corefile+5,current->comm,sizeof(current->comm));
#else
corefile[4] = '\0';
#endif
You could replace the lines with your own
prefference, eg.
sprintf(corefile,"core.%d",current->pid);
Before doing anything I suggest you increase
the buffer for the name a little bit. You
could replace 6 with 20 in the line
char corefile[6+sizeof(current->comm)];
Notice that making this buffer too small will crash
the system, the same will happen if the buffer is too
big for the stack. (There are approx 4KB stack space)
--
Kasper Dupont
------------------------------
From: [EMAIL PROTECTED]
Subject: Code for SCSI board tekram DC-395x
Date: Tue, 20 Mar 2001 19:21:09 +0000
Hi ,
I'm looking for the code of the driver of the DC-395UW SCSI board from
tekram for kernels 2.4.x
THX
------------------------------
From: <[EMAIL PROTECTED]>
Subject: reading PCI chip info
Date: Fri, 23 Mar 2001 09:45:43 -0800
I'm woking on an embedded linux project and am studying the hardware from
the rawest level. I have a program called 'lspci' that comes with RH (and
slackware, I believe) that reads the pci configuration space out of the pci
chips. I am searching for the source to lspci so I might modify it to read
data from other chips attached to my pci bus such as the usb device headers,
and pcmcia headers. I find no man entry for lspci. Can someone point me in a
reasonable direction for either lspci source or some additional utilities
that can read chip info for more then just the pci headers?
------------------------------
Date: Fri, 23 Mar 2001 11:10:26 -0700
From: "D. Stimits" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: reading PCI chip info
[EMAIL PROTECTED] wrote:
>
> I'm woking on an embedded linux project and am studying the hardware from
> the rawest level. I have a program called 'lspci' that comes with RH (and
> slackware, I believe) that reads the pci configuration space out of the pci
> chips. I am searching for the source to lspci so I might modify it to read
> data from other chips attached to my pci bus such as the usb device headers,
> and pcmcia headers. I find no man entry for lspci. Can someone point me in a
> reasonable direction for either lspci source or some additional utilities
> that can read chip info for more then just the pci headers?
The rpm package (and probably tarball too) is pciutils. You might search
for that at:
http://rpmfind.net
http://filewatcher.org
------------------------------
From: [EMAIL PROTECTED] (Philip Armstrong)
Subject: Re: Wannabe -- Wrote LAN driver now want to install
Date: 23 Mar 2001 09:10:30 -0000
In article <iyzu6.475005$[EMAIL PROTECTED]>,
QuasiCodo <[EMAIL PROTECTED]> wrote:
>Yeah, I know that I can load it with insmod, but isn't there some kind of
>install program I can write for the novice Linux user? Since I am little
>more than a novice with Linux myself, I need to learn the ins and outs of
>device installation.
Ah I see; you're after something like an 'installshield' program that
will put all the bits in the right places and set things up?
Not as such no :) If you ship source, then you can take advantage of
the kernel makefiles to install the module in the right place, but
that won't alter the boot scripts to have the kernel module loaded.
How the the latter part is done varies with linux distribution; for
instance on my Debian machine, to get a module autoloaded at boot I
have to add it's name (without the .o) to the file
/etc/modules. Mandrake and RedHat may do things differently, not
counting all the other distributions out there!
If you're only interested in releasing for a single linux
distribution, then you could use that distributions package system to
create a package containing your files + the necessary scaffolding to
install + set up your kernel module. This would be a fair amount of
work for > one distro though.
In the slightly longer term, your best bet is probably to contribute
the code to the mainline kernel (probably best to send it to Donald
Becker at scyld.com who seems to maintain the network interface
drivers generally), that way it'll go in every distribution and you
won't have to do any extra work :)
cheers,
Phil
--
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt
------------------------------
Crossposted-To: comp.os.linux,comp.os.linux.development.apps,comp.os.linux.networking
From: [EMAIL PROTECTED] (Andrei Ivanov)
Subject: Re: Too many open files error
Date: Fri, 23 Mar 2001 15:51:34 GMT
In comp.os.linux.networking Kasper Dupont <[EMAIL PROTECTED]> wrote:
> Look on the two files: /proc/sys/fs/file-max and
> /proc/sys/fs/file-nr
>
> The first file contains the maximum number of files
> allowed to be opened on the system. This number can
> be changed by root.
>
> The second file contains three numbers. First the
> maximum number of file descriptors that have been
> in use at one time since the system was booted, the
> second is the number in use now, and the last is
> the maximum allowed.
My observations gave me feeling that the 2nd value in fs.file-nr
actually shows number of UNused (i.e., free at the moment) file
handles.
--
andrei
------------------------------
From: Dennis Jenkins <[EMAIL PROTECTED]>
Subject: Re: Wannabe -- Wrote LAN driver now want to install
Date: Fri, 23 Mar 2001 12:45:08 -0600
Philip Armstrong wrote:
> In the slightly longer term, your best bet is probably to contribute
> the code to the mainline kernel (probably best to send it to Donald
> Becker at scyld.com who seems to maintain the network interface
> drivers generally), that way it'll go in every distribution and you
> won't have to do any extra work :)
Who would one submit a new file system driver to?
--
[EMAIL PROTECTED] Universal Savings Bank.
The three most dangerous things are a programmer with a soldering
iron, a manager who codes, and a user who gets ideas.
------------------------------
** 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 by posting to the
comp.os.linux.development.system newsgroup.
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
******************************