Linux-Development-Sys Digest #245, Volume #8 Mon, 30 Oct 00 17:13:16 EST
Contents:
Re: modules in kernel-2.4.0-test9 (Paul Kimoto)
driver and PCI resource allocation (Tom Charlesworth)
Linux USRobotics 56k PCI voice drivers ("Jan Berdajs")
Bootsector Question (@cisco.com)
Re: Debugging Modules (Sam Liang)
Re: memory usage realloc() (Kaz Kylheku)
Re: Kernel API (Tux)
Re: recvfrom() & sendto() (Kaz Kylheku)
EINTR set on call to sendto() ([EMAIL PROTECTED])
Re: memory usage realloc()
Re: gtk+ ("Norman Black")
kernel-2.4.0-test9 and modules (Timothy Murphy)
Re: modules in kernel-2.4.0-test9 (Timothy Murphy)
Re: Linux and PXE ([EMAIL PROTECTED])
Re: memory usage realloc() (Philip Armstrong)
Re: modules in kernel-2.4.0-test9 (Timothy Murphy)
Re: modules in kernel-2.4.0-test9 (Paul Kimoto)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] (Paul Kimoto)
Subject: Re: modules in kernel-2.4.0-test9
Date: 30 Oct 2000 12:15:27 -0500
Reply-To: [EMAIL PROTECTED]
In article <8tisj1$lhu$[EMAIL PROTECTED]>, Timothy Murphy wrote:
> Modules are installed in the latest kernel
> by establishing a symbolic link
>
> /lib/modules/2.4.0-test9/build <- /usr/src/linux
>
> This seems quite dangerous to me --
> what if one gets a new kernel version.
> and makes /usr/src/linux point to that
> (as is normal)?
Aren't the modules are actually loaded from the directory
/lib/modules/$(uname -r)/kernel?
I believe that the /lib/modules/$(uname -r)/build link is supposed to be a
convenience link to find the right #include files in case you want to build
kernel modules later: a Makefile can specify something like
"-I/lib/modules/$(uname -r)/include" instead of making the user specify
where to find the right asm/ and linux/ directories. (On some systems--
e.g., Debian--/usr/include/asm and /usr/include/linux are not symbolic
links, but rather regular directories populated with known-stable *.h
files.)
(Of course, this scheme assumes that the pointed-to directory doesn't
change. It might also be better if the link pointed at the actual
underlying directory in the [common?] case that /usr/src/linux is itself a
symbolic link.)
--
Paul Kimoto
This message was originally posted on Usenet in plain text. Any images,
hyperlinks, or the like shown here have been added without my consent,
and may be a violation of international copyright law.
------------------------------
From: [EMAIL PROTECTED] (Tom Charlesworth)
Subject: driver and PCI resource allocation
Date: Mon, 30 Oct 2000 17:40:07 GMT
I've got a piece of hardware with a non-transparent bridge, which has a number
of other peripherals behind it. Neither the BIOS nor Linux will configure
this device. So I'm happy to assign PCI resources to this bridge - but before
I do I thought I'd ask to see of there exists a formal method for allocating
PCI bus resources.
Specifically, I want to find a block (possibly quite large) of unused PCI
memory space addresses.
We're stuck on RH6.1 (2.2.12) ...
[EMAIL PROTECTED]
------------------------------
From: "Jan Berdajs" <[EMAIL PROTECTED]>
Subject: Linux USRobotics 56k PCI voice drivers
Date: Mon, 30 Oct 2000 19:37:41 +0100
Do anyone have "Linux USRobotics 56k PCI voice" drivers?
------------------------------
From: @cisco.com
Subject: Bootsector Question
Date: Mon, 30 Oct 2000 10:41:07 -0800
Reply-To: @cisco.com
Hi,
I am trying to write a boot sector which does nothing but print a
string. It does not actually boot anything, it only has that 0xAA55
signature at the end of the sector. For some reason it does not seem to
work. The system recognizes that this is a bootsector but does not print
the string.. Can someone please help me with
this. I have been spending quite sometime on this as i am not very
familiar with assembly language. The code
is pasted below.
I compile this with gcc -c file.s command, and from the resulting object
file, i seperate the code segment
machine instructions and copy to the floppy. I did a objdump -d on the
resultnig. file.o file and compared the
bytes with the one in the floppy and looks like they are same. So, i am
confident that i am seperating the machine instructions properly from
the .o file. Please reply to [EMAIL PROTECTED]
Thanks in advance,
Sarat
.text
.globl boot
BOOTSEG = 0x7C0
boot:
/* This instruction sets the CS to 0x7c00 and EIP to start
label. Atleast thats what i feel */
ljmp $BOOTSEG, $start
start:
/* set up es register */
mov $BOOTSEG, %ax
mov %ax, %es
/* read the current cursor position */
movb $0x03, %ah
xor %bh, %bh
int $0x10
/* %dh, %dl are set by now. write the string now */
mov $0x1301, %ax
mov $0x0007, %bx
mov $0x9, %cx
mov $msg, %bp
int $0x10
msg:
.ascii "\r\nHello\r\n"
.org 510
.word 0xAA55
------------------------------
From: Sam Liang <[EMAIL PROTECTED]>
Subject: Re: Debugging Modules
Date: Mon, 30 Oct 2000 11:00:23 -0800
Oliver,
You are on the right track.
When you install your module, use "insmod -m foo.o", this will print the
relocation map of your module, especially the address for the .text
segment. Then in gdb, do: "add-symbol-file foo.o 0xTEXT_OFFSET", where
0xTEXT_OFFSET is the address for .text printed by "insmod -m foo.o".
Sam
Oliver Graebner wrote:
> Hi Anyone,
>
> I tried to set up a debugging environmet for modules. I'm already able
> to debug the kernel of a x86 based remote target with gdb on the host
> and gdbstub on the target via a serial connection. After loading the
> module (compiled with -g for debugging) I break into the debugger again
> with an "int 3" instruction in the module code. The debugger shows me
> the assembler code of the module but I'm not able to connect the
> assembler code to the source code.
>
> I found a command "add-symbol-file FILE ADDR" in the gdb online help but
> I don't know what kind of address I have to fill into ADDR. Am I on the
> right way or does anybody know how to debug modules?
>
> Any hints and suggestions would be appreciated!
>
> - Oliver
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: memory usage realloc()
Reply-To: [EMAIL PROTECTED]
Date: Mon, 30 Oct 2000 18:58:53 GMT
On Sun, 29 Oct 2000 20:09:52 GMT, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>Has someone experience with ANSI library function realloc()? I have some
>problems with this function.
>
>I have something like below:
> int *p, *q;
>
> p=malloc(sizeof(int)*1024);
> q=realloc(p, sizeof(int)*1024*12);
>
> if (q!=p) {
> free(p);
> }
This invokes undefined behavior. Once you have realloced p,
the value of p is indeterminate. So the comparison q != p is
absurd. q and p simply cannot be simultaneously valid.
Moreover, it's absurd to free the data pointed at by p,
since p is an indeterminate pointer.
--
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.
------------------------------
From: Tux <[EMAIL PROTECTED]>
Subject: Re: Kernel API
Date: Mon, 30 Oct 2000 20:17:09 +0100
Nix wrote:
>
> That's a pretty safe statement. :)
>
That's a pretty short statement, when you're going to have lunch ;-)
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: recvfrom() & sendto()
Reply-To: [EMAIL PROTECTED]
Date: Mon, 30 Oct 2000 19:36:04 GMT
On 30 Oct 2000 09:38:23 GMT, Maurizio Piana <[EMAIL PROTECTED]> wrote:
>Hi all, I'm searching for the source code of recvfrom() and sendto()
>functions but all that I can find is the prototypes of these two
>functions. Does any of you know where to find the source code?
These functions are implemented for each protocol that supports them.
>I'm trying to understand how these functions work to produce an udp
>packet from an input [using functions in udp.c file] and reverse
>(from packet --> original data).
Hint: sendto and recvfrom are implemented in terms of more general sendmsg and
recvmsg functions. Each protocol supplies its own version of these functions.
Look for udp_recvmsg and udp_sendmsg.
If you want to see how sendto() and recvfrom() are implemented in terms of
these virtual functions, look for sys_sendto() and sys_recvfrom() in
net/socket.c. These convert the user space buffers to a message structure, and
call sock_sendmsg() or sock_recvmsg(). These in turn are the wrappers that
dispatch to the appropriate protocol.
--
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.
------------------------------
From: [EMAIL PROTECTED]
Subject: EINTR set on call to sendto()
Date: Mon, 30 Oct 2000 19:51:08 GMT
im building a udp application. i have one thread which creates a
socket and binds it to an address and handles incoming data. i want to
call sendto() from the main thread and have the receive thread handle
incoming data. unfortunately when the main thread calls sendto() it
returns an error with errno set to EINTR. is it not possible to do
this? if it is, how do i get around this?
thanks!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: [EMAIL PROTECTED] ()
Subject: Re: memory usage realloc()
Date: Mon, 30 Oct 2000 20:29:27 -0000
In article <8tju9i$f2p$[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote:
>I don't agree with you, because if the older memory is freed
>automatically, why it's still possible to access it, store value in it?
Because "freed" only means it has been put on the free list and can
be malloc'd later. It doesn't mean returned to the OS.
--
http://www.spinics.net/linux
------------------------------
From: "Norman Black" <[EMAIL PROTECTED]>
Subject: Re: gtk+
Date: Mon, 30 Oct 2000 12:51:06 -0800
Reply-To: "Norman Black" <[EMAIL PROTECTED]>
You need to use the Gdk window handle of the GtkWindow widget and use the
call gdk_window_set_decorations. Understand that the window manager can
ignore your request to alter the window decorations. Gdk supports setting
the Motif window manager decorations. If the window manager in use does not
support these, well ... that's X windows programming.
You can use a popup window, but that has limitations and/or side effects you
may not want. It is generally best to use a toplevel or dialog window and
adjust the decorations.
--
Norman Black
Stony Brook Software
the reply, fubar => ix.netcom
"Bill" <[EMAIL PROTECTED]> wrote in message
news:Yw2L5.24$x3.548@uchinews...
> Could anyone tell me how to build a window with GNOME/Gtk+ libraries that
> DOES NOT have a border put on by the window manager?
>
> Thanks.
>
>
>
>
------------------------------
From: [EMAIL PROTECTED] (Timothy Murphy)
Subject: kernel-2.4.0-test9 and modules
Date: 30 Oct 2000 20:55:34 -0000
As far as I can see, the changes to Rules.make in the latest kernel
(compared to 2.4.0-test5, the last kernel I compiled)
means that modules are no longer installed by "make modules_install".
Instead, there is a symbolic link established
/usr/src/liunx -> /lib/modules/2.4.0-test9/build
It is not clear to me what this symbolic link is meant to achieve,
or indeed why the previous arrangement, which seemed to work perfectly well,
was changed.
I find it difficult to believe that I am the only person
who has met this problem.
Has anyone compiled this kernel with modules,
and found things worked OK?
I'm running RedHat-7.0 with egcs as compiler.
--
Timothy Murphy
e-mail: [EMAIL PROTECTED]
tel: 086-233 6090
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
------------------------------
From: [EMAIL PROTECTED] (Timothy Murphy)
Subject: Re: modules in kernel-2.4.0-test9
Date: 30 Oct 2000 21:00:37 -0000
Adam Gorecki <[EMAIL PROTECTED]> writes:
>Timothy Murphy wrote:
>>
>> Modules are installed in the latest kernel
>> by establishing a symbolic link
>>
>> /lib/modules/2.4.0-test9/build <- /usr/src/linux
>>
>> This seems quite dangerous to me --
>> what if one gets a new kernel version.
>> and makes /usr/src/linux point to that
>> (as is normal)?
>> Or what if one cleans /usr/src/linux?
>>
>> It also seems contrary to what is said
>> in /usr/src/linux/Documentation/modules.txt .
>please, read the CHANGES file in kernel source directory.
I have (and had) read the Changes file.
Apart from saying that it had made the modules setup "saner"
I did not find anything relevant to my question.
Perhaps you could point out what you are referring to in this file.
Are you also saying that modules.txt is inaccurate?
--
Timothy Murphy
e-mail: [EMAIL PROTECTED]
tel: 086-233 6090
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Linux and PXE
Date: Mon, 30 Oct 2000 21:00:21 GMT
In my scenario, PXE is allowed to boot before the hard disk. So, if I
allow reset to happen, the PXE code will always run first, and then
download the stuff off the network, and the hard disk code will never
get executed. My main problem, is how to tell PXE not to run the next
time.
Thanks,
nitu
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> On Fri, 27 Oct 2000 23:27:09 GMT [EMAIL PROTECTED] wrote:
>
> | I have a requirement to use PXE to download linux kernel, do some
work,
> | and then boot to the os on the disk.
> |
> | The problems that I am having is that I am unable to program the
reboot
> | code to switch to the next boot device. The plug and play bios
> | specification says that int 18h could be sent to the bios to boot to
> | next device. I have verified this by sending the interrup in
Setup.s,
> | and the next boot device gets control.
> |
> | However, when I program the reboot code to send interrupt 18h
seems to
> | hang the machine. I am sending that interrup after the linux code
> | switches itself to the real mode (modified the process.c code). I
guess
> | linux when loading destroys the bios data area, which might be
causing
> | the machine to hang? Any clues? Is it possible to access bios
services
> | when running under linux. If not, what kind of cleanup I need to do
to
> | achieve the same functionality?
>
> I do believe the BIOS will have to be restarted from reset once Linux
has
> been running in protected mode. So many things besides the CPU mode
can
> be "out of whack" that the reset sequence is the only way to do this.
>
> I, too, have wanted to do this with PXE to do things like reload a
fresh
> system over the network, possibly selected differently each time
based on
> the current services provisioning.
>
> If the first stage OS boot were to always take place using PXE, then
that
> OS run code could install a modified LILO or other boot loader onto
the
> hard drive and eventually do a full reset. That modified boot loader
> would, just before actually loading the second stage OS, wipe itself
off
> the hard drive by rewriting the MBR with zeros for the bootable code
> (but leaving the partition table intsact). Then the boot loader would
> load the OS of choice from the partition boot record. That way you
could
> run the BIOS through a full reset reboot, using the MBR as the
toggling
> state memory.
>
> I'm working with an Intel ISP1100 box to experiment (haven't got to
the
> stage of doing the boot loader thing yet).
>
> --
> | Phil Howard - KA9WGN | My current websites: linuxhomepage.com,
ham.org
> | phil (at) ipal.net +----------------------------------------------
======
> | Dallas - Texas - USA | phil-evaluates-email-ads-750-dollars-
[EMAIL PROTECTED]
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: [EMAIL PROTECTED] (Philip Armstrong)
Subject: Re: memory usage realloc()
Date: 30 Oct 2000 20:04:33 -0000
In article <8tju9i$f2p$[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote:
>I don't agree with you, because if the older memory is freed
>automatically, why it's still possible to access it, store value in it?
Just because memory has been free()d doesn't mean that a segfault will
result if you access it through a pointer that you still happen to
have around. You've invoked *undefined* behaviour by accessing memory
pointing to free()d memory. That means the computer could do anything
at all, including letting you read and write to that memory location.
>Or it's because Linux will take some time to really "free" the memory,
>not right after the free() call?
It can do what ever it wants, but you can't even rely on it being
consistent. For instance, in the standard gnu malloc, large malloc
requests are handled by mmap()ing /dev/null rather than moving the brk
pointer. When you free these, they are usually returned to the global
kernel memory pool immediately. Small malloc() requests on the other
hand, are handled differently, and freeing such memory usually results
in the memory block being returned to the malloc free list, and not
being returned to the kernel's global memory pool.
So in this implementation, whether you can access memory after you've
free()d it without causing a segfault depends on how big the initial
allocation was.
If I were you, I'd get hold of a good C reference (K&R or
Harbison(sp?) & Steele) and use it.
Phil
--
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt
------------------------------
From: [EMAIL PROTECTED] (Timothy Murphy)
Subject: Re: modules in kernel-2.4.0-test9
Date: 30 Oct 2000 21:15:38 -0000
[EMAIL PROTECTED] (Paul Kimoto) writes:
>Aren't the modules are actually loaded from the directory
>/lib/modules/$(uname -r)/kernel?
This directory does not seem to be created (or populated) for me by
"make dep; make clean; make bzImage; make modules".
And I don't quite see how the modules entry in Rules.make could create it --
though I do not pretend to understand the details of the Makefile and its relatives.
But as a matter of interest, have you actually installed modules with this kernel
by "make modules" followed by "make modules_install"?
[I'm compiling the kernel under RedHat-7.0 with egcs as compiler,
though I don't see how that can be relevant.
Also I have installed the latest modutils (2.3.19).]
Any suggestions or advice gratefully received.
--
Timothy Murphy
e-mail: [EMAIL PROTECTED]
tel: 086-233 6090
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
------------------------------
From: [EMAIL PROTECTED] (Paul Kimoto)
Subject: Re: modules in kernel-2.4.0-test9
Date: 30 Oct 2000 16:26:31 -0500
Reply-To: [EMAIL PROTECTED]
In article <8tkodq$1aso$[EMAIL PROTECTED]>, Timothy Murphy wrote:
>> Aren't the modules are actually loaded from the directory
>> /lib/modules/$(uname -r)/kernel?
> This directory does not seem to be created (or populated) for me by
> "make dep; make clean; make bzImage; make modules".
> And I don't quite see how the modules entry in Rules.make could create it --
> though I do not pretend to understand the details of the Makefile and its relatives.
In the (2.4.0-test10-pre6) top-level Makefile, it would seem to be
created by
: .PHONY: modules_install
: modules_install: _modinst_ $(patsubst %, _modinst_%, $(SUBDIRS))
: _modinst_post
:
: .PHONY: _modinst_
: _modinst_:
: @rm -rf $(MODLIB)/kernel
: @rm -f $(MODLIB)/build
: @mkdir -p $(MODLIB)/kernel
: @ln -s $(TOPDIR) $(MODLIB)/build
(In fact, if this is the right place, then I don't see how you'd
get the /lib/modules/2.4.0-test9/build symlink without a
/lib/modules/2.4.0-test9/kernel directory!)
> But as a matter of interest, have you actually installed modules with this kernel
> by "make modules" followed by "make modules_install"?
Yes.
$ ls -l /lib/modules/2.4.0-test9
total 9
lrwxrwxrwx 1 root root 14 Oct 7 03:02 build ->
/usr/src/linux
drwxr-xr-x 5 root root 1024 Oct 7 03:03 kernel
-rw-r--r-- 1 root root 5210 Oct 9 03:05 modules.dep
-rw-r--r-- 1 root root 99 Oct 9 03:05 modules.pcimap
drwxr-xr-x 2 root root 1024 Oct 7 03:03 pcmcia
$ ls -l /lib/modules/2.4.0-test9/kernel
total 3
drwxr-xr-x 8 root root 1024 Oct 7 03:03 drivers
drwxr-xr-x 9 root root 1024 Oct 7 03:07 fs
drwxr-xr-x 4 root root 1024 Oct 7 03:03 net
> [I'm compiling the kernel under RedHat-7.0 with egcs as compiler,
> though I don't see how that can be relevant.
> Also I have installed the latest modutils (2.3.19).]
I'm using gcc-2.95.2 on Debian (semi-)unstable, with modutils
version 2.3.16.
--
Paul Kimoto
This message was originally posted on Usenet in plain text. Any images,
hyperlinks, or the like shown here have been added without my consent,
and may be a violation of international copyright law.
------------------------------
** 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
******************************