From: Frank Kotler on
Hi Herbert,

Sorry for the delayed reply on this. Your last Nasm version was much
more "beautiful" than the previous, IMO. I remain *extremely* frustrated
by this. "That's what I *said*, dammit!" In order to figure out exactly
where I was going wrong, I tried changing *one* thing at a time from
"the way I had it" to "the way you have it". This eventually worked, of
course, but due to a stupid typo early on, most of my "tests" were
meaningless. I'll get back to it when I get over being pissed at myself.

The comment in the beginning is wrong! I had almost *nothing* to do with
this code. You and Annie.

I'm really impressed that you became a Nasm "power user" practically
overnight! Not too many people have done anything with the (fairly) new
"multisection support". Peter Johnson, author of Yasm, was asking for
examples of how people used it, over on c.l.a.x., and got *no* response.
Only thing I've used it for is a "direct to binary" cp/m example (and
that was fairly easy *without* the new stuff - needed a negative "org",
to work... weird). So getting an ELF to work by "vstart" instead of how
Brian's "elf.inc" does it is rather a big deal! *Plus* the X aspects.
This is really nice.

Herbert Kleebauer wrote:
> Frank Kotler wrote:
>
>
>> int 80h
>> add esp, 3 * 4 ; free space for parameters
>> test eax, eax ; ERROR
>> js err
>>
>> ; my apologies for propagating this sloppiness.
>> ; really should be "cmp eax, -4096" (or -4095?)
>> ; won't happen here, but we *could* get a
>> ; valid return over 2G! - fbk
>
>
> Ok, if Linus himself said this already 10 years ago, it must be true:
>
>
> ------------------------------------------------------------------------------------
> Re: test version of 2.1.0 available
>
> Linus Torvalds (torvalds(a)cs.helsinki.fi)
> Tue, 24 Sep 1996 09:52:26 +0300 (EET DST)
>
> * Messages sorted by: [ date ][ thread ][ subject ][ author ]
> * Next message: Herbert Rosmanith: "Re: NULL strings cause "segmenation fault""
> * Previous message: George Bonser: "Re: test version of 2.1.0 available (fwd)"
> * In reply to: Michael Beach: "RE: /proc/self/fd/0"
> On Tue, 24 Sep 1996, Richard Gooch wrote:
>
>>I've just tried this, and get the following behaviour when I try to
>>load a module (this happens for a variety of modules, not just one):
>>
>># cd /lib/modules/2.1.0/net
>># insmod 3c509.o
>>create_module: Unknown error 997978112
>
>
> Ok, this is due to the silly library stub seemingly thinking that a large
> positive value is in fact a error condition due to sign problems.
>
> That doesn't mean that the kernel is broken: there are other system calls
> that return large numbers that might be thought of as negative even though
> they aren't errors (just an example: mmap() can return addresses with the
> high bit set, and always could).
>
> Instead of testing the sign bit, the low-level system call should
> probably do something like this:
>
> ... do system call, return in %eax ...
> movl %eax,%edx
> addl $4095,%edx
> jc error error if return was -1 .. -4095
>
> Is somebody willing to fix up the module loader?
>
> Linus

Well there ya go! No better authority. How long did it take you to dig
that up? Seems like a weird way to do the test. I wonder why he did it
like that? Anyway, that confirms the "magic number". Assigned error
numbers seem to stop far short of that...

Much more to experiment with on this, but you've given the "project" a
tremendous boost. I've got "distractions", but I'll get back to it.

Best,
Frank
From: Herbert Kleebauer on
Frank Kotler wrote:


> The comment in the beginning is wrong! I had almost *nothing* to do with
> this code. You and Annie.

Don't hide behind others. I don't think ASCII Annie wrote this code
it(him/her)self (but sometimes it's more important to archive and
distribute these little assembler gems than being the original
author). And I wouldn't even have taken a look at low level Linux
programming without your pushing Linux programming and completely
ignoring DOS/Windows. I also would have capitulated if you hadn't
posted X code which I could use. But at least I can claim to have
converted your code to a well designed assembler syntax and that my
version now uses proper error checking (-1 .. -4095) for int80
in opposite to the NASM version!


> I'm really impressed that you became a Nasm "power user" practically
> overnight!

There wasn't too many combinations to test. But the problem with NASM
is the poor error messages and the poor list file. You always have to
look at the binary to see what really happened.


> Well there ya go! No better authority. How long did it take you to dig
> that up?

Again, with the proper information ("-4095" which came from you)
it is just a Google call. But I wasn't so lucky with your other information
about Beth. I got a response from someone who maybe used that email
address, but after telling him what I want, he didn't reply anymore.
Maybe when you try X again, I try to contact him again (now we really
do some X programing she isn't here anymore).